mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
fix(txpool): fix legacy tx chain id check (#2005)
This commit is contained in:
@@ -1157,7 +1157,7 @@ mod tests {
|
||||
let mut f = MockTransactionFactory::default();
|
||||
let mut pool = AllTransactions::default();
|
||||
let tx = MockTransaction::eip1559().inc_price().inc_limit();
|
||||
let valid_tx = f.validated(tx.clone());
|
||||
let valid_tx = f.validated(tx);
|
||||
let InsertOk { updates, replaced_tx, move_to, state, .. } =
|
||||
pool.insert_tx(valid_tx.clone(), on_chain_balance, on_chain_nonce).unwrap();
|
||||
assert!(updates.is_empty());
|
||||
|
||||
@@ -146,7 +146,6 @@ where
|
||||
LEGACY_TX_TYPE_ID => {
|
||||
// Accept legacy transactions
|
||||
}
|
||||
|
||||
EIP2930_TX_TYPE_ID => {
|
||||
// Accept only legacy transactions until EIP-2718/2930 activates
|
||||
if !self.eip2718 {
|
||||
@@ -217,11 +216,13 @@ where
|
||||
}
|
||||
|
||||
// Checks for chainid
|
||||
if transaction.chain_id() != Some(self.chain_id()) {
|
||||
return TransactionValidationOutcome::Invalid(
|
||||
transaction,
|
||||
InvalidTransactionError::ChainIdMismatch.into(),
|
||||
)
|
||||
if let Some(chain_id) = transaction.chain_id() {
|
||||
if chain_id != self.chain_id() {
|
||||
return TransactionValidationOutcome::Invalid(
|
||||
transaction,
|
||||
InvalidTransactionError::ChainIdMismatch.into(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
let account = match self
|
||||
|
||||
Reference in New Issue
Block a user