Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(l1): don't store trie nodes if they are already inlined on their…
… parent (#1124) **Motivation** We are currently storing nodes on the DB even if they are already inlined in their parent node. This is not only storage-inefficient but it also needs special handling when verifying proofs or importing trie nodes from other clients (such as in snap sync) as inlined nodes will not be sent separately. This PR aims to solve this issue at `TrieState` level, so that the change is invisible to the main trie logic. The state will skip insertion for inlined node hashes and will decode them instead of fetching from the db upon lookups <!-- Why does this pull request exist? What are its goals? --> **Description** * `TrieState::insert` now skips node hashes that represent inlined nodes * `TrieState::get` now decoded the node if it is inlined instead of performing a db lookup <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, but is needed in order to validate and integrate output from snap sync requests #184
- Loading branch information