-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have all the special storage keys in a single place #2126
Comments
The key format is also inconsistent. Some of them are We should also update the docs to include encoded hex and the expected value type. |
The Polkadot ones are not special keys, these are just the normal |
|
Ahh you got me :P
In a perfect way we would not need them at all. Or better abstracted. But we already have the |
I think we should use |
is this issue just all about creating a crate |
It seems a bit odd to me that the keys for runtime specific things are specified in Not sure if that is ideal, better ideas?
Please first add a deprecation warning. If you want to remove something. |
@ggwpez can we then put all these keys in the frame support storage crate? |
We can re-export them there yes, but they are also needed in lower level crates, so they need to stay in there as well. I guess a common re-export module is the best we can do now. |
i don't seem to quite get what you mean by a common re-export module? what do you mean? @ggwpez |
mod well_known_keye {
pub use sp_storage::...
pub use sp_consensus_grandpa::...
} and so on. Although it would probably not cover the ones from polkadot primitives, since what would create a dependency cycle again. Not sure what @bkchr was thinking. |
Because these keys are not FRAME specific. These are Substrate well known keys for communicating data to the node. Things like the code should not require to first call into the runtime. |
Generally, maybe just adding a page in the polkadot sdk docs is a better idea. I don't see any reason for adding them somewhere to re-export them, while this ticket is just about being able to find these keys/having a place to look them up. |
so, no need to get this done anymore? @bkchr |
As I said above, I think there should be a guide/reference doc added to the sdk docs. |
Recently, I create this https://github.com/subscan-explorer/well-known-address-registry. I'm interesting to add the well know storage keys there. It might be an option. And also #324. Subscan team is struggling with the custom pallet account across different chains. 🤷🏻♂️ |
I am working on a feature of Chopsticks to decode all the storage keys. There are some keys requires special handling as they are not included in metadata.
Currently we have
polkadot-sdk/substrate/primitives/storage/src/lib.rs
Lines 192 to 216 in 86228fa
polkadot-sdk/substrate/frame/support/src/traits/metadata.rs
Lines 163 to 167 in 86228fa
polkadot-sdk/substrate/frame/support/src/storage/transactional.rs
Lines 34 to 37 in 86228fa
polkadot-sdk/substrate/primitives/consensus/grandpa/src/lib.rs
Lines 65 to 67 in 86228fa
polkadot-sdk/polkadot/primitives/src/v6/mod.rs
Lines 242 to 251 in 86228fa
Please let me know if I missed anything
This makes it really hard to implement a generic and all-catching storage decoder. Can we move all the Substrate well known keys to
sp_core::storage::well_known_keys
? The polkadot one are all in a single place so that's good.The text was updated successfully, but these errors were encountered: