Skip to content

Commit

Permalink
zksync sanity check signature
Browse files Browse the repository at this point in the history
  • Loading branch information
0rac1e committed Apr 5, 2023
1 parent 9ecefac commit 49d0b3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ func (t *Transaction) UnmarshalJSON(input []byte) error {
itx.S = (*big.Int)(dec.S)
withSignature := itx.V.Sign() != 0 || itx.R.Sign() != 0 || itx.S.Sign() != 0
if withSignature {
if err := sanityCheckSignature(itx.V, itx.R, itx.S, true); err != nil {
mayBeProtected := true
if byte(itx.V.Uint64()) < 27 {
mayBeProtected = false
}
if err := sanityCheckSignature(itx.V, itx.R, itx.S, mayBeProtected); err != nil {
return err
}
}
Expand Down

0 comments on commit 49d0b3c

Please sign in to comment.