mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: use primitive transaction as PoolTransaction::Consensus (#13086)
This commit is contained in:
@ -13,7 +13,7 @@ use reth_evm::execute::BasicBlockExecutorProvider;
|
||||
use reth_evm_ethereum::execute::EthExecutionStrategyFactory;
|
||||
use reth_network::{NetworkHandle, PeersInfo};
|
||||
use reth_node_api::{
|
||||
AddOnsContext, ConfigureEvm, EngineValidator, FullNodeComponents, NodeTypesWithDB,
|
||||
AddOnsContext, ConfigureEvm, EngineValidator, FullNodeComponents, NodeTypesWithDB, TxTy,
|
||||
};
|
||||
use reth_node_builder::{
|
||||
components::{
|
||||
@ -30,7 +30,7 @@ use reth_provider::{CanonStateSubscriptions, EthStorage};
|
||||
use reth_rpc::EthApi;
|
||||
use reth_tracing::tracing::{debug, info};
|
||||
use reth_transaction_pool::{
|
||||
blobstore::DiskFileBlobStore, EthTransactionPool, TransactionPool,
|
||||
blobstore::DiskFileBlobStore, EthTransactionPool, PoolTransaction, TransactionPool,
|
||||
TransactionValidationTaskExecutor,
|
||||
};
|
||||
use reth_trie_db::MerklePatriciaTrie;
|
||||
@ -243,7 +243,9 @@ impl EthereumPayloadBuilder {
|
||||
Types: NodeTypesWithEngine<ChainSpec = ChainSpec, Primitives = EthPrimitives>,
|
||||
Node: FullNodeTypes<Types = Types>,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Pool: TransactionPool + Unpin + 'static,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
Types::Engine: PayloadTypes<
|
||||
BuiltPayload = EthBuiltPayload,
|
||||
PayloadAttributes = EthPayloadAttributes,
|
||||
@ -280,7 +282,9 @@ impl<Types, Node, Pool> PayloadServiceBuilder<Node, Pool> for EthereumPayloadBui
|
||||
where
|
||||
Types: NodeTypesWithEngine<ChainSpec = ChainSpec, Primitives = EthPrimitives>,
|
||||
Node: FullNodeTypes<Types = Types>,
|
||||
Pool: TransactionPool + Unpin + 'static,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
Types::Engine: PayloadTypes<
|
||||
BuiltPayload = EthBuiltPayload,
|
||||
PayloadAttributes = EthPayloadAttributes,
|
||||
@ -305,7 +309,9 @@ pub struct EthereumNetworkBuilder {
|
||||
impl<Node, Pool> NetworkBuilder<Node, Pool> for EthereumNetworkBuilder
|
||||
where
|
||||
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec, Primitives = EthPrimitives>>,
|
||||
Pool: TransactionPool + Unpin + 'static,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
{
|
||||
async fn build_network(
|
||||
self,
|
||||
|
||||
@ -31,12 +31,13 @@ use reth_payload_primitives::PayloadBuilderAttributes;
|
||||
use reth_primitives::{
|
||||
proofs::{self},
|
||||
Block, BlockBody, BlockExt, EthereumHardforks, InvalidTransactionError, Receipt,
|
||||
TransactionSigned,
|
||||
};
|
||||
use reth_provider::{ChainSpecProvider, StateProviderFactory};
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
use reth_transaction_pool::{
|
||||
error::InvalidPoolTransactionError, noop::NoopTransactionPool, BestTransactions,
|
||||
BestTransactionsAttributes, TransactionPool, ValidPoolTransaction,
|
||||
BestTransactionsAttributes, PoolTransaction, TransactionPool, ValidPoolTransaction,
|
||||
};
|
||||
use reth_trie::HashedPostState;
|
||||
use revm::{
|
||||
@ -93,7 +94,7 @@ impl<EvmConfig, Pool, Client> PayloadBuilder<Pool, Client> for EthereumPayloadBu
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec>,
|
||||
Pool: TransactionPool,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
|
||||
{
|
||||
type Attributes = EthPayloadBuilderAttributes;
|
||||
type BuiltPayload = EthBuiltPayload;
|
||||
@ -157,7 +158,7 @@ pub fn default_ethereum_payload<EvmConfig, Pool, Client, F>(
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec>,
|
||||
Pool: TransactionPool,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
|
||||
F: FnOnce(BestTransactionsAttributes) -> BestTransactionsIter<Pool>,
|
||||
{
|
||||
let BuildArguments { client, pool, mut cached_reads, config, cancel, best_payload } = args;
|
||||
@ -244,7 +245,7 @@ where
|
||||
}
|
||||
|
||||
// convert tx to a signed transaction
|
||||
let tx = pool_tx.to_recovered_transaction();
|
||||
let tx = pool_tx.to_consensus();
|
||||
|
||||
// There's only limited amount of blob space available per block, so we need to check if
|
||||
// the EIP-4844 can still fit in the block
|
||||
|
||||
Reference in New Issue
Block a user