You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per EIP-2, signatures with high s values are invalid Ethereum protocol signatures and shouldn't be used in transactions, as of the Homestead hardfork.
Currently, we don't validate this upon creation of a SignedTransaction, resulting in a k256 error when recovering the address of the signature. For ease of debugging, it should be illegal to construct a SignedTransaction in this invalid state.
We propose introducing two separate structs:
struct for deserializing transactions with "unvalidated" signatures
struct for validated signatures: SignedTransaction
The SignedTransaction should have a fallible constructor which validates an "unvalidated" signature, as well as an unsafe infallible constructor which accepts an "unvalidated" signature, given the function caller's guarantee that they have pre-validated the signature.
An example of the latter use cases is when signing a transaction, as k256 pre-normalises the signature.
Definition of Done
Split the deserialization logic of SignedTransaction to a separate struct and add a safe and unsafe constructor to SignedTransaction - according to the above specification
The text was updated successfully, but these errors were encountered:
Per EIP-2, signatures with high
s
values are invalid Ethereum protocol signatures and shouldn't be used in transactions, as of the Homestead hardfork.Currently, we don't validate this upon creation of a
SignedTransaction
, resulting in ak256
error when recovering the address of the signature. For ease of debugging, it should be illegal to construct aSignedTransaction
in this invalid state.We propose introducing two separate structs:
SignedTransaction
The
SignedTransaction
should have a fallible constructor which validates an "unvalidated" signature, as well as anunsafe
infallible constructor which accepts an "unvalidated" signature, given the function caller's guarantee that they have pre-validated the signature.An example of the latter use cases is when signing a transaction, as
k256
pre-normalises the signature.Definition of Done
Split the deserialization logic of
SignedTransaction
to a separate struct and add a safe and unsafe constructor toSignedTransaction
- according to the above specificationThe text was updated successfully, but these errors were encountered: