-
Notifications
You must be signed in to change notification settings - Fork 236
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(consensus): Protected Legacy Signature #1578
Conversation
b7a9368
to
9903778
Compare
/// Returns true if the signature of the transaction is protected. | ||
#[inline] | ||
pub const fn is_protected(&self) -> bool { | ||
match self { | ||
Self::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.
should this be false
for non-legacy?
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.
No, see the reference impl in kona
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.
Here is the reference impl in optimism's op-node
Description
Adds a method to the
TxEnvelope
type that returns if the associated signature is protected.