mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor(tx-pool): add enum InvalidKind to mark_invalid (#12845)
This commit is contained in:
@ -27,13 +27,13 @@ use reth_payload_builder_primitives::PayloadBuilderError;
|
||||
use reth_payload_primitives::PayloadBuilderAttributes;
|
||||
use reth_primitives::{
|
||||
proofs::{self},
|
||||
Block, BlockBody, BlockExt, EthereumHardforks, Receipt,
|
||||
Block, BlockBody, BlockExt, EthereumHardforks, InvalidTransactionError, Receipt,
|
||||
};
|
||||
use reth_provider::{ChainSpecProvider, StateProviderFactory};
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
use reth_transaction_pool::{
|
||||
noop::NoopTransactionPool, BestTransactions, BestTransactionsAttributes, TransactionPool,
|
||||
ValidPoolTransaction,
|
||||
error::InvalidPoolTransactionError, noop::NoopTransactionPool, BestTransactions,
|
||||
BestTransactionsAttributes, TransactionPool, ValidPoolTransaction,
|
||||
};
|
||||
use reth_trie::HashedPostState;
|
||||
use revm::{
|
||||
@ -228,7 +228,10 @@ where
|
||||
// we can't fit this transaction into the block, so we need to mark it as invalid
|
||||
// which also removes all dependent transaction from the iterator before we can
|
||||
// continue
|
||||
best_txs.mark_invalid(&pool_tx);
|
||||
best_txs.mark_invalid(
|
||||
&pool_tx,
|
||||
InvalidPoolTransactionError::ExceedsGasLimit(pool_tx.gas_limit(), block_gas_limit),
|
||||
);
|
||||
continue
|
||||
}
|
||||
|
||||
@ -250,7 +253,13 @@ where
|
||||
// the iterator. This is similar to the gas limit condition
|
||||
// for regular transactions above.
|
||||
trace!(target: "payload_builder", tx=?tx.hash, ?sum_blob_gas_used, ?tx_blob_gas, "skipping blob transaction because it would exceed the max data gas per block");
|
||||
best_txs.mark_invalid(&pool_tx);
|
||||
best_txs.mark_invalid(
|
||||
&pool_tx,
|
||||
InvalidPoolTransactionError::ExceedsGasLimit(
|
||||
tx_blob_gas,
|
||||
MAX_DATA_GAS_PER_BLOCK,
|
||||
),
|
||||
);
|
||||
continue
|
||||
}
|
||||
}
|
||||
@ -270,7 +279,12 @@ where
|
||||
// if the transaction is invalid, we can skip it and all of its
|
||||
// descendants
|
||||
trace!(target: "payload_builder", %err, ?tx, "skipping invalid transaction and its descendants");
|
||||
best_txs.mark_invalid(&pool_tx);
|
||||
best_txs.mark_invalid(
|
||||
&pool_tx,
|
||||
InvalidPoolTransactionError::Consensus(
|
||||
InvalidTransactionError::TxTypeNotSupported,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user