feat: add Block AT to BlockReader (#12837)

This commit is contained in:
Arsenii Kulikov
2024-11-25 18:28:56 +04:00
committed by GitHub
parent e2c42ae242
commit c44e11b8ad
69 changed files with 664 additions and 267 deletions

View File

@ -135,7 +135,11 @@ impl OpNode {
>
where
Node: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OpEngineTypes, ChainSpec = OpChainSpec>,
Types: NodeTypesWithEngine<
Engine = OpEngineTypes,
ChainSpec = OpChainSpec,
Primitives = OpPrimitives,
>,
>,
{
let RollupArgs { disable_txpool_gossip, compute_pending_block, discovery_v4, .. } = args;
@ -293,7 +297,7 @@ pub struct OpPoolBuilder {
impl<Node> PoolBuilder<Node> for OpPoolBuilder
where
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = OpChainSpec>>,
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = OpChainSpec, Primitives = OpPrimitives>>,
{
type Pool = OpTransactionPool<Node::Provider, DiskFileBlobStore>;
@ -522,7 +526,7 @@ impl OpNetworkBuilder {
impl<Node, Pool> NetworkBuilder<Node, Pool> for OpNetworkBuilder
where
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = OpChainSpec>>,
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = OpChainSpec, Primitives = OpPrimitives>>,
Pool: TransactionPool + Unpin + 'static,
{
async fn build_network(

View File

@ -69,7 +69,7 @@ impl<Client, Tx> OpTransactionValidator<Client, Tx> {
impl<Client, Tx> OpTransactionValidator<Client, Tx>
where
Client: StateProviderFactory + BlockReaderIdExt,
Client: StateProviderFactory + BlockReaderIdExt<Block = reth_primitives::Block>,
Tx: EthPoolTransaction,
{
/// Create a new [`OpTransactionValidator`].
@ -195,7 +195,7 @@ where
impl<Client, Tx> TransactionValidator for OpTransactionValidator<Client, Tx>
where
Client: StateProviderFactory + BlockReaderIdExt,
Client: StateProviderFactory + BlockReaderIdExt<Block = reth_primitives::Block>,
Tx: EthPoolTransaction,
{
type Transaction = Tx;

View File

@ -25,6 +25,7 @@ use reth_optimism_node::{
OpEngineTypes, OpNode,
};
use reth_optimism_payload_builder::builder::OpPayloadTransactions;
use reth_optimism_primitives::OpPrimitives;
use reth_payload_util::{PayloadTransactions, PayloadTransactionsChain, PayloadTransactionsFixed};
use reth_primitives::{SealedBlock, Transaction, TransactionSigned, TransactionSignedEcRecovered};
use reth_provider::providers::BlockchainProvider2;
@ -90,8 +91,13 @@ fn build_components<Node>(
OpConsensusBuilder,
>
where
Node:
FullNodeTypes<Types: NodeTypesWithEngine<Engine = OpEngineTypes, ChainSpec = OpChainSpec>>,
Node: FullNodeTypes<
Types: NodeTypesWithEngine<
Engine = OpEngineTypes,
ChainSpec = OpChainSpec,
Primitives = OpPrimitives,
>,
>,
{
let RollupArgs { disable_txpool_gossip, compute_pending_block, discovery_v4, .. } =
RollupArgs::default();

View File

@ -20,8 +20,8 @@ use reth_evm::ConfigureEvm;
use reth_network_api::NetworkInfo;
use reth_node_builder::EthApiBuilderCtx;
use reth_provider::{
BlockNumReader, BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider, EvmEnvProvider,
StageCheckpointReader, StateProviderFactory,
BlockNumReader, BlockReader, BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider,
EvmEnvProvider, StageCheckpointReader, StateProviderFactory,
};
use reth_rpc::eth::{core::EthApiInner, DevSigner};
use reth_rpc_eth_api::{
@ -249,7 +249,7 @@ where
impl<N> Trace for OpEthApi<N>
where
Self: LoadState<Evm: ConfigureEvm<Header = Header>>,
Self: RpcNodeCore<Provider: BlockReader> + LoadState<Evm: ConfigureEvm<Header = Header>>,
N: RpcNodeCore,
{
}

View File

@ -24,7 +24,7 @@ impl<N> LoadPendingBlock for OpEthApi<N>
where
Self: SpawnBlocking,
N: RpcNodeCore<
Provider: BlockReaderIdExt
Provider: BlockReaderIdExt<Block = reth_primitives::Block>
+ EvmEnvProvider
+ ChainSpecProvider<ChainSpec: EthChainSpec + EthereumHardforks>
+ StateProviderFactory,