Type Alias TestExExContext

Source
pub type TestExExContext = ExExContext<Adapter>;
Expand description

An [ExExContext] using the Adapter type.

Aliased Type§

struct TestExExContext {
    pub head: NumHash,
    pub config: NodeConfig<ChainSpec>,
    pub reth_config: Config,
    pub events: UnboundedSender<ExExEvent>,
    pub notifications: ExExNotifications<BlockchainProvider<NodeTypesWithDBAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>>>, MockExecutorProvider>,
    pub components: NodeAdapter<FullNodeTypesAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>, BlockchainProvider<NodeTypesWithDBAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>>>>, Components<FullNodeTypesAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>, BlockchainProvider<NodeTypesWithDBAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>>>>, EthNetworkPrimitives, Pool<MockTransactionValidator<MockTransaction>, CoinbaseTipOrdering<MockTransaction>, InMemoryBlobStore>, EthEvmConfig, MockExecutorProvider, Arc<TestConsensus>>>,
}

Fields§

§head: NumHash

The current head of the blockchain at launch.

§config: NodeConfig<ChainSpec>

The config of the node

§reth_config: Config

The loaded node config

§events: UnboundedSender<ExExEvent>

Channel used to send [ExExEvent]s to the rest of the node.

§Important

The exex should emit a FinishedHeight whenever a processed block is safe to prune. Additionally, the exex can preemptively emit a FinishedHeight event to specify what blocks to receive notifications for.

§notifications: ExExNotifications<BlockchainProvider<NodeTypesWithDBAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>>>, MockExecutorProvider>

Channel to receive ExExNotifications.

§Important

Once an ExExNotification is sent over the channel, it is considered delivered by the node.

§components: NodeAdapter<FullNodeTypesAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>, BlockchainProvider<NodeTypesWithDBAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>>>>, Components<FullNodeTypesAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>, BlockchainProvider<NodeTypesWithDBAdapter<TestNode, Arc<TempDatabase<DatabaseEnv>>>>>, EthNetworkPrimitives, Pool<MockTransactionValidator<MockTransaction>, CoinbaseTipOrdering<MockTransaction>, InMemoryBlobStore>, EthEvmConfig, MockExecutorProvider, Arc<TestConsensus>>>

Node components

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 3824 bytes

Implementations

§

impl<Node> ExExContext<Node>
where Node: FullNodeComponents, <Node as FullNodeTypes>::Provider: Debug + BlockReader, <Node as FullNodeComponents>::Executor: Debug, <Node as FullNodeTypes>::Types: NodeTypes, <<Node as FullNodeTypes>::Types as NodeTypes>::Primitives: NodePrimitives,

pub fn into_dyn( self, ) -> ExExContextDyn<<<Node as FullNodeTypes>::Types as NodeTypes>::Primitives>

Returns dynamic version of the context

§

impl<Node> ExExContext<Node>
where Node: FullNodeComponents, <Node as FullNodeTypes>::Types: NodeTypes, <<Node as FullNodeTypes>::Types as NodeTypes>::Primitives: NodePrimitives,

pub fn pool(&self) -> &<Node as FullNodeComponents>::Pool

Returns the transaction pool of the node.

pub fn evm_config(&self) -> &<Node as FullNodeComponents>::Evm

Returns the node’s evm config.

pub fn block_executor(&self) -> &<Node as FullNodeComponents>::Executor

Returns the node’s executor type.

pub fn provider(&self) -> &<Node as FullNodeTypes>::Provider

Returns the provider of the node.

pub fn network(&self) -> &<Node as FullNodeComponents>::Network

Returns the handle to the network

pub fn payload_builder_handle( &self, ) -> &PayloadBuilderHandle<<<Node as FullNodeTypes>::Types as NodeTypes>::Payload>

Returns the handle to the payload builder service.

pub fn task_executor(&self) -> &TaskExecutor

Returns the task executor.

This type should be used to spawn (critical) tasks.

pub fn set_notifications_without_head(&mut self)

Sets notifications stream to [crate::ExExNotificationsWithoutHead], a stream of notifications without a head.

pub fn set_notifications_with_head(&mut self, head: ExExHead)

Sets notifications stream to [crate::ExExNotificationsWithHead], a stream of notifications with the provided head.

pub fn send_finished_height( &self, height: NumHash, ) -> Result<(), SendError<NumHash>>

Sends an [ExExEvent::FinishedHeight] to the ExEx task manager letting it know that this ExEx has processed the corresponding block.

Returns an error if the channel was closed (ExEx task manager panicked).

Trait Implementations

§

impl<Node> Debug for ExExContext<Node>
where Node: FullNodeComponents, <Node as FullNodeTypes>::Provider: Debug, <Node as FullNodeComponents>::Executor: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more