Expand description
Execution extensions (ExEx
).
An execution extension is a task that derives its state from Reth’s state.
Some examples of such state derives are rollups, bridges, and indexers.
An ExEx
is a Future
resolving to a Result<()>
that is run indefinitely alongside Reth.
ExEx
’s are initialized using an async closure that resolves to the ExEx
; this closure gets
passed an ExExContext
where it is possible to spawn additional tasks and modify Reth.
Most ExEx
’s will want to derive their state from the CanonStateNotification
channel given
in ExExContext
. A new notification is emitted whenever blocks are executed in live and
historical sync.
§Pruning
ExEx
’s SHOULD emit an ExExEvent::FinishedHeight
event to signify what blocks have been
processed. This event is used by Reth to determine what state can be pruned.
An ExEx
will only receive notifications for blocks greater than the block emitted in the
event. To clarify: if the ExEx
emits ExExEvent::FinishedHeight(0)
it will receive
notifications for any block_number > 0
.
Modules§
- serde_
bincode_ compat serde
andserde-bincode-compat
Bincode-compatible serde implementations for commonly used ExEx types.
Structs§
- Backfill job started for a specific range.
- Factory for creating new backfill jobs.
- The block cache of the WAL.
- Captures the context that an
ExEx
has access to. - Captures the context that an
ExEx
has access to. - A head of the ExEx. It contains the highest host block committed to the internal ExEx state. I.e. the latest block that the ExEx has fully processed.
- The execution extension manager.
- A handle to communicate with the
ExExManager
. - Metrics for the
ExEx
manager. - A stream of
ExExNotification
s. The stream will emit notifications for all blocks. If the stream is configured with a head viaExExNotifications::set_with_head
orExExNotifications::with_head
, it will run backfill jobs to catch up to the node head. - A stream of
ExExNotification
s. The stream will only emit notifications for blocks that are committed or reverted after the given head. The head is the ExEx’s latest view of the host chain. - A stream of
ExExNotification
s. The stream will emit notifications for all blocks. - Single block Backfill job started for a specific range.
- The underlying WAL storage backed by a directory of files.
- Stream for processing backfill jobs asynchronously.
- WAL is a write-ahead log (WAL) that stores the notifications sent to ExExes.
- A read-only handle to the WAL that can be shared.
Enums§
- Events emitted by an
ExEx
. - Notifications sent to an
ExEx
. - The source of the notification.
- The finished height of all
ExEx
’s.
Constants§
- Default max size of the internal state notifications buffer.
- The maximum number of blocks allowed in the WAL before emitting a warning.
Traits§
- A trait, that represents a stream of
ExExNotification
s. The stream will emit notifications for all blocks. If the stream is configured with a head viaExExNotifications::set_with_head
orExExNotifications::with_head
, it will run backfill jobs to catch up to the node head.