Skip to content

Commit 3aabf4b

Browse files
authored
add misisng y parity check on SetCodeTransaction (#1270)
1 parent 3803c8a commit 3aabf4b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ethereum/prague/transactions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ def recover_sender(chain_id: U64, tx: Transaction) -> Address:
376376
r, s, tx.y_parity, signing_hash_4844(tx)
377377
)
378378
elif isinstance(tx, SetCodeTransaction):
379+
if tx.y_parity not in (U256(0), U256(1)):
380+
raise InvalidSignatureError("bad y_parity")
379381
public_key = secp256k1_recover(
380382
r, s, tx.y_parity, signing_hash_7702(tx)
381383
)

0 commit comments

Comments
 (0)