From a3fa3f8057c1aa2c5a9ccb6c798df8c5b33c831b Mon Sep 17 00:00:00 2001 From: Roman Proskuryakoff Date: Wed, 19 Jun 2024 11:33:39 +0300 Subject: [PATCH] Add signature chainid guard for a legacy tx --- crates/consensus/src/transaction/legacy.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/consensus/src/transaction/legacy.rs b/crates/consensus/src/transaction/legacy.rs index c39abfbf186..7de6515df79 100644 --- a/crates/consensus/src/transaction/legacy.rs +++ b/crates/consensus/src/transaction/legacy.rs @@ -250,6 +250,7 @@ impl SignableTransaction for TxLegacy { } fn into_signed(self, signature: Signature) -> Signed { + debug_assert_eq!(signature.v().chain_id(), self.chain_id); let mut buf = Vec::with_capacity(self.encoded_len_with_signature(&signature)); self.encode_with_signature_fields(&signature, &mut buf); let hash = keccak256(&buf);