4

I have been looking deep dive into Substrate and trying to understand things behind the hood, especially storage API.

I am really keen to explore more in the Merkle abstraction between Storage API and KV database.

For example:

#[pallet::storage]
pub(super) type SomeComplexValue<T: Config> = StorageValue<_, T::AccountId, ValueQuery>;

SomeComplexValue will have prefix in kv database when we query it through Storage RPC. But how Merkle transform block transaction into these kv and save to database. Does state proof of each block will save on kv database too?

Looking forward to some great insights and documentation that explains these concepts in depth so as Substrate Builder, I can fully understand these concepts to best use of storage.

2 Answers 2

6

You should check out the Storage Deep Dive here:

https://www.shawntabrizi.com/substrate/substrate-storage-deep-dive/

If you have more specific questions, feel free to open another post.

Some Highlights:

enter image description here enter image description here

1
  • Thanks Shawn. Very informative. May 14, 2022 at 5:17
1

One of the best in class resources for an overview IMHO is the Sub0 storage deep dive by Shawn Tabrizi and the presentation created here.

The primary advanced docs on storage are also good to get more context.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.