RPC Engine Types

op-alloy-rpc-types-engine crate

The op-alloy-rpc-types-engine crate provides Optimism types for interfacing with the Engine API in the OP Stack.

Optimism defines a custom payload attributes type called OpPayloadAttributes. OpPayloadAttributes extends alloy's PayloadAttributes with a few fields: transactions, a flag for enabling the tx pool, the gas limit, and EIP 1559 parameters.

Wrapping OpPayloadAttributes, the OpAttributesWithParent type extends payload attributes with the parent block (referenced as an [L2BlockInfo][lbi]) and a flag for whether the associated batch is the last batch in the span.

Optimism also returns a custom type for the engine_getPayload request for both V3 and V4 payload envelopes. These are the OpExecutionPayloadEnvelopeV3 and OpExecutionPayloadEnvelopeV4 types, which both wrap payload envelope types from alloy-rpc-types-engine.