-
Notifications
You must be signed in to change notification settings - Fork 6
validium batch-bundle #175
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
Conversation
@@ -0,0 +1,209 @@ | |||
use alloy_primitives::{B256, keccak256}; |
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.
So we have almost identical code between validium.rs
and v7.rs
?
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.
Yes, almost identical (for now).
There are a few bound constraints in v7
that are not applicable for validium
(like upper bound on number of bytes from witness). Also, future versions (v2) of validium could diverge massively, hence I have preferred creating a new module and types altogether.
// blockhash is unused for scroll domain. | ||
if version.domain == Domain::Scroll { | ||
assert_eq!(self.prev_blockhash, B256::ZERO); | ||
assert_eq!(self.post_blockhash, B256::ZERO); |
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.
just populate them? may be useful for future
domain: Domain::Validium, | ||
stf_version: STFVersion::V1, | ||
fork: ForkName::Feynman, | ||
codec: Codec::V9, |
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.
so this Codec::V9 enum is something fully inner. We don't put a '0x9' byte at the beginning of DA? (instead we use 65?)
// Conditionally decode depending on the flag set in the envelope. | ||
let payload_bytes = if envelope.is_encoded & 1 == 1 { | ||
vm_zstd::process(&envelope.unpadded_bytes) | ||
.expect("zstd decode should succeed") |
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.
haha we should rename this crate later vm_zstd::process
to like rust_zstd_decompressor
the framework seems good. though some details i may revisit later. |
No description provided.