Available on crate feature
consensus
only.Expand description
§op-alloy-consensus
Optimism consensus interface.
This crate contains constants, types, and functions for implementing Optimism EL consensus and communication. This
includes an extended OpTxEnvelope
type with deposit transactions, and receipts containing OP Stack
specific fields (deposit_nonce
+ deposit_receipt_version
).
In general a type belongs in this crate if it exists in the alloy-consensus
crate, but was modified from the base Ethereum protocol in the OP Stack.
For consensus types that are not modified by the OP Stack, the alloy-consensus
types should be used instead.
§Provenance
Much of this code was ported from reth-primitives as part of ongoing alloy migrations.
Modules§
- eip1559
- Support for EIP-1559 parameters after holocene.
Structs§
- Deposit
Context Deposit Source - A deposit context transaction source.
- Ecotone
- The Ecotone network upgrade transactions.
- Fjord
- The Fjord network upgrade transactions.
- Hardforks
- Optimism Hardforks
- L1Info
Deposit Source - A L1 info deposit transaction source.
- OpDeposit
Receipt - Receipt containing result of transaction execution.
- TxDeposit
- Deposit transactions, also known as deposits are initiated on L1, and executed on L2.
- Upgrade
Deposit Source - An upgrade deposit transaction source.
- User
Deposit Source - A deposit transaction source.
Enums§
- Deposit
Source Domain - Source domains for deposit transactions.
- Deposit
Source Domain Identifier - Source domain identifiers for deposit transactions.
- EIP1559
Param Error - Error type for EIP-1559 parameters
- OpPooled
Transaction - All possible transactions that can be included in a response to
GetPooledTransactions
. A response toGetPooledTransactions
. This can include a typed signed transaction, but cannot include a deposit transaction or EIP-4844 transaction. - OpReceipt
Envelope - Receipt envelope, as defined in EIP-2718, modified for OP Stack chains.
- OpTx
Envelope - The Ethereum EIP-2718 Transaction Envelope, modified for OP Stack chains.
- OpTx
Type - Optimism
TransactionType
flags as specified in EIPs 2718, 1559, and 2930, as well as the deposit transaction spec - OpTyped
Transaction - The TypedTransaction enum represents all Ethereum transaction request types, modified for the OP Stack.
Constants§
- DEPOSIT_
TX_ TYPE_ ID - Identifier for an Optimism deposit transaction
Traits§
- Deposit
Transaction - A trait representing a deposit transaction with specific attributes.
- Hardfork
- The trait abstraction for a Hardfork.
- OpTx
Receipt - Receipt is the result of a transaction execution.
Functions§
- decode_
eip_ 1559_ params - Extracts the Holocene 1599 parameters from the encoded form: https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/holocene/exec-engine.md#eip1559params-encoding
- decode_
holocene_ extra_ data - Decodes the
eip1559
parameters from theextradata
bytes. - encode_
holocene_ extra_ data - Encodes the
eip1559
parameters for the payload. - serde_
deposit_ tx_ rpc serde
- Deposit transactions don’t have a signature, however, we include an empty signature in the response for better compatibility.
Type Aliases§
- OpBlock
- An Optimism block type.
- OpDeposit
Receipt With Bloom OpDepositReceipt
with calculated bloom filter, modified for the OP Stack.