madara-alliance / madara

Madara is a powerful hybrid Starknet client written in Rust.
https://madara.build
Apache License 2.0
67 stars 25 forks source link

feat(storage): Retrieve storage proof from the bonsai trie #203

Open antiyro opened 1 month ago

antiyro commented 1 month ago

Is there an existing issue?

Motivation

Currently, we use a specific implementation of the Merkle Patricia Trie called the Bonsai Trie, which allows us to verify the state and access its intermediate state easily and quickly. The issue is that our use of the Bonsai lib in production does not allow us to actually access the historical state because it requires enabling logs taht are too heavy and duplicate values at intermediate states. Our goal is to modify the Bonsai lib in collaboration with Massa Labs to access the historical state efficiently.

Request

Currently, our solution for RPC calls involves using an additional column in our database to store storage key-value and access them historically. However, Moonsang Labs needs storage proofs for its processes in SNOS. Therefore, we must serve these proofs as efficiently and quickly as possible from the bonsai trie directly.

Solution

TBD by Massa/Kasar/Moonsang

Are you willing to help with this request?

Yes!

antiyro commented 1 month ago

This issue should also unlock removing the duplicated columns for storage keys. Namely: BlockNToStateDiff and BlockStorageMeta