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: mpt feature #122

Merged
merged 8 commits into from
Jan 7, 2025
Merged

feat: mpt feature #122

merged 8 commits into from
Jan 7, 2025

Conversation

greged93
Copy link
Collaborator

@greged93 greged93 commented Dec 30, 2024

Adds a "mpt" feature, allowing to feature gate the packing and unpacking of the nibbles, as well as correctly compute the genesis block state root.

Resolves #121 and resolves #117

@greged93 greged93 marked this pull request as draft December 30, 2024 17:04
@frisitano
Copy link
Collaborator

Why do we gate the packing here? I thought we didn't need the scroll feature to be activated when we are using the mpt?

@greged93
Copy link
Collaborator Author

The issue is that a lot of the scroll crates need the scroll feature to be active.
Additionally, we need the revm crate to use the scroll feature (for correct execution) as well as the reth-primitive (for the additional field on the receipt). This caused a lot of compilation issue as a lot of the crates ended up needing the scroll feature across the code base. I figured it was easier to keep the scroll feature (technically we are executing scroll mainnet so I think this makes sense) but avoiding incorrect nibble packing or unpacking. Let me know if you think there is an easier way.

@frisitano
Copy link
Collaborator

frisitano commented Dec 30, 2024

Understood, that makes sense. The alternative would be to put non-standard bmpt logic behind a bmpt feature gate. Let's go with the path of least resistance, whatever makes the solution simpler. I would like to remove support for additional fields in the scroll account and modifications for the key hashing/traversal as quickly as possible (probably completion of milestone 2) and then we can look to refactor this.

@frisitano frisitano mentioned this pull request Dec 30, 2024
@greged93 greged93 changed the title fix: execution witness feat: mpt feature Jan 3, 2025
Signed-off-by: Gregory Edison <[email protected]>
Signed-off-by: Gregory Edison <[email protected]>
@greged93 greged93 marked this pull request as ready for review January 6, 2025 07:48
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

Looks good! Has this been tested? I propose we add some test evidence to this PR before merge. A proposal would be to sync and compare the state root against L2 geth for blocks 1000, 10000 and 50000. What do you think?

crates/scroll/revm/src/states/bundle.rs Show resolved Hide resolved
@greged93
Copy link
Collaborator Author

greged93 commented Jan 7, 2025

@frisitano below is the evidence for correct sync for blocks 1000, 10000 and 50000.

Block 1000

l2geth
Screenshot 2025-01-07 at 09 24 12
Reth
Screenshot 2025-01-07 at 09 16 23

Block 10000

l2geth
Screenshot 2025-01-07 at 09 16 29
Reth
Screenshot 2025-01-07 at 09 26 37

Block 50000

l2geth
Screenshot 2025-01-07 at 09 16 35
Reth
Screenshot 2025-01-07 at 09 29 27

frisitano
frisitano previously approved these changes Jan 7, 2025
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM!

Signed-off-by: Gregory Edison <[email protected]>
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

LGTM

@greged93 greged93 merged commit 46ed5d7 into scroll Jan 7, 2025
45 checks passed
@greged93 greged93 deleted the fix/execution-witness branch January 7, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic on debug_executionWitness Support MPT for Scroll genesis header
2 participants