pub trait LoadPendingBlock: EthApiTypes<Error: FromEvmError<Self::Evm>, RpcConvert: RpcConvert<Network = Self::NetworkTypes>> + RpcNodeCore {
// Required methods
fn pending_block(&self) -> &Mutex<Option<PendingBlock<Self::Primitives>>>;
fn pending_env_builder(&self) -> &dyn PendingEnvBuilder<Self::Evm>;
fn pending_block_kind(&self) -> PendingBlockKind;
// Provided methods
fn pending_block_env_and_cfg(
&self,
) -> Result<PendingBlockEnv<ProviderBlock<Self::Provider>, ProviderReceipt<Self::Provider>, SpecFor<Self::Evm>>, Self::Error> { ... }
fn next_env_attributes(
&self,
parent: &SealedHeader<ProviderHeader<Self::Provider>>,
) -> Result<<Self::Evm as ConfigureEvm>::NextBlockEnvCtx, Self::Error> { ... }
fn local_pending_state(
&self,
) -> impl Future<Output = Result<Option<StateProviderBox>, Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn pool_pending_block(
&self,
) -> impl Future<Output = Result<Option<PendingBlock<Self::Primitives>>, Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn local_pending_block(
&self,
) -> impl Future<Output = Result<Option<PendingBlockAndReceipts<Self::Primitives>>, Self::Error>> + Send
where Self: SpawnBlocking,
Self::Pool: TransactionPool<Transaction: PoolTransaction<Consensus = ProviderTx<Self::Provider>>> { ... }
fn build_block(
&self,
parent: &SealedHeader<ProviderHeader<Self::Provider>>,
) -> Result<ExecutedBlock<Self::Primitives>, Self::Error>
where Self::Pool: TransactionPool<Transaction: PoolTransaction<Consensus = ProviderTx<Self::Provider>>>,
EthApiError: From<ProviderError> { ... }
}
Expand description
Loads a pending block from database.
Behaviour shared by several eth_
RPC methods, not exclusive to eth_
blocks RPC methods.
Required Methods§
Sourcefn pending_block(&self) -> &Mutex<Option<PendingBlock<Self::Primitives>>>
fn pending_block(&self) -> &Mutex<Option<PendingBlock<Self::Primitives>>>
Returns a handle to the pending block.
Data access in default (L1) trait method implementations.
Sourcefn pending_env_builder(&self) -> &dyn PendingEnvBuilder<Self::Evm>
fn pending_env_builder(&self) -> &dyn PendingEnvBuilder<Self::Evm>
Returns a PendingEnvBuilder
for the pending block.
Sourcefn pending_block_kind(&self) -> PendingBlockKind
fn pending_block_kind(&self) -> PendingBlockKind
Returns the pending block kind
Provided Methods§
Sourcefn pending_block_env_and_cfg(
&self,
) -> Result<PendingBlockEnv<ProviderBlock<Self::Provider>, ProviderReceipt<Self::Provider>, SpecFor<Self::Evm>>, Self::Error>
fn pending_block_env_and_cfg( &self, ) -> Result<PendingBlockEnv<ProviderBlock<Self::Provider>, ProviderReceipt<Self::Provider>, SpecFor<Self::Evm>>, Self::Error>
Configures the [PendingBlockEnv
] for the pending block
If no pending block is available, this will derive it from the latest
block
Sourcefn next_env_attributes(
&self,
parent: &SealedHeader<ProviderHeader<Self::Provider>>,
) -> Result<<Self::Evm as ConfigureEvm>::NextBlockEnvCtx, Self::Error>
fn next_env_attributes( &self, parent: &SealedHeader<ProviderHeader<Self::Provider>>, ) -> Result<<Self::Evm as ConfigureEvm>::NextBlockEnvCtx, Self::Error>
Returns [ConfigureEvm::NextBlockEnvCtx
] for building a local pending block.
Sourcefn local_pending_state(
&self,
) -> impl Future<Output = Result<Option<StateProviderBox>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn local_pending_state(
&self,
) -> impl Future<Output = Result<Option<StateProviderBox>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Returns a [StateProviderBox
] on a mem-pool built pending block overlaying latest.
Sourcefn pool_pending_block(
&self,
) -> impl Future<Output = Result<Option<PendingBlock<Self::Primitives>>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn pool_pending_block(
&self,
) -> impl Future<Output = Result<Option<PendingBlock<Self::Primitives>>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Returns a mem-pool built pending block.
Sourcefn local_pending_block(
&self,
) -> impl Future<Output = Result<Option<PendingBlockAndReceipts<Self::Primitives>>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Self::Pool: TransactionPool<Transaction: PoolTransaction<Consensus = ProviderTx<Self::Provider>>>,
fn local_pending_block(
&self,
) -> impl Future<Output = Result<Option<PendingBlockAndReceipts<Self::Primitives>>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Self::Pool: TransactionPool<Transaction: PoolTransaction<Consensus = ProviderTx<Self::Provider>>>,
Returns the locally built pending block
Sourcefn build_block(
&self,
parent: &SealedHeader<ProviderHeader<Self::Provider>>,
) -> Result<ExecutedBlock<Self::Primitives>, Self::Error>
fn build_block( &self, parent: &SealedHeader<ProviderHeader<Self::Provider>>, ) -> Result<ExecutedBlock<Self::Primitives>, Self::Error>
Builds a pending block using the configured provider and pool.
If the origin is the actual pending block, the block is built with withdrawals.
After Cancun, if the origin is the actual pending block, the block includes the EIP-4788 pre block contract call using the parent beacon block root received from the CL.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.