Skip to content
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

feat(TrieProvider): Abstract TrieNode retrieval #787

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

hashcashier
Copy link
Contributor

This PR refactors the TrieProvider to change the the method for fetching trie node data into one that provides TrieNode instances instead of raw rlp-encoded bytes:
Before

fn trie_node_preimage(&self, key: B256) -> Result<Bytes, Self::Error>;

After

fn trie_node_by_hash(&self, key: B256) -> Result<TrieNode, Self::Error>;

This allows TrieProvider implementations to abstract away the details of how the required instance can be created and authenticated (i.e. through RLP decoding pre-image oracle answers on-demand or otherwise). This is useful for providing entire trees as query answers, instead of single nodes with blinded children.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.1%. Comparing base (71e35a7) to head (92e52fb).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/mpt/src/node.rs 75.0% 1 Missing ⚠️
Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@clabby clabby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fan of this change. LGTM

@clabby clabby added this pull request to the merge queue Nov 6, 2024
@clabby clabby added K-feature Kind: feature A-mpt Area: kona-mpt crate labels Nov 6, 2024
Merged via the queue into anton-rs:main with commit 6106301 Nov 6, 2024
16 checks passed
@github-actions github-actions bot mentioned this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mpt Area: kona-mpt crate K-feature Kind: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants