Docs
Reference
Contract documentation
L1
TaikoData

TaikoData

This library defines various data structures used in the Taiko protocol.

Config

Struct holding Taiko configuration parameters. See {TaikoConfig}.

struct Config {
  uint256 chainId;
  bool relaySignalRoot;
  uint64 blockMaxProposals;
  uint64 blockRingBufferSize;
  uint64 blockMaxVerificationsPerTx;
  uint32 blockMaxGasLimit;
  uint32 blockFeeBaseGas;
  uint24 blockMaxTxListBytes;
  uint256 blockTxListExpiry;
  uint256 proposerRewardPerSecond;
  uint256 proposerRewardMax;
  uint256 proofRegularCooldown;
  uint256 proofOracleCooldown;
  uint16 proofWindow;
  uint96 proofBond;
  bool skipProverAssignmentVerificaiton;
  uint256 ethDepositRingBufferSize;
  uint64 ethDepositMinCountPerBlock;
  uint64 ethDepositMaxCountPerBlock;
  uint96 ethDepositMinAmount;
  uint96 ethDepositMaxAmount;
  uint256 ethDepositGas;
  uint256 ethDepositMaxFee;
}

StateVariables

Struct holding state variables.

struct StateVariables {
  uint64 genesisHeight;
  uint64 genesisTimestamp;
  uint64 numBlocks;
  uint64 lastVerifiedBlockId;
  uint64 nextEthDepositToProcess;
  uint64 numEthDeposits;
}

BlockMetadataInput

Struct representing input data for block metadata.

struct BlockMetadataInput {
  bytes32 txListHash;
  address proposer;
  uint24 txListByteStart;
  uint24 txListByteEnd;
  bool cacheTxListInfo;
}

ProverAssignment

Struct representing prover assignment

struct ProverAssignment {
  address prover;
  uint64 expiry;
  bytes data;
}

BlockMetadata

Struct containing data only required for proving a block Warning: changing this struct requires changing {LibUtils.hashMetadata} accordingly.

struct BlockMetadata {
  uint64 id;
  uint64 timestamp;
  uint64 l1Height;
  bytes32 l1Hash;
  bytes32 mixHash;
  bytes32 txListHash;
  uint24 txListByteStart;
  uint24 txListByteEnd;
  uint32 gasLimit;
  address proposer;
  struct TaikoData.EthDeposit[] depositsProcessed;
}

BlockEvidence

Struct representing block evidence.

struct BlockEvidence {
  bytes32 metaHash;
  bytes32 parentHash;
  bytes32 blockHash;
  bytes32 signalRoot;
  bytes32 graffiti;
  address prover;
  bytes proofs;
}

Transition

Struct representing state transition data. 10 slots reserved for upgradability, 4 slots used.

struct Transition {
  bytes32 key;
  bytes32 blockHash;
  bytes32 signalRoot;
  address prover;
  uint64 provenAt;
  bytes32[6] __reserved;
}

Block

Struct containing data required for verifying a block. 10 slots reserved for upgradability, 3 slots used.

struct Block {
  bytes32 metaHash;
  address prover;
  uint96 proofBond;
  uint64 blockId;
  uint64 proposedAt;
  uint32 nextTransitionId;
  uint32 verifiedTransitionId;
  bytes32[7] __reserved;
}

TxListInfo

Struct representing information about a transaction list. 1 slot used.

struct TxListInfo {
  uint64 validSince;
  uint24 size;
}

EthDeposit

Struct representing an Ethereum deposit. 1 slot used.

struct EthDeposit {
  address recipient;
  uint96 amount;
  uint64 id;
}

SlotA

Forge is only able to run coverage in case the contracts by default capable of compiling without any optimization (neither optimizer runs, no compiling --via-ir flag). In order to resolve stack too deep without optimizations, we needed to introduce outsourcing vars into structs below.

struct SlotA {
  uint64 genesisHeight;
  uint64 genesisTimestamp;
  uint64 numEthDeposits;
  uint64 nextEthDepositToProcess;
}

SlotB

struct SlotB {
  uint64 numBlocks;
  uint64 nextEthDepositToProcess;
  uint64 lastVerifiedAt;
  uint64 lastVerifiedBlockId;
}

State

Struct holding the state variables for the {TaikoL1} contract.

struct State {
  mapping(uint64 => struct TaikoData.Block) blocks;
  mapping(uint64 => mapping(bytes32 => uint32)) transitionIds;
  mapping(uint64 => mapping(uint32 => struct TaikoData.Transition)) transitions;
  mapping(bytes32 => struct TaikoData.TxListInfo) txListInfo;
  mapping(uint256 => uint256) ethDeposits;
  mapping(address => uint256) taikoTokenBalances;
  struct TaikoData.SlotA slotA;
  struct TaikoData.SlotB slotB;
  uint256[142] __gap;
}