Expand description
§kona-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 to op-alloy as part of maili migrations.
Structs§
- Batch
Reader - Batch Reader provides a function that iteratively consumes batches from the reader. The L1Inclusion block is also provided at creation time. Warning: the batch reader can read every batch-type. The caller of the batch-reader should filter the results.
- Batch
Transaction - BatchTransaction is a set of
Frames that can be Into::intoBytes. if the size exceeds the desired threshold. - Batch
With Inclusion Block - A batch with its inclusion block.
- Block
Info - Block Header Info
- Channel
- A Channel is a set of batches that are split into at least one, but possibly multiple frames.
- Frame
- A channel frame representing a segment of channel data for transmission.
- L1Block
Info Bedrock - Represents the fields within a Bedrock L1 block info transaction.
- L1Block
Info Ecotone - Represents the fields within an Ecotone L1 block info transaction.
- L1Block
Info Isthmus - Represents the fields within an Isthnus L1 block info transaction.
- L2Block
Info - L2 Block Header Info
- OpAttributes
With Parent - Optimism Payload Attributes with parent block reference and the L1 origin block.
- Output
Root - The
OutputRootis a high-level commitment to an L2 block. It lifts the state root from the block header as well as the storage root of the Predeploys::L2_TO_L1_MESSAGE_PASSER account into the top-level commitment construction. - Predeploys
- Container for all predeploy contract addresses
- RawSpan
Batch - Raw Span Batch
- Single
Batch - Represents a single batch: a single encoded L2 block
- Span
Batch - Container for the inputs required to build a span of L2 blocks in derived form.
- Span
Batch Bits - Type for span batch bits.
- Span
Batch Eip1559 Transaction Data - The transaction data for an EIP-1559 transaction within a span batch.
- Span
Batch Eip2930 Transaction Data - The transaction data for an EIP-2930 transaction within a span batch.
- Span
Batch Eip7702 Transaction Data - The transaction data for an EIP-7702 transaction within a span batch.
- Span
Batch Element - A single batch element is similar to the
SingleBatchtype but does not contain the parent hash and epoch hash since spans do not contain this data for every block in the span. - Span
Batch Legacy Transaction Data - The transaction data for a legacy transaction within a span batch.
- Span
Batch Payload - Span Batch Payload
- Span
Batch Prefix - Span Batch Prefix
- Span
Batch Transactions - This struct contains the decoded information for transactions in a span batch.
- Sync
Status - The
SyncStatusof an Optimism Rollup Node.
Enums§
- Batch
- A Batch.
- Batch
Decoding Error - An error decoding a batch.
- Batch
Encoding Error - An error encoding a batch.
- Batch
Type - The Batch Type.
- Batch
Validity - Batch Validity
- Block
Info Error - An error type for parsing L1 block info transactions.
- Brotli
Decompression Error - A frame decompression error.
- Channel
Error - An error returned when adding a frame to a channel.
- Decode
Error - An error decoding an L1 block info transaction.
- Decompression
Error - Error type for decompression failures.
- Deposit
Error - An
TxDepositvalidation error. - Frame
Decoding Error - A frame decoding error.
- Frame
Parse Error - Frame parsing error.
- From
Block Error - An error that can occur when converting an OP
BlocktoL2BlockInfo. - L1Block
Info Tx - The
L1BlockInfoTxenum contains variants for the different versions of the L1 block info transaction on OP Stack chains. - OpBlock
Conversion Error - An error encountered during OP
Blockconversion. - Span
Batch Error - Span Batch Errors
- Span
Batch Transaction Data - The typed transaction data for a transaction within a span batch.
- Span
Decoding Error - Decoding Error
Constants§
- CHANNEL_
ID_ LENGTH CHANNEL_ID_LENGTHis the length of the channel ID.- DEPOSIT_
EVENT_ ABI - Deposit log event abi signature.
- DEPOSIT_
EVENT_ ABI_ HASH - Deposit event abi hash.
- DEPOSIT_
EVENT_ VERSION_ 0 - The initial version of the deposit event log.
- DERIVATION_
VERSION_ 0 - Version identifier for the current derivation pipeline format.
- FJORD_
MAX_ RLP_ BYTES_ PER_ CHANNEL FJORD_MAX_RLP_BYTES_PER_CHANNELis 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.- FRAME_
OVERHEAD - Overhead estimation for frame metadata and tagging information.
- MAX_
FRAME_ LEN - Maximum allowed size for a single frame in bytes.
- MAX_
RLP_ BYTES_ PER_ CHANNEL MAX_RLP_BYTES_PER_CHANNELis the maximum amount of bytes that will be read from a channel. This limit is set when decoding the RLP.- MAX_
SPAN_ BATCH_ ELEMENTS - MAX_SPAN_BATCH_ELEMENTS is the maximum number of blocks, transactions in total, or transaction per block allowed in a span batch.
- SINGLE_
BATCH_ TYPE - The single batch type identifier.
- SPAN_
BATCH_ TYPE - The span batch type identifier.
Traits§
- Batch
Validation Provider - Describes the functionality of a data source that fetches safe blocks.
Functions§
- decode_
deposit - Derives a deposit transaction from an EVM log event emitted by the deposit contract.
- decompress_
brotli - Decompresses the given bytes data using the Brotli decompressor implemented
in the
brotlicrate. - read_
tx_ data - Reads transaction data from a reader.
- to_
system_ config - Converts the
OpBlockto a partialSystemConfig.