Skip to content

feat(trie): witness#9803

Merged
rkrasiuk merged 3 commits intomainfrom
rkrasiuk/trie-witness
Jul 30, 2024
Merged

feat(trie): witness#9803
rkrasiuk merged 3 commits intomainfrom
rkrasiuk/trie-witness

Conversation

@rkrasiuk
Copy link
Contributor

@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 force-pushed the rkrasiuk/trie-witness branch from cda7023 to 7a9161a Compare July 30, 2024 18:55
@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
Contributor 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
Contributor 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
@rkrasiuk rkrasiuk deleted the rkrasiuk/trie-witness branch July 30, 2024 20:32
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