-
Notifications
You must be signed in to change notification settings - Fork 37
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
LxLy exit roots #90
LxLy exit roots #90
Conversation
@@ -320,8 +331,38 @@ pub mod cancun_constants { | |||
balance: U256::zero(), | |||
// Storage root for this account at genesis. | |||
storage_root: H256(hex!( | |||
"f58e5f1eae7ce386de44266ff0286a88dafe7e4269c1ffa97f79dbbcf4f59e5c" | |||
// "f58e5f1eae7ce386de44266ff0286a88dafe7e4269c1ffa97f79dbbcf4f59e5c" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this root is and why it's not the empty trie root (0x56e81f...
)? @Nashtare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is a leftover from an initial version of the impl (can't recall why I put this value tbh) but we're not using this constant anymore (it's replaced by the initial_state_and_storage_tries_with_beacon_roots()
utility method, which does specify an empty storage root) so could simply be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for BEACON_ROOTS_CONTRACT_CODE
, I don't think it's used anywhere FWIW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks William, very clean. I just need clarity one the insertion, otherwise looks good to me!
PUSH 64 // storage_key has 64 nibbles | ||
%get_storage_trie(@ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2) | ||
// stack: storage_root_ptr, 64, storage_key, value_ptr, after_timestamp_storage_insert | ||
%jump(mpt_insert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this overwrite the previous value?
I believe the reference code mentions: // if root already has a timestamp - don't update it
https://github.com/0xPolygonHermez/cdk-erigon/blob/7393c1521abfdbaff65b6236aee1d632e50c842d/zk/utils/global_exit_root.go#L49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops good catch, fixed
Also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
* feat: add block interval * fix: follow from loop * feat: add block hash parsing for interval * fix: proving logic * fix: typos * fix: review * fix: doc tests * feat: add block time cli argument * fix: interval display * feat: add from string for block interval * fix: remove block interval single variant * feat: implement concurrent block proving #88 #89 (#96) * feat: implement concurrent block proving #88 #89 * Update prover/src/lib.rs Co-authored-by: 0xaatif <169152398+0xaatif@users.noreply.github.com> * fix suggestion * Fix duplicated import when #[cfg(feature = "test_only")] --------- Co-authored-by: 0xaatif <169152398+0xaatif@users.noreply.github.com> Co-authored-by: Marko Atanasievski <markoatana@gmail.com> * fix: block interval fmt * fix: make parsing functions private * fix: use futures iterator instead of tokio-stream * fix: use anyhow error instead of block interval error --------- Co-authored-by: Zach Brown <zach@zb.dev> Co-authored-by: 0xaatif <169152398+0xaatif@users.noreply.github.com>
Write LxLy global exit roots to storage before executing a block.
Not really tied to Cancun, but this is very similar to EIP-4788 and I reused some functions from #40 so I guess it makes sense to merge it in
feat/cancun
.closes #21