Expand description
§op-alloy-protocol
Core protocol types for Optimism.
These include types, constants, and methods for derivation as well as batch-submission.
§Provenance
This code was initially ported from kona-primitives as part of ongoing op-alloy migrations.
Re-exports§
pub use deposits::decode_deposit;
pub use deposits::DepositError;
pub use deposits::DepositSourceDomain;
pub use deposits::DepositSourceDomainIdentifier;
pub use deposits::L1InfoDepositSource;
pub use deposits::UpgradeDepositSource;
pub use deposits::UserDepositSource;
pub use deposits::DEPOSIT_EVENT_ABI_HASH;
pub use block_info::L1BlockInfoBedrock;
pub use block_info::L1BlockInfoEcotone;
pub use block_info::L1BlockInfoTx;
pub use fee::calculate_tx_l1_cost_bedrock;
pub use fee::calculate_tx_l1_cost_ecotone;
pub use fee::calculate_tx_l1_cost_fjord;
pub use fee::calculate_tx_l1_cost_regolith;
pub use fee::data_gas_bedrock;
pub use fee::data_gas_fjord;
pub use fee::data_gas_regolith;
Modules§
- This module contains the L1BlockInfoTx type, and various encoding / decoding methods for it.
- Contains deposit transaction types and helper methods.
- This module contains the L1 block fee calculation function.
Structs§
- BatchTransaction is a set of Frames that can be Into::into Bytes. if the size exceeds the desired threshold.
- A batch with its inclusion block.
- Block Header Info
- A Channel is a set of batches that are split into at least one, but possibly multiple frames.
- A channel frame is a segment of a channel’s data.
- An iterator over encoded frames.
- L2 Block Header Info
- Raw Span Batch
- Represents a single batch: a single encoded L2 block
- The span batch contains the input to build a span of L2 blocks in derived form.
- Type for span batch bits.
- The transaction data for an EIP-1559 transaction within a span batch.
- The transaction data for an EIP-2930 transaction within a span batch.
- A single batch element is similar to the SingleBatch type but does not contain the parent hash and epoch hash since spans do not contain this data for every block in the span.
- The transaction data for a legacy transaction within a span batch.
- Span Batch Payload
- Span Batch Prefix
- This struct contains the decoded information for transactions in a span batch.
Enums§
- A Batch.
- An error decoding a batch.
- The Batch Type.
- Batch Validity
- An error returned when adding a frame to a channel.
- A frame decoding error.
- Frame parsing error.
- An error that can occur when converting an OpBlock to an L2BlockInfo.
- An error encountered during OpBlock conversion.
- Span Batch Errors
- The typed transaction data for a transaction within a span batch.
- Decoding Error
Constants§
- CHANNEL_ID_LENGTH is the length of the channel ID.
- The version of the derivation pipeline.
- FJORD_MAX_RLP_BYTES_PER_CHANNEL is the maximum amount of bytes that will be read from a channel when the Fjord Hardfork is activated. This limit is set when decoding the RLP.
- Count the tagging info as 200 in terms of buffer size.
- Frames cannot be larger than 1MB.
- MAX_RLP_BYTES_PER_CHANNEL is the maximum amount of bytes that will be read from a channel. This limit is set when decoding the RLP.
- MAX_SPAN_BATCH_ELEMENTS is the maximum number of blocks, transactions in total, or transaction per block allowed in a span batch.
- The single batch type identifier.
- The span batch type identifier.
Traits§
- Describes the functionality of a data source that fetches safe blocks.
Functions§
- Reads transaction data from a reader.
- Returns if the given
value
is a deposit transaction. - Converts the OpBlock to a partial SystemConfig.
Type Aliases§
- ChannelId is an opaque identifier for a channel.