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 multi diff comparison #655

Merged
merged 6 commits into from
Oct 4, 2024
Merged

Conversation

atanmarko
Copy link
Member

@atanmarko atanmarko commented Sep 24, 2024

Resolves #636

@atanmarko atanmarko added this to the Testing and Validation milestone Sep 24, 2024
@atanmarko atanmarko self-assigned this Sep 24, 2024
@atanmarko atanmarko changed the base branch from develop to feat/trie-diff-tool September 24, 2024 14:41
@github-actions github-actions bot added crate: trace_decoder Anything related to the trace_decoder crate. crate: mpt_trie Anything related to the mpt_trie crate. crate: zero_bin Anything related to the zero-bin subcrates. labels Sep 24, 2024
@github-actions github-actions bot removed the crate: trace_decoder Anything related to the trace_decoder crate. label Sep 24, 2024
@atanmarko atanmarko changed the title feat: multi trie diff comparison feat: trie multi diff comparison Sep 24, 2024
@atanmarko atanmarko mentioned this pull request Sep 24, 2024
Base automatically changed from feat/trie-diff-tool to develop September 24, 2024 15:40
@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label Sep 25, 2024
@atanmarko atanmarko force-pushed the feat/deep-tries-comparison branch 2 times, most recently from 4db375a to 793a081 Compare September 25, 2024 15:01
@atanmarko atanmarko marked this pull request as ready for review September 25, 2024 15:02
Copy link
Collaborator

@Nashtare Nashtare left a comment

Choose a reason for hiding this comment

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

Thanks Marko, I tested it and it does work fine. I think we'd need to limit the search to a certain number of discrepancies, possibly stopping early, displaying the result, along with some warn!("Too many differences, search aborted early.") kinda message to hint that this may not be a good starting point.

@Nashtare
Copy link
Collaborator

Nashtare commented Oct 4, 2024

One thing I forgot to mention, though technically orthogonal to this as part of the initial PR on trie-diff.

If for a given state key, we have Leaf vs Branch, we'll stop at this level. It could be nice to go down the branch in the given trie, until we hit Leaf / Hash / Empty to try displaying the account diff (if any). The Point Diff could keep displaying only the Branch though

@atanmarko
Copy link
Member Author

atanmarko commented Oct 4, 2024

If for a given state key, we have Leaf vs Branch, we'll stop at this level. It could be nice to go down the branch in the given trie, until we hit Leaf / Hash / Empty to try displaying the account diff (if any). The Point Diff could keep displaying only the Branch though

@Nashtare Ok, probably worth another PR to set it up.

EDIT: problem with this is - what if the branch is big and has many paths down? What should be shown? Probably only general solution is to show one leaf and other branch as the point of difference.

@Nashtare
Copy link
Collaborator

Nashtare commented Oct 4, 2024

You have the state key, so can go down the branch children until you hit a final node

@atanmarko
Copy link
Member Author

Here is the new ticket #703

@atanmarko atanmarko merged commit e5fe60b into develop Oct 4, 2024
20 checks passed
@atanmarko atanmarko deleted the feat/deep-tries-comparison branch October 4, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: evm_arithmetization Anything related to the evm_arithmetization crate. crate: mpt_trie Anything related to the mpt_trie crate. crate: zero_bin Anything related to the zero-bin subcrates.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Update trie_diff tool to show all the differences in the tries
3 participants