-
Notifications
You must be signed in to change notification settings - Fork 38
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
discuss: trie mask issue #613
base: develop
Are you sure you want to change the base?
Conversation
…der-backend-rewrite4
…der-backend-rewrite4
ba69d45
to
ba7d7dd
Compare
ba7d7dd
to
d263e91
Compare
I'm not sure I understand the replication to begin with.. zk_evm/trace_decoder/src/core.rs Lines 466 to 473 in cfe6d42
We enter the |
f56b00d
to
af9251a
Compare
Yeah creating a trie subset should always produce a trie with an identical hash, so that's a bug. Maybe subset isn't the best name here. It's true that the trie has only subset of the original trie's node and it's a different trie, but it's a bit confusing as well since the trie is the same except for hash nodes. I would just run this through trie diff and see where they diverge. |
Relates #583
I'm a bit confused by
mpt_trie::trie_subsets::create_trie_subset
.AIUI any subset should NOT change the state root of a trie - it just hides subtries behind a hash indirection.
Note that #583 calls hiding subtries "masking",
mpt_trie
calls it "subsetting". TheStateMpt::mask
function is a thin (and I think low risk) wrapper around thempt_trie
functionality:zk_evm/trace_decoder/src/typed_mpt.rs
Lines 341 to 351 in cfe6d42
Here we branch on masking a particular subtrie:
zk_evm/trace_decoder/src/core.rs
Lines 466 to 473 in cfe6d42
I've added an
SKIP_MASK_PRECOMPILED
for the sake of this discussion.If we DO mask those addresses:
Everything is ok.
If we DO NOT mask those addresses:
Eek! Let's see more detail about one of the failures
I'll try and work on a smaller test case :)