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(trie): witness #9803

Merged
merged 3 commits into from
Jul 30, 2024
Merged

feat(trie): witness #9803

merged 3 commits into from
Jul 30, 2024

Conversation

rkrasiuk
Copy link
Member

@rkrasiuk rkrasiuk commented Jul 25, 2024

Description

Ref #9249

Create a trie witness implementation that gathers all trie nodes needed to apply state transition.

@rkrasiuk rkrasiuk added C-enhancement New feature or request A-trie Related to Merkle Patricia Trie implementation labels Jul 25, 2024
@rkrasiuk rkrasiuk mentioned this pull request Jul 25, 2024
@rkrasiuk rkrasiuk added the S-blocked This cannot more forward until something else changes label Jul 25, 2024
@rkrasiuk rkrasiuk force-pushed the rkrasiuk/trie-witness branch 2 times, most recently from e2696cc to cda7023 Compare July 25, 2024 20:14
@rkrasiuk rkrasiuk removed the S-blocked This cannot more forward until something else changes label Jul 25, 2024
@rkrasiuk rkrasiuk marked this pull request as ready for review July 30, 2024 18:55
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

tbh I don't have sufficient context to review this in detail but, logic wise this looks okay to me

let account = state
.accounts
.get(&hashed_address)
.ok_or(TrieWitnessError::MissingAccount(hashed_address))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

or_else?

Copy link
Member Author

Choose a reason for hiding this comment

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

just a copy here, is it needed?

let value = if account.is_some() || storage_multiproof.root != EMPTY_ROOT_HASH {
account_rlp.clear();
TrieAccount::from((account.unwrap_or_default(), storage_multiproof.root))
.encode(&mut account_rlp as &mut dyn BufMut);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this cast required?

Copy link
Member Author

Choose a reason for hiding this comment

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

to make rust analyzer happy :/

@rkrasiuk rkrasiuk added this pull request to the merge queue Jul 30, 2024
Merged via the queue into main with commit 2c2a782 Jul 30, 2024
33 checks passed
@rkrasiuk rkrasiuk deleted the rkrasiuk/trie-witness branch July 30, 2024 20:32
Rjected pushed a commit that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants