-
Notifications
You must be signed in to change notification settings - Fork 26
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(protocol): Batch Utilities #191
base: main
Are you sure you want to change the base?
Conversation
📚
|
7f788bf
to
07ac367
Compare
07ac367
to
3e9bba1
Compare
/// Checks if the signature of the passed [TxEnvelope] is protected. | ||
pub const fn is_protected_v(tx: &TxEnvelope) -> bool { | ||
match tx { | ||
TxEnvelope::Legacy(tx) => { | ||
let v = tx.signature().v().to_u64(); | ||
if 64 - v.leading_zeros() <= 8 { | ||
return v != 27 && v != 28 && v != 1 && v != 0; | ||
} | ||
// anything not 27 or 28 is considered protected | ||
true | ||
} | ||
_ => true, | ||
} | ||
} |
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.
FYI @onbjerg, I've upstreamed this to TxEnvelope
in alloy: alloy-rs/alloy#1578
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.
We can refactor this out later once it lands in a release
Description
Ports batch utilities to
op-alloy-protocol
.Provenance
Part of a port migrating the batch types from
kona-derive
toop-alloy
. Seekona#695
.