Trait reth::core::rpc::api::servers::eth::helpers::pending_block::LoadPendingBlock
source · pub trait LoadPendingBlock {
// Required methods
fn provider(
&self,
) -> impl BlockReaderIdExt + EvmEnvProvider + ChainSpecProvider + StateProviderFactory;
fn pool(&self) -> impl TransactionPool;
fn pending_block(&self) -> &Mutex<Option<PendingBlock>>;
fn evm_config(&self) -> &impl ConfigureEvm;
// Provided methods
fn pending_block_env_and_cfg(&self) -> Result<PendingBlockEnv, EthApiError> { ... }
fn local_pending_block(
&self,
) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, EthApiError>> + Send
where Self: SpawnBlocking { ... }
fn assemble_receipt(
&self,
tx: &TransactionSignedEcRecovered,
result: ExecutionResult,
cumulative_gas_used: u64,
) -> Receipt { ... }
fn receipts_root(
&self,
_block_env: &BlockEnv,
execution_outcome: &ExecutionOutcome,
block_number: u64,
) -> FixedBytes<32> { ... }
fn build_block(
&self,
env: PendingBlockEnv,
) -> Result<SealedBlockWithSenders, EthApiError> { ... }
}
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 provider(
&self,
) -> impl BlockReaderIdExt + EvmEnvProvider + ChainSpecProvider + StateProviderFactory
fn provider( &self, ) -> impl BlockReaderIdExt + EvmEnvProvider + ChainSpecProvider + StateProviderFactory
Returns a handle for reading data from disk.
Data access in default (L1) trait method implementations.
sourcefn pool(&self) -> impl TransactionPool
fn pool(&self) -> impl TransactionPool
Returns a handle for reading data from transaction pool.
Data access in default (L1) trait method implementations.
sourcefn pending_block(&self) -> &Mutex<Option<PendingBlock>>
fn pending_block(&self) -> &Mutex<Option<PendingBlock>>
Returns a handle to the pending block.
Data access in default (L1) trait method implementations.
sourcefn evm_config(&self) -> &impl ConfigureEvm
fn evm_config(&self) -> &impl ConfigureEvm
Returns a handle for reading evm config.
Data access in default (L1) trait method implementations.
Provided Methods§
sourcefn pending_block_env_and_cfg(&self) -> Result<PendingBlockEnv, EthApiError>
fn pending_block_env_and_cfg(&self) -> Result<PendingBlockEnv, EthApiError>
Configures the CfgEnvWithHandlerCfg
and BlockEnv
for the pending block
If no pending block is available, this will derive it from the latest
block
sourcefn local_pending_block(
&self,
) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, EthApiError>> + Sendwhere
Self: SpawnBlocking,
fn local_pending_block(
&self,
) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, EthApiError>> + Sendwhere
Self: SpawnBlocking,
Returns the locally built pending block
sourcefn assemble_receipt(
&self,
tx: &TransactionSignedEcRecovered,
result: ExecutionResult,
cumulative_gas_used: u64,
) -> Receipt
fn assemble_receipt( &self, tx: &TransactionSignedEcRecovered, result: ExecutionResult, cumulative_gas_used: u64, ) -> Receipt
Assembles a Receipt
for a transaction, based on its ExecutionResult
.
sourcefn receipts_root(
&self,
_block_env: &BlockEnv,
execution_outcome: &ExecutionOutcome,
block_number: u64,
) -> FixedBytes<32>
fn receipts_root( &self, _block_env: &BlockEnv, execution_outcome: &ExecutionOutcome, block_number: u64, ) -> FixedBytes<32>
Calculates receipts root in block building.
Panics if block is not in the ExecutionOutcome
’s block range.
sourcefn build_block(
&self,
env: PendingBlockEnv,
) -> Result<SealedBlockWithSenders, EthApiError>
fn build_block( &self, env: PendingBlockEnv, ) -> Result<SealedBlockWithSenders, EthApiError>
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.