From b33d725f875b82a86b08cf4edf0ec24f1227f867 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 28 Sep 2023 14:04:32 +0800 Subject: [PATCH 01/63] feat: update bindings --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 2344 ++++++++++++++++++++++++++------------ bindings/gen_taiko_l2.go | 247 +--- 3 files changed, 1649 insertions(+), 944 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index d854d9e9d..2a79c6f19 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -ee2688156733d49cbf43c5178211db95a7079b26 +5a2aa133f37049dd2c81ed2b948bb3c3911e338f diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index 1f39b5ae0..da1bc4132 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -29,58 +29,61 @@ var ( _ = abi.ConvertType ) +// ITierProviderTier is an auto generated low-level Go binding around an user-defined struct. +type ITierProviderTier struct { + VerifierName [32]byte + ValidityBond *big.Int + ContestBond *big.Int + CooldownWindow *big.Int + ProvingWindow uint16 +} + // TaikoDataBlock is an auto generated low-level Go binding around an user-defined struct. type TaikoDataBlock struct { MetaHash [32]byte - Prover common.Address - ProofBond *big.Int + AssignedProver common.Address + LivenessBond *big.Int BlockId uint64 ProposedAt uint64 NextTransitionId uint32 VerifiedTransitionId uint32 + MinTier uint16 Reserved [7][32]byte } // TaikoDataBlockMetadata is an auto generated low-level Go binding around an user-defined struct. type TaikoDataBlockMetadata struct { - Id uint64 - Timestamp uint64 - L1Height uint64 L1Hash [32]byte MixHash [32]byte TxListHash [32]byte - TxListByteStart *big.Int - TxListByteEnd *big.Int + Id uint64 + Timestamp uint64 + L1Height uint64 GasLimit uint32 - Proposer common.Address + Coinbase common.Address DepositsProcessed []TaikoDataEthDeposit } // TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. type TaikoDataConfig struct { - ChainId *big.Int - RelaySignalRoot bool - BlockMaxProposals uint64 - BlockRingBufferSize uint64 - BlockMaxVerificationsPerTx uint64 - BlockMaxGasLimit uint32 - BlockFeeBaseGas uint32 - BlockMaxTxListBytes *big.Int - BlockTxListExpiry *big.Int - ProposerRewardPerSecond *big.Int - ProposerRewardMax *big.Int - ProofRegularCooldown *big.Int - ProofOracleCooldown *big.Int - ProofWindow uint16 - ProofBond *big.Int - SkipProverAssignmentVerificaiton bool - EthDepositRingBufferSize *big.Int - EthDepositMinCountPerBlock uint64 - EthDepositMaxCountPerBlock uint64 - EthDepositMinAmount *big.Int - EthDepositMaxAmount *big.Int - EthDepositGas *big.Int - EthDepositMaxFee *big.Int + ChainId *big.Int + RelaySignalRoot bool + BlockMaxProposals uint64 + BlockRingBufferSize uint64 + BlockMaxVerificationsPerTx uint64 + BlockMaxGasLimit uint32 + BlockFeeBaseGas uint32 + BlockMaxTxListBytes *big.Int + ProposerRewardPerSecond *big.Int + ProposerRewardMax *big.Int + LivenessBond *big.Int + EthDepositRingBufferSize *big.Int + EthDepositMinCountPerBlock uint64 + EthDepositMaxCountPerBlock uint64 + EthDepositMinAmount *big.Int + EthDepositMaxAmount *big.Int + EthDepositGas *big.Int + EthDepositMaxFee *big.Int } // TaikoDataEthDeposit is an auto generated low-level Go binding around an user-defined struct. @@ -110,25 +113,29 @@ type TaikoDataSlotB struct { type TaikoDataStateVariables struct { GenesisHeight uint64 GenesisTimestamp uint64 - NumBlocks uint64 - LastVerifiedBlockId uint64 NextEthDepositToProcess uint64 NumEthDeposits uint64 + NumBlocks uint64 + LastVerifiedBlockId uint64 } // TaikoDataTransition is an auto generated low-level Go binding around an user-defined struct. type TaikoDataTransition struct { - Key [32]byte - BlockHash [32]byte - SignalRoot [32]byte - Prover common.Address - ProvenAt uint64 - Reserved [6][32]byte + Key [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Prover common.Address + ValidityBond *big.Int + Contester common.Address + ContestBond *big.Int + Timestamp uint64 + Tier uint16 + Reserved [4][32]byte } // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ASSIGNMENT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ASSIGNMENT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bond\",\"type\":\"uint256\"}],\"name\":\"BondReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bond\",\"type\":\"uint256\"}],\"name\":\"BondReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bond\",\"type\":\"uint256\"}],\"name\":\"BondReturned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bond\",\"type\":\"uint256\"}],\"name\":\"BondReturned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bond\",\"type\":\"uint256\"}],\"name\":\"BondRewarded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bond\",\"type\":\"uint256\"}],\"name\":\"BondRewarded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"proofBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"blockTxListExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofRegularCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofOracleCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"proofWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"proofBond\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"skipProverAssignmentVerificaiton\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"bytes32[6]\",\"name\":\"__reserved\",\"type\":\"bytes32[6]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"getVerifierName\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -341,7 +348,7 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) CanDepositEthToL2(amount *big. // GetBlock is a free data retrieval call binding the contract method 0x5fa15e79. // -// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint96,uint64,uint64,uint32,uint32,bytes32[7]) blk) +// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint96,uint64,uint64,uint32,uint32,uint16,bytes32[7]) blk) func (_TaikoL1Client *TaikoL1ClientCaller) GetBlock(opts *bind.CallOpts, blockId uint64) (TaikoDataBlock, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getBlock", blockId) @@ -358,21 +365,21 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetBlock(opts *bind.CallOpts, blockId // GetBlock is a free data retrieval call binding the contract method 0x5fa15e79. // -// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint96,uint64,uint64,uint32,uint32,bytes32[7]) blk) +// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint96,uint64,uint64,uint32,uint32,uint16,bytes32[7]) blk) func (_TaikoL1Client *TaikoL1ClientSession) GetBlock(blockId uint64) (TaikoDataBlock, error) { return _TaikoL1Client.Contract.GetBlock(&_TaikoL1Client.CallOpts, blockId) } // GetBlock is a free data retrieval call binding the contract method 0x5fa15e79. // -// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint96,uint64,uint64,uint32,uint32,bytes32[7]) blk) +// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint96,uint64,uint64,uint32,uint32,uint16,bytes32[7]) blk) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlock(blockId uint64) (TaikoDataBlock, error) { return _TaikoL1Client.Contract.GetBlock(&_TaikoL1Client.CallOpts, blockId) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint256,uint256,uint256,uint16,uint96,bool,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getConfig") @@ -389,14 +396,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (Taiko // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint256,uint256,uint256,uint16,uint96,bool,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint256,uint256,uint256,uint16,uint96,bool,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } @@ -463,6 +470,37 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetCrossChainSignalRoot(blockI return _TaikoL1Client.Contract.GetCrossChainSignalRoot(&_TaikoL1Client.CallOpts, blockId) } +// GetMinTier is a free data retrieval call binding the contract method 0x59ab4e23. +// +// Solidity: function getMinTier(uint256 rand) view returns(uint16) +func (_TaikoL1Client *TaikoL1ClientCaller) GetMinTier(opts *bind.CallOpts, rand *big.Int) (uint16, error) { + var out []interface{} + err := _TaikoL1Client.contract.Call(opts, &out, "getMinTier", rand) + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// GetMinTier is a free data retrieval call binding the contract method 0x59ab4e23. +// +// Solidity: function getMinTier(uint256 rand) view returns(uint16) +func (_TaikoL1Client *TaikoL1ClientSession) GetMinTier(rand *big.Int) (uint16, error) { + return _TaikoL1Client.Contract.GetMinTier(&_TaikoL1Client.CallOpts, rand) +} + +// GetMinTier is a free data retrieval call binding the contract method 0x59ab4e23. +// +// Solidity: function getMinTier(uint256 rand) view returns(uint16) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetMinTier(rand *big.Int) (uint16, error) { + return _TaikoL1Client.Contract.GetMinTier(&_TaikoL1Client.CallOpts, rand) +} + // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // // Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64)) @@ -496,10 +534,10 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetStateVariables() (TaikoData // GetTaikoTokenBalance is a free data retrieval call binding the contract method 0x8dff9cea. // -// Solidity: function getTaikoTokenBalance(address addr) view returns(uint256) -func (_TaikoL1Client *TaikoL1ClientCaller) GetTaikoTokenBalance(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { +// Solidity: function getTaikoTokenBalance(address user) view returns(uint256) +func (_TaikoL1Client *TaikoL1ClientCaller) GetTaikoTokenBalance(opts *bind.CallOpts, user common.Address) (*big.Int, error) { var out []interface{} - err := _TaikoL1Client.contract.Call(opts, &out, "getTaikoTokenBalance", addr) + err := _TaikoL1Client.contract.Call(opts, &out, "getTaikoTokenBalance", user) if err != nil { return *new(*big.Int), err @@ -513,78 +551,109 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetTaikoTokenBalance(opts *bind.CallO // GetTaikoTokenBalance is a free data retrieval call binding the contract method 0x8dff9cea. // -// Solidity: function getTaikoTokenBalance(address addr) view returns(uint256) -func (_TaikoL1Client *TaikoL1ClientSession) GetTaikoTokenBalance(addr common.Address) (*big.Int, error) { - return _TaikoL1Client.Contract.GetTaikoTokenBalance(&_TaikoL1Client.CallOpts, addr) +// Solidity: function getTaikoTokenBalance(address user) view returns(uint256) +func (_TaikoL1Client *TaikoL1ClientSession) GetTaikoTokenBalance(user common.Address) (*big.Int, error) { + return _TaikoL1Client.Contract.GetTaikoTokenBalance(&_TaikoL1Client.CallOpts, user) } // GetTaikoTokenBalance is a free data retrieval call binding the contract method 0x8dff9cea. // -// Solidity: function getTaikoTokenBalance(address addr) view returns(uint256) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTaikoTokenBalance(addr common.Address) (*big.Int, error) { - return _TaikoL1Client.Contract.GetTaikoTokenBalance(&_TaikoL1Client.CallOpts, addr) +// Solidity: function getTaikoTokenBalance(address user) view returns(uint256) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTaikoTokenBalance(user common.Address) (*big.Int, error) { + return _TaikoL1Client.Contract.GetTaikoTokenBalance(&_TaikoL1Client.CallOpts, user) } -// GetTransition is a free data retrieval call binding the contract method 0xfd257e29. +// GetTier is a free data retrieval call binding the contract method 0x576c3de7. // -// Solidity: function getTransition(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint64,bytes32[6])) -func (_TaikoL1Client *TaikoL1ClientCaller) GetTransition(opts *bind.CallOpts, blockId uint64, parentHash [32]byte) (TaikoDataTransition, error) { +// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16)) +func (_TaikoL1Client *TaikoL1ClientCaller) GetTier(opts *bind.CallOpts, tierId uint16) (ITierProviderTier, error) { var out []interface{} - err := _TaikoL1Client.contract.Call(opts, &out, "getTransition", blockId, parentHash) + err := _TaikoL1Client.contract.Call(opts, &out, "getTier", tierId) if err != nil { - return *new(TaikoDataTransition), err + return *new(ITierProviderTier), err } - out0 := *abi.ConvertType(out[0], new(TaikoDataTransition)).(*TaikoDataTransition) + out0 := *abi.ConvertType(out[0], new(ITierProviderTier)).(*ITierProviderTier) return out0, err } -// GetTransition is a free data retrieval call binding the contract method 0xfd257e29. +// GetTier is a free data retrieval call binding the contract method 0x576c3de7. // -// Solidity: function getTransition(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint64,bytes32[6])) -func (_TaikoL1Client *TaikoL1ClientSession) GetTransition(blockId uint64, parentHash [32]byte) (TaikoDataTransition, error) { - return _TaikoL1Client.Contract.GetTransition(&_TaikoL1Client.CallOpts, blockId, parentHash) +// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16)) +func (_TaikoL1Client *TaikoL1ClientSession) GetTier(tierId uint16) (ITierProviderTier, error) { + return _TaikoL1Client.Contract.GetTier(&_TaikoL1Client.CallOpts, tierId) } -// GetTransition is a free data retrieval call binding the contract method 0xfd257e29. +// GetTier is a free data retrieval call binding the contract method 0x576c3de7. // -// Solidity: function getTransition(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint64,bytes32[6])) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTransition(blockId uint64, parentHash [32]byte) (TaikoDataTransition, error) { - return _TaikoL1Client.Contract.GetTransition(&_TaikoL1Client.CallOpts, blockId, parentHash) +// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16)) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTier(tierId uint16) (ITierProviderTier, error) { + return _TaikoL1Client.Contract.GetTier(&_TaikoL1Client.CallOpts, tierId) } -// GetVerifierName is a free data retrieval call binding the contract method 0x0372303d. +// GetTierIds is a free data retrieval call binding the contract method 0xd8cde1c6. // -// Solidity: function getVerifierName(uint16 id) pure returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientCaller) GetVerifierName(opts *bind.CallOpts, id uint16) ([32]byte, error) { +// Solidity: function getTierIds() view returns(uint16[]) +func (_TaikoL1Client *TaikoL1ClientCaller) GetTierIds(opts *bind.CallOpts) ([]uint16, error) { var out []interface{} - err := _TaikoL1Client.contract.Call(opts, &out, "getVerifierName", id) + err := _TaikoL1Client.contract.Call(opts, &out, "getTierIds") if err != nil { - return *new([32]byte), err + return *new([]uint16), err } - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + out0 := *abi.ConvertType(out[0], new([]uint16)).(*[]uint16) + + return out0, err + +} + +// GetTierIds is a free data retrieval call binding the contract method 0xd8cde1c6. +// +// Solidity: function getTierIds() view returns(uint16[]) +func (_TaikoL1Client *TaikoL1ClientSession) GetTierIds() ([]uint16, error) { + return _TaikoL1Client.Contract.GetTierIds(&_TaikoL1Client.CallOpts) +} + +// GetTierIds is a free data retrieval call binding the contract method 0xd8cde1c6. +// +// Solidity: function getTierIds() view returns(uint16[]) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTierIds() ([]uint16, error) { + return _TaikoL1Client.Contract.GetTierIds(&_TaikoL1Client.CallOpts) +} + +// GetTransition is a free data retrieval call binding the contract method 0xfd257e29. +// +// Solidity: function getTransition(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint96,address,uint96,uint64,uint16,bytes32[4])) +func (_TaikoL1Client *TaikoL1ClientCaller) GetTransition(opts *bind.CallOpts, blockId uint64, parentHash [32]byte) (TaikoDataTransition, error) { + var out []interface{} + err := _TaikoL1Client.contract.Call(opts, &out, "getTransition", blockId, parentHash) + + if err != nil { + return *new(TaikoDataTransition), err + } + + out0 := *abi.ConvertType(out[0], new(TaikoDataTransition)).(*TaikoDataTransition) return out0, err } -// GetVerifierName is a free data retrieval call binding the contract method 0x0372303d. +// GetTransition is a free data retrieval call binding the contract method 0xfd257e29. // -// Solidity: function getVerifierName(uint16 id) pure returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientSession) GetVerifierName(id uint16) ([32]byte, error) { - return _TaikoL1Client.Contract.GetVerifierName(&_TaikoL1Client.CallOpts, id) +// Solidity: function getTransition(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint96,address,uint96,uint64,uint16,bytes32[4])) +func (_TaikoL1Client *TaikoL1ClientSession) GetTransition(blockId uint64, parentHash [32]byte) (TaikoDataTransition, error) { + return _TaikoL1Client.Contract.GetTransition(&_TaikoL1Client.CallOpts, blockId, parentHash) } -// GetVerifierName is a free data retrieval call binding the contract method 0x0372303d. +// GetTransition is a free data retrieval call binding the contract method 0xfd257e29. // -// Solidity: function getVerifierName(uint16 id) pure returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetVerifierName(id uint16) ([32]byte, error) { - return _TaikoL1Client.Contract.GetVerifierName(&_TaikoL1Client.CallOpts, id) +// Solidity: function getTransition(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint96,address,uint96,uint64,uint16,bytes32[4])) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTransition(blockId uint64, parentHash [32]byte) (TaikoDataTransition, error) { + return _TaikoL1Client.Contract.GetTransition(&_TaikoL1Client.CallOpts, blockId, parentHash) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -788,25 +857,46 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) Init(_addressManager commo return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash) } -// ProposeBlock is a paid mutator transaction binding the contract method 0xb6d5a397. +// OwnerWithdrawTaikoToken is a paid mutator transaction binding the contract method 0x6edda419. +// +// Solidity: function ownerWithdrawTaikoToken(address to, uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) OwnerWithdrawTaikoToken(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "ownerWithdrawTaikoToken", to, amount) +} + +// OwnerWithdrawTaikoToken is a paid mutator transaction binding the contract method 0x6edda419. +// +// Solidity: function ownerWithdrawTaikoToken(address to, uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientSession) OwnerWithdrawTaikoToken(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.Contract.OwnerWithdrawTaikoToken(&_TaikoL1Client.TransactOpts, to, amount) +} + +// OwnerWithdrawTaikoToken is a paid mutator transaction binding the contract method 0x6edda419. +// +// Solidity: function ownerWithdrawTaikoToken(address to, uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) OwnerWithdrawTaikoToken(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.Contract.OwnerWithdrawTaikoToken(&_TaikoL1Client.TransactOpts, to, amount) +} + +// ProposeBlock is a paid mutator transaction binding the contract method 0x9dbdb99d. // -// Solidity: function proposeBlock(bytes input, bytes assignment, bytes txList) payable returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientTransactor) ProposeBlock(opts *bind.TransactOpts, input []byte, assignment []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.contract.Transact(opts, "proposeBlock", input, assignment, txList) +// Solidity: function proposeBlock(bytes32 txListHash, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientTransactor) ProposeBlock(opts *bind.TransactOpts, txListHash [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "proposeBlock", txListHash, assignment, txList) } -// ProposeBlock is a paid mutator transaction binding the contract method 0xb6d5a397. +// ProposeBlock is a paid mutator transaction binding the contract method 0x9dbdb99d. // -// Solidity: function proposeBlock(bytes input, bytes assignment, bytes txList) payable returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientSession) ProposeBlock(input []byte, assignment []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, input, assignment, txList) +// Solidity: function proposeBlock(bytes32 txListHash, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientSession) ProposeBlock(txListHash [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, txListHash, assignment, txList) } -// ProposeBlock is a paid mutator transaction binding the contract method 0xb6d5a397. +// ProposeBlock is a paid mutator transaction binding the contract method 0x9dbdb99d. // -// Solidity: function proposeBlock(bytes input, bytes assignment, bytes txList) payable returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProposeBlock(input []byte, assignment []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, input, assignment, txList) +// Solidity: function proposeBlock(bytes32 txListHash, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProposeBlock(txListHash [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, txListHash, assignment, txList) } // ProveBlock is a paid mutator transaction binding the contract method 0x10d008bd. @@ -1169,49 +1259,51 @@ func (it *TaikoL1ClientBlockProposedIterator) Close() error { // TaikoL1ClientBlockProposed represents a BlockProposed event raised by the TaikoL1Client contract. type TaikoL1ClientBlockProposed struct { - BlockId *big.Int - Prover common.Address - Reward *big.Int - Meta TaikoDataBlockMetadata - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + AssignedProver common.Address + LivenessBond *big.Int + ProverFee *big.Int + Reward *big.Int + Meta TaikoDataBlockMetadata + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed is a free log retrieval operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. +// FilterBlockProposed is a free log retrieval operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed", blockIdRule, assignedProverRule) if err != nil { return nil, err } return &TaikoL1ClientBlockProposedIterator{contract: _TaikoL1Client.contract, event: "BlockProposed", logs: logs, sub: sub}, nil } -// WatchBlockProposed is a free log subscription operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. +// WatchBlockProposed is a free log subscription operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed", blockIdRule, assignedProverRule) if err != nil { return nil, err } @@ -1243,9 +1335,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.Watch }), nil } -// ParseBlockProposed is a log parse operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. +// ParseBlockProposed is a log parse operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed(log types.Log) (*TaikoL1ClientBlockProposed, error) { event := new(TaikoL1ClientBlockProposed) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed", log); err != nil { @@ -1324,49 +1416,51 @@ func (it *TaikoL1ClientBlockProposed0Iterator) Close() error { // TaikoL1ClientBlockProposed0 represents a BlockProposed0 event raised by the TaikoL1Client contract. type TaikoL1ClientBlockProposed0 struct { - BlockId *big.Int - Prover common.Address - Reward *big.Int - Meta TaikoDataBlockMetadata - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + AssignedProver common.Address + LivenessBond *big.Int + ProverFee *big.Int + Reward *big.Int + Meta TaikoDataBlockMetadata + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. +// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed0", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed0", blockIdRule, assignedProverRule) if err != nil { return nil, err } return &TaikoL1ClientBlockProposed0Iterator{contract: _TaikoL1Client.contract, event: "BlockProposed0", logs: logs, sub: sub}, nil } -// WatchBlockProposed0 is a free log subscription operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. +// WatchBlockProposed0 is a free log subscription operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed0", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed0", blockIdRule, assignedProverRule) if err != nil { return nil, err } @@ -1398,9 +1492,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.Watc }), nil } -// ParseBlockProposed0 is a log parse operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. +// ParseBlockProposed0 is a log parse operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed0(log types.Log) (*TaikoL1ClientBlockProposed0, error) { event := new(TaikoL1ClientBlockProposed0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed0", log); err != nil { @@ -1410,9 +1504,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed0(log types.Log) return event, nil } -// TaikoL1ClientBlockProvenIterator is returned from FilterBlockProven and is used to iterate over the raw logs and unpacked data for BlockProven events raised by the TaikoL1Client contract. -type TaikoL1ClientBlockProvenIterator struct { - Event *TaikoL1ClientBlockProven // Event containing the contract specifics and raw log +// TaikoL1ClientBlockVerifiedIterator is returned from FilterBlockVerified and is used to iterate over the raw logs and unpacked data for BlockVerified events raised by the TaikoL1Client contract. +type TaikoL1ClientBlockVerifiedIterator struct { + Event *TaikoL1ClientBlockVerified // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1426,7 +1520,7 @@ type TaikoL1ClientBlockProvenIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBlockProvenIterator) Next() bool { +func (it *TaikoL1ClientBlockVerifiedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1435,7 +1529,7 @@ func (it *TaikoL1ClientBlockProvenIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockProven) + it.Event = new(TaikoL1ClientBlockVerified) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1450,7 +1544,7 @@ func (it *TaikoL1ClientBlockProvenIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockProven) + it.Event = new(TaikoL1ClientBlockVerified) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1466,55 +1560,71 @@ func (it *TaikoL1ClientBlockProvenIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBlockProvenIterator) Error() error { +func (it *TaikoL1ClientBlockVerifiedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBlockProvenIterator) Close() error { +func (it *TaikoL1ClientBlockVerifiedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBlockProven represents a BlockProven event raised by the TaikoL1Client contract. -type TaikoL1ClientBlockProven struct { - BlockId *big.Int - ParentHash [32]byte - BlockHash [32]byte - SignalRoot [32]byte - Prover common.Address - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientBlockVerified represents a BlockVerified event raised by the TaikoL1Client contract. +type TaikoL1ClientBlockVerified struct { + BlockId *big.Int + AssignedProver common.Address + Prover common.Address + BlockHash [32]byte + SignalRoot [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProven is a free log retrieval operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. +// FilterBlockVerified is a free log retrieval operation binding the contract event 0x1433d0a0bbdef88a556faadc3c8481900a1bd0941743e979ddbe046e27ce4299. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProven(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientBlockProvenIterator, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed assignedProver, address indexed prover, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address, prover []common.Address) (*TaikoL1ClientBlockVerifiedIterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) + } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProven", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified", blockIdRule, assignedProverRule, proverRule) if err != nil { return nil, err } - return &TaikoL1ClientBlockProvenIterator{contract: _TaikoL1Client.contract, event: "BlockProven", logs: logs, sub: sub}, nil + return &TaikoL1ClientBlockVerifiedIterator{contract: _TaikoL1Client.contract, event: "BlockVerified", logs: logs, sub: sub}, nil } -// WatchBlockProven is a free log subscription operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. +// WatchBlockVerified is a free log subscription operation binding the contract event 0x1433d0a0bbdef88a556faadc3c8481900a1bd0941743e979ddbe046e27ce4299. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProven, blockId []*big.Int) (event.Subscription, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed assignedProver, address indexed prover, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified, blockId []*big.Int, assignedProver []common.Address, prover []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) + } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProven", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified", blockIdRule, assignedProverRule, proverRule) if err != nil { return nil, err } @@ -1524,8 +1634,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven(opts *bind.WatchOp select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBlockProven) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProven", log); err != nil { + event := new(TaikoL1ClientBlockVerified) + if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified", log); err != nil { return err } event.Raw = log @@ -1546,21 +1656,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven(opts *bind.WatchOp }), nil } -// ParseBlockProven is a log parse operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. +// ParseBlockVerified is a log parse operation binding the contract event 0x1433d0a0bbdef88a556faadc3c8481900a1bd0941743e979ddbe046e27ce4299. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProven(log types.Log) (*TaikoL1ClientBlockProven, error) { - event := new(TaikoL1ClientBlockProven) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProven", log); err != nil { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed assignedProver, address indexed prover, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockVerified(log types.Log) (*TaikoL1ClientBlockVerified, error) { + event := new(TaikoL1ClientBlockVerified) + if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBlockProven0Iterator is returned from FilterBlockProven0 and is used to iterate over the raw logs and unpacked data for BlockProven0 events raised by the TaikoL1Client contract. -type TaikoL1ClientBlockProven0Iterator struct { - Event *TaikoL1ClientBlockProven0 // Event containing the contract specifics and raw log +// TaikoL1ClientBlockVerified0Iterator is returned from FilterBlockVerified0 and is used to iterate over the raw logs and unpacked data for BlockVerified0 events raised by the TaikoL1Client contract. +type TaikoL1ClientBlockVerified0Iterator struct { + Event *TaikoL1ClientBlockVerified0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1574,7 +1684,7 @@ type TaikoL1ClientBlockProven0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBlockProven0Iterator) Next() bool { +func (it *TaikoL1ClientBlockVerified0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1583,7 +1693,7 @@ func (it *TaikoL1ClientBlockProven0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockProven0) + it.Event = new(TaikoL1ClientBlockVerified0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1598,7 +1708,7 @@ func (it *TaikoL1ClientBlockProven0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockProven0) + it.Event = new(TaikoL1ClientBlockVerified0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1614,55 +1724,71 @@ func (it *TaikoL1ClientBlockProven0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBlockProven0Iterator) Error() error { +func (it *TaikoL1ClientBlockVerified0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBlockProven0Iterator) Close() error { +func (it *TaikoL1ClientBlockVerified0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBlockProven0 represents a BlockProven0 event raised by the TaikoL1Client contract. -type TaikoL1ClientBlockProven0 struct { - BlockId *big.Int - ParentHash [32]byte - BlockHash [32]byte - SignalRoot [32]byte - Prover common.Address - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientBlockVerified0 represents a BlockVerified0 event raised by the TaikoL1Client contract. +type TaikoL1ClientBlockVerified0 struct { + BlockId *big.Int + AssignedProver common.Address + Prover common.Address + BlockHash [32]byte + SignalRoot [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProven0 is a free log retrieval operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. +// FilterBlockVerified0 is a free log retrieval operation binding the contract event 0x1433d0a0bbdef88a556faadc3c8481900a1bd0941743e979ddbe046e27ce4299. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProven0(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientBlockProven0Iterator, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed assignedProver, address indexed prover, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified0(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address, prover []common.Address) (*TaikoL1ClientBlockVerified0Iterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) + } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProven0", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified0", blockIdRule, assignedProverRule, proverRule) if err != nil { return nil, err } - return &TaikoL1ClientBlockProven0Iterator{contract: _TaikoL1Client.contract, event: "BlockProven0", logs: logs, sub: sub}, nil + return &TaikoL1ClientBlockVerified0Iterator{contract: _TaikoL1Client.contract, event: "BlockVerified0", logs: logs, sub: sub}, nil } -// WatchBlockProven0 is a free log subscription operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. +// WatchBlockVerified0 is a free log subscription operation binding the contract event 0x1433d0a0bbdef88a556faadc3c8481900a1bd0941743e979ddbe046e27ce4299. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProven0, blockId []*big.Int) (event.Subscription, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed assignedProver, address indexed prover, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified0, blockId []*big.Int, assignedProver []common.Address, prover []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var assignedProverRule []interface{} + for _, assignedProverItem := range assignedProver { + assignedProverRule = append(assignedProverRule, assignedProverItem) + } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProven0", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified0", blockIdRule, assignedProverRule, proverRule) if err != nil { return nil, err } @@ -1672,8 +1798,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven0(opts *bind.WatchO select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBlockProven0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProven0", log); err != nil { + event := new(TaikoL1ClientBlockVerified0) + if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified0", log); err != nil { return err } event.Raw = log @@ -1694,21 +1820,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven0(opts *bind.WatchO }), nil } -// ParseBlockProven0 is a log parse operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. +// ParseBlockVerified0 is a log parse operation binding the contract event 0x1433d0a0bbdef88a556faadc3c8481900a1bd0941743e979ddbe046e27ce4299. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProven0(log types.Log) (*TaikoL1ClientBlockProven0, error) { - event := new(TaikoL1ClientBlockProven0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProven0", log); err != nil { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed assignedProver, address indexed prover, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockVerified0(log types.Log) (*TaikoL1ClientBlockVerified0, error) { + event := new(TaikoL1ClientBlockVerified0) + if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified0", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBlockVerifiedIterator is returned from FilterBlockVerified and is used to iterate over the raw logs and unpacked data for BlockVerified events raised by the TaikoL1Client contract. -type TaikoL1ClientBlockVerifiedIterator struct { - Event *TaikoL1ClientBlockVerified // Event containing the contract specifics and raw log +// TaikoL1ClientCrossChainSyncedIterator is returned from FilterCrossChainSynced and is used to iterate over the raw logs and unpacked data for CrossChainSynced events raised by the TaikoL1Client contract. +type TaikoL1ClientCrossChainSyncedIterator struct { + Event *TaikoL1ClientCrossChainSynced // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1722,7 +1848,7 @@ type TaikoL1ClientBlockVerifiedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBlockVerifiedIterator) Next() bool { +func (it *TaikoL1ClientCrossChainSyncedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1731,7 +1857,7 @@ func (it *TaikoL1ClientBlockVerifiedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockVerified) + it.Event = new(TaikoL1ClientCrossChainSynced) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1746,7 +1872,7 @@ func (it *TaikoL1ClientBlockVerifiedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockVerified) + it.Event = new(TaikoL1ClientCrossChainSynced) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1762,61 +1888,53 @@ func (it *TaikoL1ClientBlockVerifiedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBlockVerifiedIterator) Error() error { +func (it *TaikoL1ClientCrossChainSyncedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBlockVerifiedIterator) Close() error { +func (it *TaikoL1ClientCrossChainSyncedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBlockVerified represents a BlockVerified event raised by the TaikoL1Client contract. -type TaikoL1ClientBlockVerified struct { - BlockId *big.Int - Prover common.Address - BlockHash [32]byte - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientCrossChainSynced represents a CrossChainSynced event raised by the TaikoL1Client contract. +type TaikoL1ClientCrossChainSynced struct { + SrcHeight uint64 + BlockHash [32]byte + SignalRoot [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockVerified is a free log retrieval operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. +// FilterCrossChainSynced is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockVerifiedIterator, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL1ClientCrossChainSyncedIterator, error) { - var blockIdRule []interface{} - for _, blockIdItem := range blockId { - blockIdRule = append(blockIdRule, blockIdItem) - } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var srcHeightRule []interface{} + for _, srcHeightItem := range srcHeight { + srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "CrossChainSynced", srcHeightRule) if err != nil { return nil, err } - return &TaikoL1ClientBlockVerifiedIterator{contract: _TaikoL1Client.contract, event: "BlockVerified", logs: logs, sub: sub}, nil + return &TaikoL1ClientCrossChainSyncedIterator{contract: _TaikoL1Client.contract, event: "CrossChainSynced", logs: logs, sub: sub}, nil } -// WatchBlockVerified is a free log subscription operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. +// WatchCrossChainSynced is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced, srcHeight []uint64) (event.Subscription, error) { - var blockIdRule []interface{} - for _, blockIdItem := range blockId { - blockIdRule = append(blockIdRule, blockIdItem) - } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var srcHeightRule []interface{} + for _, srcHeightItem := range srcHeight { + srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "CrossChainSynced", srcHeightRule) if err != nil { return nil, err } @@ -1826,8 +1944,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.Watch select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBlockVerified) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified", log); err != nil { + event := new(TaikoL1ClientCrossChainSynced) + if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced", log); err != nil { return err } event.Raw = log @@ -1848,21 +1966,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.Watch }), nil } -// ParseBlockVerified is a log parse operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. +// ParseCrossChainSynced is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockVerified(log types.Log) (*TaikoL1ClientBlockVerified, error) { - event := new(TaikoL1ClientBlockVerified) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified", log); err != nil { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseCrossChainSynced(log types.Log) (*TaikoL1ClientCrossChainSynced, error) { + event := new(TaikoL1ClientCrossChainSynced) + if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBlockVerified0Iterator is returned from FilterBlockVerified0 and is used to iterate over the raw logs and unpacked data for BlockVerified0 events raised by the TaikoL1Client contract. -type TaikoL1ClientBlockVerified0Iterator struct { - Event *TaikoL1ClientBlockVerified0 // Event containing the contract specifics and raw log +// TaikoL1ClientCrossChainSynced0Iterator is returned from FilterCrossChainSynced0 and is used to iterate over the raw logs and unpacked data for CrossChainSynced0 events raised by the TaikoL1Client contract. +type TaikoL1ClientCrossChainSynced0Iterator struct { + Event *TaikoL1ClientCrossChainSynced0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1876,7 +1994,7 @@ type TaikoL1ClientBlockVerified0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBlockVerified0Iterator) Next() bool { +func (it *TaikoL1ClientCrossChainSynced0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1885,7 +2003,7 @@ func (it *TaikoL1ClientBlockVerified0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockVerified0) + it.Event = new(TaikoL1ClientCrossChainSynced0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1900,7 +2018,7 @@ func (it *TaikoL1ClientBlockVerified0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBlockVerified0) + it.Event = new(TaikoL1ClientCrossChainSynced0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1916,61 +2034,53 @@ func (it *TaikoL1ClientBlockVerified0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBlockVerified0Iterator) Error() error { +func (it *TaikoL1ClientCrossChainSynced0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBlockVerified0Iterator) Close() error { +func (it *TaikoL1ClientCrossChainSynced0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBlockVerified0 represents a BlockVerified0 event raised by the TaikoL1Client contract. -type TaikoL1ClientBlockVerified0 struct { - BlockId *big.Int - Prover common.Address - BlockHash [32]byte - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientCrossChainSynced0 represents a CrossChainSynced0 event raised by the TaikoL1Client contract. +type TaikoL1ClientCrossChainSynced0 struct { + SrcHeight uint64 + BlockHash [32]byte + SignalRoot [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockVerified0 is a free log retrieval operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. +// FilterCrossChainSynced0 is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified0(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockVerified0Iterator, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced0(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL1ClientCrossChainSynced0Iterator, error) { - var blockIdRule []interface{} - for _, blockIdItem := range blockId { - blockIdRule = append(blockIdRule, blockIdItem) - } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var srcHeightRule []interface{} + for _, srcHeightItem := range srcHeight { + srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified0", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "CrossChainSynced0", srcHeightRule) if err != nil { return nil, err } - return &TaikoL1ClientBlockVerified0Iterator{contract: _TaikoL1Client.contract, event: "BlockVerified0", logs: logs, sub: sub}, nil + return &TaikoL1ClientCrossChainSynced0Iterator{contract: _TaikoL1Client.contract, event: "CrossChainSynced0", logs: logs, sub: sub}, nil } -// WatchBlockVerified0 is a free log subscription operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. +// WatchCrossChainSynced0 is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified0, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced0, srcHeight []uint64) (event.Subscription, error) { - var blockIdRule []interface{} - for _, blockIdItem := range blockId { - blockIdRule = append(blockIdRule, blockIdItem) - } - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) + var srcHeightRule []interface{} + for _, srcHeightItem := range srcHeight { + srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified0", blockIdRule, proverRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "CrossChainSynced0", srcHeightRule) if err != nil { return nil, err } @@ -1980,8 +2090,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.Watc select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBlockVerified0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified0", log); err != nil { + event := new(TaikoL1ClientCrossChainSynced0) + if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced0", log); err != nil { return err } event.Raw = log @@ -2002,21 +2112,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.Watc }), nil } -// ParseBlockVerified0 is a log parse operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. +// ParseCrossChainSynced0 is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockVerified0(log types.Log) (*TaikoL1ClientBlockVerified0, error) { - event := new(TaikoL1ClientBlockVerified0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified0", log); err != nil { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseCrossChainSynced0(log types.Log) (*TaikoL1ClientCrossChainSynced0, error) { + event := new(TaikoL1ClientCrossChainSynced0) + if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced0", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBondReceivedIterator is returned from FilterBondReceived and is used to iterate over the raw logs and unpacked data for BondReceived events raised by the TaikoL1Client contract. -type TaikoL1ClientBondReceivedIterator struct { - Event *TaikoL1ClientBondReceived // Event containing the contract specifics and raw log +// TaikoL1ClientEthDepositedIterator is returned from FilterEthDeposited and is used to iterate over the raw logs and unpacked data for EthDeposited events raised by the TaikoL1Client contract. +type TaikoL1ClientEthDepositedIterator struct { + Event *TaikoL1ClientEthDeposited // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2030,7 +2140,7 @@ type TaikoL1ClientBondReceivedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBondReceivedIterator) Next() bool { +func (it *TaikoL1ClientEthDepositedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2039,7 +2149,7 @@ func (it *TaikoL1ClientBondReceivedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReceived) + it.Event = new(TaikoL1ClientEthDeposited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2054,7 +2164,7 @@ func (it *TaikoL1ClientBondReceivedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReceived) + it.Event = new(TaikoL1ClientEthDeposited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2070,53 +2180,41 @@ func (it *TaikoL1ClientBondReceivedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBondReceivedIterator) Error() error { +func (it *TaikoL1ClientEthDepositedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBondReceivedIterator) Close() error { +func (it *TaikoL1ClientEthDepositedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBondReceived represents a BondReceived event raised by the TaikoL1Client contract. -type TaikoL1ClientBondReceived struct { - From common.Address - BlockId uint64 - Bond *big.Int +// TaikoL1ClientEthDeposited represents a EthDeposited event raised by the TaikoL1Client contract. +type TaikoL1ClientEthDeposited struct { + Deposit TaikoDataEthDeposit Raw types.Log // Blockchain specific contextual infos } -// FilterBondReceived is a free log retrieval operation binding the contract event 0xbb2d4a4c4a679d81940f242e401d2b2cc3383dbcb0ae798c14bd7905b1f6cae2. +// FilterEthDeposited is a free log retrieval operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. // -// Solidity: event BondReceived(address indexed from, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBondReceived(opts *bind.FilterOpts, from []common.Address) (*TaikoL1ClientBondReceivedIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } +// Solidity: event EthDeposited((address,uint96,uint64) deposit) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterEthDeposited(opts *bind.FilterOpts) (*TaikoL1ClientEthDepositedIterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BondReceived", fromRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "EthDeposited") if err != nil { return nil, err } - return &TaikoL1ClientBondReceivedIterator{contract: _TaikoL1Client.contract, event: "BondReceived", logs: logs, sub: sub}, nil + return &TaikoL1ClientEthDepositedIterator{contract: _TaikoL1Client.contract, event: "EthDeposited", logs: logs, sub: sub}, nil } -// WatchBondReceived is a free log subscription operation binding the contract event 0xbb2d4a4c4a679d81940f242e401d2b2cc3383dbcb0ae798c14bd7905b1f6cae2. +// WatchEthDeposited is a free log subscription operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. // -// Solidity: event BondReceived(address indexed from, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReceived(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBondReceived, from []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } +// Solidity: event EthDeposited((address,uint96,uint64) deposit) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientEthDeposited) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BondReceived", fromRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "EthDeposited") if err != nil { return nil, err } @@ -2126,8 +2224,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReceived(opts *bind.WatchO select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBondReceived) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReceived", log); err != nil { + event := new(TaikoL1ClientEthDeposited) + if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited", log); err != nil { return err } event.Raw = log @@ -2148,21 +2246,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReceived(opts *bind.WatchO }), nil } -// ParseBondReceived is a log parse operation binding the contract event 0xbb2d4a4c4a679d81940f242e401d2b2cc3383dbcb0ae798c14bd7905b1f6cae2. +// ParseEthDeposited is a log parse operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. // -// Solidity: event BondReceived(address indexed from, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBondReceived(log types.Log) (*TaikoL1ClientBondReceived, error) { - event := new(TaikoL1ClientBondReceived) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReceived", log); err != nil { +// Solidity: event EthDeposited((address,uint96,uint64) deposit) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseEthDeposited(log types.Log) (*TaikoL1ClientEthDeposited, error) { + event := new(TaikoL1ClientEthDeposited) + if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBondReceived0Iterator is returned from FilterBondReceived0 and is used to iterate over the raw logs and unpacked data for BondReceived0 events raised by the TaikoL1Client contract. -type TaikoL1ClientBondReceived0Iterator struct { - Event *TaikoL1ClientBondReceived0 // Event containing the contract specifics and raw log +// TaikoL1ClientEthDeposited0Iterator is returned from FilterEthDeposited0 and is used to iterate over the raw logs and unpacked data for EthDeposited0 events raised by the TaikoL1Client contract. +type TaikoL1ClientEthDeposited0Iterator struct { + Event *TaikoL1ClientEthDeposited0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2176,7 +2274,7 @@ type TaikoL1ClientBondReceived0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBondReceived0Iterator) Next() bool { +func (it *TaikoL1ClientEthDeposited0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2185,7 +2283,7 @@ func (it *TaikoL1ClientBondReceived0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReceived0) + it.Event = new(TaikoL1ClientEthDeposited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2200,7 +2298,7 @@ func (it *TaikoL1ClientBondReceived0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReceived0) + it.Event = new(TaikoL1ClientEthDeposited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2216,53 +2314,41 @@ func (it *TaikoL1ClientBondReceived0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBondReceived0Iterator) Error() error { +func (it *TaikoL1ClientEthDeposited0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBondReceived0Iterator) Close() error { +func (it *TaikoL1ClientEthDeposited0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBondReceived0 represents a BondReceived0 event raised by the TaikoL1Client contract. -type TaikoL1ClientBondReceived0 struct { - From common.Address - BlockId uint64 - Bond *big.Int +// TaikoL1ClientEthDeposited0 represents a EthDeposited0 event raised by the TaikoL1Client contract. +type TaikoL1ClientEthDeposited0 struct { + Deposit TaikoDataEthDeposit Raw types.Log // Blockchain specific contextual infos } -// FilterBondReceived0 is a free log retrieval operation binding the contract event 0xbb2d4a4c4a679d81940f242e401d2b2cc3383dbcb0ae798c14bd7905b1f6cae2. +// FilterEthDeposited0 is a free log retrieval operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. // -// Solidity: event BondReceived(address indexed from, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBondReceived0(opts *bind.FilterOpts, from []common.Address) (*TaikoL1ClientBondReceived0Iterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } +// Solidity: event EthDeposited((address,uint96,uint64) deposit) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterEthDeposited0(opts *bind.FilterOpts) (*TaikoL1ClientEthDeposited0Iterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BondReceived0", fromRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "EthDeposited0") if err != nil { return nil, err } - return &TaikoL1ClientBondReceived0Iterator{contract: _TaikoL1Client.contract, event: "BondReceived0", logs: logs, sub: sub}, nil + return &TaikoL1ClientEthDeposited0Iterator{contract: _TaikoL1Client.contract, event: "EthDeposited0", logs: logs, sub: sub}, nil } -// WatchBondReceived0 is a free log subscription operation binding the contract event 0xbb2d4a4c4a679d81940f242e401d2b2cc3383dbcb0ae798c14bd7905b1f6cae2. +// WatchEthDeposited0 is a free log subscription operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. // -// Solidity: event BondReceived(address indexed from, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReceived0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBondReceived0, from []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } +// Solidity: event EthDeposited((address,uint96,uint64) deposit) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientEthDeposited0) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BondReceived0", fromRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "EthDeposited0") if err != nil { return nil, err } @@ -2272,8 +2358,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReceived0(opts *bind.Watch select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBondReceived0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReceived0", log); err != nil { + event := new(TaikoL1ClientEthDeposited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited0", log); err != nil { return err } event.Raw = log @@ -2294,21 +2380,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReceived0(opts *bind.Watch }), nil } -// ParseBondReceived0 is a log parse operation binding the contract event 0xbb2d4a4c4a679d81940f242e401d2b2cc3383dbcb0ae798c14bd7905b1f6cae2. +// ParseEthDeposited0 is a log parse operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. // -// Solidity: event BondReceived(address indexed from, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBondReceived0(log types.Log) (*TaikoL1ClientBondReceived0, error) { - event := new(TaikoL1ClientBondReceived0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReceived0", log); err != nil { +// Solidity: event EthDeposited((address,uint96,uint64) deposit) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseEthDeposited0(log types.Log) (*TaikoL1ClientEthDeposited0, error) { + event := new(TaikoL1ClientEthDeposited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited0", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBondReturnedIterator is returned from FilterBondReturned and is used to iterate over the raw logs and unpacked data for BondReturned events raised by the TaikoL1Client contract. -type TaikoL1ClientBondReturnedIterator struct { - Event *TaikoL1ClientBondReturned // Event containing the contract specifics and raw log +// TaikoL1ClientInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoL1Client contract. +type TaikoL1ClientInitializedIterator struct { + Event *TaikoL1ClientInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2322,7 +2408,7 @@ type TaikoL1ClientBondReturnedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBondReturnedIterator) Next() bool { +func (it *TaikoL1ClientInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2331,7 +2417,7 @@ func (it *TaikoL1ClientBondReturnedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReturned) + it.Event = new(TaikoL1ClientInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2346,7 +2432,7 @@ func (it *TaikoL1ClientBondReturnedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReturned) + it.Event = new(TaikoL1ClientInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2362,53 +2448,41 @@ func (it *TaikoL1ClientBondReturnedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBondReturnedIterator) Error() error { +func (it *TaikoL1ClientInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBondReturnedIterator) Close() error { +func (it *TaikoL1ClientInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBondReturned represents a BondReturned event raised by the TaikoL1Client contract. -type TaikoL1ClientBondReturned struct { - To common.Address - BlockId uint64 - Bond *big.Int +// TaikoL1ClientInitialized represents a Initialized event raised by the TaikoL1Client contract. +type TaikoL1ClientInitialized struct { + Version uint8 Raw types.Log // Blockchain specific contextual infos } -// FilterBondReturned is a free log retrieval operation binding the contract event 0xb14706301de9c688dd040a2ac19fc629179149bb39b0765094ef833e7bd907b2. +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // -// Solidity: event BondReturned(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBondReturned(opts *bind.FilterOpts, to []common.Address) (*TaikoL1ClientBondReturnedIterator, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } +// Solidity: event Initialized(uint8 version) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterInitialized(opts *bind.FilterOpts) (*TaikoL1ClientInitializedIterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BondReturned", toRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } - return &TaikoL1ClientBondReturnedIterator{contract: _TaikoL1Client.contract, event: "BondReturned", logs: logs, sub: sub}, nil + return &TaikoL1ClientInitializedIterator{contract: _TaikoL1Client.contract, event: "Initialized", logs: logs, sub: sub}, nil } -// WatchBondReturned is a free log subscription operation binding the contract event 0xb14706301de9c688dd040a2ac19fc629179149bb39b0765094ef833e7bd907b2. +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // -// Solidity: event BondReturned(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReturned(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBondReturned, to []common.Address) (event.Subscription, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } +// Solidity: event Initialized(uint8 version) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientInitialized) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BondReturned", toRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } @@ -2418,8 +2492,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReturned(opts *bind.WatchO select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBondReturned) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReturned", log); err != nil { + event := new(TaikoL1ClientInitialized) + if err := _TaikoL1Client.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log @@ -2440,21 +2514,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReturned(opts *bind.WatchO }), nil } -// ParseBondReturned is a log parse operation binding the contract event 0xb14706301de9c688dd040a2ac19fc629179149bb39b0765094ef833e7bd907b2. +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // -// Solidity: event BondReturned(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBondReturned(log types.Log) (*TaikoL1ClientBondReturned, error) { - event := new(TaikoL1ClientBondReturned) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReturned", log); err != nil { +// Solidity: event Initialized(uint8 version) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseInitialized(log types.Log) (*TaikoL1ClientInitialized, error) { + event := new(TaikoL1ClientInitialized) + if err := _TaikoL1Client.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBondReturned0Iterator is returned from FilterBondReturned0 and is used to iterate over the raw logs and unpacked data for BondReturned0 events raised by the TaikoL1Client contract. -type TaikoL1ClientBondReturned0Iterator struct { - Event *TaikoL1ClientBondReturned0 // Event containing the contract specifics and raw log +// TaikoL1ClientOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TaikoL1Client contract. +type TaikoL1ClientOwnershipTransferredIterator struct { + Event *TaikoL1ClientOwnershipTransferred // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2468,7 +2542,7 @@ type TaikoL1ClientBondReturned0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBondReturned0Iterator) Next() bool { +func (it *TaikoL1ClientOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2477,7 +2551,7 @@ func (it *TaikoL1ClientBondReturned0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReturned0) + it.Event = new(TaikoL1ClientOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2492,7 +2566,7 @@ func (it *TaikoL1ClientBondReturned0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondReturned0) + it.Event = new(TaikoL1ClientOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2508,53 +2582,60 @@ func (it *TaikoL1ClientBondReturned0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBondReturned0Iterator) Error() error { +func (it *TaikoL1ClientOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBondReturned0Iterator) Close() error { +func (it *TaikoL1ClientOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBondReturned0 represents a BondReturned0 event raised by the TaikoL1Client contract. -type TaikoL1ClientBondReturned0 struct { - To common.Address - BlockId uint64 - Bond *big.Int - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientOwnershipTransferred represents a OwnershipTransferred event raised by the TaikoL1Client contract. +type TaikoL1ClientOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterBondReturned0 is a free log retrieval operation binding the contract event 0xb14706301de9c688dd040a2ac19fc629179149bb39b0765094ef833e7bd907b2. +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event BondReturned(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBondReturned0(opts *bind.FilterOpts, to []common.Address) (*TaikoL1ClientBondReturned0Iterator, error) { +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoL1ClientOwnershipTransferredIterator, error) { - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BondReturned0", toRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } - return &TaikoL1ClientBondReturned0Iterator{contract: _TaikoL1Client.contract, event: "BondReturned0", logs: logs, sub: sub}, nil + return &TaikoL1ClientOwnershipTransferredIterator{contract: _TaikoL1Client.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } -// WatchBondReturned0 is a free log subscription operation binding the contract event 0xb14706301de9c688dd040a2ac19fc629179149bb39b0765094ef833e7bd907b2. +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event BondReturned(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReturned0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBondReturned0, to []common.Address) (event.Subscription, error) { +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BondReturned0", toRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } @@ -2564,8 +2645,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReturned0(opts *bind.Watch select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBondReturned0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReturned0", log); err != nil { + event := new(TaikoL1ClientOwnershipTransferred) + if err := _TaikoL1Client.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log @@ -2586,21 +2667,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondReturned0(opts *bind.Watch }), nil } -// ParseBondReturned0 is a log parse operation binding the contract event 0xb14706301de9c688dd040a2ac19fc629179149bb39b0765094ef833e7bd907b2. +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event BondReturned(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBondReturned0(log types.Log) (*TaikoL1ClientBondReturned0, error) { - event := new(TaikoL1ClientBondReturned0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondReturned0", log); err != nil { +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseOwnershipTransferred(log types.Log) (*TaikoL1ClientOwnershipTransferred, error) { + event := new(TaikoL1ClientOwnershipTransferred) + if err := _TaikoL1Client.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBondRewardedIterator is returned from FilterBondRewarded and is used to iterate over the raw logs and unpacked data for BondRewarded events raised by the TaikoL1Client contract. -type TaikoL1ClientBondRewardedIterator struct { - Event *TaikoL1ClientBondRewarded // Event containing the contract specifics and raw log +// TaikoL1ClientTokenCreditedIterator is returned from FilterTokenCredited and is used to iterate over the raw logs and unpacked data for TokenCredited events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenCreditedIterator struct { + Event *TaikoL1ClientTokenCredited // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2614,7 +2695,7 @@ type TaikoL1ClientBondRewardedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBondRewardedIterator) Next() bool { +func (it *TaikoL1ClientTokenCreditedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2623,7 +2704,7 @@ func (it *TaikoL1ClientBondRewardedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondRewarded) + it.Event = new(TaikoL1ClientTokenCredited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2638,7 +2719,7 @@ func (it *TaikoL1ClientBondRewardedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondRewarded) + it.Event = new(TaikoL1ClientTokenCredited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2654,53 +2735,42 @@ func (it *TaikoL1ClientBondRewardedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBondRewardedIterator) Error() error { +func (it *TaikoL1ClientTokenCreditedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBondRewardedIterator) Close() error { +func (it *TaikoL1ClientTokenCreditedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBondRewarded represents a BondRewarded event raised by the TaikoL1Client contract. -type TaikoL1ClientBondRewarded struct { - To common.Address - BlockId uint64 - Bond *big.Int - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenCredited represents a TokenCredited event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenCredited struct { + Amount *big.Int + Minted bool + Raw types.Log // Blockchain specific contextual infos } -// FilterBondRewarded is a free log retrieval operation binding the contract event 0x428d08856cfebcae4c1b981318595cf05b757406a9c92c9bffd3ebb9a10023a6. +// FilterTokenCredited is a free log retrieval operation binding the contract event 0xeb0ac084e2fa6cfaebe54184190c7137c2fcc63c16e1dfaf6442ae95c01c44ad. // -// Solidity: event BondRewarded(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBondRewarded(opts *bind.FilterOpts, to []common.Address) (*TaikoL1ClientBondRewardedIterator, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } +// Solidity: event TokenCredited(uint256 amount, bool minted) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenCredited(opts *bind.FilterOpts) (*TaikoL1ClientTokenCreditedIterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BondRewarded", toRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenCredited") if err != nil { return nil, err } - return &TaikoL1ClientBondRewardedIterator{contract: _TaikoL1Client.contract, event: "BondRewarded", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenCreditedIterator{contract: _TaikoL1Client.contract, event: "TokenCredited", logs: logs, sub: sub}, nil } -// WatchBondRewarded is a free log subscription operation binding the contract event 0x428d08856cfebcae4c1b981318595cf05b757406a9c92c9bffd3ebb9a10023a6. +// WatchTokenCredited is a free log subscription operation binding the contract event 0xeb0ac084e2fa6cfaebe54184190c7137c2fcc63c16e1dfaf6442ae95c01c44ad. // -// Solidity: event BondRewarded(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondRewarded(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBondRewarded, to []common.Address) (event.Subscription, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } +// Solidity: event TokenCredited(uint256 amount, bool minted) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenCredited(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenCredited) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BondRewarded", toRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenCredited") if err != nil { return nil, err } @@ -2710,8 +2780,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondRewarded(opts *bind.WatchO select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBondRewarded) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondRewarded", log); err != nil { + event := new(TaikoL1ClientTokenCredited) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenCredited", log); err != nil { return err } event.Raw = log @@ -2732,21 +2802,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondRewarded(opts *bind.WatchO }), nil } -// ParseBondRewarded is a log parse operation binding the contract event 0x428d08856cfebcae4c1b981318595cf05b757406a9c92c9bffd3ebb9a10023a6. +// ParseTokenCredited is a log parse operation binding the contract event 0xeb0ac084e2fa6cfaebe54184190c7137c2fcc63c16e1dfaf6442ae95c01c44ad. // -// Solidity: event BondRewarded(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBondRewarded(log types.Log) (*TaikoL1ClientBondRewarded, error) { - event := new(TaikoL1ClientBondRewarded) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondRewarded", log); err != nil { +// Solidity: event TokenCredited(uint256 amount, bool minted) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenCredited(log types.Log) (*TaikoL1ClientTokenCredited, error) { + event := new(TaikoL1ClientTokenCredited) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenCredited", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientBondRewarded0Iterator is returned from FilterBondRewarded0 and is used to iterate over the raw logs and unpacked data for BondRewarded0 events raised by the TaikoL1Client contract. -type TaikoL1ClientBondRewarded0Iterator struct { - Event *TaikoL1ClientBondRewarded0 // Event containing the contract specifics and raw log +// TaikoL1ClientTokenCredited0Iterator is returned from FilterTokenCredited0 and is used to iterate over the raw logs and unpacked data for TokenCredited0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenCredited0Iterator struct { + Event *TaikoL1ClientTokenCredited0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2760,7 +2830,7 @@ type TaikoL1ClientBondRewarded0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientBondRewarded0Iterator) Next() bool { +func (it *TaikoL1ClientTokenCredited0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2769,7 +2839,7 @@ func (it *TaikoL1ClientBondRewarded0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondRewarded0) + it.Event = new(TaikoL1ClientTokenCredited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2784,7 +2854,7 @@ func (it *TaikoL1ClientBondRewarded0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientBondRewarded0) + it.Event = new(TaikoL1ClientTokenCredited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2800,53 +2870,42 @@ func (it *TaikoL1ClientBondRewarded0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientBondRewarded0Iterator) Error() error { +func (it *TaikoL1ClientTokenCredited0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientBondRewarded0Iterator) Close() error { +func (it *TaikoL1ClientTokenCredited0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientBondRewarded0 represents a BondRewarded0 event raised by the TaikoL1Client contract. -type TaikoL1ClientBondRewarded0 struct { - To common.Address - BlockId uint64 - Bond *big.Int - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenCredited0 represents a TokenCredited0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenCredited0 struct { + Amount *big.Int + Minted bool + Raw types.Log // Blockchain specific contextual infos } -// FilterBondRewarded0 is a free log retrieval operation binding the contract event 0x428d08856cfebcae4c1b981318595cf05b757406a9c92c9bffd3ebb9a10023a6. +// FilterTokenCredited0 is a free log retrieval operation binding the contract event 0xeb0ac084e2fa6cfaebe54184190c7137c2fcc63c16e1dfaf6442ae95c01c44ad. // -// Solidity: event BondRewarded(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBondRewarded0(opts *bind.FilterOpts, to []common.Address) (*TaikoL1ClientBondRewarded0Iterator, error) { +// Solidity: event TokenCredited(uint256 amount, bool minted) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenCredited0(opts *bind.FilterOpts) (*TaikoL1ClientTokenCredited0Iterator, error) { - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BondRewarded0", toRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenCredited0") if err != nil { return nil, err } - return &TaikoL1ClientBondRewarded0Iterator{contract: _TaikoL1Client.contract, event: "BondRewarded0", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenCredited0Iterator{contract: _TaikoL1Client.contract, event: "TokenCredited0", logs: logs, sub: sub}, nil } -// WatchBondRewarded0 is a free log subscription operation binding the contract event 0x428d08856cfebcae4c1b981318595cf05b757406a9c92c9bffd3ebb9a10023a6. +// WatchTokenCredited0 is a free log subscription operation binding the contract event 0xeb0ac084e2fa6cfaebe54184190c7137c2fcc63c16e1dfaf6442ae95c01c44ad. // -// Solidity: event BondRewarded(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondRewarded0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBondRewarded0, to []common.Address) (event.Subscription, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } +// Solidity: event TokenCredited(uint256 amount, bool minted) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenCredited0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenCredited0) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BondRewarded0", toRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenCredited0") if err != nil { return nil, err } @@ -2856,8 +2915,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondRewarded0(opts *bind.Watch select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientBondRewarded0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondRewarded0", log); err != nil { + event := new(TaikoL1ClientTokenCredited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenCredited0", log); err != nil { return err } event.Raw = log @@ -2878,21 +2937,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBondRewarded0(opts *bind.Watch }), nil } -// ParseBondRewarded0 is a log parse operation binding the contract event 0x428d08856cfebcae4c1b981318595cf05b757406a9c92c9bffd3ebb9a10023a6. +// ParseTokenCredited0 is a log parse operation binding the contract event 0xeb0ac084e2fa6cfaebe54184190c7137c2fcc63c16e1dfaf6442ae95c01c44ad. // -// Solidity: event BondRewarded(address indexed to, uint64 blockId, uint256 bond) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBondRewarded0(log types.Log) (*TaikoL1ClientBondRewarded0, error) { - event := new(TaikoL1ClientBondRewarded0) - if err := _TaikoL1Client.contract.UnpackLog(event, "BondRewarded0", log); err != nil { +// Solidity: event TokenCredited(uint256 amount, bool minted) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenCredited0(log types.Log) (*TaikoL1ClientTokenCredited0, error) { + event := new(TaikoL1ClientTokenCredited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenCredited0", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientCrossChainSyncedIterator is returned from FilterCrossChainSynced and is used to iterate over the raw logs and unpacked data for CrossChainSynced events raised by the TaikoL1Client contract. -type TaikoL1ClientCrossChainSyncedIterator struct { - Event *TaikoL1ClientCrossChainSynced // Event containing the contract specifics and raw log +// TaikoL1ClientTokenDebitedIterator is returned from FilterTokenDebited and is used to iterate over the raw logs and unpacked data for TokenDebited events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDebitedIterator struct { + Event *TaikoL1ClientTokenDebited // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -2906,7 +2965,7 @@ type TaikoL1ClientCrossChainSyncedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientCrossChainSyncedIterator) Next() bool { +func (it *TaikoL1ClientTokenDebitedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2915,7 +2974,7 @@ func (it *TaikoL1ClientCrossChainSyncedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientCrossChainSynced) + it.Event = new(TaikoL1ClientTokenDebited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2930,7 +2989,7 @@ func (it *TaikoL1ClientCrossChainSyncedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientCrossChainSynced) + it.Event = new(TaikoL1ClientTokenDebited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2946,53 +3005,42 @@ func (it *TaikoL1ClientCrossChainSyncedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientCrossChainSyncedIterator) Error() error { +func (it *TaikoL1ClientTokenDebitedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientCrossChainSyncedIterator) Close() error { +func (it *TaikoL1ClientTokenDebitedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientCrossChainSynced represents a CrossChainSynced event raised by the TaikoL1Client contract. -type TaikoL1ClientCrossChainSynced struct { - SrcHeight uint64 - BlockHash [32]byte - SignalRoot [32]byte - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenDebited represents a TokenDebited event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDebited struct { + Amount *big.Int + FromLocalBalance bool + Raw types.Log // Blockchain specific contextual infos } -// FilterCrossChainSynced is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. +// FilterTokenDebited is a free log retrieval operation binding the contract event 0x8012eed335fcd2a9b93e688e5146be66d3b48c2e40578e713dc5f254d7fea32a. // -// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL1ClientCrossChainSyncedIterator, error) { - - var srcHeightRule []interface{} - for _, srcHeightItem := range srcHeight { - srcHeightRule = append(srcHeightRule, srcHeightItem) - } +// Solidity: event TokenDebited(uint256 amount, bool fromLocalBalance) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenDebited(opts *bind.FilterOpts) (*TaikoL1ClientTokenDebitedIterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "CrossChainSynced", srcHeightRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenDebited") if err != nil { return nil, err } - return &TaikoL1ClientCrossChainSyncedIterator{contract: _TaikoL1Client.contract, event: "CrossChainSynced", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenDebitedIterator{contract: _TaikoL1Client.contract, event: "TokenDebited", logs: logs, sub: sub}, nil } -// WatchCrossChainSynced is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. +// WatchTokenDebited is a free log subscription operation binding the contract event 0x8012eed335fcd2a9b93e688e5146be66d3b48c2e40578e713dc5f254d7fea32a. // -// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced, srcHeight []uint64) (event.Subscription, error) { - - var srcHeightRule []interface{} - for _, srcHeightItem := range srcHeight { - srcHeightRule = append(srcHeightRule, srcHeightItem) - } +// Solidity: event TokenDebited(uint256 amount, bool fromLocalBalance) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenDebited(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenDebited) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "CrossChainSynced", srcHeightRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenDebited") if err != nil { return nil, err } @@ -3002,8 +3050,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.Wa select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientCrossChainSynced) - if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced", log); err != nil { + event := new(TaikoL1ClientTokenDebited) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDebited", log); err != nil { return err } event.Raw = log @@ -3024,21 +3072,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.Wa }), nil } -// ParseCrossChainSynced is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. +// ParseTokenDebited is a log parse operation binding the contract event 0x8012eed335fcd2a9b93e688e5146be66d3b48c2e40578e713dc5f254d7fea32a. // -// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseCrossChainSynced(log types.Log) (*TaikoL1ClientCrossChainSynced, error) { - event := new(TaikoL1ClientCrossChainSynced) - if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced", log); err != nil { +// Solidity: event TokenDebited(uint256 amount, bool fromLocalBalance) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenDebited(log types.Log) (*TaikoL1ClientTokenDebited, error) { + event := new(TaikoL1ClientTokenDebited) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDebited", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientCrossChainSynced0Iterator is returned from FilterCrossChainSynced0 and is used to iterate over the raw logs and unpacked data for CrossChainSynced0 events raised by the TaikoL1Client contract. -type TaikoL1ClientCrossChainSynced0Iterator struct { - Event *TaikoL1ClientCrossChainSynced0 // Event containing the contract specifics and raw log +// TaikoL1ClientTokenDebited0Iterator is returned from FilterTokenDebited0 and is used to iterate over the raw logs and unpacked data for TokenDebited0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDebited0Iterator struct { + Event *TaikoL1ClientTokenDebited0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -3052,7 +3100,7 @@ type TaikoL1ClientCrossChainSynced0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientCrossChainSynced0Iterator) Next() bool { +func (it *TaikoL1ClientTokenDebited0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -3061,7 +3109,7 @@ func (it *TaikoL1ClientCrossChainSynced0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientCrossChainSynced0) + it.Event = new(TaikoL1ClientTokenDebited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3076,7 +3124,7 @@ func (it *TaikoL1ClientCrossChainSynced0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientCrossChainSynced0) + it.Event = new(TaikoL1ClientTokenDebited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3092,53 +3140,42 @@ func (it *TaikoL1ClientCrossChainSynced0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientCrossChainSynced0Iterator) Error() error { +func (it *TaikoL1ClientTokenDebited0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientCrossChainSynced0Iterator) Close() error { +func (it *TaikoL1ClientTokenDebited0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientCrossChainSynced0 represents a CrossChainSynced0 event raised by the TaikoL1Client contract. -type TaikoL1ClientCrossChainSynced0 struct { - SrcHeight uint64 - BlockHash [32]byte - SignalRoot [32]byte - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenDebited0 represents a TokenDebited0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDebited0 struct { + Amount *big.Int + FromLocalBalance bool + Raw types.Log // Blockchain specific contextual infos } -// FilterCrossChainSynced0 is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. +// FilterTokenDebited0 is a free log retrieval operation binding the contract event 0x8012eed335fcd2a9b93e688e5146be66d3b48c2e40578e713dc5f254d7fea32a. // -// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced0(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL1ClientCrossChainSynced0Iterator, error) { - - var srcHeightRule []interface{} - for _, srcHeightItem := range srcHeight { - srcHeightRule = append(srcHeightRule, srcHeightItem) - } +// Solidity: event TokenDebited(uint256 amount, bool fromLocalBalance) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenDebited0(opts *bind.FilterOpts) (*TaikoL1ClientTokenDebited0Iterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "CrossChainSynced0", srcHeightRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenDebited0") if err != nil { return nil, err } - return &TaikoL1ClientCrossChainSynced0Iterator{contract: _TaikoL1Client.contract, event: "CrossChainSynced0", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenDebited0Iterator{contract: _TaikoL1Client.contract, event: "TokenDebited0", logs: logs, sub: sub}, nil } -// WatchCrossChainSynced0 is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. +// WatchTokenDebited0 is a free log subscription operation binding the contract event 0x8012eed335fcd2a9b93e688e5146be66d3b48c2e40578e713dc5f254d7fea32a. // -// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced0, srcHeight []uint64) (event.Subscription, error) { - - var srcHeightRule []interface{} - for _, srcHeightItem := range srcHeight { - srcHeightRule = append(srcHeightRule, srcHeightItem) - } +// Solidity: event TokenDebited(uint256 amount, bool fromLocalBalance) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenDebited0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenDebited0) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "CrossChainSynced0", srcHeightRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenDebited0") if err != nil { return nil, err } @@ -3148,8 +3185,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.W select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientCrossChainSynced0) - if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced0", log); err != nil { + event := new(TaikoL1ClientTokenDebited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDebited0", log); err != nil { return err } event.Raw = log @@ -3170,21 +3207,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.W }), nil } -// ParseCrossChainSynced0 is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. +// ParseTokenDebited0 is a log parse operation binding the contract event 0x8012eed335fcd2a9b93e688e5146be66d3b48c2e40578e713dc5f254d7fea32a. // -// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseCrossChainSynced0(log types.Log) (*TaikoL1ClientCrossChainSynced0, error) { - event := new(TaikoL1ClientCrossChainSynced0) - if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced0", log); err != nil { +// Solidity: event TokenDebited(uint256 amount, bool fromLocalBalance) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenDebited0(log types.Log) (*TaikoL1ClientTokenDebited0, error) { + event := new(TaikoL1ClientTokenDebited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDebited0", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientEthDepositedIterator is returned from FilterEthDeposited and is used to iterate over the raw logs and unpacked data for EthDeposited events raised by the TaikoL1Client contract. -type TaikoL1ClientEthDepositedIterator struct { - Event *TaikoL1ClientEthDeposited // Event containing the contract specifics and raw log +// TaikoL1ClientTokenDepositedIterator is returned from FilterTokenDeposited and is used to iterate over the raw logs and unpacked data for TokenDeposited events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDepositedIterator struct { + Event *TaikoL1ClientTokenDeposited // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -3198,7 +3235,7 @@ type TaikoL1ClientEthDepositedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientEthDepositedIterator) Next() bool { +func (it *TaikoL1ClientTokenDepositedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -3207,7 +3244,7 @@ func (it *TaikoL1ClientEthDepositedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientEthDeposited) + it.Event = new(TaikoL1ClientTokenDeposited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3222,7 +3259,7 @@ func (it *TaikoL1ClientEthDepositedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientEthDeposited) + it.Event = new(TaikoL1ClientTokenDeposited) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3238,41 +3275,41 @@ func (it *TaikoL1ClientEthDepositedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientEthDepositedIterator) Error() error { +func (it *TaikoL1ClientTokenDepositedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientEthDepositedIterator) Close() error { +func (it *TaikoL1ClientTokenDepositedIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientEthDeposited represents a EthDeposited event raised by the TaikoL1Client contract. -type TaikoL1ClientEthDeposited struct { - Deposit TaikoDataEthDeposit - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenDeposited represents a TokenDeposited event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDeposited struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterEthDeposited is a free log retrieval operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. +// FilterTokenDeposited is a free log retrieval operation binding the contract event 0x26a49ee784523ce049bcbe276a63c7c9dbd9f428b1aa53633e679c9c046e8858. // -// Solidity: event EthDeposited((address,uint96,uint64) deposit) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterEthDeposited(opts *bind.FilterOpts) (*TaikoL1ClientEthDepositedIterator, error) { +// Solidity: event TokenDeposited(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenDeposited(opts *bind.FilterOpts) (*TaikoL1ClientTokenDepositedIterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "EthDeposited") + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenDeposited") if err != nil { return nil, err } - return &TaikoL1ClientEthDepositedIterator{contract: _TaikoL1Client.contract, event: "EthDeposited", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenDepositedIterator{contract: _TaikoL1Client.contract, event: "TokenDeposited", logs: logs, sub: sub}, nil } -// WatchEthDeposited is a free log subscription operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. +// WatchTokenDeposited is a free log subscription operation binding the contract event 0x26a49ee784523ce049bcbe276a63c7c9dbd9f428b1aa53633e679c9c046e8858. // -// Solidity: event EthDeposited((address,uint96,uint64) deposit) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientEthDeposited) (event.Subscription, error) { +// Solidity: event TokenDeposited(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenDeposited(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenDeposited) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "EthDeposited") + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenDeposited") if err != nil { return nil, err } @@ -3282,8 +3319,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited(opts *bind.WatchO select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientEthDeposited) - if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited", log); err != nil { + event := new(TaikoL1ClientTokenDeposited) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDeposited", log); err != nil { return err } event.Raw = log @@ -3304,21 +3341,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited(opts *bind.WatchO }), nil } -// ParseEthDeposited is a log parse operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. +// ParseTokenDeposited is a log parse operation binding the contract event 0x26a49ee784523ce049bcbe276a63c7c9dbd9f428b1aa53633e679c9c046e8858. // -// Solidity: event EthDeposited((address,uint96,uint64) deposit) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseEthDeposited(log types.Log) (*TaikoL1ClientEthDeposited, error) { - event := new(TaikoL1ClientEthDeposited) - if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited", log); err != nil { +// Solidity: event TokenDeposited(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenDeposited(log types.Log) (*TaikoL1ClientTokenDeposited, error) { + event := new(TaikoL1ClientTokenDeposited) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDeposited", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientEthDeposited0Iterator is returned from FilterEthDeposited0 and is used to iterate over the raw logs and unpacked data for EthDeposited0 events raised by the TaikoL1Client contract. -type TaikoL1ClientEthDeposited0Iterator struct { - Event *TaikoL1ClientEthDeposited0 // Event containing the contract specifics and raw log +// TaikoL1ClientTokenDeposited0Iterator is returned from FilterTokenDeposited0 and is used to iterate over the raw logs and unpacked data for TokenDeposited0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDeposited0Iterator struct { + Event *TaikoL1ClientTokenDeposited0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -3332,7 +3369,7 @@ type TaikoL1ClientEthDeposited0Iterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientEthDeposited0Iterator) Next() bool { +func (it *TaikoL1ClientTokenDeposited0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -3341,7 +3378,7 @@ func (it *TaikoL1ClientEthDeposited0Iterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientEthDeposited0) + it.Event = new(TaikoL1ClientTokenDeposited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3356,7 +3393,7 @@ func (it *TaikoL1ClientEthDeposited0Iterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientEthDeposited0) + it.Event = new(TaikoL1ClientTokenDeposited0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3372,41 +3409,41 @@ func (it *TaikoL1ClientEthDeposited0Iterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientEthDeposited0Iterator) Error() error { +func (it *TaikoL1ClientTokenDeposited0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientEthDeposited0Iterator) Close() error { +func (it *TaikoL1ClientTokenDeposited0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientEthDeposited0 represents a EthDeposited0 event raised by the TaikoL1Client contract. -type TaikoL1ClientEthDeposited0 struct { - Deposit TaikoDataEthDeposit - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenDeposited0 represents a TokenDeposited0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenDeposited0 struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterEthDeposited0 is a free log retrieval operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. +// FilterTokenDeposited0 is a free log retrieval operation binding the contract event 0x26a49ee784523ce049bcbe276a63c7c9dbd9f428b1aa53633e679c9c046e8858. // -// Solidity: event EthDeposited((address,uint96,uint64) deposit) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterEthDeposited0(opts *bind.FilterOpts) (*TaikoL1ClientEthDeposited0Iterator, error) { +// Solidity: event TokenDeposited(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenDeposited0(opts *bind.FilterOpts) (*TaikoL1ClientTokenDeposited0Iterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "EthDeposited0") + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenDeposited0") if err != nil { return nil, err } - return &TaikoL1ClientEthDeposited0Iterator{contract: _TaikoL1Client.contract, event: "EthDeposited0", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenDeposited0Iterator{contract: _TaikoL1Client.contract, event: "TokenDeposited0", logs: logs, sub: sub}, nil } -// WatchEthDeposited0 is a free log subscription operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. +// WatchTokenDeposited0 is a free log subscription operation binding the contract event 0x26a49ee784523ce049bcbe276a63c7c9dbd9f428b1aa53633e679c9c046e8858. // -// Solidity: event EthDeposited((address,uint96,uint64) deposit) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientEthDeposited0) (event.Subscription, error) { +// Solidity: event TokenDeposited(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenDeposited0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenDeposited0) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "EthDeposited0") + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenDeposited0") if err != nil { return nil, err } @@ -3416,8 +3453,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited0(opts *bind.Watch select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientEthDeposited0) - if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited0", log); err != nil { + event := new(TaikoL1ClientTokenDeposited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDeposited0", log); err != nil { return err } event.Raw = log @@ -3438,21 +3475,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchEthDeposited0(opts *bind.Watch }), nil } -// ParseEthDeposited0 is a log parse operation binding the contract event 0x7120a3b075ad25974c5eed76dedb3a217c76c9c6d1f1e201caeba9b89de9a9d9. +// ParseTokenDeposited0 is a log parse operation binding the contract event 0x26a49ee784523ce049bcbe276a63c7c9dbd9f428b1aa53633e679c9c046e8858. // -// Solidity: event EthDeposited((address,uint96,uint64) deposit) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseEthDeposited0(log types.Log) (*TaikoL1ClientEthDeposited0, error) { - event := new(TaikoL1ClientEthDeposited0) - if err := _TaikoL1Client.contract.UnpackLog(event, "EthDeposited0", log); err != nil { +// Solidity: event TokenDeposited(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenDeposited0(log types.Log) (*TaikoL1ClientTokenDeposited0, error) { + event := new(TaikoL1ClientTokenDeposited0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenDeposited0", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoL1Client contract. -type TaikoL1ClientInitializedIterator struct { - Event *TaikoL1ClientInitialized // Event containing the contract specifics and raw log +// TaikoL1ClientTokenWithdrawnIterator is returned from FilterTokenWithdrawn and is used to iterate over the raw logs and unpacked data for TokenWithdrawn events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawnIterator struct { + Event *TaikoL1ClientTokenWithdrawn // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -3466,7 +3503,7 @@ type TaikoL1ClientInitializedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientInitializedIterator) Next() bool { +func (it *TaikoL1ClientTokenWithdrawnIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -3475,7 +3512,7 @@ func (it *TaikoL1ClientInitializedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientInitialized) + it.Event = new(TaikoL1ClientTokenWithdrawn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3490,7 +3527,7 @@ func (it *TaikoL1ClientInitializedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientInitialized) + it.Event = new(TaikoL1ClientTokenWithdrawn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3506,41 +3543,41 @@ func (it *TaikoL1ClientInitializedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientInitializedIterator) Error() error { +func (it *TaikoL1ClientTokenWithdrawnIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientInitializedIterator) Close() error { +func (it *TaikoL1ClientTokenWithdrawnIterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientInitialized represents a Initialized event raised by the TaikoL1Client contract. -type TaikoL1ClientInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenWithdrawn represents a TokenWithdrawn event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawn struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// FilterTokenWithdrawn is a free log retrieval operation binding the contract event 0xc172f6497c150fc242267f743e8e4034b31b16ee123408d6d5f75a81128de114. // -// Solidity: event Initialized(uint8 version) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterInitialized(opts *bind.FilterOpts) (*TaikoL1ClientInitializedIterator, error) { +// Solidity: event TokenWithdrawn(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenWithdrawn(opts *bind.FilterOpts) (*TaikoL1ClientTokenWithdrawnIterator, error) { - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "Initialized") + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenWithdrawn") if err != nil { return nil, err } - return &TaikoL1ClientInitializedIterator{contract: _TaikoL1Client.contract, event: "Initialized", logs: logs, sub: sub}, nil + return &TaikoL1ClientTokenWithdrawnIterator{contract: _TaikoL1Client.contract, event: "TokenWithdrawn", logs: logs, sub: sub}, nil } -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// WatchTokenWithdrawn is a free log subscription operation binding the contract event 0xc172f6497c150fc242267f743e8e4034b31b16ee123408d6d5f75a81128de114. // -// Solidity: event Initialized(uint8 version) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientInitialized) (event.Subscription, error) { +// Solidity: event TokenWithdrawn(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenWithdrawn(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenWithdrawn) (event.Subscription, error) { - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "Initialized") + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenWithdrawn") if err != nil { return nil, err } @@ -3550,8 +3587,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchInitialized(opts *bind.WatchOp select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientInitialized) - if err := _TaikoL1Client.contract.UnpackLog(event, "Initialized", log); err != nil { + event := new(TaikoL1ClientTokenWithdrawn) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawn", log); err != nil { return err } event.Raw = log @@ -3572,21 +3609,21 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchInitialized(opts *bind.WatchOp }), nil } -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// ParseTokenWithdrawn is a log parse operation binding the contract event 0xc172f6497c150fc242267f743e8e4034b31b16ee123408d6d5f75a81128de114. // -// Solidity: event Initialized(uint8 version) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseInitialized(log types.Log) (*TaikoL1ClientInitialized, error) { - event := new(TaikoL1ClientInitialized) - if err := _TaikoL1Client.contract.UnpackLog(event, "Initialized", log); err != nil { +// Solidity: event TokenWithdrawn(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenWithdrawn(log types.Log) (*TaikoL1ClientTokenWithdrawn, error) { + event := new(TaikoL1ClientTokenWithdrawn) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawn", log); err != nil { return nil, err } event.Raw = log return event, nil } -// TaikoL1ClientOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TaikoL1Client contract. -type TaikoL1ClientOwnershipTransferredIterator struct { - Event *TaikoL1ClientOwnershipTransferred // Event containing the contract specifics and raw log +// TaikoL1ClientTokenWithdrawn0Iterator is returned from FilterTokenWithdrawn0 and is used to iterate over the raw logs and unpacked data for TokenWithdrawn0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawn0Iterator struct { + Event *TaikoL1ClientTokenWithdrawn0 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -3600,7 +3637,7 @@ type TaikoL1ClientOwnershipTransferredIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *TaikoL1ClientOwnershipTransferredIterator) Next() bool { +func (it *TaikoL1ClientTokenWithdrawn0Iterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -3609,7 +3646,7 @@ func (it *TaikoL1ClientOwnershipTransferredIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(TaikoL1ClientOwnershipTransferred) + it.Event = new(TaikoL1ClientTokenWithdrawn0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3624,7 +3661,7 @@ func (it *TaikoL1ClientOwnershipTransferredIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(TaikoL1ClientOwnershipTransferred) + it.Event = new(TaikoL1ClientTokenWithdrawn0) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -3640,60 +3677,176 @@ func (it *TaikoL1ClientOwnershipTransferredIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ClientOwnershipTransferredIterator) Error() error { +func (it *TaikoL1ClientTokenWithdrawn0Iterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *TaikoL1ClientOwnershipTransferredIterator) Close() error { +func (it *TaikoL1ClientTokenWithdrawn0Iterator) Close() error { it.sub.Unsubscribe() return nil } -// TaikoL1ClientOwnershipTransferred represents a OwnershipTransferred event raised by the TaikoL1Client contract. -type TaikoL1ClientOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos +// TaikoL1ClientTokenWithdrawn0 represents a TokenWithdrawn0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawn0 struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// FilterTokenWithdrawn0 is a free log retrieval operation binding the contract event 0xc172f6497c150fc242267f743e8e4034b31b16ee123408d6d5f75a81128de114. // -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoL1ClientOwnershipTransferredIterator, error) { +// Solidity: event TokenWithdrawn(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenWithdrawn0(opts *bind.FilterOpts) (*TaikoL1ClientTokenWithdrawn0Iterator, error) { - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenWithdrawn0") + if err != nil { + return nil, err } + return &TaikoL1ClientTokenWithdrawn0Iterator{contract: _TaikoL1Client.contract, event: "TokenWithdrawn0", logs: logs, sub: sub}, nil +} - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) +// WatchTokenWithdrawn0 is a free log subscription operation binding the contract event 0xc172f6497c150fc242267f743e8e4034b31b16ee123408d6d5f75a81128de114. +// +// Solidity: event TokenWithdrawn(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenWithdrawn0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenWithdrawn0) (event.Subscription, error) { + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenWithdrawn0") if err != nil { return nil, err } - return &TaikoL1ClientOwnershipTransferredIterator{contract: _TaikoL1Client.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL1ClientTokenWithdrawn0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawn0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil } -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// ParseTokenWithdrawn0 is a log parse operation binding the contract event 0xc172f6497c150fc242267f743e8e4034b31b16ee123408d6d5f75a81128de114. // -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { +// Solidity: event TokenWithdrawn(uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenWithdrawn0(log types.Log) (*TaikoL1ClientTokenWithdrawn0, error) { + event := new(TaikoL1ClientTokenWithdrawn0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawn0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) +// TaikoL1ClientTokenWithdrawnByOwnerIterator is returned from FilterTokenWithdrawnByOwner and is used to iterate over the raw logs and unpacked data for TokenWithdrawnByOwner events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawnByOwnerIterator struct { + Event *TaikoL1ClientTokenWithdrawnByOwner // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL1ClientTokenWithdrawnByOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTokenWithdrawnByOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTokenWithdrawnByOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() } +} - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL1ClientTokenWithdrawnByOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ClientTokenWithdrawnByOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ClientTokenWithdrawnByOwner represents a TokenWithdrawnByOwner event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawnByOwner struct { + To common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTokenWithdrawnByOwner is a free log retrieval operation binding the contract event 0xc4f72d4b841abf7e4afe6a797fbc9d92a5186aa6332c2ff33c0e327f1c3e9a4c. +// +// Solidity: event TokenWithdrawnByOwner(address to, uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenWithdrawnByOwner(opts *bind.FilterOpts) (*TaikoL1ClientTokenWithdrawnByOwnerIterator, error) { + + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenWithdrawnByOwner") + if err != nil { + return nil, err + } + return &TaikoL1ClientTokenWithdrawnByOwnerIterator{contract: _TaikoL1Client.contract, event: "TokenWithdrawnByOwner", logs: logs, sub: sub}, nil +} + +// WatchTokenWithdrawnByOwner is a free log subscription operation binding the contract event 0xc4f72d4b841abf7e4afe6a797fbc9d92a5186aa6332c2ff33c0e327f1c3e9a4c. +// +// Solidity: event TokenWithdrawnByOwner(address to, uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenWithdrawnByOwner(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenWithdrawnByOwner) (event.Subscription, error) { + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenWithdrawnByOwner") if err != nil { return nil, err } @@ -3703,8 +3856,8 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchOwnershipTransferred(opts *bin select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(TaikoL1ClientOwnershipTransferred) - if err := _TaikoL1Client.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + event := new(TaikoL1ClientTokenWithdrawnByOwner) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawnByOwner", log); err != nil { return err } event.Raw = log @@ -3725,12 +3878,747 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchOwnershipTransferred(opts *bin }), nil } -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// ParseTokenWithdrawnByOwner is a log parse operation binding the contract event 0xc4f72d4b841abf7e4afe6a797fbc9d92a5186aa6332c2ff33c0e327f1c3e9a4c. // -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseOwnershipTransferred(log types.Log) (*TaikoL1ClientOwnershipTransferred, error) { - event := new(TaikoL1ClientOwnershipTransferred) - if err := _TaikoL1Client.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { +// Solidity: event TokenWithdrawnByOwner(address to, uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenWithdrawnByOwner(log types.Log) (*TaikoL1ClientTokenWithdrawnByOwner, error) { + event := new(TaikoL1ClientTokenWithdrawnByOwner) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawnByOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ClientTokenWithdrawnByOwner0Iterator is returned from FilterTokenWithdrawnByOwner0 and is used to iterate over the raw logs and unpacked data for TokenWithdrawnByOwner0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawnByOwner0Iterator struct { + Event *TaikoL1ClientTokenWithdrawnByOwner0 // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL1ClientTokenWithdrawnByOwner0Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTokenWithdrawnByOwner0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTokenWithdrawnByOwner0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL1ClientTokenWithdrawnByOwner0Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ClientTokenWithdrawnByOwner0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ClientTokenWithdrawnByOwner0 represents a TokenWithdrawnByOwner0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTokenWithdrawnByOwner0 struct { + To common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTokenWithdrawnByOwner0 is a free log retrieval operation binding the contract event 0xc4f72d4b841abf7e4afe6a797fbc9d92a5186aa6332c2ff33c0e327f1c3e9a4c. +// +// Solidity: event TokenWithdrawnByOwner(address to, uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTokenWithdrawnByOwner0(opts *bind.FilterOpts) (*TaikoL1ClientTokenWithdrawnByOwner0Iterator, error) { + + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TokenWithdrawnByOwner0") + if err != nil { + return nil, err + } + return &TaikoL1ClientTokenWithdrawnByOwner0Iterator{contract: _TaikoL1Client.contract, event: "TokenWithdrawnByOwner0", logs: logs, sub: sub}, nil +} + +// WatchTokenWithdrawnByOwner0 is a free log subscription operation binding the contract event 0xc4f72d4b841abf7e4afe6a797fbc9d92a5186aa6332c2ff33c0e327f1c3e9a4c. +// +// Solidity: event TokenWithdrawnByOwner(address to, uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTokenWithdrawnByOwner0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTokenWithdrawnByOwner0) (event.Subscription, error) { + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TokenWithdrawnByOwner0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL1ClientTokenWithdrawnByOwner0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawnByOwner0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTokenWithdrawnByOwner0 is a log parse operation binding the contract event 0xc4f72d4b841abf7e4afe6a797fbc9d92a5186aa6332c2ff33c0e327f1c3e9a4c. +// +// Solidity: event TokenWithdrawnByOwner(address to, uint256 amount) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTokenWithdrawnByOwner0(log types.Log) (*TaikoL1ClientTokenWithdrawnByOwner0, error) { + event := new(TaikoL1ClientTokenWithdrawnByOwner0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TokenWithdrawnByOwner0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ClientTransitionContestedIterator is returned from FilterTransitionContested and is used to iterate over the raw logs and unpacked data for TransitionContested events raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionContestedIterator struct { + Event *TaikoL1ClientTransitionContested // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL1ClientTransitionContestedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionContested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionContested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL1ClientTransitionContestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ClientTransitionContestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ClientTransitionContested represents a TransitionContested event raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionContested struct { + BlockId *big.Int + ParentHash [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Contester common.Address + ContestBond *big.Int + Tier uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransitionContested is a free log retrieval operation binding the contract event 0x135961061f7c7cad9a389080483d14014ba6fe9ebcf6d3d826185c69dd71ce75. +// +// Solidity: event TransitionContested(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address contester, uint96 contestBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTransitionContested(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientTransitionContestedIterator, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TransitionContested", blockIdRule) + if err != nil { + return nil, err + } + return &TaikoL1ClientTransitionContestedIterator{contract: _TaikoL1Client.contract, event: "TransitionContested", logs: logs, sub: sub}, nil +} + +// WatchTransitionContested is a free log subscription operation binding the contract event 0x135961061f7c7cad9a389080483d14014ba6fe9ebcf6d3d826185c69dd71ce75. +// +// Solidity: event TransitionContested(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address contester, uint96 contestBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTransitionContested(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTransitionContested, blockId []*big.Int) (event.Subscription, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TransitionContested", blockIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL1ClientTransitionContested) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionContested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransitionContested is a log parse operation binding the contract event 0x135961061f7c7cad9a389080483d14014ba6fe9ebcf6d3d826185c69dd71ce75. +// +// Solidity: event TransitionContested(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address contester, uint96 contestBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTransitionContested(log types.Log) (*TaikoL1ClientTransitionContested, error) { + event := new(TaikoL1ClientTransitionContested) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionContested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ClientTransitionContested0Iterator is returned from FilterTransitionContested0 and is used to iterate over the raw logs and unpacked data for TransitionContested0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionContested0Iterator struct { + Event *TaikoL1ClientTransitionContested0 // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL1ClientTransitionContested0Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionContested0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionContested0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL1ClientTransitionContested0Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ClientTransitionContested0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ClientTransitionContested0 represents a TransitionContested0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionContested0 struct { + BlockId *big.Int + ParentHash [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Contester common.Address + ContestBond *big.Int + Tier uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransitionContested0 is a free log retrieval operation binding the contract event 0x135961061f7c7cad9a389080483d14014ba6fe9ebcf6d3d826185c69dd71ce75. +// +// Solidity: event TransitionContested(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address contester, uint96 contestBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTransitionContested0(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientTransitionContested0Iterator, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TransitionContested0", blockIdRule) + if err != nil { + return nil, err + } + return &TaikoL1ClientTransitionContested0Iterator{contract: _TaikoL1Client.contract, event: "TransitionContested0", logs: logs, sub: sub}, nil +} + +// WatchTransitionContested0 is a free log subscription operation binding the contract event 0x135961061f7c7cad9a389080483d14014ba6fe9ebcf6d3d826185c69dd71ce75. +// +// Solidity: event TransitionContested(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address contester, uint96 contestBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTransitionContested0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTransitionContested0, blockId []*big.Int) (event.Subscription, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TransitionContested0", blockIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL1ClientTransitionContested0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionContested0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransitionContested0 is a log parse operation binding the contract event 0x135961061f7c7cad9a389080483d14014ba6fe9ebcf6d3d826185c69dd71ce75. +// +// Solidity: event TransitionContested(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address contester, uint96 contestBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTransitionContested0(log types.Log) (*TaikoL1ClientTransitionContested0, error) { + event := new(TaikoL1ClientTransitionContested0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionContested0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ClientTransitionProvedIterator is returned from FilterTransitionProved and is used to iterate over the raw logs and unpacked data for TransitionProved events raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionProvedIterator struct { + Event *TaikoL1ClientTransitionProved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL1ClientTransitionProvedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionProved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionProved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL1ClientTransitionProvedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ClientTransitionProvedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ClientTransitionProved represents a TransitionProved event raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionProved struct { + BlockId *big.Int + ParentHash [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Prover common.Address + ValidityBond *big.Int + Tier uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransitionProved is a free log retrieval operation binding the contract event 0x9eaac66787b7d7e72981c31449ddd9bde78ffdb8cb3e6543ba2b9a4bb653b5e3. +// +// Solidity: event TransitionProved(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint96 validityBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTransitionProved(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientTransitionProvedIterator, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TransitionProved", blockIdRule) + if err != nil { + return nil, err + } + return &TaikoL1ClientTransitionProvedIterator{contract: _TaikoL1Client.contract, event: "TransitionProved", logs: logs, sub: sub}, nil +} + +// WatchTransitionProved is a free log subscription operation binding the contract event 0x9eaac66787b7d7e72981c31449ddd9bde78ffdb8cb3e6543ba2b9a4bb653b5e3. +// +// Solidity: event TransitionProved(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint96 validityBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTransitionProved(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTransitionProved, blockId []*big.Int) (event.Subscription, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TransitionProved", blockIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL1ClientTransitionProved) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionProved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransitionProved is a log parse operation binding the contract event 0x9eaac66787b7d7e72981c31449ddd9bde78ffdb8cb3e6543ba2b9a4bb653b5e3. +// +// Solidity: event TransitionProved(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint96 validityBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTransitionProved(log types.Log) (*TaikoL1ClientTransitionProved, error) { + event := new(TaikoL1ClientTransitionProved) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionProved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ClientTransitionProved0Iterator is returned from FilterTransitionProved0 and is used to iterate over the raw logs and unpacked data for TransitionProved0 events raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionProved0Iterator struct { + Event *TaikoL1ClientTransitionProved0 // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL1ClientTransitionProved0Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionProved0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL1ClientTransitionProved0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL1ClientTransitionProved0Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ClientTransitionProved0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ClientTransitionProved0 represents a TransitionProved0 event raised by the TaikoL1Client contract. +type TaikoL1ClientTransitionProved0 struct { + BlockId *big.Int + ParentHash [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Prover common.Address + ValidityBond *big.Int + Tier uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransitionProved0 is a free log retrieval operation binding the contract event 0x9eaac66787b7d7e72981c31449ddd9bde78ffdb8cb3e6543ba2b9a4bb653b5e3. +// +// Solidity: event TransitionProved(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint96 validityBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterTransitionProved0(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientTransitionProved0Iterator, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "TransitionProved0", blockIdRule) + if err != nil { + return nil, err + } + return &TaikoL1ClientTransitionProved0Iterator{contract: _TaikoL1Client.contract, event: "TransitionProved0", logs: logs, sub: sub}, nil +} + +// WatchTransitionProved0 is a free log subscription operation binding the contract event 0x9eaac66787b7d7e72981c31449ddd9bde78ffdb8cb3e6543ba2b9a4bb653b5e3. +// +// Solidity: event TransitionProved(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint96 validityBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchTransitionProved0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientTransitionProved0, blockId []*big.Int) (event.Subscription, error) { + + var blockIdRule []interface{} + for _, blockIdItem := range blockId { + blockIdRule = append(blockIdRule, blockIdItem) + } + + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "TransitionProved0", blockIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL1ClientTransitionProved0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionProved0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransitionProved0 is a log parse operation binding the contract event 0x9eaac66787b7d7e72981c31449ddd9bde78ffdb8cb3e6543ba2b9a4bb653b5e3. +// +// Solidity: event TransitionProved(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint96 validityBond, uint16 tier) +func (_TaikoL1Client *TaikoL1ClientFilterer) ParseTransitionProved0(log types.Log) (*TaikoL1ClientTransitionProved0, error) { + event := new(TaikoL1ClientTransitionProved0) + if err := _TaikoL1Client.contract.UnpackLog(event, "TransitionProved0", log); err != nil { return nil, err } event.Raw = log diff --git a/bindings/gen_taiko_l2.go b/bindings/gen_taiko_l2.go index fdf8add4d..f95cbdb49 100644 --- a/bindings/gen_taiko_l2.go +++ b/bindings/gen_taiko_l2.go @@ -31,23 +31,15 @@ var ( // TaikoL2EIP1559Config is an auto generated low-level Go binding around an user-defined struct. type TaikoL2EIP1559Config struct { + Xscale *big.Int Yscale *big.Int - Xscale uint64 - GasIssuedPerSecond uint32 -} - -// TaikoL2EIP1559Params is an auto generated low-level Go binding around an user-defined struct. -type TaikoL2EIP1559Params struct { - Basefee uint64 GasIssuedPerSecond uint32 GasExcessMax uint64 - GasTarget uint64 - Ratio2x1x uint64 } // TaikoL2ClientMetaData contains all meta data concerning the TaikoL2Client contract. var TaikoL2ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainid\",\"type\":\"uint64\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gasExcess\",\"type\":\"uint64\"}],\"name\":\"EIP1559ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip1559Config\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"updateEIP1559Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainid\",\"type\":\"uint64\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"name\":\"calcEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"xscale\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"xscale\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // TaikoL2ClientABI is the input ABI used to generate the binding from. @@ -289,54 +281,35 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) AddressManager() (common.Addre return _TaikoL2Client.Contract.AddressManager(&_TaikoL2Client.CallOpts) } -// Eip1559Config is a free data retrieval call binding the contract method 0x4111610b. +// CalcEIP1559Config is a free data retrieval call binding the contract method 0x06becb55. // -// Solidity: function eip1559Config() view returns(uint128 yscale, uint64 xscale, uint32 gasIssuedPerSecond) -func (_TaikoL2Client *TaikoL2ClientCaller) Eip1559Config(opts *bind.CallOpts) (struct { - Yscale *big.Int - Xscale uint64 - GasIssuedPerSecond uint32 -}, error) { +// Solidity: function calcEIP1559Config(uint64 basefee, uint32 gasIssuedPerSecond, uint64 gasExcessMax, uint64 gasTarget, uint64 ratio2x1x) pure returns((uint128,uint128,uint32,uint64) config) +func (_TaikoL2Client *TaikoL2ClientCaller) CalcEIP1559Config(opts *bind.CallOpts, basefee uint64, gasIssuedPerSecond uint32, gasExcessMax uint64, gasTarget uint64, ratio2x1x uint64) (TaikoL2EIP1559Config, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "eip1559Config") + err := _TaikoL2Client.contract.Call(opts, &out, "calcEIP1559Config", basefee, gasIssuedPerSecond, gasExcessMax, gasTarget, ratio2x1x) - outstruct := new(struct { - Yscale *big.Int - Xscale uint64 - GasIssuedPerSecond uint32 - }) if err != nil { - return *outstruct, err + return *new(TaikoL2EIP1559Config), err } - outstruct.Yscale = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.Xscale = *abi.ConvertType(out[1], new(uint64)).(*uint64) - outstruct.GasIssuedPerSecond = *abi.ConvertType(out[2], new(uint32)).(*uint32) + out0 := *abi.ConvertType(out[0], new(TaikoL2EIP1559Config)).(*TaikoL2EIP1559Config) - return *outstruct, err + return out0, err } -// Eip1559Config is a free data retrieval call binding the contract method 0x4111610b. +// CalcEIP1559Config is a free data retrieval call binding the contract method 0x06becb55. // -// Solidity: function eip1559Config() view returns(uint128 yscale, uint64 xscale, uint32 gasIssuedPerSecond) -func (_TaikoL2Client *TaikoL2ClientSession) Eip1559Config() (struct { - Yscale *big.Int - Xscale uint64 - GasIssuedPerSecond uint32 -}, error) { - return _TaikoL2Client.Contract.Eip1559Config(&_TaikoL2Client.CallOpts) +// Solidity: function calcEIP1559Config(uint64 basefee, uint32 gasIssuedPerSecond, uint64 gasExcessMax, uint64 gasTarget, uint64 ratio2x1x) pure returns((uint128,uint128,uint32,uint64) config) +func (_TaikoL2Client *TaikoL2ClientSession) CalcEIP1559Config(basefee uint64, gasIssuedPerSecond uint32, gasExcessMax uint64, gasTarget uint64, ratio2x1x uint64) (TaikoL2EIP1559Config, error) { + return _TaikoL2Client.Contract.CalcEIP1559Config(&_TaikoL2Client.CallOpts, basefee, gasIssuedPerSecond, gasExcessMax, gasTarget, ratio2x1x) } -// Eip1559Config is a free data retrieval call binding the contract method 0x4111610b. +// CalcEIP1559Config is a free data retrieval call binding the contract method 0x06becb55. // -// Solidity: function eip1559Config() view returns(uint128 yscale, uint64 xscale, uint32 gasIssuedPerSecond) -func (_TaikoL2Client *TaikoL2ClientCallerSession) Eip1559Config() (struct { - Yscale *big.Int - Xscale uint64 - GasIssuedPerSecond uint32 -}, error) { - return _TaikoL2Client.Contract.Eip1559Config(&_TaikoL2Client.CallOpts) +// Solidity: function calcEIP1559Config(uint64 basefee, uint32 gasIssuedPerSecond, uint64 gasExcessMax, uint64 gasTarget, uint64 ratio2x1x) pure returns((uint128,uint128,uint32,uint64) config) +func (_TaikoL2Client *TaikoL2ClientCallerSession) CalcEIP1559Config(basefee uint64, gasIssuedPerSecond uint32, gasExcessMax uint64, gasTarget uint64, ratio2x1x uint64) (TaikoL2EIP1559Config, error) { + return _TaikoL2Client.Contract.CalcEIP1559Config(&_TaikoL2Client.CallOpts, basefee, gasIssuedPerSecond, gasExcessMax, gasTarget, ratio2x1x) } // GasExcess is a free data retrieval call binding the contract method 0xf535bd56. @@ -496,7 +469,7 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainSignalRoot(blockI // GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. // -// Solidity: function getEIP1559Config() view returns((uint128,uint64,uint32)) +// Solidity: function getEIP1559Config() pure returns((uint128,uint128,uint32,uint64) config) func (_TaikoL2Client *TaikoL2ClientCaller) GetEIP1559Config(opts *bind.CallOpts) (TaikoL2EIP1559Config, error) { var out []interface{} err := _TaikoL2Client.contract.Call(opts, &out, "getEIP1559Config") @@ -513,14 +486,14 @@ func (_TaikoL2Client *TaikoL2ClientCaller) GetEIP1559Config(opts *bind.CallOpts) // GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. // -// Solidity: function getEIP1559Config() view returns((uint128,uint64,uint32)) +// Solidity: function getEIP1559Config() pure returns((uint128,uint128,uint32,uint64) config) func (_TaikoL2Client *TaikoL2ClientSession) GetEIP1559Config() (TaikoL2EIP1559Config, error) { return _TaikoL2Client.Contract.GetEIP1559Config(&_TaikoL2Client.CallOpts) } // GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. // -// Solidity: function getEIP1559Config() view returns((uint128,uint64,uint32)) +// Solidity: function getEIP1559Config() pure returns((uint128,uint128,uint32,uint64) config) func (_TaikoL2Client *TaikoL2ClientCallerSession) GetEIP1559Config() (TaikoL2EIP1559Config, error) { return _TaikoL2Client.Contract.GetEIP1559Config(&_TaikoL2Client.CallOpts) } @@ -782,25 +755,25 @@ func (_TaikoL2Client *TaikoL2ClientTransactorSession) Anchor(l1Hash [32]byte, l1 return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, l1Height, parentGasUsed) } -// Init is a paid mutator transaction binding the contract method 0x5c82e9c2. +// Init is a paid mutator transaction binding the contract method 0x19ab453c. // -// Solidity: function init(address _addressManager, (uint64,uint32,uint64,uint64,uint64) _param1559) returns() -func (_TaikoL2Client *TaikoL2ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { - return _TaikoL2Client.contract.Transact(opts, "init", _addressManager, _param1559) +// Solidity: function init(address _addressManager) returns() +func (_TaikoL2Client *TaikoL2ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address) (*types.Transaction, error) { + return _TaikoL2Client.contract.Transact(opts, "init", _addressManager) } -// Init is a paid mutator transaction binding the contract method 0x5c82e9c2. +// Init is a paid mutator transaction binding the contract method 0x19ab453c. // -// Solidity: function init(address _addressManager, (uint64,uint32,uint64,uint64,uint64) _param1559) returns() -func (_TaikoL2Client *TaikoL2ClientSession) Init(_addressManager common.Address, _param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager, _param1559) +// Solidity: function init(address _addressManager) returns() +func (_TaikoL2Client *TaikoL2ClientSession) Init(_addressManager common.Address) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager) } -// Init is a paid mutator transaction binding the contract method 0x5c82e9c2. +// Init is a paid mutator transaction binding the contract method 0x19ab453c. // -// Solidity: function init(address _addressManager, (uint64,uint32,uint64,uint64,uint64) _param1559) returns() -func (_TaikoL2Client *TaikoL2ClientTransactorSession) Init(_addressManager common.Address, _param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager, _param1559) +// Solidity: function init(address _addressManager) returns() +func (_TaikoL2Client *TaikoL2ClientTransactorSession) Init(_addressManager common.Address) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -866,27 +839,6 @@ func (_TaikoL2Client *TaikoL2ClientTransactorSession) TransferOwnership(newOwner return _TaikoL2Client.Contract.TransferOwnership(&_TaikoL2Client.TransactOpts, newOwner) } -// UpdateEIP1559Config is a paid mutator transaction binding the contract method 0xc1ea62de. -// -// Solidity: function updateEIP1559Config((uint64,uint32,uint64,uint64,uint64) _param1559) returns() -func (_TaikoL2Client *TaikoL2ClientTransactor) UpdateEIP1559Config(opts *bind.TransactOpts, _param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { - return _TaikoL2Client.contract.Transact(opts, "updateEIP1559Config", _param1559) -} - -// UpdateEIP1559Config is a paid mutator transaction binding the contract method 0xc1ea62de. -// -// Solidity: function updateEIP1559Config((uint64,uint32,uint64,uint64,uint64) _param1559) returns() -func (_TaikoL2Client *TaikoL2ClientSession) UpdateEIP1559Config(_param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { - return _TaikoL2Client.Contract.UpdateEIP1559Config(&_TaikoL2Client.TransactOpts, _param1559) -} - -// UpdateEIP1559Config is a paid mutator transaction binding the contract method 0xc1ea62de. -// -// Solidity: function updateEIP1559Config((uint64,uint32,uint64,uint64,uint64) _param1559) returns() -func (_TaikoL2Client *TaikoL2ClientTransactorSession) UpdateEIP1559Config(_param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { - return _TaikoL2Client.Contract.UpdateEIP1559Config(&_TaikoL2Client.TransactOpts, _param1559) -} - // TaikoL2ClientAddressManagerChangedIterator is returned from FilterAddressManagerChanged and is used to iterate over the raw logs and unpacked data for AddressManagerChanged events raised by the TaikoL2Client contract. type TaikoL2ClientAddressManagerChangedIterator struct { Event *TaikoL2ClientAddressManagerChanged // Event containing the contract specifics and raw log @@ -1318,141 +1270,6 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) ParseCrossChainSynced(log types.Log return event, nil } -// TaikoL2ClientEIP1559ConfigUpdatedIterator is returned from FilterEIP1559ConfigUpdated and is used to iterate over the raw logs and unpacked data for EIP1559ConfigUpdated events raised by the TaikoL2Client contract. -type TaikoL2ClientEIP1559ConfigUpdatedIterator struct { - Event *TaikoL2ClientEIP1559ConfigUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL2ClientEIP1559ConfigUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL2ClientEIP1559ConfigUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL2ClientEIP1559ConfigUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL2ClientEIP1559ConfigUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL2ClientEIP1559ConfigUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL2ClientEIP1559ConfigUpdated represents a EIP1559ConfigUpdated event raised by the TaikoL2Client contract. -type TaikoL2ClientEIP1559ConfigUpdated struct { - Config TaikoL2EIP1559Config - GasExcess uint64 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEIP1559ConfigUpdated is a free log retrieval operation binding the contract event 0x60807b646ebaa6bfeb242d7281f23e864f8ba09f3f0d16bfec4060fb4e48e77d. -// -// Solidity: event EIP1559ConfigUpdated((uint128,uint64,uint32) config, uint64 gasExcess) -func (_TaikoL2Client *TaikoL2ClientFilterer) FilterEIP1559ConfigUpdated(opts *bind.FilterOpts) (*TaikoL2ClientEIP1559ConfigUpdatedIterator, error) { - - logs, sub, err := _TaikoL2Client.contract.FilterLogs(opts, "EIP1559ConfigUpdated") - if err != nil { - return nil, err - } - return &TaikoL2ClientEIP1559ConfigUpdatedIterator{contract: _TaikoL2Client.contract, event: "EIP1559ConfigUpdated", logs: logs, sub: sub}, nil -} - -// WatchEIP1559ConfigUpdated is a free log subscription operation binding the contract event 0x60807b646ebaa6bfeb242d7281f23e864f8ba09f3f0d16bfec4060fb4e48e77d. -// -// Solidity: event EIP1559ConfigUpdated((uint128,uint64,uint32) config, uint64 gasExcess) -func (_TaikoL2Client *TaikoL2ClientFilterer) WatchEIP1559ConfigUpdated(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientEIP1559ConfigUpdated) (event.Subscription, error) { - - logs, sub, err := _TaikoL2Client.contract.WatchLogs(opts, "EIP1559ConfigUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL2ClientEIP1559ConfigUpdated) - if err := _TaikoL2Client.contract.UnpackLog(event, "EIP1559ConfigUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseEIP1559ConfigUpdated is a log parse operation binding the contract event 0x60807b646ebaa6bfeb242d7281f23e864f8ba09f3f0d16bfec4060fb4e48e77d. -// -// Solidity: event EIP1559ConfigUpdated((uint128,uint64,uint32) config, uint64 gasExcess) -func (_TaikoL2Client *TaikoL2ClientFilterer) ParseEIP1559ConfigUpdated(log types.Log) (*TaikoL2ClientEIP1559ConfigUpdated, error) { - event := new(TaikoL2ClientEIP1559ConfigUpdated) - if err := _TaikoL2Client.contract.UnpackLog(event, "EIP1559ConfigUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - // TaikoL2ClientInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoL2Client contract. type TaikoL2ClientInitializedIterator struct { Event *TaikoL2ClientInitialized // Event containing the contract specifics and raw log From 28f660fd1d05d503b9da1e16e4eb3e1a9d01b77a Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 14:36:02 +0800 Subject: [PATCH 02/63] feat: update `encoding` package --- .github/workflows/test.yml | 1 + bindings/encoding/input.go | 219 ++++--------------------------- bindings/encoding/input_test.go | 136 +------------------ bindings/encoding/struct.go | 37 +++--- bindings/encoding/struct_test.go | 21 --- 5 files changed, 45 insertions(+), 369 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8dde3246..9e6063d86 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,7 @@ jobs: with: repository: taikoxyz/taiko-mono path: ${{ env.TAIKO_MONO_DIR }} + ref: contestable-zkrollup - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/bindings/encoding/input.go b/bindings/encoding/input.go index 12ec44ebb..65da78de7 100644 --- a/bindings/encoding/input.go +++ b/bindings/encoding/input.go @@ -1,103 +1,16 @@ package encoding import ( - "bytes" "errors" "fmt" "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" "github.com/taikoxyz/taiko-client/bindings" ) // ABI arguments marshaling components. var ( - blockMetadataInputComponents = []abi.ArgumentMarshaling{ - { - Name: "txListHash", - Type: "bytes32", - }, - { - Name: "proposer", - Type: "address", - }, - { - Name: "txListByteStart", - Type: "uint24", - }, - { - Name: "txListByteEnd", - Type: "uint24", - }, - { - Name: "cacheTxListInfo", - Type: "bool", - }, - } - blockMetadataComponents = []abi.ArgumentMarshaling{ - { - Name: "id", - Type: "uint64", - }, - { - Name: "timestamp", - Type: "uint64", - }, - { - Name: "l1Height", - Type: "uint64", - }, - { - Name: "l1Hash", - Type: "bytes32", - }, - { - Name: "mixHash", - Type: "bytes32", - }, - { - Name: "txListHash", - Type: "bytes32", - }, - { - Name: "txListByteStart", - Type: "uint24", - }, - { - Name: "txListByteEnd", - Type: "uint24", - }, - { - Name: "gasLimit", - Type: "uint32", - }, - { - Name: "proposer", - Type: "address", - }, - { - Name: "depositsProcessed", - Type: "tuple[]", - Components: []abi.ArgumentMarshaling{ - { - Name: "recipient", - Type: "address", - }, - { - Name: "amount", - Type: "uint96", - }, - { - Name: "id", - Type: "uint64", - }, - }, - }, - } evidenceComponents = []abi.ArgumentMarshaling{ { Name: "metaHash", @@ -120,11 +33,11 @@ var ( Type: "bytes32", }, { - Name: "prover", - Type: "address", + Name: "tier", + Type: "uint16", }, { - Name: "proofs", + Name: "proof", Type: "bytes", }, } @@ -134,48 +47,41 @@ var ( Type: "address", }, { - Name: "expiry", - Type: "uint64", - }, - { - Name: "data", - Type: "bytes", - }, - } - proposeBlockDataComponents = []abi.ArgumentMarshaling{ - { - Name: "input", - Type: "tuple", - Components: blockMetadataInputComponents, + Name: "feeToken", + Type: "address", }, { - Name: "fee", - Type: "uint256", + Name: "tierFees", + Type: "tuple[]", + Components: []abi.ArgumentMarshaling{ + { + Name: "tier", + Type: "uint64", + }, + { + Name: "fee", + Type: "uint256", + }, + }, }, - { Name: "expiry", Type: "uint64", }, + { + Name: "signature", + Type: "bytes", + }, } ) var ( - // BlockMetadataInput - blockMetadataInputType, _ = abi.NewType("tuple", "TaikoData.BlockMetadataInput", blockMetadataInputComponents) - blockMetadataInputArgs = abi.Arguments{{Name: "BlockMetadataInput", Type: blockMetadataInputType}} - // BlockMetadata - blockMetadataType, _ = abi.NewType("tuple", "TaikoData.BlockMetadata", blockMetadataComponents) - blockMetadataArgs = abi.Arguments{{Name: "BlockMetadata", Type: blockMetadataType}} // Evidence EvidenceType, _ = abi.NewType("tuple", "TaikoData.BlockEvidence", evidenceComponents) EvidenceArgs = abi.Arguments{{Name: "Evidence", Type: EvidenceType}} // ProverAssignment proverAssignmentType, _ = abi.NewType("tuple", "ProverAssignment", proverAssignmentComponents) proverAssignmentArgs = abi.Arguments{{Name: "ProverAssignment", Type: proverAssignmentType}} - // ProposeBlockData - proposeBlockDataType, _ = abi.NewType("tuple", "ProposeBlockData", proposeBlockDataComponents) - proposeBlockDataArgs = abi.Arguments{{Name: "ProposeBlockData", Type: proposeBlockDataType}} ) // Contract ABIs. @@ -196,24 +102,6 @@ func init() { } } -// EncodeBlockMetadataInput performs the solidity `abi.encode` for the given blockMetadataInput. -func EncodeBlockMetadataInput(meta *TaikoL1BlockMetadataInput) ([]byte, error) { - b, err := blockMetadataInputArgs.Pack(meta) - if err != nil { - return nil, fmt.Errorf("failed to abi.encode block metadata input, %w", err) - } - return b, nil -} - -// EncodeBlockMetadata performs the solidity `abi.encode` for the given blockMetadata. -func EncodeBlockMetadata(meta *bindings.TaikoDataBlockMetadata) ([]byte, error) { - b, err := blockMetadataArgs.Pack(meta) - if err != nil { - return nil, fmt.Errorf("failed to abi.encode block metadata, %w", err) - } - return b, nil -} - // EncodeProverAssignment performs the solidity `abi.encode` for the given proverAssignment. func EncodeProverAssignment(assignment *ProverAssignment) ([]byte, error) { b, err := proverAssignmentArgs.Pack(assignment) @@ -223,17 +111,8 @@ func EncodeProverAssignment(assignment *ProverAssignment) ([]byte, error) { return b, nil } -// EncodeProposeBlockData performs the solidity `abi.encode` for the given proposeBlockData. -func EncodeProposeBlockData(data *ProposeBlockData) ([]byte, error) { - b, err := proposeBlockDataArgs.Pack(data) - if err != nil { - return nil, fmt.Errorf("failed to abi.encode proposeBlock data, %w", err) - } - return b, nil -} - // EncodeEvidence performs the solidity `abi.encode` for the given evidence. -func EncodeEvidence(e *TaikoL1Evidence) ([]byte, error) { +func EncodeEvidence(e *BlockEvidence) ([]byte, error) { b, err := EvidenceArgs.Pack(e) if err != nil { return nil, fmt.Errorf("failed to abi.encode evidence, %w", err) @@ -241,60 +120,6 @@ func EncodeEvidence(e *TaikoL1Evidence) ([]byte, error) { return b, nil } -// EncodeCommitHash performs the solidity `abi.encodePacked` for the given -// commitHash components. -func EncodeCommitHash(beneficiary common.Address, txListHash [32]byte) []byte { - // keccak256(abi.encodePacked(beneficiary, txListHash)); - return crypto.Keccak256( - bytes.Join([][]byte{beneficiary.Bytes(), txListHash[:]}, nil), - ) -} - -// EncodeProposeBlockInput encodes the input params for TaikoL1.proposeBlock. -func EncodeProposeBlockInput(metadataInput *TaikoL1BlockMetadataInput) ([]byte, error) { - metaBytes, err := EncodeBlockMetadataInput(metadataInput) - if err != nil { - return nil, err - } - return metaBytes, nil -} - -// EncodeProveBlockInput encodes the input params for TaikoL1.proveBlock. -func EncodeProveBlockInput( - evidence *TaikoL1Evidence, -) ([]byte, error) { - evidenceBytes, err := EncodeEvidence(evidence) - if err != nil { - return nil, err - } - - return evidenceBytes, nil -} - -// EncodeProveBlockInvalidInput encodes the input params for TaikoL1.proveBlockInvalid. -func EncodeProveBlockInvalidInput( - evidence *TaikoL1Evidence, - target *bindings.TaikoDataBlockMetadata, - receipt *types.Receipt, -) ([][]byte, error) { - evidenceBytes, err := EncodeEvidence(evidence) - if err != nil { - return nil, err - } - - metaBytes, err := EncodeBlockMetadata(target) - if err != nil { - return nil, err - } - - receiptBytes, err := rlp.EncodeToBytes(receipt) - if err != nil { - return nil, err - } - - return [][]byte{evidenceBytes, metaBytes, receiptBytes}, nil -} - // UnpackTxListBytes unpacks the input data of a TaikoL1.proposeBlock transaction, and returns the txList bytes. func UnpackTxListBytes(txData []byte) ([]byte, error) { method, err := TaikoL1ABI.MethodById(txData) diff --git a/bindings/encoding/input_test.go b/bindings/encoding/input_test.go index 7b17cf93e..d031ffb6e 100644 --- a/bindings/encoding/input_test.go +++ b/bindings/encoding/input_test.go @@ -7,19 +7,17 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/require" - "github.com/taikoxyz/taiko-client/bindings" ) func TestEncodeEvidence(t *testing.T) { - evidence := &TaikoL1Evidence{ + evidence := &BlockEvidence{ MetaHash: randomHash(), BlockHash: randomHash(), ParentHash: randomHash(), SignalRoot: randomHash(), Graffiti: randomHash(), - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), + Tier: uint16(rand.Uint64()), Proofs: randomHash().Big().Bytes(), } @@ -29,40 +27,14 @@ func TestEncodeEvidence(t *testing.T) { require.NotEmpty(t, b) } -func TestEncodeCommitHash(t *testing.T) { - require.NotEmpty(t, EncodeCommitHash(common.BytesToAddress(randomHash().Bytes()), randomHash())) -} - -func TestEncodeProposeBlockInput(t *testing.T) { - encoded, err := EncodeProposeBlockInput(&testMetaInput) - - require.Nil(t, err) - require.NotNil(t, encoded) -} - -func TestEncodeProveBlockInput(t *testing.T) { - encoded, err := EncodeProveBlockInput( - &TaikoL1Evidence{ - MetaHash: randomHash(), - BlockHash: randomHash(), - ParentHash: randomHash(), - SignalRoot: randomHash(), - Graffiti: randomHash(), - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), - Proofs: randomHash().Big().Bytes(), - }, - ) - - require.Nil(t, err) - require.NotNil(t, encoded) -} - func TestEncodeProverAssignment(t *testing.T) { encoded, err := EncodeProverAssignment( &ProverAssignment{ - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), - Data: randomHash().Big().Bytes(), - Expiry: 1024, + Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), + FeeToken: common.Address{}, + TierFees: []*TierFee{}, + Signature: randomHash().Big().Bytes(), + Expiry: 1024, }, ) @@ -70,100 +42,6 @@ func TestEncodeProverAssignment(t *testing.T) { require.NotNil(t, encoded) } -func TestEncodeProveBlockInvalidInput(t *testing.T) { - encoded, err := EncodeProveBlockInvalidInput( - &TaikoL1Evidence{ - MetaHash: randomHash(), - BlockHash: randomHash(), - ParentHash: randomHash(), - SignalRoot: randomHash(), - Graffiti: randomHash(), - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), - Proofs: randomHash().Big().Bytes(), - }, - &testMeta, - types.NewReceipt(randomHash().Bytes(), false, 1024), - ) - - require.Nil(t, err) - require.NotNil(t, encoded) -} - -func TestEncodeBlockMetadata(t *testing.T) { - // since strings are right padded in solidity https://github.com/ethereum/solidity/issues/1340 - var abcdBytes [32]byte - copy(abcdBytes[:], common.RightPadBytes([]byte("abcd"), 32)) - - // Encode block metadata using EncodeBlockMetadata function - encoded, err := EncodeBlockMetadata(&bindings.TaikoDataBlockMetadata{ - Id: uint64(1), - L1Height: uint64(1), - L1Hash: abcdBytes, - Proposer: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), - TxListHash: abcdBytes, - TxListByteStart: big.NewInt(0), - TxListByteEnd: big.NewInt(1000), - GasLimit: 1, - MixHash: abcdBytes, - Timestamp: uint64(1), - DepositsProcessed: []bindings.TaikoDataEthDeposit{}, - }) - - require.Nil(t, err) - require.NotNil(t, encoded) - - kgv, err := hexutil.Decode("0x00000000000000000000000000000000000000000000000000000000" + - "0000002000000000000000000000000000000000000000000000000000000000000000010000000000000" + - "0000000000000000000000000000000000000000000000000010000000000000000000000000000000000" + - "0000000000000000000000000000016162636400000000000000000000000000000000000000000000000" + - "0000000006162636400000000000000000000000000000000000000000000000000000000616263640000" + - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + - "00000003e8000000000000000000000000000000000000000000000000000000000000000100000000000" + - "000000000000010020fcb72e27650651b05ed2ceca493bc807ba400000000000000000000000000000000" + - "0000000000000000000000000000016000000000000000000000000000000000000000000000000000000" + - "00000000000") - - require.Nil(t, err) - require.Equal(t, kgv, encoded) - - encoded2, err := EncodeBlockMetadata(&bindings.TaikoDataBlockMetadata{ - Id: uint64(1), - L1Height: uint64(1), - L1Hash: abcdBytes, - Proposer: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), - TxListHash: abcdBytes, - TxListByteStart: big.NewInt(0), - TxListByteEnd: big.NewInt(1000), - GasLimit: 1, - MixHash: abcdBytes, - Timestamp: uint64(1), - DepositsProcessed: []bindings.TaikoDataEthDeposit{ - {Recipient: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), Amount: big.NewInt(2), Id: uint64(1)}, - }, - }) - - require.Nil(t, err) - require.NotNil(t, encoded2) - - kgv2, err := hexutil.Decode("0x0000000000000000000000000000000000000000000000000000000" + - "0000000200000000000000000000000000000000000000000000000000000000000000001000000000000" + - "0000000000000000000000000000000000000000000000000001000000000000000000000000000000000" + - "0000000000000000000000000000001616263640000000000000000000000000000000000000000000000" + - "0000000000616263640000000000000000000000000000000000000000000000000000000061626364000" + - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + - "000000003e800000000000000000000000000000000000000000000000000000000000000010000000000" + - "0000000000000010020fcb72e27650651b05ed2ceca493bc807ba40000000000000000000000000000000" + - "0000000000000000000000000000001600000000000000000000000000000000000000000000000000000" + - "00000000000100000000000000000000000010020fcb72e27650651b05ed2ceca493bc807ba4000000000" + - "0000000000000000000000000000000000000000000000000000002000000000000000000000000000000" + - "0000000000000000000000000000000001") - - require.Nil(t, err) - require.Equal(t, kgv2, encoded2) -} - func TestUnpackTxListBytes(t *testing.T) { _, err := UnpackTxListBytes(randomBytes(1024)) require.NotNil(t, err) diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index d0f61fd59..a3f848b8c 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -8,10 +8,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) -var ( - OracleProverAddress = common.HexToAddress("0x0000000000000000000000000000000000000001") -) - +// BlockHeader represents an Ethereum block header. type BlockHeader struct { ParentHash [32]byte OmmersHash [32]byte @@ -31,34 +28,30 @@ type BlockHeader struct { BaseFeePerGas *big.Int } -type TaikoL1Evidence struct { +// BlockEvidence should be same with TaikoData.BlockEvidence. +type BlockEvidence struct { MetaHash [32]byte - BlockHash [32]byte ParentHash [32]byte + BlockHash [32]byte SignalRoot [32]byte Graffiti [32]byte - Prover common.Address + Tier uint16 Proofs []byte } -type TaikoL1BlockMetadataInput struct { - TxListHash [32]byte - Proposer common.Address - TxListByteStart *big.Int - TxListByteEnd *big.Int - CacheTxListInfo bool +// TierFee should be same with TaikoData.TierFee. +type TierFee struct { + Tier uint16 + Fee *big.Int } +// ProverAssignment should be same with TaikoData.ProverAssignment. type ProverAssignment struct { - Prover common.Address - Expiry uint64 - Data []byte -} - -type ProposeBlockData struct { - Input TaikoL1BlockMetadataInput `json:"input"` - Fee *big.Int `json:"fee"` - Expiry uint64 `json:"expiry"` + Prover common.Address + FeeToken common.Address + TierFees []*TierFee + Expiry uint64 + Signature []byte } // FromGethHeader converts a GETH *types.Header to *BlockHeader. diff --git a/bindings/encoding/struct_test.go b/bindings/encoding/struct_test.go index 00f05a105..03355fbab 100644 --- a/bindings/encoding/struct_test.go +++ b/bindings/encoding/struct_test.go @@ -11,7 +11,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/stretchr/testify/require" - "github.com/taikoxyz/taiko-client/bindings" ) var ( @@ -33,26 +32,6 @@ var ( Nonce: types.EncodeNonce(rand.Uint64()), BaseFee: new(big.Int).SetUint64(rand.Uint64()), } - testMetaInput = TaikoL1BlockMetadataInput{ - Proposer: common.BytesToAddress(randomHash().Bytes()), - TxListHash: randomHash(), - TxListByteStart: common.Big0, - TxListByteEnd: common.Big0, - CacheTxListInfo: false, - } - testMeta = bindings.TaikoDataBlockMetadata{ - Id: rand.Uint64(), - Timestamp: uint64(time.Now().Unix()), - L1Height: rand.Uint64(), - L1Hash: randomHash(), - MixHash: randomHash(), - TxListHash: randomHash(), - TxListByteStart: common.Big0, - TxListByteEnd: common.Big256, - GasLimit: rand.Uint32(), - Proposer: common.BytesToAddress(randomHash().Bytes()), - DepositsProcessed: []bindings.TaikoDataEthDeposit{}, - } ) func TestFromGethHeader(t *testing.T) { From 1dc851d57de7622a402325767f85fe4686a9769d Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 14:53:04 +0800 Subject: [PATCH 03/63] feat(cmd): update flags --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 53 ++++++++++++++++++++-------------------- cmd/flags/driver.go | 6 +++-- cmd/flags/proposer.go | 15 +++++++++--- cmd/flags/prover.go | 49 ++++++++++++++++++------------------- 5 files changed, 68 insertions(+), 57 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 2a79c6f19..7b8009c92 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -5a2aa133f37049dd2c81ed2b948bb3c3911e338f +29bfd962f9699f4c7836beb1845644a03fb1e484 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index da1bc4132..c8f0c452e 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -54,8 +54,9 @@ type TaikoDataBlock struct { // TaikoDataBlockMetadata is an auto generated low-level Go binding around an user-defined struct. type TaikoDataBlockMetadata struct { L1Hash [32]byte - MixHash [32]byte + Difficulty [32]byte TxListHash [32]byte + ExtraData [32]byte Id uint64 Timestamp uint64 L1Height uint64 @@ -135,7 +136,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -878,25 +879,25 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) OwnerWithdrawTaikoToken(to return _TaikoL1Client.Contract.OwnerWithdrawTaikoToken(&_TaikoL1Client.TransactOpts, to, amount) } -// ProposeBlock is a paid mutator transaction binding the contract method 0x9dbdb99d. +// ProposeBlock is a paid mutator transaction binding the contract method 0x04dc4c8b. // -// Solidity: function proposeBlock(bytes32 txListHash, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientTransactor) ProposeBlock(opts *bind.TransactOpts, txListHash [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.contract.Transact(opts, "proposeBlock", txListHash, assignment, txList) +// Solidity: function proposeBlock(bytes32 txListHash, bytes32 extraData, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientTransactor) ProposeBlock(opts *bind.TransactOpts, txListHash [32]byte, extraData [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "proposeBlock", txListHash, extraData, assignment, txList) } -// ProposeBlock is a paid mutator transaction binding the contract method 0x9dbdb99d. +// ProposeBlock is a paid mutator transaction binding the contract method 0x04dc4c8b. // -// Solidity: function proposeBlock(bytes32 txListHash, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientSession) ProposeBlock(txListHash [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, txListHash, assignment, txList) +// Solidity: function proposeBlock(bytes32 txListHash, bytes32 extraData, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientSession) ProposeBlock(txListHash [32]byte, extraData [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, txListHash, extraData, assignment, txList) } -// ProposeBlock is a paid mutator transaction binding the contract method 0x9dbdb99d. +// ProposeBlock is a paid mutator transaction binding the contract method 0x04dc4c8b. // -// Solidity: function proposeBlock(bytes32 txListHash, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProposeBlock(txListHash [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, txListHash, assignment, txList) +// Solidity: function proposeBlock(bytes32 txListHash, bytes32 extraData, bytes assignment, bytes txList) payable returns((bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProposeBlock(txListHash [32]byte, extraData [32]byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, txListHash, extraData, assignment, txList) } // ProveBlock is a paid mutator transaction binding the contract method 0x10d008bd. @@ -1268,9 +1269,9 @@ type TaikoL1ClientBlockProposed struct { Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed is a free log retrieval operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. +// FilterBlockProposed is a free log retrieval operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { var blockIdRule []interface{} @@ -1289,9 +1290,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.Filt return &TaikoL1ClientBlockProposedIterator{contract: _TaikoL1Client.contract, event: "BlockProposed", logs: logs, sub: sub}, nil } -// WatchBlockProposed is a free log subscription operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. +// WatchBlockProposed is a free log subscription operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} @@ -1335,9 +1336,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.Watch }), nil } -// ParseBlockProposed is a log parse operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. +// ParseBlockProposed is a log parse operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed(log types.Log) (*TaikoL1ClientBlockProposed, error) { event := new(TaikoL1ClientBlockProposed) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed", log); err != nil { @@ -1425,9 +1426,9 @@ type TaikoL1ClientBlockProposed0 struct { Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. +// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { var blockIdRule []interface{} @@ -1446,9 +1447,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.Fil return &TaikoL1ClientBlockProposed0Iterator{contract: _TaikoL1Client.contract, event: "BlockProposed0", logs: logs, sub: sub}, nil } -// WatchBlockProposed0 is a free log subscription operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. +// WatchBlockProposed0 is a free log subscription operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} @@ -1492,9 +1493,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.Watc }), nil } -// ParseBlockProposed0 is a log parse operation binding the contract event 0x26243d4c335230f74fc3472f2c10f44e8d055c3107473e90be831fcbfe70d889. +// ParseBlockProposed0 is a log parse operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed0(log types.Log) (*TaikoL1ClientBlockProposed0, error) { event := new(TaikoL1ClientBlockProposed0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed0", log); err != nil { diff --git a/cmd/flags/driver.go b/cmd/flags/driver.go index b84d64362..53218736b 100644 --- a/cmd/flags/driver.go +++ b/cmd/flags/driver.go @@ -1,6 +1,8 @@ package flags import ( + "time" + "github.com/urfave/cli/v2" ) @@ -29,11 +31,11 @@ var ( Value: false, Category: driverCategory, } - P2PSyncTimeout = &cli.UintFlag{ + P2PSyncTimeout = &cli.DurationFlag{ Name: "p2p.syncTimeout", Usage: "P2P syncing timeout in seconds, if no sync progress is made within this time span, " + "driver will stop the P2P sync and insert all remaining L2 blocks one by one", - Value: 1800, + Value: 1 * time.Hour, Category: driverCategory, } CheckPointSyncUrl = &cli.StringFlag{ diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 3ead92e0f..c6b4ed3cc 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -21,11 +21,13 @@ var ( ProverEndpoints = &cli.StringFlag{ Name: "proverEndpoints", Usage: "Comma-delineated list of prover endpoints proposer should query when attempting to propose a block", + Required: true, Category: proposerCategory, } BlockProposalFee = &cli.StringFlag{ Name: "blockProposalFee", Usage: "Initial block proposal fee (in wei) paid on block proposing", + Required: true, Category: proposerCategory, } TaikoTokenAddress = &cli.StringFlag{ @@ -38,12 +40,18 @@ var ( // Optional flags used by proposer. var ( - ProposeInterval = &cli.StringFlag{ + ExtraData = &cli.StringFlag{ + Name: "extraData", + Usage: "Block extra data set by the proposer", + Value: "", + Category: proposerCategory, + } + ProposeInterval = &cli.DurationFlag{ Name: "proposeInterval", Usage: "Time interval to propose L2 pending transactions", Category: proposerCategory, } - TxPoolLocals = &cli.StringFlag{ + TxPoolLocals = &cli.StringSliceFlag{ Name: "txpool.locals", Usage: "Comma separated accounts to treat as locals (priority inclusion)", Category: proposerCategory, @@ -54,7 +62,7 @@ var ( Value: false, Category: proposerCategory, } - ProposeEmptyBlocksInterval = &cli.StringFlag{ + ProposeEmptyBlocksInterval = &cli.DurationFlag{ Name: "proposeEmptyBlockInterval", Usage: "Time interval to propose empty blocks", Category: proposerCategory, @@ -102,6 +110,7 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ ProposeInterval, TxPoolLocals, TxPoolLocalsOnly, + ExtraData, ProposeEmptyBlocksInterval, MaxProposedTxListsPerEpoch, ProposeBlockTxGasLimit, diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index e7b6af69d..dbaf0f109 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -21,9 +21,8 @@ var ( Category: proverCategory, } L1ProverPrivKey = &cli.StringFlag{ - Name: "l1.proverPrivKey", - Usage: "Private key of L1 prover, " + - "who will send TaikoL1.proveBlock / TaikoL1.proveBlockInvalid transactions", + Name: "l1.proverPrivKey", + Usage: "Private key of L1 prover, who will send TaikoL1.proveBlock transactions", Required: true, Category: proverCategory, } @@ -48,19 +47,6 @@ var ( Value: 1, Category: proverCategory, } - // Special flags for testing. - Dummy = &cli.BoolFlag{ - Name: "dummy", - Usage: "Produce dummy proofs, testing purposes only", - Value: false, - Category: proverCategory, - } - RandomDummyProofDelay = &cli.StringFlag{ - Name: "randomDummyProofDelay", - Usage: "Set the random dummy proof delay between the bounds using the format: " + - "`lowerBound-upperBound` (e.g. `30m-1h`), testing purposes only", - Category: proverCategory, - } OracleProver = &cli.BoolFlag{ Name: "oracleProver", Usage: "Set whether prover should use oracle prover or not", @@ -71,10 +57,10 @@ var ( Usage: "Private key of oracle prover", Category: proverCategory, } - OracleProofSubmissionDelay = &cli.Uint64Flag{ + OracleProofSubmissionDelay = &cli.DurationFlag{ Name: "oracleProofSubmissionDelay", - Usage: "Oracle proof submission delay in seconds", - Value: 0, + Usage: "Oracle proof submission delay", + Value: 0 * time.Second, Category: proverCategory, } ProofSubmissionMaxRetry = &cli.Uint64Flag{ @@ -89,11 +75,11 @@ var ( Category: proverCategory, Value: "", } - CheckProofWindowExpiredInterval = &cli.Uint64Flag{ + CheckProofWindowExpiredInterval = &cli.DurationFlag{ Name: "prover.checkProofWindowExpiredInterval", - Usage: "Interval in seconds to check for expired proof windows from other provers", + Usage: "Interval to check for expired proof windows from other provers", Category: proverCategory, - Value: 15, + Value: 15 * time.Second, } ProveUnassignedBlocks = &cli.BoolFlag{ Name: "prover.proveUnassignedBlocks", @@ -128,18 +114,31 @@ var ( Usage: "Capacity of prover, required if oracleProver is false", Category: proverCategory, } - MaxExpiry = &cli.Uint64Flag{ + MaxExpiry = &cli.DurationFlag{ Name: "prover.maxExpiry", Usage: "maximum accepted expiry in seconds for accepting proving a block", - Value: uint64(time.Hour.Seconds()), + Value: 1 * time.Hour, Category: proverCategory, } TempCapacityExpiresAt = &cli.DurationFlag{ Name: "prover.tempCapacityExpiresAt", - Usage: "time in seconds temporary capacity lives for, format: 36s", + Usage: "time in seconds temporary capacity lives for (format: 36s)", Value: 36 * time.Second, Category: proverCategory, } + // Special flags for testing. + Dummy = &cli.BoolFlag{ + Name: "dummy", + Usage: "Produce dummy proofs, testing purposes only", + Value: false, + Category: proverCategory, + } + RandomDummyProofDelay = &cli.StringFlag{ + Name: "randomDummyProofDelay", + Usage: "Set the random dummy proof delay between the bounds using the format: " + + "`lowerBound-upperBound` (e.g. `30m-1h`), testing purposes only", + Category: proverCategory, + } ) // All prover flags. From 7cb6d702eb2528ab935b9042eeeb8ea2cced86d1 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 15:07:25 +0800 Subject: [PATCH 04/63] feat: update configs --- cmd/flags/common.go | 14 ++++--- cmd/flags/prover.go | 18 +++----- driver/config.go | 6 +-- driver/config_test.go | 8 ++-- proposer/config.go | 19 ++++----- proposer/config_test.go | 12 +++--- prover/config.go | 92 +++++++++++------------------------------ prover/config_test.go | 21 +++------- 8 files changed, 66 insertions(+), 124 deletions(-) diff --git a/cmd/flags/common.go b/cmd/flags/common.go index 4f94daeec..be4eb2c07 100644 --- a/cmd/flags/common.go +++ b/cmd/flags/common.go @@ -1,6 +1,8 @@ package flags import ( + "time" + "github.com/urfave/cli/v2" ) @@ -89,22 +91,22 @@ var ( Category: commonCategory, Value: 10, } - BackOffRetryInterval = &cli.Uint64Flag{ + BackOffRetryInterval = &cli.DurationFlag{ Name: "backoff.retryInterval", Usage: "Retry interval in seconds when there is an error", Category: commonCategory, - Value: 12, + Value: 12 * time.Second, } - RPCTimeout = &cli.Uint64Flag{ + RPCTimeout = &cli.DurationFlag{ Name: "rpc.timeout", Usage: "Timeout in seconds for RPC calls", Category: commonCategory, } - WaitReceiptTimeout = &cli.Uint64Flag{ + WaitReceiptTimeout = &cli.DurationFlag{ Name: "rpc.waitReceiptTimeout", - Usage: "Timeout in seconds for wait for receipts for RPC transactions", + Usage: "Timeout for wait for receipts for RPC transactions", Category: commonCategory, - Value: 60, + Value: 1 * time.Minute, } ) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index dbaf0f109..72b5f203b 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -32,6 +32,12 @@ var ( Required: true, Category: proverCategory, } + ProverCapacity = &cli.Uint64Flag{ + Name: "prover.capacity", + Usage: "Capacity of prover, required if oracleProver is false", + Required: true, + Category: proverCategory, + } ) // Optional flags used by prover. @@ -109,11 +115,6 @@ var ( Category: proverCategory, Value: 9876, } - ProverCapacity = &cli.Uint64Flag{ - Name: "prover.capacity", - Usage: "Capacity of prover, required if oracleProver is false", - Category: proverCategory, - } MaxExpiry = &cli.DurationFlag{ Name: "prover.maxExpiry", Usage: "maximum accepted expiry in seconds for accepting proving a block", @@ -133,12 +134,6 @@ var ( Value: false, Category: proverCategory, } - RandomDummyProofDelay = &cli.StringFlag{ - Name: "randomDummyProofDelay", - Usage: "Set the random dummy proof delay between the bounds using the format: " + - "`lowerBound-upperBound` (e.g. `30m-1h`), testing purposes only", - Category: proverCategory, - } ) // All prover flags. @@ -153,7 +148,6 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ StartingBlockID, MaxConcurrentProvingJobs, Dummy, - RandomDummyProofDelay, OracleProver, OracleProverPrivateKey, OracleProofSubmissionDelay, diff --git a/driver/config.go b/driver/config.go index 37135c095..646946cc2 100644 --- a/driver/config.go +++ b/driver/config.go @@ -46,7 +46,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { var timeout *time.Duration if c.IsSet(flags.RPCTimeout.Name) { - duration := time.Duration(c.Uint64(flags.RPCTimeout.Name)) * time.Second + duration := c.Duration(flags.RPCTimeout.Name) timeout = &duration } @@ -59,8 +59,8 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)), JwtSecret: string(jwtSecret), P2PSyncVerifiedBlocks: p2pSyncVerifiedBlocks, - P2PSyncTimeout: time.Duration(int64(time.Second) * int64(c.Uint(flags.P2PSyncTimeout.Name))), - BackOffRetryInterval: time.Duration(c.Uint64(flags.BackOffRetryInterval.Name)) * time.Second, + P2PSyncTimeout: c.Duration(flags.P2PSyncTimeout.Name), + BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), RPCTimeout: timeout, }, nil } diff --git a/driver/config_test.go b/driver/config_test.go index fee0104e1..82836dc21 100644 --- a/driver/config_test.go +++ b/driver/config_test.go @@ -47,8 +47,8 @@ func (s *DriverTestSuite) TestNewConfigFromCliContext() { "--" + flags.TaikoL1Address.Name, taikoL1, "--" + flags.TaikoL2Address.Name, taikoL2, "--" + flags.JWTSecret.Name, os.Getenv("JWT_SECRET"), - "--" + flags.P2PSyncTimeout.Name, "120", - "--" + flags.RPCTimeout.Name, "5", + "--" + flags.P2PSyncTimeout.Name, "120s", + "--" + flags.RPCTimeout.Name, "5s", "--" + flags.P2PSyncVerifiedBlocks.Name, "--" + flags.CheckPointSyncUrl.Name, "http://localhost:8545", })) @@ -82,8 +82,8 @@ func (s *DriverTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.TaikoL2Address.Name}, &cli.StringFlag{Name: flags.JWTSecret.Name}, &cli.BoolFlag{Name: flags.P2PSyncVerifiedBlocks.Name}, - &cli.UintFlag{Name: flags.P2PSyncTimeout.Name}, - &cli.UintFlag{Name: flags.RPCTimeout.Name}, + &cli.DurationFlag{Name: flags.P2PSyncTimeout.Name}, + &cli.DurationFlag{Name: flags.RPCTimeout.Name}, &cli.StringFlag{Name: flags.CheckPointSyncUrl.Name}, } app.Action = func(ctx *cli.Context) error { diff --git a/proposer/config.go b/proposer/config.go index 34428ef7c..9a4d76eec 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -23,6 +23,7 @@ type Config struct { TaikoTokenAddress common.Address L1ProposerPrivKey *ecdsa.PrivateKey L2SuggestedFeeRecipient common.Address + ExtraData string ProposeInterval *time.Duration LocalAddresses []common.Address LocalAddressesOnly bool @@ -53,18 +54,13 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { // Proposing configuration var proposingInterval *time.Duration if c.IsSet(flags.ProposeInterval.Name) { - interval, err := time.ParseDuration(c.String(flags.ProposeInterval.Name)) - if err != nil { - return nil, fmt.Errorf("invalid proposing interval: %w", err) - } + interval := c.Duration(flags.ProposeInterval.Name) proposingInterval = &interval } + var proposeEmptyBlocksInterval *time.Duration if c.IsSet(flags.ProposeEmptyBlocksInterval.Name) { - interval, err := time.ParseDuration(c.String(flags.ProposeEmptyBlocksInterval.Name)) - if err != nil { - return nil, fmt.Errorf("invalid proposing empty blocks interval: %w", err) - } + interval := c.Duration(flags.ProposeEmptyBlocksInterval.Name) proposeEmptyBlocksInterval = &interval } @@ -100,7 +96,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { var timeout *time.Duration if c.IsSet(flags.RPCTimeout.Name) { - duration := time.Duration(c.Uint64(flags.RPCTimeout.Name)) * time.Second + duration := c.Duration(flags.RPCTimeout.Name) timeout = &duration } @@ -131,16 +127,17 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { TaikoTokenAddress: common.HexToAddress(c.String(flags.TaikoTokenAddress.Name)), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(l2SuggestedFeeRecipient), + ExtraData: c.String(flags.ExtraData.Name), ProposeInterval: proposingInterval, LocalAddresses: localAddresses, LocalAddressesOnly: c.Bool(flags.TxPoolLocalsOnly.Name), ProposeEmptyBlocksInterval: proposeEmptyBlocksInterval, MaxProposedTxListsPerEpoch: c.Uint64(flags.MaxProposedTxListsPerEpoch.Name), ProposeBlockTxGasLimit: proposeBlockTxGasLimit, - BackOffRetryInterval: time.Duration(c.Uint64(flags.BackOffRetryInterval.Name)) * time.Second, + BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), ProposeBlockTxReplacementMultiplier: proposeBlockTxReplacementMultiplier, RPCTimeout: timeout, - WaitReceiptTimeout: time.Duration(c.Uint64(flags.WaitReceiptTimeout.Name)) * time.Second, + WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProposeBlockTxGasTipCap: proposeBlockTxGasTipCap, ProverEndpoints: proverEndpoints, BlockProposalFee: blockProposalFee, diff --git a/proposer/config_test.go b/proposer/config_test.go index ac880005e..7b84f5d47 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -76,8 +76,8 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { "--" + flags.ProposeInterval.Name, proposeInterval, "--" + flags.TxPoolLocals.Name, goldenTouchAddress.Hex(), "--" + flags.ProposeBlockTxReplacementMultiplier.Name, "5", - "--" + flags.RPCTimeout.Name, "5", - "--" + flags.WaitReceiptTimeout.Name, "10", + "--" + flags.RPCTimeout.Name, "5s", + "--" + flags.WaitReceiptTimeout.Name, "10s", "--" + flags.ProposeBlockTxGasTipCap.Name, "100000", "--" + flags.ProposeBlockTxGasLimit.Name, "100000", "--" + flags.ProverEndpoints.Name, proverEndpoints, @@ -187,14 +187,14 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.TaikoTokenAddress.Name}, &cli.StringFlag{Name: flags.L1ProposerPrivKey.Name}, &cli.StringFlag{Name: flags.L2SuggestedFeeRecipient.Name}, - &cli.StringFlag{Name: flags.ProposeEmptyBlocksInterval.Name}, - &cli.StringFlag{Name: flags.ProposeInterval.Name}, + &cli.DurationFlag{Name: flags.ProposeEmptyBlocksInterval.Name}, + &cli.DurationFlag{Name: flags.ProposeInterval.Name}, &cli.StringFlag{Name: flags.TxPoolLocals.Name}, &cli.StringFlag{Name: flags.ProverEndpoints.Name}, &cli.Uint64Flag{Name: flags.BlockProposalFee.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxReplacementMultiplier.Name}, - &cli.Uint64Flag{Name: flags.RPCTimeout.Name}, - &cli.Uint64Flag{Name: flags.WaitReceiptTimeout.Name}, + &cli.DurationFlag{Name: flags.RPCTimeout.Name}, + &cli.DurationFlag{Name: flags.WaitReceiptTimeout.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasTipCap.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasLimit.Name}, &cli.Uint64Flag{Name: flags.BlockProposalFeeIncreasePercentage.Name}, diff --git a/prover/config.go b/prover/config.go index c9c42d4a6..5ba898ac6 100644 --- a/prover/config.go +++ b/prover/config.go @@ -4,7 +4,6 @@ import ( "crypto/ecdsa" "fmt" "math/big" - "strings" "time" "github.com/ethereum/go-ethereum/common" @@ -33,8 +32,6 @@ type Config struct { OracleProofSubmissionDelay time.Duration ProofSubmissionMaxRetry uint64 Graffiti string - RandomDummyProofDelayLowerBound *time.Duration - RandomDummyProofDelayUpperBound *time.Duration BackOffMaxRetrys uint64 BackOffRetryInterval time.Duration CheckProofWindowExpiredInterval time.Duration @@ -60,10 +57,8 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, fmt.Errorf("invalid L1 prover private key: %w", err) } - oracleProverSet := c.IsSet(flags.OracleProver.Name) - var oracleProverPrivKey *ecdsa.PrivateKey - if oracleProverSet { + if c.IsSet(flags.OracleProver.Name) { if !c.IsSet(flags.OracleProverPrivateKey.Name) { return nil, fmt.Errorf("oracleProver flag set without oracleProverPrivateKey set") } @@ -72,39 +67,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { if err != nil { return nil, fmt.Errorf("invalid oracle private key: %w", err) } - } else { - if !c.IsSet(flags.ProverCapacity.Name) { - return nil, fmt.Errorf("capacity is required if oracleProver is not set to true") - } - } - - var ( - randomDummyProofDelayLowerBound *time.Duration - randomDummyProofDelayUpperBound *time.Duration - ) - if c.IsSet(flags.RandomDummyProofDelay.Name) { - flagValue := c.String(flags.RandomDummyProofDelay.Name) - splitted := strings.Split(flagValue, "-") - if len(splitted) != 2 { - return nil, fmt.Errorf("invalid random dummy proof delay value: %s", flagValue) - } - - lower, err := time.ParseDuration(splitted[0]) - if err != nil { - return nil, fmt.Errorf("invalid random dummy proof delay value: %s, err: %w", flagValue, err) - } - upper, err := time.ParseDuration(splitted[1]) - if err != nil { - return nil, fmt.Errorf("invalid random dummy proof delay value: %s, err: %w", flagValue, err) - } - if lower > upper { - return nil, fmt.Errorf("invalid random dummy proof delay value (lower > upper): %s", flagValue) - } - - if upper != time.Duration(0) { - randomDummyProofDelayLowerBound = &lower - randomDummyProofDelayUpperBound = &upper - } } var startingBlockID *big.Int @@ -114,7 +76,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { var timeout *time.Duration if c.IsSet(flags.RPCTimeout.Name) { - duration := time.Duration(c.Uint64(flags.RPCTimeout.Name)) * time.Second + duration := c.Duration(flags.RPCTimeout.Name) timeout = &duration } @@ -143,34 +105,30 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } return &Config{ - L1WsEndpoint: c.String(flags.L1WSEndpoint.Name), - L1HttpEndpoint: c.String(flags.L1HTTPEndpoint.Name), - L2WsEndpoint: c.String(flags.L2WSEndpoint.Name), - L2HttpEndpoint: c.String(flags.L2HTTPEndpoint.Name), - TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)), - TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)), - TaikoTokenAddress: common.HexToAddress(c.String(flags.TaikoTokenAddress.Name)), - L1ProverPrivKey: l1ProverPrivKey, - ZKEvmRpcdEndpoint: c.String(flags.ZkEvmRpcdEndpoint.Name), - ZkEvmRpcdParamsPath: c.String(flags.ZkEvmRpcdParamsPath.Name), - StartingBlockID: startingBlockID, - MaxConcurrentProvingJobs: c.Uint(flags.MaxConcurrentProvingJobs.Name), - Dummy: c.Bool(flags.Dummy.Name), - OracleProver: c.Bool(flags.OracleProver.Name), - OracleProverPrivateKey: oracleProverPrivKey, - OracleProofSubmissionDelay: time.Duration(c.Uint64(flags.OracleProofSubmissionDelay.Name)) * time.Second, - ProofSubmissionMaxRetry: c.Uint64(flags.ProofSubmissionMaxRetry.Name), - Graffiti: c.String(flags.Graffiti.Name), - RandomDummyProofDelayLowerBound: randomDummyProofDelayLowerBound, - RandomDummyProofDelayUpperBound: randomDummyProofDelayUpperBound, - BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), - BackOffRetryInterval: time.Duration(c.Uint64(flags.BackOffRetryInterval.Name)) * time.Second, - CheckProofWindowExpiredInterval: time.Duration( - c.Uint64(flags.CheckProofWindowExpiredInterval.Name), - ) * time.Second, + L1WsEndpoint: c.String(flags.L1WSEndpoint.Name), + L1HttpEndpoint: c.String(flags.L1HTTPEndpoint.Name), + L2WsEndpoint: c.String(flags.L2WSEndpoint.Name), + L2HttpEndpoint: c.String(flags.L2HTTPEndpoint.Name), + TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)), + TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)), + TaikoTokenAddress: common.HexToAddress(c.String(flags.TaikoTokenAddress.Name)), + L1ProverPrivKey: l1ProverPrivKey, + ZKEvmRpcdEndpoint: c.String(flags.ZkEvmRpcdEndpoint.Name), + ZkEvmRpcdParamsPath: c.String(flags.ZkEvmRpcdParamsPath.Name), + StartingBlockID: startingBlockID, + MaxConcurrentProvingJobs: c.Uint(flags.MaxConcurrentProvingJobs.Name), + Dummy: c.Bool(flags.Dummy.Name), + OracleProver: c.Bool(flags.OracleProver.Name), + OracleProverPrivateKey: oracleProverPrivKey, + OracleProofSubmissionDelay: c.Duration(flags.OracleProofSubmissionDelay.Name), + ProofSubmissionMaxRetry: c.Uint64(flags.ProofSubmissionMaxRetry.Name), + Graffiti: c.String(flags.Graffiti.Name), + BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), + BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), + CheckProofWindowExpiredInterval: c.Duration(flags.CheckProofWindowExpiredInterval.Name), ProveUnassignedBlocks: c.Bool(flags.ProveUnassignedBlocks.Name), RPCTimeout: timeout, - WaitReceiptTimeout: time.Duration(c.Uint64(flags.WaitReceiptTimeout.Name)) * time.Second, + WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProveBlockGasLimit: proveBlockTxGasLimit, Capacity: c.Uint64(flags.ProverCapacity.Name), TempCapacityExpiresAt: c.Duration(flags.TempCapacityExpiresAt.Name), @@ -178,6 +136,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { ProveBlockMaxTxGasTipCap: proveBlockMaxTxGasTipCap, HTTPServerPort: c.Uint64(flags.ProverHTTPServerPort.Name), MinProofFee: minProofFee, - MaxExpiry: time.Duration(c.Uint64(flags.MaxExpiry.Name)) * time.Second, + MaxExpiry: c.Duration(flags.MaxExpiry.Name), }, nil } diff --git a/prover/config_test.go b/prover/config_test.go index 130c507de..988755cc4 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -36,8 +36,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { crypto.PubkeyToAddress(s.p.cfg.L1ProverPrivKey.PublicKey), crypto.PubkeyToAddress(c.L1ProverPrivKey.PublicKey), ) - s.Equal(30*time.Minute, *c.RandomDummyProofDelayLowerBound) - s.Equal(time.Hour, *c.RandomDummyProofDelayUpperBound) s.True(c.Dummy) s.True(c.OracleProver) s.Equal( @@ -69,10 +67,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { "--" + flags.TaikoL2Address.Name, taikoL2, "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.StartingBlockID.Name, "0", - "--" + flags.RPCTimeout.Name, "5", + "--" + flags.RPCTimeout.Name, "5s", "--" + flags.ProveBlockTxGasLimit.Name, "100000", "--" + flags.Dummy.Name, - "--" + flags.RandomDummyProofDelay.Name, "30m-1h", "--" + flags.MinProofFee.Name, minProofFee, "--" + flags.ProverCapacity.Name, "8", "--" + flags.OracleProver.Name, @@ -80,7 +77,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { "--" + flags.ProveBlockMaxTxGasTipCap.Name, "256", "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.Graffiti.Name, "", - "--" + flags.CheckProofWindowExpiredInterval.Name, "30", + "--" + flags.CheckProofWindowExpiredInterval.Name, "30s", "--" + flags.TempCapacityExpiresAt.Name, "15s", "--" + flags.ProveUnassignedBlocks.Name, })) @@ -99,10 +96,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { "--" + flags.TaikoL2Address.Name, taikoL2, "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.Dummy.Name, - "--" + flags.RandomDummyProofDelay.Name, "30m-1h", "--" + flags.OracleProver.Name, "--" + flags.Graffiti.Name, "", - "--" + flags.RPCTimeout.Name, "5", + "--" + flags.RPCTimeout.Name, "5s", "--" + flags.MinProofFee.Name, minProofFee, }), "oracleProver flag set without oracleProverPrivateKey set") } @@ -135,7 +131,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayError() { "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProver.Name, - "--" + flags.RandomDummyProofDelay.Name, "130m", "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -148,7 +143,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorLower() { "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProver.Name, - "--" + flags.RandomDummyProofDelay.Name, "30x-1h", "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -161,7 +155,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorUpper() { "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProver.Name, - "--" + flags.RandomDummyProofDelay.Name, "30m-1x", "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -174,7 +167,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorOrder() { "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.OracleProver.Name, - "--" + flags.RandomDummyProofDelay.Name, "1h-30m", "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value (lower > upper)") } @@ -191,16 +183,15 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, &cli.Uint64Flag{Name: flags.StartingBlockID.Name}, &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, &cli.BoolFlag{Name: flags.OracleProver.Name}, &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, - &cli.Uint64Flag{Name: flags.CheckProofWindowExpiredInterval.Name}, + &cli.DurationFlag{Name: flags.CheckProofWindowExpiredInterval.Name}, &cli.BoolFlag{Name: flags.ProveUnassignedBlocks.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxReplacementMultiplier.Name}, &cli.Uint64Flag{Name: flags.ProveBlockMaxTxGasTipCap.Name}, - &cli.Uint64Flag{Name: flags.RPCTimeout.Name}, - &cli.Uint64Flag{Name: flags.ProverCapacity.Name}, + &cli.DurationFlag{Name: flags.RPCTimeout.Name}, + &cli.DurationFlag{Name: flags.ProverCapacity.Name}, &cli.Uint64Flag{Name: flags.MinProofFee.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxGasLimit.Name}, &cli.DurationFlag{Name: flags.TempCapacityExpiresAt.Name}, From 11fa6f62190bea635dcb478d57a4c14249aecece Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 15:25:51 +0800 Subject: [PATCH 05/63] feat(prover): update prover server --- bindings/encoding/input.go | 12 ++++++ go.mod | 11 ------ go.sum | 78 -------------------------------------- proposer/proposer.go | 1 - prover/server/api.go | 51 +++++++++++++++++++------ prover/server/api_test.go | 15 +++----- 6 files changed, 56 insertions(+), 112 deletions(-) diff --git a/bindings/encoding/input.go b/bindings/encoding/input.go index 65da78de7..d09741dd5 100644 --- a/bindings/encoding/input.go +++ b/bindings/encoding/input.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" ) @@ -120,6 +121,17 @@ func EncodeEvidence(e *BlockEvidence) ([]byte, error) { return b, nil } +// EncodeProverAssignmentPayload performs the solidity `abi.encode` for the given proverAssignment payload. +func EncodeProverAssignmentPayload( + txListHash common.Hash, + feeToken common.Address, + expiry uint64, + tierFees []*TierFee, +) ([]byte, error) { + // TODO: implement this function. + return nil, nil +} + // UnpackTxListBytes unpacks the input data of a TaikoL1.proposeBlock transaction, and returns the txList bytes. func UnpackTxListBytes(txData []byte) ([]byte, error) { method, err := TaikoL1ABI.MethodById(txData) diff --git a/go.mod b/go.mod index 703a6608a..8f938d890 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.21 require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/cenkalti/backoff/v4 v4.1.3 - github.com/cyberhorsey/webutils v0.0.0-20230314183728-56890c6ddbe7 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 github.com/ethereum/go-ethereum v1.12.2 github.com/go-resty/resty/v2 v2.7.0 @@ -22,7 +21,6 @@ require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/KyleBanks/depth v1.2.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.0 // indirect - github.com/aymerick/douceur v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.7.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect @@ -35,7 +33,6 @@ require ( github.com/consensys/gnark-crypto v0.10.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect - github.com/cyberhorsey/errors v0.0.0-20220929234051-087d6d8bb841 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/ethereum/c-kzg-4844 v0.3.1 // indirect @@ -46,9 +43,6 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/spec v0.20.9 // indirect github.com/go-openapi/swag v0.22.4 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -57,7 +51,6 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/uuid v1.3.0 // indirect - github.com/gorilla/css v1.0.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.3 // indirect @@ -69,18 +62,15 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/labstack/gommon v0.4.0 // indirect - github.com/leodido/go-urn v1.2.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/microcosm-cc/bluemonday v1.0.21 // indirect github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/neko-neko/echo-logrus/v2 v2.0.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -111,7 +101,6 @@ require ( golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.13.0 // indirect - google.golang.org/grpc v1.40.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index b26ee3c5a..687afadb4 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= @@ -9,17 +8,13 @@ github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwS github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.0 h1:vnVi/y9yKDcD9akmc4NqAoqgQhJrOwUF+j9LTgn4QDE= github.com/VictoriaMetrics/fastcache v1.12.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bazelbuild/rules_go v0.23.2 h1:Wxu7JjqnF78cKZbsBsARLSXx/jlGaSLCnUV3mTlyHvM= github.com/bazelbuild/rules_go v0.23.2/go.mod h1:MC23Dc/wkXEyk3Wpq6lCqz0ZAYOZDw2DR5y3N1q2i7M= @@ -36,18 +31,14 @@ github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= @@ -73,10 +64,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberhorsey/errors v0.0.0-20220929234051-087d6d8bb841 h1:FaPua89k9KmkkiptlTAmYzcTsn1IFdQsqneuFO6IAu8= -github.com/cyberhorsey/errors v0.0.0-20220929234051-087d6d8bb841/go.mod h1:qSH/IvpdArCjfny4ODMko/7U0z4JoNIWctgCnUrapnI= -github.com/cyberhorsey/webutils v0.0.0-20230314183728-56890c6ddbe7 h1:KYOh2RfWAltxYsfD/Ar5D3zB4+AuNQejXW5BvMlGor4= -github.com/cyberhorsey/webutils v0.0.0-20230314183728-56890c6ddbe7/go.mod h1:bNNUHadsCy1HleNUToQ/t11vmKI9/+9Taw8K6GyxERo= github.com/d4l3k/messagediff v1.2.1 h1:ZcAIMYsUg0EAp9X+tt8/enBE/Q8Yd5kzPynLyKptt9U= github.com/d4l3k/messagediff v1.2.1/go.mod h1:Oozbb1TVXFac9FtSIxHBMnBCq2qeH/2KkEQxENCrlLo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -89,16 +76,12 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg= @@ -118,7 +101,6 @@ github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= @@ -143,17 +125,6 @@ github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= -github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= @@ -179,7 +150,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -188,7 +158,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -212,12 +181,9 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -264,7 +230,6 @@ github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -276,34 +241,25 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno= -github.com/labstack/echo/v4 v4.1.15/go.mod h1:GWO5IBVzI371K8XJe50CSvHjQCafK6cw8R/moLhEU6o= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/echo/v4 v4.11.1 h1:dEpLU2FLg4UVmvCGPuk/APjlH6GDpbEPti61srUUUs4= github.com/labstack/echo/v4 v4.11.1/go.mod h1:YuYRTSM3CHs2ybfrL8Px48bO6BAnYIN4l8wSTMP6BDQ= -github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= @@ -320,9 +276,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= -github.com/microcosm-cc/bluemonday v1.0.21 h1:dNH3e4PSyE4vNX+KlRGHT5KrSvjeUkoNPwEORjffHJg= -github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -345,8 +298,6 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/neko-neko/echo-logrus/v2 v2.0.1 h1:BX2U6uv2N3UiUY75y+SntQak5S1AJIel9j+5Y6h4Nb4= -github.com/neko-neko/echo-logrus/v2 v2.0.1/go.mod h1:GDYWo9CY4VXk/vn5ac5reoutYEkZEexlFI01MzHXVG0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -395,9 +346,7 @@ github.com/prysmaticlabs/prysm/v4 v4.0.1/go.mod h1:EQ8hYKry3NYHGirqLiQh8gXJ/O12d github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -412,13 +361,10 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -428,7 +374,6 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -469,9 +414,7 @@ github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKn github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= @@ -491,19 +434,14 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -523,7 +461,6 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -534,20 +471,17 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -559,10 +493,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -571,7 +503,6 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -586,7 +517,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -642,21 +572,14 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -689,7 +612,6 @@ gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHN gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/proposer/proposer.go b/proposer/proposer.go index 30adef90c..f887be4c8 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -382,7 +382,6 @@ func (p *Proposer) sendProposeBlockTx( // ProposeTxList proposes the given transactions list to TaikoL1 smart contract. func (p *Proposer) ProposeTxList( ctx context.Context, - meta *encoding.TaikoL1BlockMetadataInput, txListBytes []byte, txNum uint, nonce *uint64, diff --git a/prover/server/api.go b/prover/server/api.go index 2d38f81f9..058023717 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -12,6 +12,14 @@ import ( "github.com/taikoxyz/taiko-client/pkg/rpc" ) +// CreateAssignmentRequestBody represents a request body when handling assignment creation request. +type CreateAssignmentRequestBody struct { + FeeToken common.Address + TierFees []*encoding.TierFee + Expiry uint64 + TxListHash common.Hash +} + // Status represents the current prover server status. type Status struct { MinProofFee uint64 `json:"minProofFee"` @@ -51,18 +59,34 @@ type ProposeBlockResponse struct { // @Accept json // @Produce json // @Success 200 {object} ProposeBlockResponse +// @Failure 422 {string} string "invalid txList hash" +// @Failure 422 {string} string "only receive ETH" // @Failure 422 {string} string "insufficient prover balance" // @Failure 422 {string} string "proof fee too low" // @Failure 422 {string} string "expiry too long" // @Failure 422 {string} string "prover does not have capacity" // @Router /assignment [post] func (srv *ProverServer) CreateAssignment(c echo.Context) error { - req := new(encoding.ProposeBlockData) + req := new(CreateAssignmentRequestBody) if err := c.Bind(req); err != nil { return c.JSON(http.StatusUnprocessableEntity, err) } - log.Info("Propose block data", "fee", req.Fee, "expiry", req.Expiry) + log.Info( + "Propose block data", + "feeToken", req.FeeToken, + "expiry", req.Expiry, + "tierFees", req.TierFees, + "txListHash", req.TxListHash, + ) + + if req.TxListHash == (common.Hash{}) { + return echo.NewHTTPError(http.StatusUnprocessableEntity, "invalid txList hash") + } + + if req.FeeToken != (common.Address{}) { + return echo.NewHTTPError(http.StatusUnprocessableEntity, "only receive ETH") + } if !srv.isOracle { ok, err := rpc.CheckProverBalance(c.Request().Context(), srv.rpc, srv.proverAddress, srv.taikoL1Address, srv.bond) @@ -79,14 +103,17 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { } } - if req.Fee.Cmp(srv.minProofFee) < 0 { - log.Warn( - "Proof fee too low", - "reqFee", req.Fee.String(), - "srvMinProofFee", srv.minProofFee.String(), - "proposerIP", c.RealIP(), - ) - return echo.NewHTTPError(http.StatusUnprocessableEntity, "proof fee too low") + for _, tier := range req.TierFees { + if tier.Fee.Cmp(srv.minProofFee) < 0 { + log.Warn( + "Proof fee too low", + "tier", tier.Tier, + "fee", tier.Fee, + "srvMinProofFee", srv.minProofFee.String(), + "proposerIP", c.RealIP(), + ) + return echo.NewHTTPError(http.StatusUnprocessableEntity, "proof fee too low") + } } if req.Expiry > uint64(time.Now().Add(srv.maxExpiry).Unix()) { @@ -104,9 +131,9 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { return echo.NewHTTPError(http.StatusUnprocessableEntity, "prover does not have capacity") } - encoded, err := encoding.EncodeProposeBlockData(req) + encoded, err := encoding.EncodeProverAssignmentPayload(req.TxListHash, req.FeeToken, req.Expiry, req.TierFees) if err != nil { - log.Error("Failed to encode proposeBlock data", "error", err) + log.Error("Failed to encode proverAssignment payload data", "error", err) return echo.NewHTTPError(http.StatusUnprocessableEntity, err) } diff --git a/prover/server/api_test.go b/prover/server/api_test.go index 866c543f7..785bbea85 100644 --- a/prover/server/api_test.go +++ b/prover/server/api_test.go @@ -29,16 +29,11 @@ func (s *ProverServerTestSuite) TestGetStatusSuccess() { } func (s *ProverServerTestSuite) TestProposeBlockSuccess() { - data, err := json.Marshal(encoding.ProposeBlockData{ - Fee: common.Big256, - Expiry: uint64(time.Now().Add(time.Minute).Unix()), - Input: encoding.TaikoL1BlockMetadataInput{ - Proposer: common.BytesToAddress(randomHash().Bytes()), - TxListHash: randomHash(), - TxListByteStart: common.Big0, - TxListByteEnd: common.Big0, - CacheTxListInfo: false, - }, + data, err := json.Marshal(CreateAssignmentRequestBody{ + FeeToken: (common.Address{}), + TierFees: []*encoding.TierFee{{Tier: 0, Fee: common.Big256}}, + Expiry: uint64(time.Now().Add(time.Minute).Unix()), + TxListHash: common.BigToHash(common.Big1), }) s.Nil(err) resp, err := http.Post(s.ws.URL+"/assignment", "application/json", strings.NewReader(string(data))) From 8a5929314558e83a79b2b16305a79333b49093e3 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 15:27:59 +0800 Subject: [PATCH 06/63] test(prover): update tests --- prover/server/api_test.go | 20 ++++++++++---------- prover/server/server_test.go | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/prover/server/api_test.go b/prover/server/api_test.go index 785bbea85..29bb3cbe8 100644 --- a/prover/server/api_test.go +++ b/prover/server/api_test.go @@ -13,18 +13,18 @@ import ( ) func (s *ProverServerTestSuite) TestGetStatusSuccess() { - resp := s.sendReq("/status") - s.Equal(http.StatusOK, resp.StatusCode) + res := s.sendReq("/status") + s.Equal(http.StatusOK, res.StatusCode) status := new(Status) - defer resp.Body.Close() - b, err := io.ReadAll(resp.Body) + defer res.Body.Close() + b, err := io.ReadAll(res.Body) s.Nil(err) s.Nil(json.Unmarshal(b, &status)) - s.Equal(s.ps.minProofFee.Uint64(), status.MinProofFee) - s.Equal(uint64(s.ps.maxExpiry.Seconds()), status.MaxExpiry) + s.Equal(s.s.minProofFee.Uint64(), status.MinProofFee) + s.Equal(uint64(s.s.maxExpiry.Seconds()), status.MaxExpiry) s.Greater(status.CurrentCapacity, uint64(0)) } @@ -36,11 +36,11 @@ func (s *ProverServerTestSuite) TestProposeBlockSuccess() { TxListHash: common.BigToHash(common.Big1), }) s.Nil(err) - resp, err := http.Post(s.ws.URL+"/assignment", "application/json", strings.NewReader(string(data))) + res, err := http.Post(s.testServer.URL+"/assignment", "application/json", strings.NewReader(string(data))) s.Nil(err) - s.Equal(http.StatusOK, resp.StatusCode) - defer resp.Body.Close() - b, err := io.ReadAll(resp.Body) + s.Equal(http.StatusOK, res.StatusCode) + defer res.Body.Close() + b, err := io.ReadAll(res.Body) s.Nil(err) s.Contains(string(b), "signedPayload") } diff --git a/prover/server/server_test.go b/prover/server/server_test.go index 74a513faa..e992e91b5 100644 --- a/prover/server/server_test.go +++ b/prover/server/server_test.go @@ -24,8 +24,8 @@ import ( type ProverServerTestSuite struct { suite.Suite - ps *ProverServer - ws *httptest.Server // web server + s *ProverServer + testServer *httptest.Server } func (s *ProverServerTestSuite) SetupTest() { @@ -61,8 +61,8 @@ func (s *ProverServerTestSuite) SetupTest() { p.echo.HideBanner = true p.configureMiddleware() p.configureRoutes() - s.ps = p - s.ws = httptest.NewServer(p.echo) + s.s = p + s.testServer = httptest.NewServer(p.echo) } func (s *ProverServerTestSuite) TestHealth() { @@ -81,7 +81,7 @@ func (s *ProverServerTestSuite) TestStartShutdown() { s.Nil(err) go func() { - if err := s.ps.Start(fmt.Sprintf(":%v", port)); err != nil { + if err := s.s.Start(fmt.Sprintf(":%v", port)); err != nil { log.Error("Failed to start prover server", "error", err) } }() @@ -99,11 +99,11 @@ func (s *ProverServerTestSuite) TestStartShutdown() { return nil }, backoff.NewExponentialBackOff())) - s.Nil(s.ps.Shutdown(context.Background())) + s.Nil(s.s.Shutdown(context.Background())) } func (s *ProverServerTestSuite) TearDownTest() { - s.ws.Close() + s.testServer.Close() } func TestProverServerTestSuite(t *testing.T) { @@ -111,7 +111,7 @@ func TestProverServerTestSuite(t *testing.T) { } func (s *ProverServerTestSuite) sendReq(path string) *http.Response { - resp, err := http.Get(s.ws.URL + path) + res, err := http.Get(s.testServer.URL + path) s.Nil(err) - return resp + return res } From 330b92fcf632e0ef3449bb79be17c7b1602ffb32 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 16:11:13 +0800 Subject: [PATCH 07/63] feat(proposer): update proposer based on protocol changes --- proposer/proposer.go | 80 ++++++++++--------- proposer/proposer_test.go | 40 ++++------ .../prover_selector/eth_fee_eoa_selector.go | 60 +++++++------- proposer/prover_selector/interface.go | 6 +- 4 files changed, 94 insertions(+), 92 deletions(-) diff --git a/proposer/proposer.go b/proposer/proposer.go index f887be4c8..37e42923e 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -43,9 +43,8 @@ type Proposer struct { rpc *rpc.Client // Private keys and account addresses - l1ProposerPrivKey *ecdsa.PrivateKey - l1ProposerAddress common.Address - l2SuggestedFeeRecipient common.Address + proposerPrivKey *ecdsa.PrivateKey + proposerAddress common.Address // Proposing configurations proposingInterval *time.Duration @@ -88,9 +87,8 @@ func (p *Proposer) InitFromCli(ctx context.Context, c *cli.Context) error { // InitFromConfig initializes the proposer instance based on the given configurations. func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { - p.l1ProposerPrivKey = cfg.L1ProposerPrivKey - p.l1ProposerAddress = crypto.PubkeyToAddress(cfg.L1ProposerPrivKey.PublicKey) - p.l2SuggestedFeeRecipient = cfg.L2SuggestedFeeRecipient + p.proposerPrivKey = cfg.L1ProposerPrivKey + p.proposerAddress = crypto.PubkeyToAddress(cfg.L1ProposerPrivKey.PublicKey) p.proposingInterval = cfg.ProposeInterval p.proposeEmptyBlocksInterval = cfg.ProposeEmptyBlocksInterval p.proposeBlockTxGasLimit = cfg.ProposeBlockTxGasLimit @@ -232,7 +230,7 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { txLists, err := p.rpc.GetPoolContent( ctx, - p.L2SuggestedFeeRecipient(), + p.proposerAddress, baseFee, p.protocolConfigs.BlockMaxGasLimit, p.protocolConfigs.BlockMaxTxListBytes.Uint64(), @@ -282,7 +280,7 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { } nonce, err := p.rpc.L1.NonceAt( ctx, - crypto.PubkeyToAddress(p.l1ProposerPrivKey.PublicKey), + crypto.PubkeyToAddress(p.proposerPrivKey.PublicKey), new(big.Int).SetUint64(head), ) if err != nil { @@ -305,13 +303,7 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { } txNonce := nonce + uint64(i) - if err := p.ProposeTxList(ctx, &encoding.TaikoL1BlockMetadataInput{ - Proposer: p.l2SuggestedFeeRecipient, - TxListHash: crypto.Keccak256Hash(txListBytes), - TxListByteStart: common.Big0, - TxListByteEnd: new(big.Int).SetUint64(uint64(len(txListBytes))), - CacheTxListInfo: false, - }, txListBytes, uint(txs.Len()), &txNonce); err != nil { + if err := p.ProposeTxList(ctx, txListBytes, uint(txs.Len()), &txNonce); err != nil { return fmt.Errorf("failed to propose transactions: %w", err) } @@ -336,19 +328,14 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { // sendProposeBlockTx tries to send a TaikoL1.proposeBlock transaction. func (p *Proposer) sendProposeBlockTx( ctx context.Context, - meta *encoding.TaikoL1BlockMetadataInput, txListBytes []byte, nonce *uint64, - assignment []byte, + assignment *encoding.ProverAssignment, fee *big.Int, isReplacement bool, ) (*types.Transaction, error) { // Propose the transactions list - inputs, err := encoding.EncodeProposeBlockInput(meta) - if err != nil { - return nil, err - } - opts, err := getTxOpts(ctx, p.rpc.L1, p.l1ProposerPrivKey, p.rpc.L1ChainID, fee) + opts, err := getTxOpts(ctx, p.rpc.L1, p.proposerPrivKey, p.rpc.L1ChainID, fee) if err != nil { return nil, err } @@ -363,7 +350,7 @@ func (p *Proposer) sendProposeBlockTx( ctx, p.rpc, opts, - p.l1ProposerAddress, + p.proposerAddress, new(big.Int).SetUint64(p.txReplacementTipMultiplier), p.proposeBlockTxGasTipCap, ); err != nil { @@ -371,7 +358,18 @@ func (p *Proposer) sendProposeBlockTx( } } - proposeTx, err := p.rpc.TaikoL1.ProposeBlock(opts, inputs, assignment, txListBytes) + encodedssignment, err := encoding.EncodeProverAssignment(assignment) + if err != nil { + return nil, err + } + + proposeTx, err := p.rpc.TaikoL1.ProposeBlock( + opts, + crypto.Keccak256Hash(txListBytes), + rpc.StringToBytes32(p.cfg.ExtraData), + encodedssignment, + txListBytes, + ) if err != nil { return nil, encoding.TryParsingCustomError(err) } @@ -386,7 +384,11 @@ func (p *Proposer) ProposeTxList( txNum uint, nonce *uint64, ) error { - assignment, fee, err := p.proverSelector.AssignProver(ctx, meta) + signature, prover, fee, err := p.proverSelector.AssignProver( + ctx, + []*encoding.TierFee{}, // TODO: update tier fees + crypto.Keccak256Hash(txListBytes), + ) if err != nil { return err } @@ -400,7 +402,20 @@ func (p *Proposer) ProposeTxList( if ctx.Err() != nil { return nil } - if tx, err = p.sendProposeBlockTx(ctx, meta, txListBytes, nonce, assignment, fee, isReplacement); err != nil { + if tx, err = p.sendProposeBlockTx( + ctx, + txListBytes, + nonce, + &encoding.ProverAssignment{ + Prover: prover, + FeeToken: common.Address{}, + TierFees: []*encoding.TierFee{}, // TODO: update tier fees + Expiry: uint64(proverAssignmentTimeout.Seconds()), + Signature: signature, + }, + fee, + isReplacement, + ); err != nil { log.Warn("Failed to send propose block transaction", "error", encoding.TryParsingCustomError(err)) if strings.Contains(err.Error(), core.ErrNonceTooLow.Error()) { return nil @@ -446,13 +461,7 @@ func (p *Proposer) ProposeTxList( // ProposeEmptyBlockOp performs a proposing one empty block operation. func (p *Proposer) ProposeEmptyBlockOp(ctx context.Context) error { - return p.ProposeTxList(ctx, &encoding.TaikoL1BlockMetadataInput{ - TxListHash: crypto.Keccak256Hash([]byte{}), - Proposer: p.L2SuggestedFeeRecipient(), - TxListByteStart: common.Big0, - TxListByteEnd: common.Big0, - CacheTxListInfo: false, - }, []byte{}, 0, nil) + return p.ProposeTxList(ctx, []byte{}, 0, nil) } // updateProposingTicker updates the internal proposing timer. @@ -478,11 +487,6 @@ func (p *Proposer) Name() string { return "proposer" } -// L2SuggestedFeeRecipient returns the L2 suggested fee recipient of the current proposer. -func (p *Proposer) L2SuggestedFeeRecipient() common.Address { - return p.l2SuggestedFeeRecipient -} - // getTxOpts creates a bind.TransactOpts instance using the given private key. func getTxOpts( ctx context.Context, diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 9d7d16086..4508b2a8d 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -104,7 +104,6 @@ func (s *ProposerTestSuite) TestProposeOp() { _, isPending, err := s.p.rpc.L1.TransactionByHash(context.Background(), event.Raw.TxHash) s.Nil(err) s.False(isPending) - s.Equal(s.p.l2SuggestedFeeRecipient, event.Meta.Proposer) receipt, err := s.p.rpc.L1.TransactionReceipt(context.Background(), event.Raw.TxHash) s.Nil(err) @@ -132,14 +131,14 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { opts, err := getTxOpts( context.Background(), s.p.rpc.L1, - s.p.l1ProposerPrivKey, + s.p.proposerPrivKey, s.RpcClient.L1ChainID, fee, ) s.Nil(err) s.Greater(opts.GasTipCap.Uint64(), uint64(0)) - nonce, err := s.RpcClient.L1.PendingNonceAt(context.Background(), s.p.l1ProposerAddress) + nonce, err := s.RpcClient.L1.PendingNonceAt(context.Background(), s.p.proposerAddress) s.Nil(err) tx := types.NewTransaction( @@ -154,7 +153,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { s.SetL1Automine(false) defer s.SetL1Automine(true) - signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RpcClient.L1ChainID), s.p.l1ProposerPrivKey) + signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RpcClient.L1ChainID), s.p.proposerPrivKey) s.Nil(err) s.Nil(s.RpcClient.L1.SendTransaction(context.Background(), signedTx)) @@ -162,23 +161,24 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { encoded, err := rlp.EncodeToBytes(emptyTxs) s.Nil(err) - meta := &encoding.TaikoL1BlockMetadataInput{ - Proposer: s.p.L2SuggestedFeeRecipient(), - TxListHash: crypto.Keccak256Hash(encoded), - TxListByteStart: common.Big0, - TxListByteEnd: new(big.Int).SetUint64(uint64(len(encoded))), - CacheTxListInfo: false, - } - - assignment, fee, err := s.p.proverSelector.AssignProver(context.Background(), meta) + signature, prover, fee, err := s.p.proverSelector.AssignProver( + context.Background(), + []*encoding.TierFee{}, + testutils.RandomHash(), + ) s.Nil(err) newTx, err := s.p.sendProposeBlockTx( context.Background(), - meta, encoded, &nonce, - assignment, + &encoding.ProverAssignment{ + Prover: prover, + FeeToken: common.Address{}, + TierFees: []*encoding.TierFee{}, + Expiry: uint64(proverAssignmentTimeout.Seconds()), + Signature: signature, + }, fee, true, ) @@ -187,18 +187,10 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { } func (s *ProposerTestSuite) TestAssignProverSuccessFirstRound() { - meta := &encoding.TaikoL1BlockMetadataInput{ - Proposer: s.p.L2SuggestedFeeRecipient(), - TxListHash: testutils.RandomHash(), - TxListByteStart: common.Big0, - TxListByteEnd: common.Big0, - CacheTxListInfo: false, - } - s.SetL1Automine(false) defer s.SetL1Automine(true) - _, fee, err := s.p.proverSelector.AssignProver(context.Background(), meta) + _, _, fee, err := s.p.proverSelector.AssignProver(context.Background(), []*encoding.TierFee{}, testutils.RandomHash()) s.Nil(err) s.Equal(fee.Uint64(), s.p.cfg.BlockProposalFee.Uint64()) diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index c340e9d68..11784c89b 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -82,15 +82,16 @@ func (s *ETHFeeEOASelector) ProverEndpoints() []*url.URL { return s.proverEndpoi // AssignProver tries to pick a prover through the registered prover endpoints. func (s *ETHFeeEOASelector) AssignProver( ctx context.Context, - meta *encoding.TaikoL1BlockMetadataInput, -) ([]byte, *big.Int, error) { + tierFees []*encoding.TierFee, + txListHash common.Hash, +) ([]byte, common.Address, *big.Int, error) { oracleProverAddress, err := s.rpc.TaikoL1.Resolve0( &bind.CallOpts{Context: ctx}, rpc.StringToBytes32("oracle_prover"), true, ) if err != nil { - return nil, nil, err + return nil, common.Address{}, nil, err } // Iterate over each configured endpoint, and see if someone wants to accept this block. // If it is denied, we continue on to the next endpoint. @@ -111,10 +112,11 @@ func (s *ETHFeeEOASelector) AssignProver( for _, endpoint := range s.shuffleProverEndpoints() { encodedAssignment, proverAddress, err := assignProver( ctx, - meta, endpoint, fee, expiry, + tierFees, + txListHash, s.requestTimeout, oracleProverAddress, ) @@ -123,22 +125,20 @@ func (s *ETHFeeEOASelector) AssignProver( continue } - if proverAddress != encoding.OracleProverAddress { - ok, err := rpc.CheckProverBalance(ctx, s.rpc, proverAddress, s.taikoL1Address, s.protocolConfigs.ProofBond) - if err != nil { - log.Warn("Failed to check prover balance", "endpoint", endpoint, "error", err) - continue - } - if !ok { - continue - } + ok, err := rpc.CheckProverBalance(ctx, s.rpc, proverAddress, s.taikoL1Address, s.protocolConfigs.LivenessBond) + if err != nil { + log.Warn("Failed to check prover balance", "endpoint", endpoint, "error", err) + continue + } + if !ok { + continue } - return encodedAssignment, fee, nil + return encodedAssignment, proverAddress, fee, nil } } - return nil, nil, errUnableToFindProver + return nil, common.Address{}, nil, errUnableToFindProver } // shuffleProverEndpoints shuffles the current selector's prover endpoints. @@ -152,10 +152,11 @@ func (s *ETHFeeEOASelector) shuffleProverEndpoints() []*url.URL { // assignProver tries to assign a proof generation task to the given prover by HTTP API. func assignProver( ctx context.Context, - meta *encoding.TaikoL1BlockMetadataInput, endpoint *url.URL, fee *big.Int, expiry uint64, + tierFees []*encoding.TierFee, + txListHash common.Hash, timeout time.Duration, oracleProverAddress common.Address, ) ([]byte, common.Address, error) { @@ -164,13 +165,19 @@ func assignProver( "endpoint", endpoint, "fee", fee.String(), "expiry", expiry, + "txListHash", txListHash, ) // Send the HTTP request var ( client = resty.New() - reqBody = &encoding.ProposeBlockData{Expiry: expiry, Input: *meta, Fee: fee} - result = server.ProposeBlockResponse{} + reqBody = &server.CreateAssignmentRequestBody{ + FeeToken: (common.Address{}), + TierFees: tierFees, + Expiry: expiry, + TxListHash: txListHash, + } + result = server.ProposeBlockResponse{} ) requestUrl, err := url.JoinPath(endpoint.String(), "/assignment") if err != nil { @@ -196,12 +203,12 @@ func assignProver( // Ensure prover in response is the same as the one recovered // from the signature - encodedBlockData, err := encoding.EncodeProposeBlockData(reqBody) + payload, err := encoding.EncodeProverAssignmentPayload(txListHash, common.Address{}, expiry, tierFees) if err != nil { return nil, common.Address{}, err } - pubKey, err := crypto.SigToPub(crypto.Keccak256Hash(encodedBlockData).Bytes(), result.SignedPayload) + pubKey, err := crypto.SigToPub(crypto.Keccak256Hash(payload).Bytes(), result.SignedPayload) if err != nil { return nil, common.Address{}, err } @@ -217,15 +224,12 @@ func assignProver( // Convert signature to one solidity can recover by adding 27 to 65th byte result.SignedPayload[64] = uint8(uint(result.SignedPayload[64])) + 27 - // If this assignment is to oracle prover, change prover address in assignment to `LibUtils.ORACLE_PROVER` - if oracleProverAddress != (common.Address{}) && result.Prover == oracleProverAddress { - result.Prover = encoding.OracleProverAddress - } - encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ - Prover: result.Prover, - Expiry: reqBody.Expiry, - Data: result.SignedPayload, + Prover: result.Prover, + FeeToken: common.Address{}, + TierFees: []*encoding.TierFee{}, // TODO: update tier fees + Expiry: reqBody.Expiry, + Signature: result.SignedPayload, }) if err != nil { return nil, common.Address{}, err diff --git a/proposer/prover_selector/interface.go b/proposer/prover_selector/interface.go index 53ab9df14..04bf0d276 100644 --- a/proposer/prover_selector/interface.go +++ b/proposer/prover_selector/interface.go @@ -5,13 +5,15 @@ import ( "math/big" "net/url" + "github.com/ethereum/go-ethereum/common" "github.com/taikoxyz/taiko-client/bindings/encoding" ) type ProverSelector interface { AssignProver( ctx context.Context, - meta *encoding.TaikoL1BlockMetadataInput, - ) (signedPayload []byte, fee *big.Int, err error) + tierFees []*encoding.TierFee, + txListHash common.Hash, + ) (signedPayload []byte, prover common.Address, fee *big.Int, err error) ProverEndpoints() []*url.URL } From e58ace7c5a4f96347d0b64ca5d0222dc5f10f23d Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 16:17:07 +0800 Subject: [PATCH 08/63] feat: update `pkg` package --- driver/state/l1_current.go | 4 +- ...rator.go => transition_proven_iterator.go} | 53 +++++++++++-------- pkg/rpc/methods.go | 1 + pkg/rpc/subscription.go | 14 ++--- pkg/rpc/subscription_test.go | 6 +-- pkg/rpc/utils.go | 2 +- 6 files changed, 44 insertions(+), 36 deletions(-) rename pkg/chain_iterator/event_iterator/{block_proven_iterator.go => transition_proven_iterator.go} (63%) diff --git a/driver/state/l1_current.go b/driver/state/l1_current.go index bbb0f2e6c..95d163a60 100644 --- a/driver/state/l1_current.go +++ b/driver/state/l1_current.go @@ -63,14 +63,14 @@ func (s *State) ResetL1Current( iter, err := eventIterator.NewBlockProvenIterator( ctx, - &eventIterator.BlockProvenIteratorConfig{ + &eventIterator.TransitionProvenIteratorConfig{ Client: s.rpc.L1, TaikoL1: s.rpc.TaikoL1, StartHeight: s.GenesisL1Height, EndHeight: s.GetL1Head().Number, FilterQuery: []*big.Int{}, Reverse: true, - OnBlockProvenEvent: func( + OnTransitionProved: func( ctx context.Context, e *bindings.TaikoL1ClientBlockProven, end eventIterator.EndBlockProvenEventIterFunc, diff --git a/pkg/chain_iterator/event_iterator/block_proven_iterator.go b/pkg/chain_iterator/event_iterator/transition_proven_iterator.go similarity index 63% rename from pkg/chain_iterator/event_iterator/block_proven_iterator.go rename to pkg/chain_iterator/event_iterator/transition_proven_iterator.go index 71aa5be4e..2c11de17c 100644 --- a/pkg/chain_iterator/event_iterator/block_proven_iterator.go +++ b/pkg/chain_iterator/event_iterator/transition_proven_iterator.go @@ -12,16 +12,20 @@ import ( "github.com/taikoxyz/taiko-client/pkg/rpc" ) -// EndBlockProvenEventIterFunc ends the current iteration. -type EndBlockProvenEventIterFunc func() +// EndTransitionProvedEventIterFunc ends the current iteration. +type EndTransitionProvedEventIterFunc func() -// OnBlockProvenEvent represents the callback function which will be called when a TaikoL1.BlockProven event is +// OnTransitionProved represents the callback function which will be called when a TaikoL1.TransitionProved event is // iterated. -type OnBlockProvenEvent func(context.Context, *bindings.TaikoL1ClientBlockProven, EndBlockProvenEventIterFunc) error +type OnTransitionProved func( + context.Context, + *bindings.TaikoL1ClientTransitionProved, + EndTransitionProvedEventIterFunc, +) error -// BlockProvenIterator iterates the emitted TaikoL1.BlockProven events in the chain, +// TransitionProvedIterator iterates the emitted TaikoL1.TransitionProved events in the chain, // with the awareness of reorganization. -type BlockProvenIterator struct { +type TransitionProvedIterator struct { ctx context.Context taikoL1 *bindings.TaikoL1Client blockBatchIterator *chainIterator.BlockBatchIterator @@ -29,8 +33,8 @@ type BlockProvenIterator struct { isEnd bool } -// BlockProvenIteratorConfig represents the configs of a BlockProven event iterator. -type BlockProvenIteratorConfig struct { +// TransitionProvenIteratorConfig represents the configs of a TransitionProved event iterator. +type TransitionProvenIteratorConfig struct { Client *rpc.EthClient TaikoL1 *bindings.TaikoL1Client MaxBlocksReadPerEpoch *uint64 @@ -38,16 +42,19 @@ type BlockProvenIteratorConfig struct { EndHeight *big.Int FilterQuery []*big.Int Reverse bool - OnBlockProvenEvent OnBlockProvenEvent + OnTransitionProved OnTransitionProved } -// NewBlockProvenIterator creates a new instance of BlockProven event iterator. -func NewBlockProvenIterator(ctx context.Context, cfg *BlockProvenIteratorConfig) (*BlockProvenIterator, error) { - if cfg.OnBlockProvenEvent == nil { +// NewTransitionProvedIterator creates a new instance of TransitionProved event iterator. +func NewTransitionProvedIterator( + ctx context.Context, + cfg *TransitionProvenIteratorConfig, +) (*TransitionProvedIterator, error) { + if cfg.OnTransitionProved == nil { return nil, errors.New("invalid callback") } - iterator := &BlockProvenIterator{ + iterator := &TransitionProvedIterator{ ctx: ctx, taikoL1: cfg.TaikoL1, filterQuery: cfg.FilterQuery, @@ -60,11 +67,11 @@ func NewBlockProvenIterator(ctx context.Context, cfg *BlockProvenIteratorConfig) StartHeight: cfg.StartHeight, EndHeight: cfg.EndHeight, Reverse: cfg.Reverse, - OnBlocks: assembleBlockProvenIteratorCallback( + OnBlocks: assembleTransitionProvedIteratorCallback( cfg.Client, cfg.TaikoL1, cfg.FilterQuery, - cfg.OnBlockProvenEvent, + cfg.OnTransitionProved, iterator, ), }) @@ -78,24 +85,24 @@ func NewBlockProvenIterator(ctx context.Context, cfg *BlockProvenIteratorConfig) } // Iter iterates the given chain between the given start and end heights, -// will call the callback when a BlockProven event is iterated. -func (i *BlockProvenIterator) Iter() error { +// will call the callback when a TransitionProved event is iterated. +func (i *TransitionProvedIterator) Iter() error { return i.blockBatchIterator.Iter() } // end ends the current iteration. -func (i *BlockProvenIterator) end() { +func (i *TransitionProvedIterator) end() { i.isEnd = true } -// assembleBlockProvenIteratorCallback assembles the callback which will be used +// assembleTransitionProvedIteratorCallback assembles the callback which will be used // by a event iterator's inner block iterator. -func assembleBlockProvenIteratorCallback( +func assembleTransitionProvedIteratorCallback( client *rpc.EthClient, taikoL1Client *bindings.TaikoL1Client, filterQuery []*big.Int, - callback OnBlockProvenEvent, - eventIter *BlockProvenIterator, + callback OnTransitionProved, + eventIter *TransitionProvedIterator, ) chainIterator.OnBlocksFunc { return func( ctx context.Context, @@ -104,7 +111,7 @@ func assembleBlockProvenIteratorCallback( endFunc chainIterator.EndIterFunc, ) error { endHeight := end.Number.Uint64() - iter, err := taikoL1Client.FilterBlockProven( + iter, err := taikoL1Client.FilterTransitionProved( &bind.FilterOpts{Start: start.Number.Uint64(), End: &endHeight, Context: ctx}, filterQuery, ) diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index 3e7d486fd..834e0a7dd 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -47,6 +47,7 @@ func (c *Client) ensureGenesisMatched(ctx context.Context) error { &bind.FilterOpts{Start: stateVars.GenesisHeight, End: &stateVars.GenesisHeight, Context: ctxWithTimeout}, []*big.Int{common.Big0}, nil, + nil, ) if err != nil { return err diff --git a/pkg/rpc/subscription.go b/pkg/rpc/subscription.go index 4a8ff8eb2..26b3d5a6c 100644 --- a/pkg/rpc/subscription.go +++ b/pkg/rpc/subscription.go @@ -33,7 +33,7 @@ func SubscribeBlockVerified( ch chan *bindings.TaikoL1ClientBlockVerified, ) event.Subscription { return SubscribeEvent("BlockVerified", func(ctx context.Context) (event.Subscription, error) { - sub, err := taikoL1.WatchBlockVerified(nil, ch, nil, nil) + sub, err := taikoL1.WatchBlockVerified(nil, ch, nil, nil, nil) if err != nil { log.Error("Create TaikoL1.BlockVerified subscription error", "error", err) return nil, err @@ -81,15 +81,15 @@ func SubscribeXchainSynced( }) } -// SubscribeBlockProven subscribes the protocol's BlockProven events. -func SubscribeBlockProven( +// SubscribeTransitionProved subscribes the protocol's TransitionProved events. +func SubscribeTransitionProved( taikoL1 *bindings.TaikoL1Client, - ch chan *bindings.TaikoL1ClientBlockProven, + ch chan *bindings.TaikoL1ClientTransitionProved, ) event.Subscription { - return SubscribeEvent("BlockProven", func(ctx context.Context) (event.Subscription, error) { - sub, err := taikoL1.WatchBlockProven(nil, ch, nil) + return SubscribeEvent("TransitionProved", func(ctx context.Context) (event.Subscription, error) { + sub, err := taikoL1.WatchTransitionProved(nil, ch, nil) if err != nil { - log.Error("Create TaikoL1.BlockProven subscription error", "error", err) + log.Error("Create TaikoL1.TransitionProved subscription error", "error", err) return nil, err } diff --git a/pkg/rpc/subscription_test.go b/pkg/rpc/subscription_test.go index b19483f94..7fae688ac 100644 --- a/pkg/rpc/subscription_test.go +++ b/pkg/rpc/subscription_test.go @@ -37,10 +37,10 @@ func TestSubscribeSubscribeXchainSynced(t *testing.T) { ) } -func TestSubscribeBlockProven(t *testing.T) { - require.NotNil(t, SubscribeBlockProven( +func TestSubscribeTransitionProved(t *testing.T) { + require.NotNil(t, SubscribeTransitionProved( newTestClient(t).TaikoL1, - make(chan *bindings.TaikoL1ClientBlockProven, 1024)), + make(chan *bindings.TaikoL1ClientTransitionProved, 1024)), ) } diff --git a/pkg/rpc/utils.go b/pkg/rpc/utils.go index a8145e1e8..e934e2059 100644 --- a/pkg/rpc/utils.go +++ b/pkg/rpc/utils.go @@ -189,7 +189,7 @@ func NeedNewProof( "📬 Block's proof has already been submitted by another prover", "blockID", id, "prover", transition.Prover, - "provenAt", transition.ProvenAt, + "timestamp", transition.Timestamp, ) return false, nil From 3267dab58df8c9d2cbde80a5717735f309afaa70 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 16:18:35 +0800 Subject: [PATCH 09/63] feat: update `testutils` package --- testutils/helper.go | 21 +++------------------ testutils/interfaces.go | 2 -- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/testutils/helper.go b/testutils/helper.go index e3ef0b97f..366e5b4f9 100644 --- a/testutils/helper.go +++ b/testutils/helper.go @@ -6,7 +6,6 @@ import ( "crypto/rand" "errors" "fmt" - "math/big" "net/http" "net/url" "os" @@ -17,13 +16,11 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/go-resty/resty/v2" "github.com/phayes/freeport" "github.com/taikoxyz/taiko-client/bindings" - "github.com/taikoxyz/taiko-client/bindings/encoding" capacity "github.com/taikoxyz/taiko-client/prover/capacity_manager" "github.com/taikoxyz/taiko-client/prover/server" ) @@ -31,13 +28,7 @@ import ( func ProposeInvalidTxListBytes(s *ClientTestSuite, proposer Proposer) { invalidTxListBytes := RandomBytes(256) - s.Nil(proposer.ProposeTxList(context.Background(), &encoding.TaikoL1BlockMetadataInput{ - Proposer: proposer.L2SuggestedFeeRecipient(), - TxListHash: crypto.Keccak256Hash(invalidTxListBytes), - TxListByteStart: common.Big0, - TxListByteEnd: new(big.Int).SetUint64(uint64(len(invalidTxListBytes))), - CacheTxListInfo: false, - }, invalidTxListBytes, 1, nil)) + s.Nil(proposer.ProposeTxList(context.Background(), invalidTxListBytes, 1, nil)) } func ProposeAndInsertEmptyBlocks( @@ -64,13 +55,7 @@ func ProposeAndInsertEmptyBlocks( encoded, err := rlp.EncodeToBytes(emptyTxs) s.Nil(err) - s.Nil(proposer.ProposeTxList(context.Background(), &encoding.TaikoL1BlockMetadataInput{ - Proposer: proposer.L2SuggestedFeeRecipient(), - TxListHash: crypto.Keccak256Hash(encoded), - TxListByteStart: common.Big0, - TxListByteEnd: new(big.Int).SetUint64(uint64(len(encoded))), - CacheTxListInfo: false, - }, encoded, 0, nil)) + s.Nil(proposer.ProposeTxList(context.Background(), encoded, 0, nil)) ProposeInvalidTxListBytes(s, proposer) @@ -203,7 +188,7 @@ func NewTestProverServer( CapacityManager: capacityManager, TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), Rpc: s.RpcClient, - Bond: protocolConfig.ProofBond, + Bond: protocolConfig.LivenessBond, IsOracle: true, }) s.Nil(err) diff --git a/testutils/interfaces.go b/testutils/interfaces.go index 17fa62b34..348aa1e00 100644 --- a/testutils/interfaces.go +++ b/testutils/interfaces.go @@ -5,7 +5,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/cmd/utils" ) @@ -20,7 +19,6 @@ type Proposer interface { L2SuggestedFeeRecipient() common.Address ProposeTxList( ctx context.Context, - meta *encoding.TaikoL1BlockMetadataInput, txListBytes []byte, txNum uint, nonce *uint64, From b71d0b1ece070399a8467eb4361c88e533ad8197 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 16:22:34 +0800 Subject: [PATCH 10/63] feat: update `proof_producer` package --- prover/proof_producer/dummy_producer.go | 46 +++++--------------- prover/proof_producer/dummy_producer_test.go | 35 --------------- prover/proof_producer/zkevm_cmd_producer.go | 2 +- prover/proof_producer/zkevm_rpcd_producer.go | 2 +- prover/prover.go | 27 +++++------- 5 files changed, 24 insertions(+), 88 deletions(-) diff --git a/prover/proof_producer/dummy_producer.go b/prover/proof_producer/dummy_producer.go index 507c6ce3d..c5a4fd129 100644 --- a/prover/proof_producer/dummy_producer.go +++ b/prover/proof_producer/dummy_producer.go @@ -4,8 +4,6 @@ import ( "bytes" "context" "math/big" - "math/rand" - "time" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" @@ -13,10 +11,7 @@ import ( ) // DummyProofProducer always returns a dummy proof. -type DummyProofProducer struct { - RandomDummyProofDelayLowerBound *time.Duration - RandomDummyProofDelayUpperBound *time.Duration -} +type DummyProofProducer struct{} // RequestProof implements the ProofProducer interface. func (d *DummyProofProducer) RequestProof( @@ -30,42 +25,21 @@ func (d *DummyProofProducer) RequestProof( log.Info( "Request dummy proof", "blockID", blockID, - "proposer", meta.Proposer, + "coinbase", meta.Coinbase, "height", header.Number, "hash", header.Hash(), ) - time.AfterFunc(d.proofDelay(), func() { - resultCh <- &ProofWithHeader{ - BlockID: blockID, - Meta: meta, - Header: header, - ZkProof: bytes.Repeat([]byte{0xff}, 100), - Degree: CircuitsIdx, - Opts: opts, - } - }) - - return nil -} - -// proofDelay calculates a random proof delay between the bounds. -func (d *DummyProofProducer) proofDelay() time.Duration { - if d.RandomDummyProofDelayLowerBound == nil || - d.RandomDummyProofDelayUpperBound == nil || - *d.RandomDummyProofDelayUpperBound == time.Duration(0) { - return time.Duration(0) + resultCh <- &ProofWithHeader{ + BlockID: blockID, + Meta: meta, + Header: header, + ZkProof: bytes.Repeat([]byte{0xff}, 100), + Degree: CircuitsIdx, + Opts: opts, } - lowerSeconds := int(d.RandomDummyProofDelayLowerBound.Seconds()) - upperSeconds := int(d.RandomDummyProofDelayUpperBound.Seconds()) - - randomDurationSeconds := rand.Intn((upperSeconds - lowerSeconds)) + lowerSeconds - delay := time.Duration(randomDurationSeconds) * time.Second - - log.Info("Random dummy proof delay", "delay", delay) - - return delay + return nil } // Cancel cancels an existing proof generation. diff --git a/prover/proof_producer/dummy_producer_test.go b/prover/proof_producer/dummy_producer_test.go index 27dfb7bf0..e97756b56 100644 --- a/prover/proof_producer/dummy_producer_test.go +++ b/prover/proof_producer/dummy_producer_test.go @@ -50,41 +50,6 @@ func TestRequestProof(t *testing.T) { require.NotEmpty(t, res.ZkProof) } -func TestProofDelay(t *testing.T) { - dummyProofProducer := &DummyProofProducer{} - require.Equal(t, time.Duration(0), dummyProofProducer.proofDelay()) - - var ( - delays []time.Duration - oneSecond = 1 * time.Second - oneDay = 24 * time.Hour - ) - for i := 0; i < 1024; i++ { - dummyProofProducer := &DummyProofProducer{ - RandomDummyProofDelayLowerBound: &oneSecond, - RandomDummyProofDelayUpperBound: &oneDay, - } - - delay := dummyProofProducer.proofDelay() - - require.LessOrEqual(t, delay, oneDay) - require.Greater(t, delay, oneSecond) - - delays = append(delays, delay) - } - - allSame := func(d []time.Duration) bool { - for i := 1; i < len(d); i++ { - if d[i] != d[0] { - return false - } - } - return true - } - - require.False(t, allSame(delays)) -} - func TestProofCancel(t *testing.T) { dummyProofProducer := &DummyProofProducer{} diff --git a/prover/proof_producer/zkevm_cmd_producer.go b/prover/proof_producer/zkevm_cmd_producer.go index 12478e7c0..a664b0b35 100644 --- a/prover/proof_producer/zkevm_cmd_producer.go +++ b/prover/proof_producer/zkevm_cmd_producer.go @@ -45,7 +45,7 @@ func (p *ZkevmCmdProducer) RequestProof( log.Info( "Request proof from ZKEVM CMD", "blockID", blockID, - "proposer", meta.Proposer, + "coinbase", meta.Coinbase, "height", header.Number, "hash", header.Hash(), "cmd", p.CmdPath, diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index 23c074546..341ca042d 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -131,7 +131,7 @@ func (p *ZkevmRpcdProducer) RequestProof( log.Info( "Request proof from zkevm-chain proverd service", "blockID", blockID, - "proposer", meta.Proposer, + "coinbase", meta.Coinbase, "height", header.Number, "hash", header.Hash(), ) diff --git a/prover/prover.go b/prover/prover.go index 1ed725a6a..9f1ef5f67 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -63,13 +63,13 @@ type Prover struct { validProofSubmitter proofSubmitter.ProofSubmitter // Subscriptions - blockProposedCh chan *bindings.TaikoL1ClientBlockProposed - blockProposedSub event.Subscription - blockProvenCh chan *bindings.TaikoL1ClientBlockProven - blockProvenSub event.Subscription - blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified - blockVerifiedSub event.Subscription - proveNotify chan struct{} + blockProposedCh chan *bindings.TaikoL1ClientBlockProposed + blockProposedSub event.Subscription + transitionProvenCh chan *bindings.TaikoL1ClientTransitionProved + blockProvenSub event.Subscription + blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified + blockVerifiedSub event.Subscription + proveNotify chan struct{} // Proof related proofGenerationCh chan *proofProducer.ProofWithHeader @@ -143,7 +143,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { chBufferSize := p.protocolConfigs.BlockMaxProposals p.blockProposedCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.blockVerifiedCh = make(chan *bindings.TaikoL1ClientBlockVerified, chBufferSize) - p.blockProvenCh = make(chan *bindings.TaikoL1ClientBlockProven, chBufferSize) + p.transitionProvenCh = make(chan *bindings.TaikoL1ClientTransitionProved, chBufferSize) p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) p.proveNotify = make(chan struct{}, 1) if err := p.initL1Current(cfg.StartingBlockID); err != nil { @@ -170,10 +170,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { var producer proofProducer.ProofProducer if cfg.Dummy { - producer = &proofProducer.DummyProofProducer{ - RandomDummyProofDelayLowerBound: p.cfg.RandomDummyProofDelayLowerBound, - RandomDummyProofDelayUpperBound: p.cfg.RandomDummyProofDelayUpperBound, - } + producer = &proofProducer.DummyProofProducer{} } else { if producer, err = proofProducer.NewZkevmRpcdProducer( cfg.ZKEvmRpcdEndpoint, @@ -215,7 +212,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { CapacityManager: p.capacityManager, TaikoL1Address: p.cfg.TaikoL1Address, Rpc: p.rpc, - Bond: protocolConfigs.ProofBond, + Bond: protocolConfigs.LivenessBond, IsOracle: p.cfg.OracleProver, } if p.cfg.OracleProver { @@ -307,7 +304,7 @@ func (p *Prover) eventLoop() { if err := p.onBlockVerified(p.ctx, e); err != nil { log.Error("Handle BlockVerified event error", "error", err) } - case e := <-p.blockProvenCh: + case e := <-p.transitionProvenCh: if err := p.onBlockProven(p.ctx, e); err != nil { log.Error("Handle BlockProven event error", "error", err) } @@ -802,7 +799,7 @@ func (p *Prover) isBlockVerified(id *big.Int) (bool, error) { func (p *Prover) initSubscription() { p.blockProposedSub = rpc.SubscribeBlockProposed(p.rpc.TaikoL1, p.blockProposedCh) p.blockVerifiedSub = rpc.SubscribeBlockVerified(p.rpc.TaikoL1, p.blockVerifiedCh) - p.blockProvenSub = rpc.SubscribeBlockProven(p.rpc.TaikoL1, p.blockProvenCh) + p.blockProvenSub = rpc.SubscribeBlockProven(p.rpc.TaikoL1, p.transitionProvenCh) } // closeSubscription closes all subscriptions. From c0720a5283384c969d014e92bd0477be3df3fc36 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 20:30:03 +0800 Subject: [PATCH 11/63] feat(driver): update driver based on protocol changes --- driver/chain_syncer/calldata/syncer.go | 8 +-- driver/chain_syncer/calldata/syncer_test.go | 4 +- driver/chain_syncer/chain_syncer_test.go | 6 +- driver/state/l1_current.go | 6 +- driver/state/state.go | 65 ++++++++++----------- testutils/interfaces.go | 2 - 6 files changed, 42 insertions(+), 49 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index cb9db3562..c6040cd56 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -421,16 +421,16 @@ func (s *Syncer) createExecutionPayloads( fc := &engine.ForkchoiceStateV1{HeadBlockHash: parentHash} attributes := &engine.PayloadAttributes{ Timestamp: event.Meta.Timestamp, - Random: event.Meta.MixHash, - SuggestedFeeRecipient: event.Meta.Proposer, + Random: event.Meta.Difficulty, + SuggestedFeeRecipient: event.Meta.Coinbase, Withdrawals: withdrawals, BlockMetadata: &engine.BlockMetadata{ HighestBlockID: headBlockID, - Beneficiary: event.Meta.Proposer, + Beneficiary: event.Meta.Coinbase, GasLimit: uint64(event.Meta.GasLimit) + s.anchorConstructor.GasLimit(), Timestamp: event.Meta.Timestamp, TxList: txListBytes, - MixHash: event.Meta.MixHash, + MixHash: event.Meta.Difficulty, }, BaseFeePerGas: baseFee, L1Origin: l1Origin, diff --git a/driver/chain_syncer/calldata/syncer_test.go b/driver/chain_syncer/calldata/syncer_test.go index 8186b6353..86c74c9b1 100644 --- a/driver/chain_syncer/calldata/syncer_test.go +++ b/driver/chain_syncer/calldata/syncer_test.go @@ -118,9 +118,9 @@ func (s *CalldataSyncerTestSuite) TestInsertNewHead() { Id: 1, L1Height: l1Head.NumberU64(), L1Hash: l1Head.Hash(), - Proposer: common.BytesToAddress(testutils.RandomBytes(1024)), + Coinbase: common.BytesToAddress(testutils.RandomBytes(1024)), TxListHash: testutils.RandomHash(), - MixHash: testutils.RandomHash(), + Difficulty: testutils.RandomHash(), GasLimit: rand.Uint32(), Timestamp: uint64(time.Now().Unix()), }, diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index 1ef204ec4..1345dfc72 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -102,16 +102,14 @@ func (s *ChainSyncerTestSuite) TestAheadOfProtocolVerifiedHead2() { log.Info("L2HeaderByNumber head", "number", l2Head.Number) log.Info("LatestVerifiedBlock number", "number", s.s.state.GetLatestVerifiedBlock().ID.Uint64()) - config, err := s.s.rpc.TaikoL1.GetConfig(&bind.CallOpts{}) - s.Nil(err) - // increase evm time to make blocks verifiable. var result uint64 s.Nil(s.RpcClient.L1RawRPC.CallContext( context.Background(), &result, "evm_increaseTime", - config.ProofRegularCooldown.Uint64())) + (1024 * time.Hour).Seconds(), + )) s.NotNil(result) log.Info("EVM time increase", "number", result) diff --git a/driver/state/l1_current.go b/driver/state/l1_current.go index 95d163a60..d35deef18 100644 --- a/driver/state/l1_current.go +++ b/driver/state/l1_current.go @@ -61,7 +61,7 @@ func (s *State) ResetL1Current( } targetHash := header.Hash() - iter, err := eventIterator.NewBlockProvenIterator( + iter, err := eventIterator.NewTransitionProvedIterator( ctx, &eventIterator.TransitionProvenIteratorConfig{ Client: s.rpc.L1, @@ -72,8 +72,8 @@ func (s *State) ResetL1Current( Reverse: true, OnTransitionProved: func( ctx context.Context, - e *bindings.TaikoL1ClientBlockProven, - end eventIterator.EndBlockProvenEventIterFunc, + e *bindings.TaikoL1ClientTransitionProved, + end eventIterator.EndTransitionProvedEventIterFunc, ) error { log.Debug("Filtered BlockProven event", "ID", e.BlockId, "hash", common.Hash(e.BlockHash)) if e.BlockHash == targetHash { diff --git a/driver/state/state.go b/driver/state/state.go index 91e3745d8..b76c8f752 100644 --- a/driver/state/state.go +++ b/driver/state/state.go @@ -13,7 +13,6 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" - "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/metrics" "github.com/taikoxyz/taiko-client/pkg/rpc" ) @@ -32,19 +31,19 @@ func (h *HeightOrID) NotEmpty() bool { // State contains all states which will be used by driver. type State struct { // Subscriptions, will automatically resubscribe on errors - l1HeadSub event.Subscription // L1 new heads - l2HeadSub event.Subscription // L2 new heads - l2BlockProvenSub event.Subscription // TaikoL1.BlockProven events - l2BlockVerifiedSub event.Subscription // TaikoL1.BlockVerified events - l2BlockProposedSub event.Subscription // TaikoL1.BlockProposed events - l2HeaderSyncedSub event.Subscription // TaikoL1.HeaderSynced events - - l1HeadCh chan *types.Header - l2HeadCh chan *types.Header - blockProposedCh chan *bindings.TaikoL1ClientBlockProposed - blockProvenCh chan *bindings.TaikoL1ClientBlockProven - blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified - crossChainSynced chan *bindings.TaikoL1ClientCrossChainSynced + l1HeadSub event.Subscription // L1 new heads + l2HeadSub event.Subscription // L2 new heads + l2TransitionProvedSub event.Subscription // TaikoL1.BlockProven events + l2BlockVerifiedSub event.Subscription // TaikoL1.BlockVerified events + l2BlockProposedSub event.Subscription // TaikoL1.BlockProposed events + l2HeaderSyncedSub event.Subscription // TaikoL1.HeaderSynced events + + l1HeadCh chan *types.Header + l2HeadCh chan *types.Header + blockProposedCh chan *bindings.TaikoL1ClientBlockProposed + transitionProvedCh chan *bindings.TaikoL1ClientTransitionProved + blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified + crossChainSynced chan *bindings.TaikoL1ClientCrossChainSynced // Feeds l1HeadsFeed event.Feed // L1 new heads notification feed @@ -66,19 +65,19 @@ type State struct { // New creates a new driver state instance. func New(ctx context.Context, rpc *rpc.Client) (*State, error) { s := &State{ - rpc: rpc, - l1Head: new(atomic.Value), - l2Head: new(atomic.Value), - l2HeadBlockID: new(atomic.Value), - l2VerifiedHead: new(atomic.Value), - l1Current: new(atomic.Value), - l1HeadCh: make(chan *types.Header, 10), - l2HeadCh: make(chan *types.Header, 10), - blockProposedCh: make(chan *bindings.TaikoL1ClientBlockProposed, 10), - blockProvenCh: make(chan *bindings.TaikoL1ClientBlockProven, 10), - blockVerifiedCh: make(chan *bindings.TaikoL1ClientBlockVerified, 10), - crossChainSynced: make(chan *bindings.TaikoL1ClientCrossChainSynced, 10), - BlockDeadendHash: common.BigToHash(common.Big1), + rpc: rpc, + l1Head: new(atomic.Value), + l2Head: new(atomic.Value), + l2HeadBlockID: new(atomic.Value), + l2VerifiedHead: new(atomic.Value), + l1Current: new(atomic.Value), + l1HeadCh: make(chan *types.Header, 10), + l2HeadCh: make(chan *types.Header, 10), + blockProposedCh: make(chan *bindings.TaikoL1ClientBlockProposed, 10), + transitionProvedCh: make(chan *bindings.TaikoL1ClientTransitionProved, 10), + blockVerifiedCh: make(chan *bindings.TaikoL1ClientBlockVerified, 10), + crossChainSynced: make(chan *bindings.TaikoL1ClientCrossChainSynced, 10), + BlockDeadendHash: common.BigToHash(common.Big1), } if err := s.init(ctx); err != nil { @@ -96,7 +95,7 @@ func (s *State) Close() { s.l2HeadSub.Unsubscribe() s.l2BlockVerifiedSub.Unsubscribe() s.l2BlockProposedSub.Unsubscribe() - s.l2BlockProvenSub.Unsubscribe() + s.l2TransitionProvedSub.Unsubscribe() s.l2HeaderSyncedSub.Unsubscribe() } @@ -158,7 +157,7 @@ func (s *State) startSubscriptions(ctx context.Context) { s.l2HeaderSyncedSub = rpc.SubscribeXchainSynced(s.rpc.TaikoL1, s.crossChainSynced) s.l2BlockVerifiedSub = rpc.SubscribeBlockVerified(s.rpc.TaikoL1, s.blockVerifiedCh) s.l2BlockProposedSub = rpc.SubscribeBlockProposed(s.rpc.TaikoL1, s.blockProposedCh) - s.l2BlockProvenSub = rpc.SubscribeBlockProven(s.rpc.TaikoL1, s.blockProvenCh) + s.l2TransitionProvedSub = rpc.SubscribeTransitionProved(s.rpc.TaikoL1, s.transitionProvedCh) go func() { for { @@ -167,10 +166,8 @@ func (s *State) startSubscriptions(ctx context.Context) { return case e := <-s.blockProposedCh: s.setHeadBlockID(e.BlockId) - case e := <-s.blockProvenCh: - if e.Prover != encoding.OracleProverAddress { - log.Info("✅ Block proven", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) - } + case e := <-s.transitionProvedCh: + log.Info("✅ Block proven", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) case e := <-s.blockVerifiedCh: log.Info("📈 Block verified", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) case e := <-s.crossChainSynced: @@ -294,7 +291,7 @@ func (s *State) getSyncedHeaderID(ctx context.Context, l1Height uint64, hash com Start: l1Height, End: &l1Height, Context: ctx, - }, nil, nil) + }, nil, nil, nil) if err != nil { return nil, fmt.Errorf("failed to filter BlockVerified event: %w", err) } diff --git a/testutils/interfaces.go b/testutils/interfaces.go index 348aa1e00..7aa9e273e 100644 --- a/testutils/interfaces.go +++ b/testutils/interfaces.go @@ -3,7 +3,6 @@ package testutils import ( "context" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/taikoxyz/taiko-client/cmd/utils" ) @@ -16,7 +15,6 @@ type Proposer interface { utils.SubcommandApplication ProposeOp(ctx context.Context) error ProposeEmptyBlockOp(ctx context.Context) error - L2SuggestedFeeRecipient() common.Address ProposeTxList( ctx context.Context, txListBytes []byte, From 739affad19b6b1c9de921f0f4edcb1adb47b6f8f Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 21:04:38 +0800 Subject: [PATCH 12/63] feat(protocol): add `minTier` to `BlockProposed` event --- pkg/rpc/methods.go | 28 +++ .../proof_submitter/valid_proof_submitter.go | 25 +-- prover/prover.go | 165 ++++-------------- 3 files changed, 73 insertions(+), 145 deletions(-) diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index 834e0a7dd..09bc16c97 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -560,3 +560,31 @@ func (c *Client) IsJustSyncedByP2P(ctx context.Context) (bool, error) { return false, nil } + +// TierProviderTierWithID wraps protocol ITierProviderTier struct with an ID. +type TierProviderTierWithID struct { + ID uint16 + bindings.ITierProviderTier +} + +// GetTiers fetches all protocol supported tiers. +func (c *Client) GetTiers(ctx context.Context) ([]*TierProviderTierWithID, error) { + ctxWithTimeout, cancel := ctxWithTimeoutOrDefault(ctx, defaultTimeout) + defer cancel() + + ids, err := c.TaikoL1.GetTierIds(&bind.CallOpts{Context: ctxWithTimeout}) + if err != nil { + return nil, err + } + + var tiers []*TierProviderTierWithID + for _, id := range ids { + tier, err := c.TaikoL1.GetTier(&bind.CallOpts{Context: ctxWithTimeout}, id) + if err != nil { + return nil, err + } + tiers = append(tiers, &TierProviderTierWithID{ID: id, ITierProviderTier: tier}) + } + + return tiers, nil +} diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index de6291e52..a7e9dd864 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -177,7 +177,7 @@ func (s *ValidProofSubmitter) SubmitProof( log.Info( "New valid block proof", "blockID", proofWithHeader.BlockID, - "proposer", proofWithHeader.Meta.Proposer, + "proposer", proofWithHeader.Meta.Coinbase, "hash", proofWithHeader.Header.Hash(), "proof", common.Bytes2Hex(proofWithHeader.ZkProof), "graffiti", common.Bytes2Hex(s.graffiti[:]), @@ -221,34 +221,23 @@ func (s *ValidProofSubmitter) SubmitProof( return fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) } - evidence := &encoding.TaikoL1Evidence{ + evidence := &encoding.BlockEvidence{ MetaHash: proofWithHeader.Opts.MetaHash, ParentHash: proofWithHeader.Opts.ParentHash, BlockHash: proofWithHeader.Opts.BlockHash, SignalRoot: proofWithHeader.Opts.SignalRoot, Graffiti: s.graffiti, + Tier: 0, // TODO: update tier Proofs: zkProof, } - var circuitsIdx uint16 - var prover common.Address - - if s.isOracleProver { - prover = encoding.OracleProverAddress - - circuitsIdx = uint16(0) - } else { - prover = s.proverAddress - - circuitsIdx, err = proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) - if err != nil { - return err - } + circuitsIdx, err := proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) + if err != nil { + return err } evidence.Proofs = append(uint16ToBytes(circuitsIdx), evidence.Proofs...) - evidence.Prover = prover - input, err := encoding.EncodeProveBlockInput(evidence) + input, err := encoding.EncodeEvidence(evidence) if err != nil { return fmt.Errorf("failed to encode TaikoL1.proveBlock inputs: %w", err) } diff --git a/prover/prover.go b/prover/prover.go index 9f1ef5f67..758105e86 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -31,7 +31,8 @@ import ( ) var ( - errNoCapacity = errors.New("no prover capacity available") + errNoCapacity = errors.New("no prover capacity available") + errEmptyTiersList = errors.New("empty proof tiers list in protocol") ) type cancelFunc func() @@ -58,18 +59,19 @@ type Prover struct { genesisHeightL1 uint64 l1Current *types.Header reorgDetectedFlag bool + tiers []*rpc.TierProviderTierWithID // Proof submitters validProofSubmitter proofSubmitter.ProofSubmitter // Subscriptions - blockProposedCh chan *bindings.TaikoL1ClientBlockProposed - blockProposedSub event.Subscription - transitionProvenCh chan *bindings.TaikoL1ClientTransitionProved - blockProvenSub event.Subscription - blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified - blockVerifiedSub event.Subscription - proveNotify chan struct{} + blockProposedCh chan *bindings.TaikoL1ClientBlockProposed + blockProposedSub event.Subscription + transitionProvedCh chan *bindings.TaikoL1ClientTransitionProved + transitionProvedSub event.Subscription + blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified + blockVerifiedSub event.Subscription + proveNotify chan struct{} // Proof related proofGenerationCh chan *proofProducer.ProofWithHeader @@ -143,7 +145,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { chBufferSize := p.protocolConfigs.BlockMaxProposals p.blockProposedCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.blockVerifiedCh = make(chan *bindings.TaikoL1ClientBlockVerified, chBufferSize) - p.transitionProvenCh = make(chan *bindings.TaikoL1ClientTransitionProved, chBufferSize) + p.transitionProvedCh = make(chan *bindings.TaikoL1ClientTransitionProved, chBufferSize) p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) p.proveNotify = make(chan struct{}, 1) if err := p.initL1Current(cfg.StartingBlockID); err != nil { @@ -204,6 +206,13 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { return err } + if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { + return err + } + if len(p.tiers) == 0 { + return errEmptyTiersList + } + // Prover server proverServerOpts := &server.NewProverServerOpts{ ProverPrivateKey: p.cfg.L1ProverPrivKey, @@ -304,7 +313,7 @@ func (p *Prover) eventLoop() { if err := p.onBlockVerified(p.ctx, e); err != nil { log.Error("Handle BlockVerified event error", "error", err) } - case e := <-p.transitionProvenCh: + case e := <-p.transitionProvedCh: if err := p.onBlockProven(p.ctx, e); err != nil { log.Error("Handle BlockProven event error", "error", err) } @@ -485,7 +494,7 @@ func (p *Prover) onBlockProposed( log.Info( "Proposed block information", "blockID", event.BlockId, - "prover", block.Prover, + "assignedProver", block.AssignedProver, "proposedAt", block.ProposedAt, ) @@ -543,15 +552,13 @@ func (p *Prover) onBlockProposed( proofWindowExpiresAt := block.ProposedAt + uint64(p.protocolConfigs.ProofWindow) proofWindowExpired := uint64(time.Now().Unix()) > proofWindowExpiresAt // zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address - if block.Prover != p.proverAddress && - !proofWindowExpired && - !(block.Prover == encoding.OracleProverAddress && p.oracleProverAddress == p.proverAddress) { + if block.AssignedProver != p.proverAddress && !proofWindowExpired { log.Info( "Proposed block not provable", "blockID", event.BlockId, - "prover", - block.Prover.Hex(), + "assignedProver", + block.AssignedProver.Hex(), "proofWindowExpiresAt", proofWindowExpiresAt, "timeToExpire", @@ -564,8 +571,8 @@ func (p *Prover) onBlockProposed( log.Info("Adding proposed block to wait for proof window expiration", "blockID", event.BlockId, - "prover", - block.Prover.Hex(), + "assignedProver", + block.AssignedProver.Hex(), "proofWindowExpiresAt", proofWindowExpiresAt, ) @@ -591,7 +598,7 @@ func (p *Prover) onBlockProposed( log.Info( "Proposed block is provable", "blockID", event.BlockId, - "prover", block.Prover.Hex(), + "assignedProver", block.AssignedProver.Hex(), "proofWindowExpired", proofWindowExpired, ) @@ -699,13 +706,8 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli // onBlockProven cancels proof generation if the proof is being generated by this prover, // and the proof is not the oracle proof address. -func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientBlockProven) error { +func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) - // if this proof is submitted by an oracle prover or a system prover, don't cancel proof. - if event.Prover == p.oracleProverAddress || - event.Prover == encoding.OracleProverAddress { - return nil - } // cancel any proofs being generated for this block isValidProof, err := p.isValidProof( @@ -799,7 +801,7 @@ func (p *Prover) isBlockVerified(id *big.Int) (bool, error) { func (p *Prover) initSubscription() { p.blockProposedSub = rpc.SubscribeBlockProposed(p.rpc.TaikoL1, p.blockProposedCh) p.blockVerifiedSub = rpc.SubscribeBlockVerified(p.rpc.TaikoL1, p.blockVerifiedCh) - p.blockProvenSub = rpc.SubscribeBlockProven(p.rpc.TaikoL1, p.transitionProvenCh) + p.transitionProvedSub = rpc.SubscribeTransitionProved(p.rpc.TaikoL1, p.transitionProvedCh) } // closeSubscription closes all subscriptions. @@ -882,107 +884,6 @@ func (p *Prover) cancelProof(ctx context.Context, blockID uint64) { } } -// checkProofWindowsExpired iterates through the current blocks waiting for proof window to expire, -// which are blocks that have been proposed, but we were not selected as the prover. if the proof window -// has expired, we can start generating a proof for them. -func (p *Prover) checkProofWindowsExpired(ctx context.Context) error { - p.currentBlocksWaitingForProofWindowMutex.Lock() - defer p.currentBlocksWaitingForProofWindowMutex.Unlock() - - for blockId, l1Height := range p.currentBlocksWaitingForProofWindow { - if err := p.checkProofWindowExpired(ctx, l1Height, blockId); err != nil { - return err - } - } - - return nil -} - -// checkProofWindowExpired checks a single instance of a block to see if its proof window has expired -// and the proof is now able to be submitted by anyone, not just the blocks assigned prover. -func (p *Prover) checkProofWindowExpired(ctx context.Context, l1Height, blockId uint64) error { - block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, blockId) - if err != nil { - return encoding.TryParsingCustomError(err) - } - - isExpired := time.Now().Unix() > int64(block.ProposedAt)+int64(p.protocolConfigs.ProofWindow) - - if isExpired { - log.Debug( - "Block proof window is expired", - "blockID", blockId, - "l1Height", l1Height, - ) - - // we should remove this block from being watched regardless of whether the block - // has a valid proof - delete(p.currentBlocksWaitingForProofWindow, blockId) - - // we can see if a fork choice with correct parentHash/gasUsed has come in. - // if it hasnt, we can start to generate a proof for this. - parent, err := p.rpc.L2ParentByBlockId(ctx, new(big.Int).SetUint64(blockId)) - if err != nil { - return err - } - - transition, err := p.rpc.TaikoL1.GetTransition( - &bind.CallOpts{Context: ctx}, - blockId, - parent.Hash(), - ) - - if err != nil && !strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_TRANSITION_NOT_FOUND") { - return encoding.TryParsingCustomError(err) - } - - if transition.Prover == rpc.ZeroAddress { - log.Info( - "Proof window for proof not assigned to us expired, requesting proof", - "blockID", blockId, - "l1Height", l1Height, - ) - // we can generate the proof, no proof came in by proof window expiring - if err := p.requestProofForBlockId( - new(big.Int).SetUint64(blockId), - new(big.Int).SetUint64(l1Height), - ); err != nil { - return err - } - } else { - // we need to check the block hash vs the proof's blockHash to see - // if the proof is valid or not - block, err := p.rpc.L2.BlockByNumber(ctx, new(big.Int).SetUint64(blockId)) - if err != nil { - return err - } - - // if the hashes dont match, we can generate proof even though - // a proof came in before proofwindow expired. - if block.Hash() != transition.BlockHash { - log.Info( - "Invalid proof detected while watching for proof window expiration, requesting proof", - "blockID", blockId, - "l1Height", l1Height, - "expectedBlockHash", block.Hash(), - "transitionBlockHash", common.Bytes2Hex(transition.BlockHash[:]), - ) - // we can generate the proof, the proof is incorrect since blockHash does not match - // the correct one but parentHash/gasUsed are correct. - if err := p.requestProofForBlockId( - new(big.Int).SetUint64(blockId), - new(big.Int).SetUint64(l1Height), - ); err != nil { - return err - } - } - } - } - - // otherwise, keep it in the map and check again next iteration - return nil -} - // proveOp performs a proving operation, find current unproven blocks, then // request generating proofs for them. func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) error { @@ -1067,3 +968,13 @@ func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) err return nil } + +func proofWindow(tiers []*rpc.TierProviderTierWithID, id uint64) (uint64, error) { + for _, tier := range tiers { + if tier.ID == id { + + } + } + + return 0, fmt.Errorf("tier id not found: %d", id) +} From 2be2c8cbf79858afb2c927f134779b40fda9b8d4 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 29 Sep 2023 21:12:35 +0800 Subject: [PATCH 13/63] feat(prover): update prover based on protocol changes --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 28 ++--- prover/prover.go | 214 ++++++++++----------------------------- prover/prover_test.go | 6 -- 4 files changed, 68 insertions(+), 182 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 7b8009c92..6738f5ebd 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -29bfd962f9699f4c7836beb1845644a03fb1e484 +8a40bf3a331e6a3b42982ef54292acaa6f921ec3 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index c8f0c452e..9d4bd4caf 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -136,7 +136,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -1265,13 +1265,14 @@ type TaikoL1ClientBlockProposed struct { LivenessBond *big.Int ProverFee *big.Int Reward *big.Int + MinTier uint16 Meta TaikoDataBlockMetadata Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed is a free log retrieval operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. +// FilterBlockProposed is a free log retrieval operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { var blockIdRule []interface{} @@ -1290,9 +1291,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.Filt return &TaikoL1ClientBlockProposedIterator{contract: _TaikoL1Client.contract, event: "BlockProposed", logs: logs, sub: sub}, nil } -// WatchBlockProposed is a free log subscription operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. +// WatchBlockProposed is a free log subscription operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} @@ -1336,9 +1337,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.Watch }), nil } -// ParseBlockProposed is a log parse operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. +// ParseBlockProposed is a log parse operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed(log types.Log) (*TaikoL1ClientBlockProposed, error) { event := new(TaikoL1ClientBlockProposed) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed", log); err != nil { @@ -1422,13 +1423,14 @@ type TaikoL1ClientBlockProposed0 struct { LivenessBond *big.Int ProverFee *big.Int Reward *big.Int + MinTier uint16 Meta TaikoDataBlockMetadata Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. +// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { var blockIdRule []interface{} @@ -1447,9 +1449,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.Fil return &TaikoL1ClientBlockProposed0Iterator{contract: _TaikoL1Client.contract, event: "BlockProposed0", logs: logs, sub: sub}, nil } -// WatchBlockProposed0 is a free log subscription operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. +// WatchBlockProposed0 is a free log subscription operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} @@ -1493,9 +1495,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.Watc }), nil } -// ParseBlockProposed0 is a log parse operation binding the contract event 0x7d7de1006646df79bd42d625048c46f105ef35f40005c7f05f26248c61ae6901. +// ParseBlockProposed0 is a log parse operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed0(log types.Log) (*TaikoL1ClientBlockProposed0, error) { event := new(TaikoL1ClientBlockProposed0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed0", log); err != nil { diff --git a/prover/prover.go b/prover/prover.go index 758105e86..f903e94c4 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -6,7 +6,6 @@ import ( "fmt" "math/big" "net/http" - "strings" "sync" "time" @@ -19,7 +18,6 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" - "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/metrics" eventIterator "github.com/taikoxyz/taiko-client/pkg/chain_iterator/event_iterator" "github.com/taikoxyz/taiko-client/pkg/rpc" @@ -263,23 +261,12 @@ func (p *Prover) eventLoop() { } } - lastLatestVerifiedL1Height := p.latestVerifiedL1Height - // If there is too many (TaikoData.Config.maxNumBlocks) pending blocks in TaikoL1 contract, there will be no new // BlockProposed temporarily, so except the BlockProposed subscription, we need another trigger to start // fetching the proposed blocks. forceProvingTicker := time.NewTicker(15 * time.Second) defer forceProvingTicker.Stop() - // If there is no new block verification in `proofCooldownPeriod * 2` seconds, and the current prover is - // a special prover, we will go back to try proving the block whose id is `lastVerifiedBlockId + 1`. - verificationCheckTicker := time.NewTicker( - time.Duration(p.protocolConfigs.ProofRegularCooldown.Uint64()*2) * time.Second, - ) - defer verificationCheckTicker.Stop() - - checkProofWindowExpiredTicker := time.After(p.checkProofWindowExpiredInterval) - // Call reqProving() right away to catch up with the latest state. reqProving() @@ -287,20 +274,6 @@ func (p *Prover) eventLoop() { select { case <-p.ctx.Done(): return - case <-verificationCheckTicker.C: - if err := backoff.Retry( - func() error { return p.checkChainVerification(lastLatestVerifiedL1Height) }, - backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), - ); err != nil { - log.Error("Check chain verification error", "error", err) - } - case <-checkProofWindowExpiredTicker: - func() { - defer func() { checkProofWindowExpiredTicker = time.After(p.checkProofWindowExpiredInterval) }() - if err := p.checkProofWindowsExpired(p.ctx); err != nil { - log.Error("Failed to check if proof window is expired", "error", err) - } - }() case proofWithHeader := <-p.proofGenerationCh: p.submitProofOp(p.ctx, proofWithHeader) case <-p.proveNotify: @@ -498,112 +471,55 @@ func (p *Prover) onBlockProposed( "proposedAt", block.ProposedAt, ) - var skipProofWindowExpiredCheck bool - if p.cfg.OracleProver { - shouldSkipProofWindowExpiredCheck := func() (bool, error) { - parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) - if err != nil { - return false, err - } - - // check if an invalid proof has been submitted, if so, we can skip proofWindowExpired check below - // and always submit proof. otherwise, oracleProver follows same proof logic as regular. - transition, err := p.rpc.TaikoL1.GetTransition( - &bind.CallOpts{Context: ctx}, - event.BlockId.Uint64(), - parent.Hash(), - ) - if err != nil { - if strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_TRANSITION_NOT_FOUND") { - // proof hasnt been submitted - return false, nil - } else { - return false, err - } - } - - block, err := p.rpc.L2.BlockByNumber(ctx, event.BlockId) - if err != nil { - return false, err - } - - // proof is invalid but has correct parents, oracle prover should skip - // checking proofWindow expired, and simply force prove. - if transition.BlockHash != block.Hash() { - log.Info( - "Oracle prover forcing prove block due to invalid proof", - "blockID", event.BlockId, - "transitionBlockHash", common.BytesToHash(transition.BlockHash[:]).Hex(), - "expectedBlockHash", block.Hash().Hex(), - ) - - return true, nil - } - - return false, nil - } - - if skipProofWindowExpiredCheck, err = shouldSkipProofWindowExpiredCheck(); err != nil { - return err - } - } - - if !skipProofWindowExpiredCheck { - proofWindowExpiresAt := block.ProposedAt + uint64(p.protocolConfigs.ProofWindow) - proofWindowExpired := uint64(time.Now().Unix()) > proofWindowExpiresAt - // zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address - if block.AssignedProver != p.proverAddress && !proofWindowExpired { - log.Info( - "Proposed block not provable", - "blockID", - event.BlockId, - "assignedProver", - block.AssignedProver.Hex(), - "proofWindowExpiresAt", - proofWindowExpiresAt, - "timeToExpire", - proofWindowExpiresAt-uint64(time.Now().Unix()), - ) - - // if we cant prove it now, but config is set to wait and try to prove - // expired proofs - if p.cfg.ProveUnassignedBlocks { - log.Info("Adding proposed block to wait for proof window expiration", - "blockID", - event.BlockId, - "assignedProver", - block.AssignedProver.Hex(), - "proofWindowExpiresAt", - proofWindowExpiresAt, - ) - - p.currentBlocksWaitingForProofWindowMutex.Lock() - p.currentBlocksWaitingForProofWindow[event.Meta.Id] = event.Raw.BlockNumber - p.currentBlocksWaitingForProofWindowMutex.Unlock() - } - - return nil - } - - // if set not to prove unassigned blocks, this block is still not provable - // by us even though its open proving. - if proofWindowExpired && !p.cfg.ProveUnassignedBlocks { - log.Info( - "Skipping proofWindowExpired block", - "blockID", event.BlockId, - ) - return nil - } - - log.Info( - "Proposed block is provable", - "blockID", event.BlockId, - "assignedProver", block.AssignedProver.Hex(), - "proofWindowExpired", proofWindowExpired, - ) - - metrics.ProverProofsAssigned.Inc(1) - } + // TODO: add this back + // if p.cfg.OracleProver { + // shouldSkipProofWindowExpiredCheck := func() (bool, error) { + // parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) + // if err != nil { + // return false, err + // } + + // // check if an invalid proof has been submitted, if so, we can skip proofWindowExpired check below + // // and always submit proof. otherwise, oracleProver follows same proof logic as regular. + // transition, err := p.rpc.TaikoL1.GetTransition( + // &bind.CallOpts{Context: ctx}, + // event.BlockId.Uint64(), + // parent.Hash(), + // ) + // if err != nil { + // if strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_TRANSITION_NOT_FOUND") { + // // proof hasnt been submitted + // return false, nil + // } else { + // return false, err + // } + // } + + // block, err := p.rpc.L2.BlockByNumber(ctx, event.BlockId) + // if err != nil { + // return false, err + // } + + // // proof is invalid but has correct parents, oracle prover should skip + // // checking proofWindow expired, and simply force prove. + // if transition.BlockHash != block.Hash() { + // log.Info( + // "Oracle prover forcing prove block due to invalid proof", + // "blockID", event.BlockId, + // "transitionBlockHash", common.BytesToHash(transition.BlockHash[:]).Hex(), + // "expectedBlockHash", block.Hash().Hex(), + // ) + + // return true, nil + // } + + // return false, nil + // } + + // if skipProofWindowExpiredCheck, err = shouldSkipProofWindowExpiredCheck(); err != nil { + // return err + // } + // } if !p.cfg.OracleProver { if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { @@ -810,33 +726,6 @@ func (p *Prover) closeSubscription() { p.blockProposedSub.Unsubscribe() } -// checkChainVerification checks if there is no new block verification in protocol, if so, -// it will let current special prover to go back to try proving the block whose id is `lastVerifiedBlockId + 1`. -func (p *Prover) checkChainVerification(lastLatestVerifiedL1Height uint64) error { - if (!p.cfg.OracleProver) || lastLatestVerifiedL1Height != p.latestVerifiedL1Height { - return nil - } - - log.Warn( - "No new block verification in `proofCooldownPeriod * 2` seconds", - "latestVerifiedL1Height", p.latestVerifiedL1Height, - "proofCooldownPeriod", p.protocolConfigs.ProofRegularCooldown, - ) - - stateVar, err := p.rpc.TaikoL1.GetStateVariables(&bind.CallOpts{Context: p.ctx}) - if err != nil { - log.Error("Failed to get protocol state variables", "error", err) - return err - } - - if err := p.initL1Current(new(big.Int).SetUint64(stateVar.LastVerifiedBlockId)); err != nil { - return err - } - p.lastHandledBlockID = stateVar.LastVerifiedBlockId - - return nil -} - // isValidProof cancels proof only if the parentGasUsed and parentHash in the proof match what // is expected func (p *Prover) isValidProof( @@ -969,10 +858,11 @@ func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) err return nil } -func proofWindow(tiers []*rpc.TierProviderTierWithID, id uint64) (uint64, error) { +// provingWindow returns the provingWindow of the given tier. +func provingWindow(tiers []*rpc.TierProviderTierWithID, id uint16) (time.Duration, error) { for _, tier := range tiers { if tier.ID == id { - + return time.Duration(tier.ProvingWindow) * time.Second, nil } } diff --git a/prover/prover_test.go b/prover/prover_test.go index ba5528bd4..585fb8237 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -194,12 +194,6 @@ func (s *ProverTestSuite) TestStartSubscription() { s.NotPanics(s.p.closeSubscription) } -func (s *ProverTestSuite) TestCheckChainVerification() { - s.Nil(s.p.checkChainVerification(0)) - s.p.latestVerifiedL1Height = 1024 - s.Nil(s.p.checkChainVerification(1024)) -} - func TestProverTestSuite(t *testing.T) { suite.Run(t, new(ProverTestSuite)) } From 920c7b7e719cc02f4244adf48f7d168b9215a190 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 1 Oct 2023 13:16:19 +0800 Subject: [PATCH 14/63] feat(integration_test): update test scripts --- bindings/.githead | 2 +- integration_test/entrypoint.sh | 1 - integration_test/nodes/init.sh | 4 +++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 6738f5ebd..64917ca0f 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -8a40bf3a331e6a3b42982ef54292acaa6f921ec3 +be0fe1cfa4f8f97f8abdec2a9d350c2c5224ac68 diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index a63ef3e5a..f57e50f16 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -53,7 +53,6 @@ if [ "$RUN_TESTS" == "true" ]; then L1_PROPOSER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ L2_SUGGESTED_FEE_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ L1_PROVER_PRIVATE_KEY=59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d \ - TREASURY=0xdf09A0afD09a63fb04ab3573922437e1e637dE8b \ PREMINT_TOKEN_AMOUNT=$PREMINT_TOKEN_AMOUNT \ JWT_SECRET=$DIR/nodes/jwt.hex \ go test -v -p=1 ./$PACKAGE -coverprofile=coverage.out -covermode=atomic -timeout=300s diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index 49a469b72..c8b72638d 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -33,13 +33,15 @@ L2_GENESIS_HASH=$( # Deploy Taiko protocol. cd $TAIKO_MONO_DIR/packages/protocol && PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - ORACLE_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ + GUARDIAN_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ OWNER=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \ TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ L2_SIGNAL_SERVICE=0x1000777700000000000000000000000000000007 \ SHARED_SIGNAL_SERVICE=0x0000000000000000000000000000000000000000 \ + PROPOSER=0x0000000000000000000000000000000000000000 \ TAIKO_TOKEN_PREMINT_RECIPIENTS="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266,0x70997970C51812dc3A010C7d01b50e0d17dc79C8" \ TAIKO_TOKEN_PREMINT_AMOUNTS=$PREMINT_TOKEN_AMOUNT,$PREMINT_TOKEN_AMOUNT \ + TIER_PROVIDER=0x0 \ L2_GENESIS_HASH=$L2_GENESIS_HASH \ forge script script/DeployOnL1.s.sol:DeployOnL1 \ --fork-url http://localhost:18545 \ From 4c24265e3dab3f596771346f28007d9220c84cf0 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 1 Oct 2023 13:28:34 +0800 Subject: [PATCH 15/63] test: update encoding tests --- bindings/encoding/input.go | 2 +- bindings/encoding/input_test.go | 4 ++-- bindings/encoding/struct.go | 4 ++-- proposer/proposer.go | 2 +- proposer/proposer_test.go | 2 +- proposer/prover_selector/eth_fee_eoa_selector.go | 2 +- prover/proof_submitter/valid_proof_submitter.go | 4 ++-- prover/prover.go | 9 ++------- 8 files changed, 12 insertions(+), 17 deletions(-) diff --git a/bindings/encoding/input.go b/bindings/encoding/input.go index d09741dd5..8ebd3290c 100644 --- a/bindings/encoding/input.go +++ b/bindings/encoding/input.go @@ -57,7 +57,7 @@ var ( Components: []abi.ArgumentMarshaling{ { Name: "tier", - Type: "uint64", + Type: "uint16", }, { Name: "fee", diff --git a/bindings/encoding/input_test.go b/bindings/encoding/input_test.go index d031ffb6e..f58d05fef 100644 --- a/bindings/encoding/input_test.go +++ b/bindings/encoding/input_test.go @@ -18,7 +18,7 @@ func TestEncodeEvidence(t *testing.T) { SignalRoot: randomHash(), Graffiti: randomHash(), Tier: uint16(rand.Uint64()), - Proofs: randomHash().Big().Bytes(), + Proof: randomHash().Big().Bytes(), } b, err := EncodeEvidence(evidence) @@ -32,7 +32,7 @@ func TestEncodeProverAssignment(t *testing.T) { &ProverAssignment{ Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), FeeToken: common.Address{}, - TierFees: []*TierFee{}, + TierFees: []TierFee{{Tier: 0, Fee: common.Big1}}, Signature: randomHash().Big().Bytes(), Expiry: 1024, }, diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index a3f848b8c..356aed5a0 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -36,7 +36,7 @@ type BlockEvidence struct { SignalRoot [32]byte Graffiti [32]byte Tier uint16 - Proofs []byte + Proof []byte } // TierFee should be same with TaikoData.TierFee. @@ -49,7 +49,7 @@ type TierFee struct { type ProverAssignment struct { Prover common.Address FeeToken common.Address - TierFees []*TierFee + TierFees []TierFee Expiry uint64 Signature []byte } diff --git a/proposer/proposer.go b/proposer/proposer.go index 37e42923e..cce0fa0aa 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -409,7 +409,7 @@ func (p *Proposer) ProposeTxList( &encoding.ProverAssignment{ Prover: prover, FeeToken: common.Address{}, - TierFees: []*encoding.TierFee{}, // TODO: update tier fees + TierFees: []encoding.TierFee{}, // TODO: update tier fees Expiry: uint64(proverAssignmentTimeout.Seconds()), Signature: signature, }, diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 4508b2a8d..4da60efd3 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -175,7 +175,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { &encoding.ProverAssignment{ Prover: prover, FeeToken: common.Address{}, - TierFees: []*encoding.TierFee{}, + TierFees: []encoding.TierFee{}, Expiry: uint64(proverAssignmentTimeout.Seconds()), Signature: signature, }, diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index 11784c89b..7644d82a1 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -227,7 +227,7 @@ func assignProver( encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ Prover: result.Prover, FeeToken: common.Address{}, - TierFees: []*encoding.TierFee{}, // TODO: update tier fees + TierFees: []encoding.TierFee{}, // TODO: update tier fees Expiry: reqBody.Expiry, Signature: result.SignedPayload, }) diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index a7e9dd864..4c1a88dfb 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -228,14 +228,14 @@ func (s *ValidProofSubmitter) SubmitProof( SignalRoot: proofWithHeader.Opts.SignalRoot, Graffiti: s.graffiti, Tier: 0, // TODO: update tier - Proofs: zkProof, + Proof: zkProof, } circuitsIdx, err := proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) if err != nil { return err } - evidence.Proofs = append(uint16ToBytes(circuitsIdx), evidence.Proofs...) + evidence.Proof = append(uint16ToBytes(circuitsIdx), evidence.Proof...) input, err := encoding.EncodeEvidence(evidence) if err != nil { diff --git a/prover/prover.go b/prover/prover.go index ea054c07f..b9b386f36 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -461,16 +461,11 @@ func (p *Prover) onBlockProposed( p.cancelProof(ctx, event.Meta.Id) } - block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, event.BlockId.Uint64()) - if err != nil { - return err - } - log.Info( "Proposed block information", "blockID", event.BlockId, - "assignedProver", block.AssignedProver, - "proposedAt", block.ProposedAt, + "assignedProver", event.AssignedProver, + "minTier", event.MinTier, ) // TODO: add this back From 355ced6064b4ce19bb4ef0b1168a20a648bbcb59 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 1 Oct 2023 13:53:47 +0800 Subject: [PATCH 16/63] feat(all): rename oracle prover to guardian prover --- bindings/encoding/input.go | 2 +- cmd/flags/prover.go | 26 +++++----- pkg/rpc/methods.go | 6 ++- proposer/proposer.go | 19 ++++++-- proposer/proposer_test.go | 6 +-- .../prover_selector/eth_fee_eoa_selector.go | 41 ++++++++-------- .../eth_fee_eoa_selector_test.go | 3 +- proposer/prover_selector/interface.go | 2 +- prover/config.go | 24 +++++----- prover/config_test.go | 48 +++++++++---------- .../proof_submitter/valid_proof_submitter.go | 8 ++-- prover/prover.go | 48 +++++++++---------- prover/prover_test.go | 10 ++-- prover/server/api.go | 4 +- prover/server/api_test.go | 2 +- prover/server/server.go | 6 +-- prover/server/server_test.go | 2 +- testutils/helper.go | 2 +- 18 files changed, 135 insertions(+), 124 deletions(-) diff --git a/bindings/encoding/input.go b/bindings/encoding/input.go index 8ebd3290c..8f9b873ff 100644 --- a/bindings/encoding/input.go +++ b/bindings/encoding/input.go @@ -126,7 +126,7 @@ func EncodeProverAssignmentPayload( txListHash common.Hash, feeToken common.Address, expiry uint64, - tierFees []*TierFee, + tierFees []TierFee, ) ([]byte, error) { // TODO: implement this function. return nil, nil diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 72b5f203b..4b483b77a 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -34,7 +34,7 @@ var ( } ProverCapacity = &cli.Uint64Flag{ Name: "prover.capacity", - Usage: "Capacity of prover, required if oracleProver is false", + Usage: "Capacity of prover", Required: true, Category: proverCategory, } @@ -53,19 +53,19 @@ var ( Value: 1, Category: proverCategory, } - OracleProver = &cli.BoolFlag{ - Name: "oracleProver", - Usage: "Set whether prover should use oracle prover or not", + GuardianProver = &cli.BoolFlag{ + Name: "guardianProver", + Usage: "Set whether prover should use guardian prover or not", Category: proverCategory, } - OracleProverPrivateKey = &cli.StringFlag{ - Name: "oracleProverPrivateKey", - Usage: "Private key of oracle prover", + GuardianProverPrivateKey = &cli.StringFlag{ + Name: "guardianProverPrivateKey", + Usage: "Private key of guardian prover", Category: proverCategory, } - OracleProofSubmissionDelay = &cli.DurationFlag{ - Name: "oracleProofSubmissionDelay", - Usage: "Oracle proof submission delay", + GuardianProofSubmissionDelay = &cli.DurationFlag{ + Name: "guardianProofSubmissionDelay", + Usage: "Guardian proof submission delay", Value: 0 * time.Second, Category: proverCategory, } @@ -148,9 +148,9 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ StartingBlockID, MaxConcurrentProvingJobs, Dummy, - OracleProver, - OracleProverPrivateKey, - OracleProofSubmissionDelay, + GuardianProver, + GuardianProverPrivateKey, + GuardianProofSubmissionDelay, ProofSubmissionMaxRetry, ProveBlockTxReplacementMultiplier, ProveBlockMaxTxGasTipCap, diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index 09bc16c97..9c2c8c90d 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -22,7 +22,8 @@ import ( var ( // errSyncing is returned when the L2 execution engine is syncing. - errSyncing = errors.New("syncing") + errSyncing = errors.New("syncing") + errEmptyTiersList = errors.New("empty proof tiers list in protocol") // syncProgressRecheckDelay is the time delay of rechecking the L2 execution engine's sync progress again, // if the previous check failed. syncProgressRecheckDelay = 12 * time.Second @@ -576,6 +577,9 @@ func (c *Client) GetTiers(ctx context.Context) ([]*TierProviderTierWithID, error if err != nil { return nil, err } + if len(ids) == 0 { + return nil, errEmptyTiersList + } var tiers []*TierProviderTierWithID for _, id := range ids { diff --git a/proposer/proposer.go b/proposer/proposer.go index cce0fa0aa..72db2e81c 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -56,6 +56,8 @@ type Proposer struct { proposeBlockTxGasLimit *uint64 txReplacementTipMultiplier uint64 proposeBlockTxGasTipCap *big.Int + tiers []*rpc.TierProviderTierWithID + tierFees []encoding.TierFee // Prover selector proverSelector selector.ProverSelector @@ -124,11 +126,22 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { log.Info("Protocol configs", "configs", p.protocolConfigs) + if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { + return err + } + + log.Info("Protocol tiers", "tiers", p.tiers) + + // TODO: use flags to set tier fees + for _, tier := range p.tiers { + p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: common.Big256}) + } + if p.proverSelector, err = selector.NewETHFeeEOASelector( &protocolConfigs, p.rpc, cfg.TaikoL1Address, - cfg.BlockProposalFee, + p.tierFees, cfg.BlockProposalFeeIncreasePercentage, cfg.ProverEndpoints, cfg.BlockProposalFeeIterations, @@ -386,7 +399,7 @@ func (p *Proposer) ProposeTxList( ) error { signature, prover, fee, err := p.proverSelector.AssignProver( ctx, - []*encoding.TierFee{}, // TODO: update tier fees + p.tierFees, crypto.Keccak256Hash(txListBytes), ) if err != nil { @@ -409,7 +422,7 @@ func (p *Proposer) ProposeTxList( &encoding.ProverAssignment{ Prover: prover, FeeToken: common.Address{}, - TierFees: []encoding.TierFee{}, // TODO: update tier fees + TierFees: p.tierFees, Expiry: uint64(proverAssignmentTimeout.Seconds()), Signature: signature, }, diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 4da60efd3..4faf6a36a 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -163,7 +163,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { signature, prover, fee, err := s.p.proverSelector.AssignProver( context.Background(), - []*encoding.TierFee{}, + s.p.tierFees, testutils.RandomHash(), ) s.Nil(err) @@ -175,7 +175,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { &encoding.ProverAssignment{ Prover: prover, FeeToken: common.Address{}, - TierFees: []encoding.TierFee{}, + TierFees: s.p.tierFees, Expiry: uint64(proverAssignmentTimeout.Seconds()), Signature: signature, }, @@ -190,7 +190,7 @@ func (s *ProposerTestSuite) TestAssignProverSuccessFirstRound() { s.SetL1Automine(false) defer s.SetL1Automine(true) - _, _, fee, err := s.p.proverSelector.AssignProver(context.Background(), []*encoding.TierFee{}, testutils.RandomHash()) + _, _, fee, err := s.p.proverSelector.AssignProver(context.Background(), s.p.tierFees, testutils.RandomHash()) s.Nil(err) s.Equal(fee.Uint64(), s.p.cfg.BlockProposalFee.Uint64()) diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index 7644d82a1..f3550efcc 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -33,7 +33,7 @@ type ETHFeeEOASelector struct { protocolConfigs *bindings.TaikoDataConfig rpc *rpc.Client taikoL1Address common.Address - feeBase *big.Int + tiersFee []encoding.TierFee feeIncreasePercentage *big.Int proverEndpoints []*url.URL proposalFeeIterations uint64 @@ -46,7 +46,7 @@ func NewETHFeeEOASelector( protocolConfigs *bindings.TaikoDataConfig, rpc *rpc.Client, taikoL1Address common.Address, - feeBase *big.Int, + tiersFee []encoding.TierFee, feeIncreasePercentage *big.Int, proverEndpoints []*url.URL, proposalFeeIterations uint64, @@ -67,7 +67,7 @@ func NewETHFeeEOASelector( protocolConfigs, rpc, taikoL1Address, - feeBase, + tiersFee, feeIncreasePercentage, proverEndpoints, proposalFeeIterations, @@ -82,12 +82,12 @@ func (s *ETHFeeEOASelector) ProverEndpoints() []*url.URL { return s.proverEndpoi // AssignProver tries to pick a prover through the registered prover endpoints. func (s *ETHFeeEOASelector) AssignProver( ctx context.Context, - tierFees []*encoding.TierFee, + tierFees []encoding.TierFee, txListHash common.Hash, ) ([]byte, common.Address, *big.Int, error) { - oracleProverAddress, err := s.rpc.TaikoL1.Resolve0( + guardianProverAddress, err := s.rpc.TaikoL1.Resolve0( &bind.CallOpts{Context: ctx}, - rpc.StringToBytes32("oracle_prover"), + rpc.StringToBytes32("guardian"), true, ) if err != nil { @@ -98,27 +98,26 @@ func (s *ETHFeeEOASelector) AssignProver( // If we do not find a prover, we can increase the fee up to a point, or give up. for i := 0; i < int(s.proposalFeeIterations); i++ { var ( - fee = new(big.Int).Set(s.feeBase) expiry = uint64(time.Now().Add(s.proposalExpiry).Unix()) ) // Increase fee on each failed loop - if i > 0 { - cumulativePercent := new(big.Int).Mul(s.feeIncreasePercentage, big.NewInt(int64(i))) - increase := new(big.Int).Mul(fee, cumulativePercent) - increase.Div(increase, big.NewInt(100)) - fee.Add(fee, increase) - } + // TODO: fix this + // if i > 0 { + // cumulativePercent := new(big.Int).Mul(s.feeIncreasePercentage, big.NewInt(int64(i))) + // increase := new(big.Int).Mul(fee, cumulativePercent) + // increase.Div(increase, big.NewInt(100)) + // fee.Add(fee, increase) + // } for _, endpoint := range s.shuffleProverEndpoints() { encodedAssignment, proverAddress, err := assignProver( ctx, endpoint, - fee, expiry, tierFees, txListHash, s.requestTimeout, - oracleProverAddress, + guardianProverAddress, ) if err != nil { log.Warn("Failed to assign prover", "endpoint", endpoint, "error", err) @@ -134,7 +133,8 @@ func (s *ETHFeeEOASelector) AssignProver( continue } - return encodedAssignment, proverAddress, fee, nil + // TODO: fix fee value + return encodedAssignment, proverAddress, common.Big1, nil } } @@ -153,17 +153,15 @@ func (s *ETHFeeEOASelector) shuffleProverEndpoints() []*url.URL { func assignProver( ctx context.Context, endpoint *url.URL, - fee *big.Int, expiry uint64, - tierFees []*encoding.TierFee, + tierFees []encoding.TierFee, txListHash common.Hash, timeout time.Duration, - oracleProverAddress common.Address, + guardianProverAddress common.Address, ) ([]byte, common.Address, error) { log.Info( "Attempting to assign prover", "endpoint", endpoint, - "fee", fee.String(), "expiry", expiry, "txListHash", txListHash, ) @@ -227,7 +225,7 @@ func assignProver( encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ Prover: result.Prover, FeeToken: common.Address{}, - TierFees: []encoding.TierFee{}, // TODO: update tier fees + TierFees: tierFees, Expiry: reqBody.Expiry, Signature: result.SignedPayload, }) @@ -239,7 +237,6 @@ func assignProver( "Prover assigned", "address", result.Prover, "endpoint", endpoint, - "fee", fee.String(), "expiry", expiry, ) diff --git a/proposer/prover_selector/eth_fee_eoa_selector_test.go b/proposer/prover_selector/eth_fee_eoa_selector_test.go index 00fd11dbc..df3d415c5 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector_test.go +++ b/proposer/prover_selector/eth_fee_eoa_selector_test.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" + "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/testutils" ) @@ -32,7 +33,7 @@ func (s *ProverSelectorTestSuite) SetupTest() { &protocolConfigs, s.RpcClient, common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - common.Big256, + []encoding.TierFee{}, common.Big2, []*url.URL{s.ProverEndpoints[0]}, 32, diff --git a/proposer/prover_selector/interface.go b/proposer/prover_selector/interface.go index 04bf0d276..c699e7db0 100644 --- a/proposer/prover_selector/interface.go +++ b/proposer/prover_selector/interface.go @@ -12,7 +12,7 @@ import ( type ProverSelector interface { AssignProver( ctx context.Context, - tierFees []*encoding.TierFee, + tierFees []encoding.TierFee, txListHash common.Hash, ) (signedPayload []byte, prover common.Address, fee *big.Int, err error) ProverEndpoints() []*url.URL diff --git a/prover/config.go b/prover/config.go index 5ba898ac6..7880f2270 100644 --- a/prover/config.go +++ b/prover/config.go @@ -27,9 +27,9 @@ type Config struct { StartingBlockID *big.Int MaxConcurrentProvingJobs uint Dummy bool - OracleProver bool - OracleProverPrivateKey *ecdsa.PrivateKey - OracleProofSubmissionDelay time.Duration + GuardianProver bool + GuardianProverPrivateKey *ecdsa.PrivateKey + GuardianProofSubmissionDelay time.Duration ProofSubmissionMaxRetry uint64 Graffiti string BackOffMaxRetrys uint64 @@ -57,15 +57,15 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, fmt.Errorf("invalid L1 prover private key: %w", err) } - var oracleProverPrivKey *ecdsa.PrivateKey - if c.IsSet(flags.OracleProver.Name) { - if !c.IsSet(flags.OracleProverPrivateKey.Name) { - return nil, fmt.Errorf("oracleProver flag set without oracleProverPrivateKey set") + var guardianProverPrivKey *ecdsa.PrivateKey + if c.IsSet(flags.GuardianProver.Name) { + if !c.IsSet(flags.GuardianProverPrivateKey.Name) { + return nil, fmt.Errorf("guardianProver flag set without guardianProverPrivateKey set") } - oracleProverPrivKey, err = crypto.ToECDSA(common.Hex2Bytes(c.String(flags.OracleProverPrivateKey.Name))) + guardianProverPrivKey, err = crypto.ToECDSA(common.Hex2Bytes(c.String(flags.GuardianProverPrivateKey.Name))) if err != nil { - return nil, fmt.Errorf("invalid oracle private key: %w", err) + return nil, fmt.Errorf("invalid guardian private key: %w", err) } } @@ -118,9 +118,9 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { StartingBlockID: startingBlockID, MaxConcurrentProvingJobs: c.Uint(flags.MaxConcurrentProvingJobs.Name), Dummy: c.Bool(flags.Dummy.Name), - OracleProver: c.Bool(flags.OracleProver.Name), - OracleProverPrivateKey: oracleProverPrivKey, - OracleProofSubmissionDelay: c.Duration(flags.OracleProofSubmissionDelay.Name), + GuardianProver: c.Bool(flags.GuardianProver.Name), + GuardianProverPrivateKey: guardianProverPrivKey, + GuardianProofSubmissionDelay: c.Duration(flags.GuardianProofSubmissionDelay.Name), ProofSubmissionMaxRetry: c.Uint64(flags.ProofSubmissionMaxRetry.Name), Graffiti: c.String(flags.Graffiti.Name), BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), diff --git a/prover/config_test.go b/prover/config_test.go index 988755cc4..a2ef5ad45 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -21,7 +21,7 @@ var ( minProofFee = "1024" ) -func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { +func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { app := s.SetupApp() app.Action = func(ctx *cli.Context) error { c, err := NewConfigFromCliContext(ctx) @@ -37,10 +37,10 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { crypto.PubkeyToAddress(c.L1ProverPrivKey.PublicKey), ) s.True(c.Dummy) - s.True(c.OracleProver) + s.True(c.GuardianProver) s.Equal( - crypto.PubkeyToAddress(s.p.cfg.OracleProverPrivateKey.PublicKey), - crypto.PubkeyToAddress(c.OracleProverPrivateKey.PublicKey), + crypto.PubkeyToAddress(s.p.cfg.GuardianProverPrivateKey.PublicKey), + crypto.PubkeyToAddress(c.GuardianProverPrivateKey.PublicKey), ) s.Equal("", c.Graffiti) s.Equal(30*time.Second, c.CheckProofWindowExpiredInterval) @@ -58,7 +58,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { } s.Nil(app.Run([]string{ - "TestNewConfigFromCliContext_OracleProver", + "TestNewConfigFromCliContextGuardianProver", "--" + flags.L1WSEndpoint.Name, l1WsEndpoint, "--" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, "--" + flags.L2WSEndpoint.Name, l2WsEndpoint, @@ -72,10 +72,10 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { "--" + flags.Dummy.Name, "--" + flags.MinProofFee.Name, minProofFee, "--" + flags.ProverCapacity.Name, "8", - "--" + flags.OracleProver.Name, + "--" + flags.GuardianProver.Name, "--" + flags.ProveBlockTxReplacementMultiplier.Name, "3", "--" + flags.ProveBlockMaxTxGasTipCap.Name, "256", - "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.Graffiti.Name, "", "--" + flags.CheckProofWindowExpiredInterval.Name, "30s", "--" + flags.TempCapacityExpiresAt.Name, "15s", @@ -83,7 +83,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { })) } -func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { +func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProverError() { app := s.SetupApp() s.ErrorContains(app.Run([]string{ @@ -96,11 +96,11 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { "--" + flags.TaikoL2Address.Name, taikoL2, "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.Dummy.Name, - "--" + flags.OracleProver.Name, + "--" + flags.GuardianProver.Name, "--" + flags.Graffiti.Name, "", "--" + flags.RPCTimeout.Name, "5s", "--" + flags.MinProofFee.Name, minProofFee, - }), "oracleProver flag set without oracleProverPrivateKey set") + }), "guardianProver flag set without guardianProverPrivateKey set") } func (s *ProverTestSuite) TestNewConfigFromCliContext_ProverKeyError() { @@ -112,15 +112,15 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_ProverKeyError() { }), "invalid L1 prover private key") } -func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverKeyError() { +func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProverKeyError() { app := s.SetupApp() s.ErrorContains(app.Run([]string{ "TestNewConfigFromCliContext", "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProver.Name, - "--" + flags.OracleProverPrivateKey.Name, "", - }), "invalid oracle private key") + "--" + flags.GuardianProver.Name, + "--" + flags.GuardianProverPrivateKey.Name, "", + }), "invalid guardian private key") } func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayError() { @@ -129,8 +129,8 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayError() { s.ErrorContains(app.Run([]string{ "TestNewConfigFromCliContext", "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProver.Name, + "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "--" + flags.GuardianProver.Name, "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -141,8 +141,8 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorLower() { s.ErrorContains(app.Run([]string{ "TestNewConfigFromCliContext", "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProver.Name, + "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "--" + flags.GuardianProver.Name, "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -153,8 +153,8 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorUpper() { s.ErrorContains(app.Run([]string{ "TestNewConfigFromCliContext", "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProver.Name, + "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "--" + flags.GuardianProver.Name, "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -165,8 +165,8 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorOrder() { s.ErrorContains(app.Run([]string{ "TestNewConfigFromCliContext", "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.OracleProver.Name, + "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "--" + flags.GuardianProver.Name, "--" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value (lower > upper)") } @@ -183,8 +183,8 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, &cli.Uint64Flag{Name: flags.StartingBlockID.Name}, &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.BoolFlag{Name: flags.OracleProver.Name}, - &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, + &cli.BoolFlag{Name: flags.GuardianProver.Name}, + &cli.StringFlag{Name: flags.GuardianProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, &cli.DurationFlag{Name: flags.CheckProofWindowExpiredInterval.Name}, &cli.BoolFlag{Name: flags.ProveUnassignedBlocks.Name}, diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index 4c1a88dfb..35faa3979 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -38,7 +38,7 @@ type ValidProofSubmitter struct { l1SignalService common.Address l2SignalService common.Address mutex *sync.Mutex - isOracleProver bool + isGuardianProver bool graffiti [32]byte submissionMaxRetry uint64 retryInterval time.Duration @@ -56,7 +56,7 @@ func NewValidProofSubmitter( taikoL2Address common.Address, proverPrivKey *ecdsa.PrivateKey, mutex *sync.Mutex, - isOracleProver bool, + isGuardianProver bool, graffiti string, submissionMaxRetry uint64, retryInterval time.Duration, @@ -91,7 +91,7 @@ func NewValidProofSubmitter( l2SignalService: l2SignalService, taikoL2Address: taikoL2Address, mutex: mutex, - isOracleProver: isOracleProver, + isGuardianProver: isGuardianProver, graffiti: rpc.StringToBytes32(graffiti), submissionMaxRetry: submissionMaxRetry, retryInterval: retryInterval, @@ -275,7 +275,7 @@ func (s *ValidProofSubmitter) SubmitProof( } maxRetry := &s.submissionMaxRetry - if s.isOracleProver { + if s.isGuardianProver { maxRetry = nil } diff --git a/prover/prover.go b/prover/prover.go index b9b386f36..29303f554 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -29,8 +29,7 @@ import ( ) var ( - errNoCapacity = errors.New("no prover capacity available") - errEmptyTiersList = errors.New("empty proof tiers list in protocol") + errNoCapacity = errors.New("no prover capacity available") ) type cancelFunc func() @@ -38,9 +37,9 @@ type cancelFunc func() // Prover keep trying to prove new proposed blocks valid/invalid. type Prover struct { // Configurations - cfg *Config - proverAddress common.Address - oracleProverAddress common.Address + cfg *Config + proverAddress common.Address + guardianProverAddress common.Address // Clients rpc *rpc.Client @@ -156,17 +155,17 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.checkProofWindowExpiredInterval = p.cfg.CheckProofWindowExpiredInterval - oracleProverAddress, err := p.rpc.TaikoL1.Resolve( + guardianProverAddress, err := p.rpc.TaikoL1.Resolve( &bind.CallOpts{Context: ctx}, p.rpc.L1ChainID, - rpc.StringToBytes32("oracle_prover"), + rpc.StringToBytes32("guardian"), true, ) if err != nil { return err } - p.oracleProverAddress = oracleProverAddress + p.guardianProverAddress = guardianProverAddress var producer proofProducer.ProofProducer if cfg.Dummy { @@ -192,7 +191,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.cfg.TaikoL2Address, p.cfg.L1ProverPrivKey, p.submitProofTxMutex, - p.cfg.OracleProver, + p.cfg.GuardianProver, p.cfg.Graffiti, p.cfg.ProofSubmissionMaxRetry, p.cfg.BackOffRetryInterval, @@ -207,9 +206,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { return err } - if len(p.tiers) == 0 { - return errEmptyTiersList - } // Prover server proverServerOpts := &server.NewProverServerOpts{ @@ -220,10 +216,10 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { TaikoL1Address: p.cfg.TaikoL1Address, Rpc: p.rpc, Bond: protocolConfigs.LivenessBond, - IsOracle: p.cfg.OracleProver, + IsGuardian: p.cfg.GuardianProver, } - if p.cfg.OracleProver { - proverServerOpts.ProverPrivateKey = p.cfg.OracleProverPrivateKey + if p.cfg.GuardianProver { + proverServerOpts.ProverPrivateKey = p.cfg.GuardianProverPrivateKey } if p.srv, err = server.New(proverServerOpts); err != nil { return err @@ -469,7 +465,7 @@ func (p *Prover) onBlockProposed( ) // TODO: add this back - // if p.cfg.OracleProver { + // if p.cfg.GuardianProver { // shouldSkipProofWindowExpiredCheck := func() (bool, error) { // parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) // if err != nil { @@ -477,7 +473,7 @@ func (p *Prover) onBlockProposed( // } // // check if an invalid proof has been submitted, if so, we can skip proofWindowExpired check below - // // and always submit proof. otherwise, oracleProver follows same proof logic as regular. + // // and always submit proof. otherwise, guardianProver follows same proof logic as regular. // transition, err := p.rpc.TaikoL1.GetTransition( // &bind.CallOpts{Context: ctx}, // event.BlockId.Uint64(), @@ -497,11 +493,11 @@ func (p *Prover) onBlockProposed( // return false, err // } - // // proof is invalid but has correct parents, oracle prover should skip + // // proof is invalid but has correct parents, guardian prover should skip // // checking proofWindow expired, and simply force prove. // if transition.BlockHash != block.Hash() { // log.Info( - // "Oracle prover forcing prove block due to invalid proof", + // "Guardian prover forcing prove block due to invalid proof", // "blockID", event.BlockId, // "transitionBlockHash", common.BytesToHash(transition.BlockHash[:]).Hex(), // "expectedBlockHash", block.Hash().Hex(), @@ -518,7 +514,7 @@ func (p *Prover) onBlockProposed( // } // } - if !p.cfg.OracleProver { + if !p.cfg.GuardianProver { if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { return errNoCapacity } @@ -572,7 +568,7 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc defer func() { <-p.submitProofConcurrencyGuard - if !p.cfg.OracleProver { + if !p.cfg.GuardianProver { _, released := p.capacityManager.ReleaseOneCapacity(proofWithHeader.Meta.Id) if !released { log.Error("unable to release capacity") @@ -618,7 +614,7 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli } // onBlockProven cancels proof generation if the proof is being generated by this prover, -// and the proof is not the oracle proof address. +// and the proof is not the guardian proof address. func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) @@ -636,8 +632,8 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien if isValidProof { p.cancelProof(ctx, event.BlockId.Uint64()) } else { - // generate oracle proof if oracle prover, proof is invalid - if p.cfg.OracleProver { + // generate guardian proof if guardian prover, proof is invalid + if p.cfg.GuardianProver { return p.requestProofForBlockId(event.BlockId, new(big.Int).SetUint64(event.Raw.BlockNumber)) } } @@ -758,7 +754,7 @@ func (p *Prover) cancelProof(ctx context.Context, blockID uint64) { cancel() delete(p.currentBlocksBeingProven, blockID) - if !p.cfg.OracleProver { + if !p.cfg.GuardianProver { capacity, released := p.capacityManager.ReleaseOneCapacity(blockID) if !released { log.Error("unable to release capacity while cancelling proof", @@ -795,7 +791,7 @@ func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) err } // make sure to takea capacity before requesting proof - if !p.cfg.OracleProver { + if !p.cfg.GuardianProver { if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { return errNoCapacity } diff --git a/prover/prover_test.go b/prover/prover_test.go index 585fb8237..308ef6a0e 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -49,8 +49,8 @@ func (s *ProverTestSuite) SetupTest() { TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), L1ProverPrivKey: l1ProverPrivKey, - OracleProverPrivateKey: l1ProverPrivKey, - OracleProver: false, + GuardianProverPrivateKey: l1ProverPrivKey, + GuardianProver: false, Dummy: true, MaxConcurrentProvingJobs: 1, CheckProofWindowExpiredInterval: 5 * time.Second, @@ -131,7 +131,7 @@ func (s *ProverTestSuite) TestInitError() { TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), L1ProverPrivKey: l1ProverPrivKey, - OracleProverPrivateKey: l1ProverPrivKey, + GuardianProverPrivateKey: l1ProverPrivKey, Dummy: true, MaxConcurrentProvingJobs: 1, CheckProofWindowExpiredInterval: 5 * time.Second, @@ -141,11 +141,11 @@ func (s *ProverTestSuite) TestInitError() { } func (s *ProverTestSuite) TestOnBlockProposed() { - s.p.cfg.OracleProver = true + s.p.cfg.GuardianProver = true // Init prover l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) s.Nil(err) - s.p.cfg.OracleProverPrivateKey = l1ProverPrivKey + s.p.cfg.GuardianProverPrivateKey = l1ProverPrivKey // Valid block e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) s.Nil(s.p.onBlockProposed(context.Background(), e, func() {})) diff --git a/prover/server/api.go b/prover/server/api.go index 058023717..5cabe51b4 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -15,7 +15,7 @@ import ( // CreateAssignmentRequestBody represents a request body when handling assignment creation request. type CreateAssignmentRequestBody struct { FeeToken common.Address - TierFees []*encoding.TierFee + TierFees []encoding.TierFee Expiry uint64 TxListHash common.Hash } @@ -88,7 +88,7 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { return echo.NewHTTPError(http.StatusUnprocessableEntity, "only receive ETH") } - if !srv.isOracle { + if !srv.isGuardian { ok, err := rpc.CheckProverBalance(c.Request().Context(), srv.rpc, srv.proverAddress, srv.taikoL1Address, srv.bond) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err) diff --git a/prover/server/api_test.go b/prover/server/api_test.go index 29bb3cbe8..67d948ec2 100644 --- a/prover/server/api_test.go +++ b/prover/server/api_test.go @@ -31,7 +31,7 @@ func (s *ProverServerTestSuite) TestGetStatusSuccess() { func (s *ProverServerTestSuite) TestProposeBlockSuccess() { data, err := json.Marshal(CreateAssignmentRequestBody{ FeeToken: (common.Address{}), - TierFees: []*encoding.TierFee{{Tier: 0, Fee: common.Big256}}, + TierFees: []encoding.TierFee{{Tier: 0, Fee: common.Big256}}, Expiry: uint64(time.Now().Add(time.Minute).Unix()), TxListHash: common.BigToHash(common.Big1), }) diff --git a/prover/server/server.go b/prover/server/server.go index ac8141190..85fddc586 100644 --- a/prover/server/server.go +++ b/prover/server/server.go @@ -39,7 +39,7 @@ type ProverServer struct { taikoL1Address common.Address rpc *rpc.Client bond *big.Int - isOracle bool + isGuardian bool } // NewProverServerOpts contains all configurations for creating a prover server instance. @@ -51,7 +51,7 @@ type NewProverServerOpts struct { TaikoL1Address common.Address Rpc *rpc.Client Bond *big.Int - IsOracle bool + IsGuardian bool } // New creates a new prover server instance. @@ -66,7 +66,7 @@ func New(opts *NewProverServerOpts) (*ProverServer, error) { taikoL1Address: opts.TaikoL1Address, rpc: opts.Rpc, bond: opts.Bond, - isOracle: opts.IsOracle, + isGuardian: opts.IsGuardian, } srv.echo.HideBanner = true diff --git a/prover/server/server_test.go b/prover/server/server_test.go index e992e91b5..d007c94f1 100644 --- a/prover/server/server_test.go +++ b/prover/server/server_test.go @@ -55,7 +55,7 @@ func (s *ProverServerTestSuite) SetupTest() { taikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), rpc: rpcClient, bond: common.Big0, - isOracle: false, + isGuardian: false, } p.echo.HideBanner = true diff --git a/testutils/helper.go b/testutils/helper.go index 366e5b4f9..85d51d276 100644 --- a/testutils/helper.go +++ b/testutils/helper.go @@ -189,7 +189,7 @@ func NewTestProverServer( TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), Rpc: s.RpcClient, Bond: protocolConfig.LivenessBond, - IsOracle: true, + IsGuardian: true, }) s.Nil(err) From 34765daa0e3dd8701416c7dea8c719b45a0fc0d5 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 1 Oct 2023 23:26:20 +0800 Subject: [PATCH 17/63] feat(encoding): implement `EncodeProverAssignmentPayload()` --- bindings/encoding/input.go | 39 ++++++++++++++++--- proposer/proposer.go | 31 +++++++-------- proposer/proposer_test.go | 13 ++----- .../prover_selector/eth_fee_eoa_selector.go | 10 +++-- proposer/prover_selector/interface.go | 2 +- 5 files changed, 58 insertions(+), 37 deletions(-) diff --git a/bindings/encoding/input.go b/bindings/encoding/input.go index 8f9b873ff..48687778b 100644 --- a/bindings/encoding/input.go +++ b/bindings/encoding/input.go @@ -78,11 +78,37 @@ var ( var ( // Evidence - EvidenceType, _ = abi.NewType("tuple", "TaikoData.BlockEvidence", evidenceComponents) - EvidenceArgs = abi.Arguments{{Name: "Evidence", Type: EvidenceType}} + evidenceType, _ = abi.NewType("tuple", "TaikoData.BlockEvidence", evidenceComponents) + evidenceArgs = abi.Arguments{{Name: "Evidence", Type: evidenceType}} // ProverAssignment proverAssignmentType, _ = abi.NewType("tuple", "ProverAssignment", proverAssignmentComponents) proverAssignmentArgs = abi.Arguments{{Name: "ProverAssignment", Type: proverAssignmentType}} + // ProverAssignmentPayload + stringType, _ = abi.NewType("string", "", nil) + bytes32Type, _ = abi.NewType("bytes32", "", nil) + addressType, _ = abi.NewType("address", "", nil) + uint64Type, _ = abi.NewType("uint64", "", nil) + tierFeesType, _ = abi.NewType( + "tuple[]", + "", + []abi.ArgumentMarshaling{ + { + Name: "tier", + Type: "uint16", + }, + { + Name: "fee", + Type: "uint256", + }, + }, + ) + proverAssignmentPayloadArgs = abi.Arguments{ + {Name: "PROVER_ASSIGNMENT", Type: stringType}, + {Name: "txListHash", Type: bytes32Type}, + {Name: "assignment.feeToken", Type: addressType}, + {Name: "assignment.expiry", Type: uint64Type}, + {Name: "assignment.tierFees", Type: tierFeesType}, + } ) // Contract ABIs. @@ -114,7 +140,7 @@ func EncodeProverAssignment(assignment *ProverAssignment) ([]byte, error) { // EncodeEvidence performs the solidity `abi.encode` for the given evidence. func EncodeEvidence(e *BlockEvidence) ([]byte, error) { - b, err := EvidenceArgs.Pack(e) + b, err := evidenceArgs.Pack(e) if err != nil { return nil, fmt.Errorf("failed to abi.encode evidence, %w", err) } @@ -128,8 +154,11 @@ func EncodeProverAssignmentPayload( expiry uint64, tierFees []TierFee, ) ([]byte, error) { - // TODO: implement this function. - return nil, nil + b, err := proverAssignmentPayloadArgs.Pack("PROVER_ASSIGNMENT", txListHash, feeToken, expiry, tierFees) + if err != nil { + return nil, fmt.Errorf("failed to abi.encode prover assignment hash payload, %w", err) + } + return b, nil } // UnpackTxListBytes unpacks the input data of a TaikoL1.proposeBlock transaction, and returns the txList bytes. diff --git a/proposer/proposer.go b/proposer/proposer.go index 72db2e81c..a93891a89 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -130,10 +130,18 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { return err } - log.Info("Protocol tiers", "tiers", p.tiers) - // TODO: use flags to set tier fees for _, tier := range p.tiers { + log.Info( + "Protocol tier", + "id", tier.ID, + "name", string(tier.VerifierName[:]), + "validityBond", tier.ValidityBond, + "contestBond", tier.ContestBond, + "provingWindow", tier.ProvingWindow, + "cooldownWindow", tier.CooldownWindow, + ) + p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: common.Big256}) } @@ -343,7 +351,7 @@ func (p *Proposer) sendProposeBlockTx( ctx context.Context, txListBytes []byte, nonce *uint64, - assignment *encoding.ProverAssignment, + signedAssignment []byte, fee *big.Int, isReplacement bool, ) (*types.Transaction, error) { @@ -371,16 +379,11 @@ func (p *Proposer) sendProposeBlockTx( } } - encodedssignment, err := encoding.EncodeProverAssignment(assignment) - if err != nil { - return nil, err - } - proposeTx, err := p.rpc.TaikoL1.ProposeBlock( opts, crypto.Keccak256Hash(txListBytes), rpc.StringToBytes32(p.cfg.ExtraData), - encodedssignment, + signedAssignment, txListBytes, ) if err != nil { @@ -397,7 +400,7 @@ func (p *Proposer) ProposeTxList( txNum uint, nonce *uint64, ) error { - signature, prover, fee, err := p.proverSelector.AssignProver( + signedAssignment, fee, err := p.proverSelector.AssignProver( ctx, p.tierFees, crypto.Keccak256Hash(txListBytes), @@ -419,13 +422,7 @@ func (p *Proposer) ProposeTxList( ctx, txListBytes, nonce, - &encoding.ProverAssignment{ - Prover: prover, - FeeToken: common.Address{}, - TierFees: p.tierFees, - Expiry: uint64(proverAssignmentTimeout.Seconds()), - Signature: signature, - }, + signedAssignment, fee, isReplacement, ); err != nil { diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 4faf6a36a..02c98c4f0 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -13,7 +13,6 @@ import ( "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/suite" "github.com/taikoxyz/taiko-client/bindings" - "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/testutils" ) @@ -161,7 +160,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { encoded, err := rlp.EncodeToBytes(emptyTxs) s.Nil(err) - signature, prover, fee, err := s.p.proverSelector.AssignProver( + signedAssignment, fee, err := s.p.proverSelector.AssignProver( context.Background(), s.p.tierFees, testutils.RandomHash(), @@ -172,13 +171,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { context.Background(), encoded, &nonce, - &encoding.ProverAssignment{ - Prover: prover, - FeeToken: common.Address{}, - TierFees: s.p.tierFees, - Expiry: uint64(proverAssignmentTimeout.Seconds()), - Signature: signature, - }, + signedAssignment, fee, true, ) @@ -190,7 +183,7 @@ func (s *ProposerTestSuite) TestAssignProverSuccessFirstRound() { s.SetL1Automine(false) defer s.SetL1Automine(true) - _, _, fee, err := s.p.proverSelector.AssignProver(context.Background(), s.p.tierFees, testutils.RandomHash()) + _, fee, err := s.p.proverSelector.AssignProver(context.Background(), s.p.tierFees, testutils.RandomHash()) s.Nil(err) s.Equal(fee.Uint64(), s.p.cfg.BlockProposalFee.Uint64()) diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index f3550efcc..c4ec06a46 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -84,14 +84,14 @@ func (s *ETHFeeEOASelector) AssignProver( ctx context.Context, tierFees []encoding.TierFee, txListHash common.Hash, -) ([]byte, common.Address, *big.Int, error) { +) ([]byte, *big.Int, error) { guardianProverAddress, err := s.rpc.TaikoL1.Resolve0( &bind.CallOpts{Context: ctx}, rpc.StringToBytes32("guardian"), true, ) if err != nil { - return nil, common.Address{}, nil, err + return nil, nil, err } // Iterate over each configured endpoint, and see if someone wants to accept this block. // If it is denied, we continue on to the next endpoint. @@ -134,11 +134,11 @@ func (s *ETHFeeEOASelector) AssignProver( } // TODO: fix fee value - return encodedAssignment, proverAddress, common.Big1, nil + return encodedAssignment, common.Big256, nil } } - return nil, common.Address{}, nil, errUnableToFindProver + return nil, nil, errUnableToFindProver } // shuffleProverEndpoints shuffles the current selector's prover endpoints. @@ -220,7 +220,9 @@ func assignProver( } // Convert signature to one solidity can recover by adding 27 to 65th byte + log.Info("Prover signature", "signature", result.SignedPayload, "len", len(result.SignedPayload)) result.SignedPayload[64] = uint8(uint(result.SignedPayload[64])) + 27 + log.Info("Prover signature2", "signature", result.SignedPayload, "len", len(result.SignedPayload)) encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ Prover: result.Prover, diff --git a/proposer/prover_selector/interface.go b/proposer/prover_selector/interface.go index c699e7db0..60a765074 100644 --- a/proposer/prover_selector/interface.go +++ b/proposer/prover_selector/interface.go @@ -14,6 +14,6 @@ type ProverSelector interface { ctx context.Context, tierFees []encoding.TierFee, txListHash common.Hash, - ) (signedPayload []byte, prover common.Address, fee *big.Int, err error) + ) (signedPayload []byte, fee *big.Int, err error) ProverEndpoints() []*url.URL } From 666ff72f6db7e7c3e3a29421b73058ba24853d10 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 2 Oct 2023 00:17:10 +0800 Subject: [PATCH 18/63] test: update tests --- integration_test/entrypoint.sh | 1 + proposer/config_test.go | 27 ---------- proposer/proposer.go | 1 - proposer/proposer_test.go | 2 +- .../prover_selector/eth_fee_eoa_selector.go | 2 - prover/config_test.go | 50 +------------------ prover/prover.go | 11 ---- prover/server/api_test.go | 10 ---- 8 files changed, 3 insertions(+), 101 deletions(-) diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index f57e50f16..a63ef3e5a 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -53,6 +53,7 @@ if [ "$RUN_TESTS" == "true" ]; then L1_PROPOSER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ L2_SUGGESTED_FEE_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ L1_PROVER_PRIVATE_KEY=59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d \ + TREASURY=0xdf09A0afD09a63fb04ab3573922437e1e637dE8b \ PREMINT_TOKEN_AMOUNT=$PREMINT_TOKEN_AMOUNT \ JWT_SECRET=$DIR/nodes/jwt.hex \ go test -v -p=1 ./$PACKAGE -coverprofile=coverage.out -covermode=atomic -timeout=300s diff --git a/proposer/config_test.go b/proposer/config_test.go index 7b84f5d47..270d6d292 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -96,33 +96,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContextPrivKeyErr() { }), "invalid L1 proposer private key") } -func (s *ProposerTestSuite) TestNewConfigFromCliContextPropIntervalErr() { - goldenTouchPrivKey, err := s.RpcClient.TaikoL2.GOLDENTOUCHPRIVATEKEY(nil) - s.Nil(err) - - app := s.SetupApp() - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContextProposeIntervalErr", - "--" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()), - "--" + flags.ProposeInterval.Name, "", - }), "invalid proposing interval") -} - -func (s *ProposerTestSuite) TestNewConfigFromCliContextEmptyPropoIntervalErr() { - goldenTouchPrivKey, err := s.RpcClient.TaikoL2.GOLDENTOUCHPRIVATEKEY(nil) - s.Nil(err) - - app := s.SetupApp() - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContextEmptyProposalIntervalErr", - "--" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()), - "--" + flags.ProposeInterval.Name, proposeInterval, - "--" + flags.ProposeEmptyBlocksInterval.Name, "", - }), "invalid proposing empty blocks interval") -} - func (s *ProposerTestSuite) TestNewConfigFromCliContextL2RecipErr() { goldenTouchPrivKey, err := s.RpcClient.TaikoL2.GOLDENTOUCHPRIVATEKEY(nil) s.Nil(err) diff --git a/proposer/proposer.go b/proposer/proposer.go index a93891a89..a521ecbd9 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -520,7 +520,6 @@ func getTxOpts( } opts.GasTipCap = gasTipCap - opts.Value = fee return opts, nil diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 02c98c4f0..7e2ce87f4 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -163,7 +163,7 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { signedAssignment, fee, err := s.p.proverSelector.AssignProver( context.Background(), s.p.tierFees, - testutils.RandomHash(), + crypto.Keccak256Hash(encoded), ) s.Nil(err) diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index c4ec06a46..6b041d8da 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -220,9 +220,7 @@ func assignProver( } // Convert signature to one solidity can recover by adding 27 to 65th byte - log.Info("Prover signature", "signature", result.SignedPayload, "len", len(result.SignedPayload)) result.SignedPayload[64] = uint8(uint(result.SignedPayload[64])) + 27 - log.Info("Prover signature2", "signature", result.SignedPayload, "len", len(result.SignedPayload)) encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ Prover: result.Prover, diff --git a/prover/config_test.go b/prover/config_test.go index a2ef5ad45..74787c101 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -123,54 +123,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProverKeyError() { }), "invalid guardian private key") } -func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayError() { - app := s.SetupApp() - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContext", - "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProver.Name, - "--" + flags.MinProofFee.Name, minProofFee, - }), "invalid random dummy proof delay value") -} - -func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorLower() { - app := s.SetupApp() - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContext", - "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProver.Name, - "--" + flags.MinProofFee.Name, minProofFee, - }), "invalid random dummy proof delay value") -} - -func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorUpper() { - app := s.SetupApp() - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContext", - "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProver.Name, - "--" + flags.MinProofFee.Name, minProofFee, - }), "invalid random dummy proof delay value") -} - -func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorOrder() { - app := s.SetupApp() - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContext", - "--" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "--" + flags.GuardianProver.Name, - "--" + flags.MinProofFee.Name, minProofFee, - }), "invalid random dummy proof delay value (lower > upper)") -} - func (s *ProverTestSuite) SetupApp() *cli.App { app := cli.NewApp() app.Flags = []cli.Flag{ @@ -191,7 +143,7 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.Uint64Flag{Name: flags.ProveBlockTxReplacementMultiplier.Name}, &cli.Uint64Flag{Name: flags.ProveBlockMaxTxGasTipCap.Name}, &cli.DurationFlag{Name: flags.RPCTimeout.Name}, - &cli.DurationFlag{Name: flags.ProverCapacity.Name}, + &cli.Uint64Flag{Name: flags.ProverCapacity.Name}, &cli.Uint64Flag{Name: flags.MinProofFee.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxGasLimit.Name}, &cli.DurationFlag{Name: flags.TempCapacityExpiresAt.Name}, diff --git a/prover/prover.go b/prover/prover.go index 29303f554..d3805c8c5 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -850,14 +850,3 @@ func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) err return nil } - -// provingWindow returns the provingWindow of the given tier. -func provingWindow(tiers []*rpc.TierProviderTierWithID, id uint16) (time.Duration, error) { - for _, tier := range tiers { - if tier.ID == id { - return time.Duration(tier.ProvingWindow) * time.Second, nil - } - } - - return 0, fmt.Errorf("tier id not found: %d", id) -} diff --git a/prover/server/api_test.go b/prover/server/api_test.go index 67d948ec2..d066d4579 100644 --- a/prover/server/api_test.go +++ b/prover/server/api_test.go @@ -1,7 +1,6 @@ package server import ( - "crypto/rand" "encoding/json" "io" "net/http" @@ -44,12 +43,3 @@ func (s *ProverServerTestSuite) TestProposeBlockSuccess() { s.Nil(err) s.Contains(string(b), "signedPayload") } - -// randomHash generates a random blob of data and returns it as a hash. -func randomHash() common.Hash { - var hash common.Hash - if n, err := rand.Read(hash[:]); n != common.HashLength || err != nil { - panic(err) - } - return hash -} From 97444758d9ee9bd21a33164cbd19c4e951d3d83f Mon Sep 17 00:00:00 2001 From: David Date: Fri, 6 Oct 2023 12:42:14 +0800 Subject: [PATCH 19/63] feat(bindings): update bindings --- bindings/.githead | 2 +- bindings/gen_taiko_l2.go | 224 +++++++------------- driver/chain_syncer/calldata/syncer.go | 14 +- prover/capacity_manager/capacity_manager.go | 21 +- prover/prover.go | 195 ++--------------- 5 files changed, 122 insertions(+), 334 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 64917ca0f..dceed7fc9 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -be0fe1cfa4f8f97f8abdec2a9d350c2c5224ac68 +a74f44f1d710185c9b29d88e60e73794893ba99d diff --git a/bindings/gen_taiko_l2.go b/bindings/gen_taiko_l2.go index f95cbdb49..c1b40a319 100644 --- a/bindings/gen_taiko_l2.go +++ b/bindings/gen_taiko_l2.go @@ -29,17 +29,9 @@ var ( _ = abi.ConvertType ) -// TaikoL2EIP1559Config is an auto generated low-level Go binding around an user-defined struct. -type TaikoL2EIP1559Config struct { - Xscale *big.Int - Yscale *big.Int - GasIssuedPerSecond uint32 - GasExcessMax uint64 -} - // TaikoL2ClientMetaData contains all meta data concerning the TaikoL2Client contract. var TaikoL2ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainid\",\"type\":\"uint64\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"name\":\"calcEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"xscale\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"xscale\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"EIP1559_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_GAS_EXCESS_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"gasExcess\",\"type\":\"uint128\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"syncedL1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"get1559Params\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"adjustmentQuotient\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"syncedL1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"_gasExcess\",\"type\":\"uint128\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // TaikoL2ClientABI is the input ABI used to generate the binding from. @@ -281,74 +273,88 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) AddressManager() (common.Addre return _TaikoL2Client.Contract.AddressManager(&_TaikoL2Client.CallOpts) } -// CalcEIP1559Config is a free data retrieval call binding the contract method 0x06becb55. +// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // -// Solidity: function calcEIP1559Config(uint64 basefee, uint32 gasIssuedPerSecond, uint64 gasExcessMax, uint64 gasTarget, uint64 ratio2x1x) pure returns((uint128,uint128,uint32,uint64) config) -func (_TaikoL2Client *TaikoL2ClientCaller) CalcEIP1559Config(opts *bind.CallOpts, basefee uint64, gasIssuedPerSecond uint32, gasExcessMax uint64, gasTarget uint64, ratio2x1x uint64) (TaikoL2EIP1559Config, error) { +// Solidity: function gasExcess() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientCaller) GasExcess(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "calcEIP1559Config", basefee, gasIssuedPerSecond, gasExcessMax, gasTarget, ratio2x1x) + err := _TaikoL2Client.contract.Call(opts, &out, "gasExcess") if err != nil { - return *new(TaikoL2EIP1559Config), err + return *new(*big.Int), err } - out0 := *abi.ConvertType(out[0], new(TaikoL2EIP1559Config)).(*TaikoL2EIP1559Config) + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } -// CalcEIP1559Config is a free data retrieval call binding the contract method 0x06becb55. +// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // -// Solidity: function calcEIP1559Config(uint64 basefee, uint32 gasIssuedPerSecond, uint64 gasExcessMax, uint64 gasTarget, uint64 ratio2x1x) pure returns((uint128,uint128,uint32,uint64) config) -func (_TaikoL2Client *TaikoL2ClientSession) CalcEIP1559Config(basefee uint64, gasIssuedPerSecond uint32, gasExcessMax uint64, gasTarget uint64, ratio2x1x uint64) (TaikoL2EIP1559Config, error) { - return _TaikoL2Client.Contract.CalcEIP1559Config(&_TaikoL2Client.CallOpts, basefee, gasIssuedPerSecond, gasExcessMax, gasTarget, ratio2x1x) +// Solidity: function gasExcess() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientSession) GasExcess() (*big.Int, error) { + return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) } -// CalcEIP1559Config is a free data retrieval call binding the contract method 0x06becb55. +// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // -// Solidity: function calcEIP1559Config(uint64 basefee, uint32 gasIssuedPerSecond, uint64 gasExcessMax, uint64 gasTarget, uint64 ratio2x1x) pure returns((uint128,uint128,uint32,uint64) config) -func (_TaikoL2Client *TaikoL2ClientCallerSession) CalcEIP1559Config(basefee uint64, gasIssuedPerSecond uint32, gasExcessMax uint64, gasTarget uint64, ratio2x1x uint64) (TaikoL2EIP1559Config, error) { - return _TaikoL2Client.Contract.CalcEIP1559Config(&_TaikoL2Client.CallOpts, basefee, gasIssuedPerSecond, gasExcessMax, gasTarget, ratio2x1x) +// Solidity: function gasExcess() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GasExcess() (*big.Int, error) { + return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) } -// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. +// Get1559Params is a free data retrieval call binding the contract method 0x594e47ca. // -// Solidity: function gasExcess() view returns(uint64) -func (_TaikoL2Client *TaikoL2ClientCaller) GasExcess(opts *bind.CallOpts) (uint64, error) { +// Solidity: function get1559Params() pure returns(uint64 gasTarget, uint256 adjustmentQuotient) +func (_TaikoL2Client *TaikoL2ClientCaller) Get1559Params(opts *bind.CallOpts) (struct { + GasTarget uint64 + AdjustmentQuotient *big.Int +}, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "gasExcess") + err := _TaikoL2Client.contract.Call(opts, &out, "get1559Params") + outstruct := new(struct { + GasTarget uint64 + AdjustmentQuotient *big.Int + }) if err != nil { - return *new(uint64), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.GasTarget = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.AdjustmentQuotient = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - return out0, err + return *outstruct, err } -// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. +// Get1559Params is a free data retrieval call binding the contract method 0x594e47ca. // -// Solidity: function gasExcess() view returns(uint64) -func (_TaikoL2Client *TaikoL2ClientSession) GasExcess() (uint64, error) { - return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) +// Solidity: function get1559Params() pure returns(uint64 gasTarget, uint256 adjustmentQuotient) +func (_TaikoL2Client *TaikoL2ClientSession) Get1559Params() (struct { + GasTarget uint64 + AdjustmentQuotient *big.Int +}, error) { + return _TaikoL2Client.Contract.Get1559Params(&_TaikoL2Client.CallOpts) } -// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. +// Get1559Params is a free data retrieval call binding the contract method 0x594e47ca. // -// Solidity: function gasExcess() view returns(uint64) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GasExcess() (uint64, error) { - return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) +// Solidity: function get1559Params() pure returns(uint64 gasTarget, uint256 adjustmentQuotient) +func (_TaikoL2Client *TaikoL2ClientCallerSession) Get1559Params() (struct { + GasTarget uint64 + AdjustmentQuotient *big.Int +}, error) { + return _TaikoL2Client.Contract.Get1559Params(&_TaikoL2Client.CallOpts) } // GetBasefee is a free data retrieval call binding the contract method 0xa7e022d1. // -// Solidity: function getBasefee(uint64 timeSinceParent, uint32 parentGasUsed) view returns(uint256 _basefee) -func (_TaikoL2Client *TaikoL2ClientCaller) GetBasefee(opts *bind.CallOpts, timeSinceParent uint64, parentGasUsed uint32) (*big.Int, error) { +// Solidity: function getBasefee(uint64 syncedL1Height, uint32 parentGasUsed) view returns(uint256 basefee) +func (_TaikoL2Client *TaikoL2ClientCaller) GetBasefee(opts *bind.CallOpts, syncedL1Height uint64, parentGasUsed uint32) (*big.Int, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "getBasefee", timeSinceParent, parentGasUsed) + err := _TaikoL2Client.contract.Call(opts, &out, "getBasefee", syncedL1Height, parentGasUsed) if err != nil { return *new(*big.Int), err @@ -362,16 +368,16 @@ func (_TaikoL2Client *TaikoL2ClientCaller) GetBasefee(opts *bind.CallOpts, timeS // GetBasefee is a free data retrieval call binding the contract method 0xa7e022d1. // -// Solidity: function getBasefee(uint64 timeSinceParent, uint32 parentGasUsed) view returns(uint256 _basefee) -func (_TaikoL2Client *TaikoL2ClientSession) GetBasefee(timeSinceParent uint64, parentGasUsed uint32) (*big.Int, error) { - return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, timeSinceParent, parentGasUsed) +// Solidity: function getBasefee(uint64 syncedL1Height, uint32 parentGasUsed) view returns(uint256 basefee) +func (_TaikoL2Client *TaikoL2ClientSession) GetBasefee(syncedL1Height uint64, parentGasUsed uint32) (*big.Int, error) { + return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, syncedL1Height, parentGasUsed) } // GetBasefee is a free data retrieval call binding the contract method 0xa7e022d1. // -// Solidity: function getBasefee(uint64 timeSinceParent, uint32 parentGasUsed) view returns(uint256 _basefee) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBasefee(timeSinceParent uint64, parentGasUsed uint32) (*big.Int, error) { - return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, timeSinceParent, parentGasUsed) +// Solidity: function getBasefee(uint64 syncedL1Height, uint32 parentGasUsed) view returns(uint256 basefee) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBasefee(syncedL1Height uint64, parentGasUsed uint32) (*big.Int, error) { + return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, syncedL1Height, parentGasUsed) } // GetBlockHash is a free data retrieval call binding the contract method 0x23ac7136. @@ -467,37 +473,6 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainSignalRoot(blockI return _TaikoL2Client.Contract.GetCrossChainSignalRoot(&_TaikoL2Client.CallOpts, blockId) } -// GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. -// -// Solidity: function getEIP1559Config() pure returns((uint128,uint128,uint32,uint64) config) -func (_TaikoL2Client *TaikoL2ClientCaller) GetEIP1559Config(opts *bind.CallOpts) (TaikoL2EIP1559Config, error) { - var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "getEIP1559Config") - - if err != nil { - return *new(TaikoL2EIP1559Config), err - } - - out0 := *abi.ConvertType(out[0], new(TaikoL2EIP1559Config)).(*TaikoL2EIP1559Config) - - return out0, err - -} - -// GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. -// -// Solidity: function getEIP1559Config() pure returns((uint128,uint128,uint32,uint64) config) -func (_TaikoL2Client *TaikoL2ClientSession) GetEIP1559Config() (TaikoL2EIP1559Config, error) { - return _TaikoL2Client.Contract.GetEIP1559Config(&_TaikoL2Client.CallOpts) -} - -// GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. -// -// Solidity: function getEIP1559Config() pure returns((uint128,uint128,uint32,uint64) config) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GetEIP1559Config() (TaikoL2EIP1559Config, error) { - return _TaikoL2Client.Contract.GetEIP1559Config(&_TaikoL2Client.CallOpts) -} - // LatestSyncedL1Height is a free data retrieval call binding the contract method 0xc7b96908. // // Solidity: function latestSyncedL1Height() view returns(uint64) @@ -560,37 +535,6 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) Owner() (common.Address, error return _TaikoL2Client.Contract.Owner(&_TaikoL2Client.CallOpts) } -// ParentTimestamp is a free data retrieval call binding the contract method 0x539b8ade. -// -// Solidity: function parentTimestamp() view returns(uint64) -func (_TaikoL2Client *TaikoL2ClientCaller) ParentTimestamp(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "parentTimestamp") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// ParentTimestamp is a free data retrieval call binding the contract method 0x539b8ade. -// -// Solidity: function parentTimestamp() view returns(uint64) -func (_TaikoL2Client *TaikoL2ClientSession) ParentTimestamp() (uint64, error) { - return _TaikoL2Client.Contract.ParentTimestamp(&_TaikoL2Client.CallOpts) -} - -// ParentTimestamp is a free data retrieval call binding the contract method 0x539b8ade. -// -// Solidity: function parentTimestamp() view returns(uint64) -func (_TaikoL2Client *TaikoL2ClientCallerSession) ParentTimestamp() (uint64, error) { - return _TaikoL2Client.Contract.ParentTimestamp(&_TaikoL2Client.CallOpts) -} - // PublicInputHash is a free data retrieval call binding the contract method 0xdac5df78. // // Solidity: function publicInputHash() view returns(bytes32) @@ -736,44 +680,44 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) SignAnchor(digest [32]byte, k // Anchor is a paid mutator transaction binding the contract method 0xda69d3db. // -// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) returns() -func (_TaikoL2Client *TaikoL2ClientTransactor) Anchor(opts *bind.TransactOpts, l1Hash [32]byte, l1SignalRoot [32]byte, l1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { - return _TaikoL2Client.contract.Transact(opts, "anchor", l1Hash, l1SignalRoot, l1Height, parentGasUsed) +// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 syncedL1Height, uint32 parentGasUsed) returns() +func (_TaikoL2Client *TaikoL2ClientTransactor) Anchor(opts *bind.TransactOpts, l1Hash [32]byte, l1SignalRoot [32]byte, syncedL1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { + return _TaikoL2Client.contract.Transact(opts, "anchor", l1Hash, l1SignalRoot, syncedL1Height, parentGasUsed) } // Anchor is a paid mutator transaction binding the contract method 0xda69d3db. // -// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) returns() -func (_TaikoL2Client *TaikoL2ClientSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, l1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, l1Height, parentGasUsed) +// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 syncedL1Height, uint32 parentGasUsed) returns() +func (_TaikoL2Client *TaikoL2ClientSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, syncedL1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, syncedL1Height, parentGasUsed) } // Anchor is a paid mutator transaction binding the contract method 0xda69d3db. // -// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) returns() -func (_TaikoL2Client *TaikoL2ClientTransactorSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, l1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, l1Height, parentGasUsed) +// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 syncedL1Height, uint32 parentGasUsed) returns() +func (_TaikoL2Client *TaikoL2ClientTransactorSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, syncedL1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, syncedL1Height, parentGasUsed) } -// Init is a paid mutator transaction binding the contract method 0x19ab453c. +// Init is a paid mutator transaction binding the contract method 0xcce03bf3. // -// Solidity: function init(address _addressManager) returns() -func (_TaikoL2Client *TaikoL2ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address) (*types.Transaction, error) { - return _TaikoL2Client.contract.Transact(opts, "init", _addressManager) +// Solidity: function init(address _addressManager, uint128 _gasExcess) returns() +func (_TaikoL2Client *TaikoL2ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _gasExcess *big.Int) (*types.Transaction, error) { + return _TaikoL2Client.contract.Transact(opts, "init", _addressManager, _gasExcess) } -// Init is a paid mutator transaction binding the contract method 0x19ab453c. +// Init is a paid mutator transaction binding the contract method 0xcce03bf3. // -// Solidity: function init(address _addressManager) returns() -func (_TaikoL2Client *TaikoL2ClientSession) Init(_addressManager common.Address) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager) +// Solidity: function init(address _addressManager, uint128 _gasExcess) returns() +func (_TaikoL2Client *TaikoL2ClientSession) Init(_addressManager common.Address, _gasExcess *big.Int) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager, _gasExcess) } -// Init is a paid mutator transaction binding the contract method 0x19ab453c. +// Init is a paid mutator transaction binding the contract method 0xcce03bf3. // -// Solidity: function init(address _addressManager) returns() -func (_TaikoL2Client *TaikoL2ClientTransactorSession) Init(_addressManager common.Address) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager) +// Solidity: function init(address _addressManager, uint128 _gasExcess) returns() +func (_TaikoL2Client *TaikoL2ClientTransactorSession) Init(_addressManager common.Address, _gasExcess *big.Int) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Init(&_TaikoL2Client.TransactOpts, _addressManager, _gasExcess) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -1052,20 +996,14 @@ func (it *TaikoL2ClientAnchoredIterator) Close() error { // TaikoL2ClientAnchored represents a Anchored event raised by the TaikoL2Client contract. type TaikoL2ClientAnchored struct { - Number uint64 - Basefee uint64 - Gaslimit uint32 - Timestamp uint64 ParentHash [32]byte - Prevrandao *big.Int - Coinbase common.Address - Chainid uint64 + GasExcess *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterAnchored is a free log retrieval operation binding the contract event 0xf0fde5abf5476e9fb590d1e786d07c1ceee1d3c80cce3fafe0478e203cf5184e. +// FilterAnchored is a free log retrieval operation binding the contract event 0xb01a20e23471fa4d881340e2b742c2f84cb2f7a714b34ba370b815478ae4aae0. // -// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) +// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess) func (_TaikoL2Client *TaikoL2ClientFilterer) FilterAnchored(opts *bind.FilterOpts) (*TaikoL2ClientAnchoredIterator, error) { logs, sub, err := _TaikoL2Client.contract.FilterLogs(opts, "Anchored") @@ -1075,9 +1013,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) FilterAnchored(opts *bind.FilterOpt return &TaikoL2ClientAnchoredIterator{contract: _TaikoL2Client.contract, event: "Anchored", logs: logs, sub: sub}, nil } -// WatchAnchored is a free log subscription operation binding the contract event 0xf0fde5abf5476e9fb590d1e786d07c1ceee1d3c80cce3fafe0478e203cf5184e. +// WatchAnchored is a free log subscription operation binding the contract event 0xb01a20e23471fa4d881340e2b742c2f84cb2f7a714b34ba370b815478ae4aae0. // -// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) +// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess) func (_TaikoL2Client *TaikoL2ClientFilterer) WatchAnchored(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientAnchored) (event.Subscription, error) { logs, sub, err := _TaikoL2Client.contract.WatchLogs(opts, "Anchored") @@ -1112,9 +1050,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) WatchAnchored(opts *bind.WatchOpts, }), nil } -// ParseAnchored is a log parse operation binding the contract event 0xf0fde5abf5476e9fb590d1e786d07c1ceee1d3c80cce3fafe0478e203cf5184e. +// ParseAnchored is a log parse operation binding the contract event 0xb01a20e23471fa4d881340e2b742c2f84cb2f7a714b34ba370b815478ae4aae0. // -// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) +// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess) func (_TaikoL2Client *TaikoL2ClientFilterer) ParseAnchored(log types.Log) (*TaikoL2ClientAnchored, error) { event := new(TaikoL2ClientAnchored) if err := _TaikoL2Client.contract.UnpackLog(event, "Anchored", log); err != nil { diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index c6040cd56..bbb703289 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -330,25 +330,21 @@ func (s *Syncer) insertNewHead( } } - parentTimestamp, err := s.rpc.TaikoL2.ParentTimestamp(&bind.CallOpts{BlockNumber: parent.Number, Context: ctx}) - if err != nil { - return nil, err - } - // Get L2 baseFee baseFee, err := s.rpc.TaikoL2.GetBasefee( &bind.CallOpts{BlockNumber: parent.Number, Context: ctx}, - event.Meta.Timestamp-parentTimestamp, + event.Meta.L1Height, uint32(parent.GasUsed), ) if err != nil { return nil, fmt.Errorf("failed to get L2 baseFee: %w", encoding.TryParsingCustomError(err)) } - log.Debug( - "GetBasefee", + log.Info( + "L2 baseFee", + "blockID", event.BlockId, "baseFee", baseFee, - "timeSinceParent", uint32(event.Meta.Timestamp-parentTimestamp), + "syncedL1Height", event.Meta.L1Height, "parentGasUsed", parent.GasUsed, ) diff --git a/prover/capacity_manager/capacity_manager.go b/prover/capacity_manager/capacity_manager.go index 532a94a4b..92b58db16 100644 --- a/prover/capacity_manager/capacity_manager.go +++ b/prover/capacity_manager/capacity_manager.go @@ -31,7 +31,8 @@ func (m *CapacityManager) ReadCapacity() uint64 { m.mutex.RLock() defer m.mutex.RUnlock() - log.Info("Reading capacity", + log.Info( + "Reading capacity", "maxCapacity", m.maxCapacity, "currentCapacity", m.maxCapacity-uint64(len(m.capacity)), "currentUsage", len(m.capacity), @@ -47,7 +48,8 @@ func (m *CapacityManager) ReleaseOneCapacity(blockID uint64) (uint64, bool) { defer m.mutex.Unlock() if _, ok := m.capacity[blockID]; !ok { - log.Info("Can not release capacity", + log.Info( + "Can not release capacity", "blockID", blockID, "maxCapacity", m.maxCapacity, "currentCapacity", m.maxCapacity-uint64(len(m.capacity)), @@ -58,7 +60,8 @@ func (m *CapacityManager) ReleaseOneCapacity(blockID uint64) (uint64, bool) { delete(m.capacity, blockID) - log.Info("Released capacity", + log.Info( + "Released capacity", "blockID", blockID, "maxCapacity", m.maxCapacity, "currentCapacityAfterRelease", m.maxCapacity-uint64(len(m.capacity)), @@ -74,7 +77,8 @@ func (m *CapacityManager) TakeOneCapacity(blockID uint64) (uint64, bool) { defer m.mutex.Unlock() if len(m.capacity) == int(m.maxCapacity) { - log.Info("Could not take one capacity", + log.Info( + "Could not take one capacity", "blockID", blockID, "maxCapacity", m.maxCapacity, "currentCapacity", m.maxCapacity-uint64(len(m.capacity)), @@ -85,7 +89,8 @@ func (m *CapacityManager) TakeOneCapacity(blockID uint64) (uint64, bool) { m.capacity[blockID] = true - log.Info("Took one capacity", + log.Info( + "Took one capacity", "blockID", blockID, "maxCapacity", m.maxCapacity, "currentCapacityAfterTaking", m.maxCapacity-uint64(len(m.capacity)), @@ -104,7 +109,8 @@ func (m *CapacityManager) TakeOneTempCapacity() (uint64, bool) { m.clearExpiredTempCapacities() if len(m.capacity)+len(m.tempCapacity) >= int(m.maxCapacity) { - log.Info("Could not take one temp capacity", + log.Info( + "Could not take one temp capacity", "maxCapacity", m.maxCapacity, "currentCapacityAfterTaking", m.maxCapacity-uint64(len(m.capacity)), "currentUsageAfterTaking", len(m.capacity), @@ -123,7 +129,8 @@ func (m *CapacityManager) clearExpiredTempCapacities() { for i, c := range m.tempCapacity { if time.Now().UTC().Sub(c) > m.tempCapacityExpiresAt { m.tempCapacity = append(m.tempCapacity[:i], m.tempCapacity[i+1:]...) - log.Info("Cleared one temp capacity", + log.Info( + "Cleared one temp capacity", "maxCapacity", m.maxCapacity, "currentCapacityAfterClearing", m.maxCapacity-uint64(len(m.capacity)), "currentUsageAfterClearing", len(m.capacity), diff --git a/prover/prover.go b/prover/prover.go index d3805c8c5..b9eb1a5dd 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -32,8 +32,6 @@ var ( errNoCapacity = errors.New("no prover capacity available") ) -type cancelFunc func() - // Prover keep trying to prove new proposed blocks valid/invalid. type Prover struct { // Configurations @@ -78,14 +76,6 @@ type Prover struct { submitProofConcurrencyGuard chan struct{} submitProofTxMutex *sync.Mutex - currentBlocksBeingProven map[uint64]cancelFunc - currentBlocksBeingProvenMutex *sync.Mutex - currentBlocksWaitingForProofWindow map[uint64]uint64 // l2BlockId : l1Height - currentBlocksWaitingForProofWindowMutex *sync.Mutex - - // interval settings - checkProofWindowExpiredInterval time.Duration - // capacity-related configs capacityManager *capacity.CapacityManager @@ -107,10 +97,6 @@ func (p *Prover) InitFromCli(ctx context.Context, c *cli.Context) error { func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.cfg = cfg p.ctx = ctx - p.currentBlocksBeingProven = make(map[uint64]cancelFunc) - p.currentBlocksBeingProvenMutex = new(sync.Mutex) - p.currentBlocksWaitingForProofWindow = make(map[uint64]uint64, 0) - p.currentBlocksWaitingForProofWindowMutex = new(sync.Mutex) p.capacityManager = capacity.New(cfg.Capacity, cfg.TempCapacityExpiresAt) // Clients @@ -153,8 +139,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.proposeConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) p.submitProofConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) - p.checkProofWindowExpiredInterval = p.cfg.CheckProofWindowExpiredInterval - guardianProverAddress, err := p.rpc.TaikoL1.Resolve( &bind.CallOpts{Context: ctx}, p.rpc.L1ChainID, @@ -257,7 +241,7 @@ func (p *Prover) eventLoop() { } } - // If there is too many (TaikoData.Config.maxNumBlocks) pending blocks in TaikoL1 contract, there will be no new + // If there is too many (TaikoData.Config.blockMaxProposals) pending blocks in TaikoL1 contract, there will be no new // BlockProposed temporarily, so except the BlockProposed subscription, we need another trigger to start // fetching the proposed blocks. forceProvingTicker := time.NewTicker(15 * time.Second) @@ -296,7 +280,7 @@ func (p *Prover) eventLoop() { func (p *Prover) Close(ctx context.Context) { p.closeSubscription() if err := p.srv.Shutdown(ctx); err != nil { - log.Error("Error shutting down http server", "error", err) + log.Error("Failed to shut down prover server", "error", err) } p.wg.Wait() } @@ -451,12 +435,6 @@ func (p *Prover) onBlockProposed( return nil } - // Check if the current prover has seen this block ID before, there was probably - // a L1 reorg, we need to cancel that reorged block's proof generation task at first. - if p.currentBlocksBeingProven[event.Meta.Id] != nil { - p.cancelProof(ctx, event.Meta.Id) - } - log.Info( "Proposed block information", "blockID", event.BlockId, @@ -520,16 +498,6 @@ func (p *Prover) onBlockProposed( } } - ctx, cancelCtx := context.WithCancel(ctx) - p.currentBlocksBeingProvenMutex.Lock() - p.currentBlocksBeingProven[event.BlockId.Uint64()] = cancelFunc(func() { - defer cancelCtx() - if err := p.validProofSubmitter.CancelProof(ctx, event.BlockId); err != nil { - log.Error("failed to cancel proof", "error", err, "blockID", event.BlockId) - } - }) - p.currentBlocksBeingProvenMutex.Unlock() - return p.validProofSubmitter.RequestProof(ctx, event) } @@ -547,9 +515,6 @@ func (p *Prover) onBlockProposed( func() error { return handleBlockProposedEvent() }, backoff.WithMaxRetries(backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), p.cfg.BackOffMaxRetrys), ); err != nil { - p.currentBlocksBeingProvenMutex.Lock() - delete(p.currentBlocksBeingProven, event.BlockId.Uint64()) - p.currentBlocksBeingProvenMutex.Unlock() log.Error("Handle new BlockProposed event error", "error", err) } }() @@ -562,10 +527,6 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc p.submitProofConcurrencyGuard <- struct{}{} go func() { - p.currentBlocksBeingProvenMutex.Lock() - delete(p.currentBlocksBeingProven, proofWithHeader.Meta.Id) - p.currentBlocksBeingProvenMutex.Unlock() - defer func() { <-p.submitProofConcurrencyGuard if !p.cfg.GuardianProver { @@ -607,37 +568,6 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli "prover", event.Prover, ) - // cancel any proofs being generated for this block - p.cancelProof(ctx, event.BlockId.Uint64()) - - return nil -} - -// onBlockProven cancels proof generation if the proof is being generated by this prover, -// and the proof is not the guardian proof address. -func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { - metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) - - // cancel any proofs being generated for this block - isValidProof, err := p.isValidProof( - ctx, - event.BlockId.Uint64(), - event.ParentHash, - event.BlockHash, - ) - if err != nil { - return err - } - - if isValidProof { - p.cancelProof(ctx, event.BlockId.Uint64()) - } else { - // generate guardian proof if guardian prover, proof is invalid - if p.cfg.GuardianProver { - return p.requestProofForBlockId(event.BlockId, new(big.Int).SetUint64(event.Raw.BlockNumber)) - } - } - return nil } @@ -744,109 +674,26 @@ func (p *Prover) isValidProof( return false, nil } -// cancelProof cancels local proof generation -func (p *Prover) cancelProof(ctx context.Context, blockID uint64) { - p.currentBlocksBeingProvenMutex.Lock() - defer p.currentBlocksBeingProvenMutex.Unlock() - - if cancel, ok := p.currentBlocksBeingProven[blockID]; ok { - log.Info("cancelling proof", "blockID", blockID) - - cancel() - delete(p.currentBlocksBeingProven, blockID) - if !p.cfg.GuardianProver { - capacity, released := p.capacityManager.ReleaseOneCapacity(blockID) - if !released { - log.Error("unable to release capacity while cancelling proof", - "capacity", capacity, - "blockID", blockID, - ) - } - } - } -} - -// proveOp performs a proving operation, find current unproven blocks, then -// request generating proofs for them. -func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) error { - onBlockProposed := func( - ctx context.Context, - event *bindings.TaikoL1ClientBlockProposed, - end eventIterator.EndBlockProposedEventIterFunc, - ) error { - // only filter for exact blockID we want - if event.BlockId.Cmp(blockId) != 0 { - return nil - } - - // Check whether the block has been verified. - isVerified, err := p.isBlockVerified(event.BlockId) - if err != nil { - return fmt.Errorf("failed to check if the current L2 block is verified: %w", err) - } - - if isVerified { - log.Info("📋 Block has been verified", "blockID", event.BlockId) - return nil - } - - // make sure to takea capacity before requesting proof - if !p.cfg.GuardianProver { - if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { - return errNoCapacity - } - } - - ctx, cancelCtx := context.WithCancel(ctx) - p.currentBlocksBeingProvenMutex.Lock() - p.currentBlocksBeingProven[event.BlockId.Uint64()] = cancelFunc(func() { - defer cancelCtx() - if err := p.validProofSubmitter.CancelProof(ctx, event.BlockId); err != nil { - log.Error("Failed to cancel proof", "error", err, "blockID", event.BlockId) - } - }) - p.currentBlocksBeingProvenMutex.Unlock() - - p.proposeConcurrencyGuard <- struct{}{} - - if err := p.validProofSubmitter.RequestProof(ctx, event); err != nil { - return err - } - - return nil - } - - handleBlockProposedEvent := func() error { - defer func() { <-p.proposeConcurrencyGuard }() - - iter, err := eventIterator.NewBlockProposedIterator(p.ctx, &eventIterator.BlockProposedIteratorConfig{ - Client: p.rpc.L1, - TaikoL1: p.rpc.TaikoL1, - StartHeight: l1Height, - EndHeight: new(big.Int).Add(l1Height, common.Big1), - OnBlockProposedEvent: onBlockProposed, - FilterQuery: []*big.Int{blockId}, - }) - if err != nil { - return err - } - - return iter.Iter() - } +// onBlockProven cancels proof generation if the proof is being generated by this prover, +// and the proof is not the guardian proof address. +func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { + metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) - go func() { - if err := backoff.Retry( - func() error { - return handleBlockProposedEvent() - }, - backoff.WithMaxRetries(backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), p.cfg.BackOffMaxRetrys), - ); err != nil { - p.currentBlocksBeingProvenMutex.Lock() - defer p.currentBlocksBeingProvenMutex.Unlock() - delete(p.currentBlocksBeingProven, blockId.Uint64()) - log.Error("Request proof with a given block ID", "blockID", blockId, "error", err) - } - }() + // cancel any proofs being generated for this block + // isValidProof, err := p.isValidProof( + // ctx, + // event.BlockId.Uint64(), + // event.ParentHash, + // event.BlockHash, + // ) + // if err != nil { + // return err + // } + + // // generate guardian proof if guardian prover, proof is invalid + // if p.cfg.GuardianProver { + // return p.requestProofForBlockId(event.BlockId, new(big.Int).SetUint64(event.Raw.BlockNumber)) + // } return nil } From 66f2701c6033e77dc17fb855955f8e2f8fc5e962 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 6 Oct 2023 19:18:03 +0800 Subject: [PATCH 20/63] feat(prover): update `onBlockProven` handler --- integration_test/nodes/docker-compose.yml | 2 +- prover/prover.go | 114 +++++++++++++++++----- 2 files changed, 93 insertions(+), 23 deletions(-) diff --git a/integration_test/nodes/docker-compose.yml b/integration_test/nodes/docker-compose.yml index 64a816b99..18b4c5d47 100644 --- a/integration_test/nodes/docker-compose.yml +++ b/integration_test/nodes/docker-compose.yml @@ -14,7 +14,7 @@ services: - "0.0.0.0" l2_execution_engine: - image: gcr.io/evmchain/taiko-geth:taiko + image: gcr.io/evmchain/taiko-geth:sha-6a5990c restart: unless-stopped pull_policy: always volumes: diff --git a/prover/prover.go b/prover/prover.go index b9eb1a5dd..1850f6540 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -260,16 +260,16 @@ func (p *Prover) eventLoop() { if err := p.proveOp(); err != nil { log.Error("Prove new blocks error", "error", err) } - case <-p.blockProposedCh: - reqProving() case e := <-p.blockVerifiedCh: if err := p.onBlockVerified(p.ctx, e); err != nil { log.Error("Handle BlockVerified event error", "error", err) } case e := <-p.transitionProvedCh: - if err := p.onBlockProven(p.ctx, e); err != nil { - log.Error("Handle BlockProven event error", "error", err) + if err := p.onTransitionProved(p.ctx, e); err != nil { + log.Error("Handle TransitionProved event error", "error", err) } + case <-p.blockProposedCh: + reqProving() case <-forceProvingTicker.C: reqProving() } @@ -674,26 +674,96 @@ func (p *Prover) isValidProof( return false, nil } -// onBlockProven cancels proof generation if the proof is being generated by this prover, -// and the proof is not the guardian proof address. -func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { +func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) - // cancel any proofs being generated for this block - // isValidProof, err := p.isValidProof( - // ctx, - // event.BlockId.Uint64(), - // event.ParentHash, - // event.BlockHash, - // ) - // if err != nil { - // return err - // } - - // // generate guardian proof if guardian prover, proof is invalid - // if p.cfg.GuardianProver { - // return p.requestProofForBlockId(event.BlockId, new(big.Int).SetUint64(event.Raw.BlockNumber)) - // } + if !p.cfg.GuardianProver { + return nil + } + + isValidProof, err := p.isValidProof( + ctx, + event.BlockId.Uint64(), + event.ParentHash, + event.BlockHash, + ) + if err != nil { + return err + } + + if isValidProof { + return nil + } + + L1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}) + if err != nil { + return err + } + + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(L1Height)) +} + +// requestProofByBlockID performs a proving operation for the given block. +func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) error { + onBlockProposed := func( + ctx context.Context, + event *bindings.TaikoL1ClientBlockProposed, + end eventIterator.EndBlockProposedEventIterFunc, + ) error { + // Only filter for exact blockID we want + if event.BlockId.Cmp(blockId) != 0 { + return nil + } + + // Check whether the block has been verified. + isVerified, err := p.isBlockVerified(event.BlockId) + if err != nil { + return fmt.Errorf("failed to check if the current L2 block is verified: %w", err) + } + + if isVerified { + log.Info("📋 Block has been verified", "blockID", event.BlockId) + return nil + } + + // make sure to takea capacity before requesting proof + if !p.cfg.GuardianProver { + if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { + return errNoCapacity + } + } + + p.proposeConcurrencyGuard <- struct{}{} + + return p.validProofSubmitter.RequestProof(ctx, event) + } + + handleBlockProposedEvent := func() error { + defer func() { <-p.proposeConcurrencyGuard }() + + iter, err := eventIterator.NewBlockProposedIterator(p.ctx, &eventIterator.BlockProposedIteratorConfig{ + Client: p.rpc.L1, + TaikoL1: p.rpc.TaikoL1, + StartHeight: l1Height, + EndHeight: new(big.Int).Add(l1Height, common.Big1), + OnBlockProposedEvent: onBlockProposed, + FilterQuery: []*big.Int{blockId}, + }) + if err != nil { + return err + } + + return iter.Iter() + } + + go func() { + if err := backoff.Retry( + func() error { return handleBlockProposedEvent() }, + backoff.WithMaxRetries(backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), p.cfg.BackOffMaxRetrys), + ); err != nil { + log.Error("Failed to request proof with a given block ID", "blockID", blockId, "error", err) + } + }() return nil } From 4dd63c3f0525c3ab6a1ecd8a17e59518281ccb15 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 6 Oct 2023 20:20:39 +0800 Subject: [PATCH 21/63] feat(prover): add `getProvingWindow` --- prover/prover.go | 127 +++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/prover/prover.go b/prover/prover.go index 1850f6540..81188e69f 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -29,7 +29,8 @@ import ( ) var ( - errNoCapacity = errors.New("no prover capacity available") + errNoCapacity = errors.New("no prover capacity available") + errTierNotFound = errors.New("tier not found") ) // Prover keep trying to prove new proposed blocks valid/invalid. @@ -60,13 +61,14 @@ type Prover struct { validProofSubmitter proofSubmitter.ProofSubmitter // Subscriptions - blockProposedCh chan *bindings.TaikoL1ClientBlockProposed - blockProposedSub event.Subscription - transitionProvedCh chan *bindings.TaikoL1ClientTransitionProved - transitionProvedSub event.Subscription - blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified - blockVerifiedSub event.Subscription - proveNotify chan struct{} + blockProposedCh chan *bindings.TaikoL1ClientBlockProposed + blockProposedSub event.Subscription + transitionProvedCh chan *bindings.TaikoL1ClientTransitionProved + transitionProvedSub event.Subscription + blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified + blockVerifiedSub event.Subscription + proofWindowExpiredCh chan *bindings.TaikoL1ClientBlockProposed + proveNotify chan struct{} // Proof related proofGenerationCh chan *proofProducer.ProofWithHeader @@ -130,6 +132,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.blockVerifiedCh = make(chan *bindings.TaikoL1ClientBlockVerified, chBufferSize) p.transitionProvedCh = make(chan *bindings.TaikoL1ClientTransitionProved, chBufferSize) p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) + p.proofWindowExpiredCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.proveNotify = make(chan struct{}, 1) if err := p.initL1Current(cfg.StartingBlockID); err != nil { return fmt.Errorf("initialize L1 current cursor error: %w", err) @@ -442,55 +445,49 @@ func (p *Prover) onBlockProposed( "minTier", event.MinTier, ) - // TODO: add this back - // if p.cfg.GuardianProver { - // shouldSkipProofWindowExpiredCheck := func() (bool, error) { - // parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) - // if err != nil { - // return false, err - // } - - // // check if an invalid proof has been submitted, if so, we can skip proofWindowExpired check below - // // and always submit proof. otherwise, guardianProver follows same proof logic as regular. - // transition, err := p.rpc.TaikoL1.GetTransition( - // &bind.CallOpts{Context: ctx}, - // event.BlockId.Uint64(), - // parent.Hash(), - // ) - // if err != nil { - // if strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_TRANSITION_NOT_FOUND") { - // // proof hasnt been submitted - // return false, nil - // } else { - // return false, err - // } - // } - - // block, err := p.rpc.L2.BlockByNumber(ctx, event.BlockId) - // if err != nil { - // return false, err - // } - - // // proof is invalid but has correct parents, guardian prover should skip - // // checking proofWindow expired, and simply force prove. - // if transition.BlockHash != block.Hash() { - // log.Info( - // "Guardian prover forcing prove block due to invalid proof", - // "blockID", event.BlockId, - // "transitionBlockHash", common.BytesToHash(transition.BlockHash[:]).Hex(), - // "expectedBlockHash", block.Hash().Hex(), - // ) - - // return true, nil - // } - - // return false, nil - // } - - // if skipProofWindowExpiredCheck, err = shouldSkipProofWindowExpiredCheck(); err != nil { - // return err - // } - // } + provingWindow, err := p.getProvingWindow(event) + if err != nil { + return fmt.Errorf("failed to get proving window: %w", err) + } + + var ( + now = uint64(time.Now().Unix()) + provingWindowExpiresAt = currentL1OriginHeader.Time + uint64(provingWindow.Seconds()) + provingWindowExpired = now > provingWindowExpiresAt + timeToExpire = time.Duration(provingWindowExpiresAt-now) * time.Second + ) + if event.AssignedProver != p.proverAddress && !provingWindowExpired { + log.Info( + "Proposed block is not provable", + "blockID", event.BlockId, + "prover", event.AssignedProver, + "expiresAt", provingWindowExpiresAt, + "timeToExpire", timeToExpire, + ) + + if p.cfg.ProveUnassignedBlocks { + log.Info("Add proposed block to wait for proof window expiration", "blockID", event.BlockId) + time.AfterFunc(timeToExpire, func() { p.proofWindowExpiredCh <- event }) + } + + return nil + } + + // If set not to prove unassigned blocks, this block is still not provable + // by us even though its open proving. + if provingWindowExpired && !p.cfg.ProveUnassignedBlocks { + log.Info("Skip proving expired blocks", "blockID", event.BlockId) + return nil + } + + log.Info( + "Proposed block is provable", + "blockID", event.BlockId, + "prover", event.AssignedProver, + "expiresAt", provingWindowExpiresAt, + ) + + metrics.ProverProofsAssigned.Inc(1) if !p.cfg.GuardianProver { if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { @@ -649,8 +646,7 @@ func (p *Prover) closeSubscription() { p.blockProposedSub.Unsubscribe() } -// isValidProof cancels proof only if the parentGasUsed and parentHash in the proof match what -// is expected +// isValidProof checks if the given proof is a valid one. func (p *Prover) isValidProof( ctx context.Context, blockID uint64, @@ -726,7 +722,7 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) erro return nil } - // make sure to takea capacity before requesting proof + // Make sure to take a capacity before requesting proof if !p.cfg.GuardianProver { if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { return errNoCapacity @@ -767,3 +763,14 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) erro return nil } + +// getProvingWindow returns the provingWindow of the given proposed block. +func (p *Prover) getProvingWindow(e *bindings.TaikoL1ClientBlockProposed) (time.Duration, error) { + for _, t := range p.tiers { + if e.MinTier == t.ID { + return time.Duration(t.ProvingWindow) * time.Second, nil + } + } + + return 0, errTierNotFound +} From 994b2e4b5e59568015bfc03093288b54268fe499 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 6 Oct 2023 20:57:09 +0800 Subject: [PATCH 22/63] feat(prover): add `onProvingWindowExpired` --- prover/prover.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/prover/prover.go b/prover/prover.go index 81188e69f..4b1a4412d 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -271,6 +271,10 @@ func (p *Prover) eventLoop() { if err := p.onTransitionProved(p.ctx, e); err != nil { log.Error("Handle TransitionProved event error", "error", err) } + case e := <-p.proofWindowExpiredCh: + if err := p.onProvingWindowExpired(p.ctx, e); err != nil { + log.Error("Handle provingWindow expired event error", "error", err) + } case <-p.blockProposedCh: reqProving() case <-forceProvingTicker.C: @@ -764,6 +768,22 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) erro return nil } +// onProvingWindowExpired tries to submit a proof for an expired block. +func (p *Prover) onProvingWindowExpired(ctx context.Context, e *bindings.TaikoL1ClientBlockProposed) error { + log.Info("Block proving window is expired", "blockID", e.BlockId, "l1Height", e.Raw.BlockNumber) + + needNewProof, err := rpc.NeedNewProof(ctx, p.rpc, e.BlockId, p.proverAddress) + if err != nil { + return err + } + + if !needNewProof { + return nil + } + + return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber)) +} + // getProvingWindow returns the provingWindow of the given proposed block. func (p *Prover) getProvingWindow(e *bindings.TaikoL1ClientBlockProposed) (time.Duration, error) { for _, t := range p.tiers { From 2ff237e8ce2edd4a3510872e28e4786179519466 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Oct 2023 11:06:00 +0800 Subject: [PATCH 23/63] feat(proposer): update `ETHFeeEOASelector` --- bindings/encoding/struct.go | 8 +++ cmd/flags/proposer.go | 55 +++++++++------- cmd/flags/prover.go | 9 +-- driver/chain_syncer/calldata/syncer_test.go | 28 ++++---- driver/chain_syncer/chain_syncer_test.go | 28 ++++---- driver/driver_test.go | 28 ++++---- proposer/config.go | 23 +++---- proposer/config_test.go | 18 +++--- proposer/proposer.go | 55 ++++++++++------ proposer/proposer_test.go | 8 +-- .../prover_selector/eth_fee_eoa_selector.go | 64 +++++++++++-------- prover/config.go | 1 - prover/config_test.go | 2 - .../valid_proof_submitter_test.go | 28 ++++---- prover/prover_test.go | 28 ++++---- 15 files changed, 205 insertions(+), 178 deletions(-) diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index 356aed5a0..206387b3b 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -8,6 +8,14 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) +// Tier IDs defined in protocol. +const ( + TierOptimisticID = 100 + TierSgxID = 200 + TierPseZkevmID = 300 + TierGuardianID = 1000 +) + // BlockHeader represents an Ethereum block header. type BlockHeader struct { ParentHash [32]byte diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index c6b4ed3cc..abaac37da 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -24,12 +24,6 @@ var ( Required: true, Category: proposerCategory, } - BlockProposalFee = &cli.StringFlag{ - Name: "blockProposalFee", - Usage: "Initial block proposal fee (in wei) paid on block proposing", - Required: true, - Category: proposerCategory, - } TaikoTokenAddress = &cli.StringFlag{ Name: "taikoToken", Usage: "TaikoToken contract address", @@ -46,6 +40,33 @@ var ( Value: "", Category: proposerCategory, } + OptimisticTierFee = &cli.Uint64Flag{ + Name: "tierFee.optimistic", + Usage: "Initial tier fee (in wei) paid to prover to generate an optimistic proofs", + Category: proposerCategory, + } + SgxTierFee = &cli.Uint64Flag{ + Name: "tierFee.sgx", + Usage: "Initial tier fee (in wei) paid to prover to generate a SGX proofs", + Category: proposerCategory, + } + PseZkevmTierFee = &cli.Uint64Flag{ + Name: "tierFee.pseZKEvm", + Usage: "Initial tier fee (in wei) paid to prover to generate a PSE zkEVM proofs", + Category: proposerCategory, + } + TierFeePriceBump = &cli.Uint64Flag{ + Name: "tierFee.pricebump", + Usage: "Price bump percentage when no prover wants to accept the block at initial fee", + Value: 10, + Category: proposerCategory, + } + MaxTierFeePriceBumpIterations = &cli.Uint64Flag{ + Name: "tierFee.maxPriceBumpIterations", + Usage: "If nobody accepts block at initial tier fee, how many iterations to increase tier fee before giving up", + Category: proposerCategory, + Value: 3, + } ProposeInterval = &cli.DurationFlag{ Name: "proposeInterval", Usage: "Time interval to propose L2 pending transactions", @@ -88,23 +109,12 @@ var ( Usage: "Gas tip cap (in wei) for a TaikoL1.proposeBlock transaction when doing the transaction replacement", Category: proposerCategory, } - BlockProposalFeeIncreasePercentage = &cli.Uint64Flag{ - Name: "blockProposalFeeIncreasePercentage", - Usage: "Increase fee by what percentage when no prover wants to accept the block at initial fee", - Category: proposerCategory, - Value: 10, - } - BlockProposalFeeIterations = &cli.Uint64Flag{ - Name: "blockProposalFeeIterations", - Usage: "If nobody accepts block at initial fee, how many iterations to increase fee before giving up", - Category: proposerCategory, - Value: 3, - } ) // All proposer flags. var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ L2HTTPEndpoint, + TaikoTokenAddress, L1ProposerPrivKey, L2SuggestedFeeRecipient, ProposeInterval, @@ -117,8 +127,9 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ ProposeBlockTxReplacementMultiplier, ProposeBlockTxGasTipCap, ProverEndpoints, - BlockProposalFee, - BlockProposalFeeIncreasePercentage, - BlockProposalFeeIterations, - TaikoTokenAddress, + OptimisticTierFee, + SgxTierFee, + PseZkevmTierFee, + TierFeePriceBump, + MaxTierFeePriceBumpIterations, }) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 4b483b77a..ee7322a7f 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -72,7 +72,7 @@ var ( ProofSubmissionMaxRetry = &cli.Uint64Flag{ Name: "proofSubmissionMaxRetry", Usage: "Max retry counts for proof submission", - Value: 0, + Value: 3, Category: proverCategory, } Graffiti = &cli.StringFlag{ @@ -81,12 +81,6 @@ var ( Category: proverCategory, Value: "", } - CheckProofWindowExpiredInterval = &cli.DurationFlag{ - Name: "prover.checkProofWindowExpiredInterval", - Usage: "Interval to check for expired proof windows from other provers", - Category: proverCategory, - Value: 15 * time.Second, - } ProveUnassignedBlocks = &cli.BoolFlag{ Name: "prover.proveUnassignedBlocks", Usage: "Whether you want to prove unassigned blocks, or only work on assigned proofs", @@ -155,7 +149,6 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ ProveBlockTxReplacementMultiplier, ProveBlockMaxTxGasTipCap, Graffiti, - CheckProofWindowExpiredInterval, ProveUnassignedBlocks, ProveBlockTxGasLimit, ProverHTTPServerPort, diff --git a/driver/chain_syncer/calldata/syncer_test.go b/driver/chain_syncer/calldata/syncer_test.go index 86c74c9b1..6e3d38345 100644 --- a/driver/chain_syncer/calldata/syncer_test.go +++ b/driver/chain_syncer/calldata/syncer_test.go @@ -47,20 +47,20 @@ func (s *CalldataSyncerTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - BlockProposalFee: big.NewInt(1000), - BlockProposalFeeIterations: 3, - BlockProposalFeeIncreasePercentage: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: big.NewInt(1000), + MaxTierFeePriceBumpIterations: 3, + TierFeePriceBump: common.Big2, }))) s.p = prop diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index 1345dfc72..992d025c5 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -49,20 +49,20 @@ func (s *ChainSyncerTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - BlockProposalFee: big.NewInt(1000), - BlockProposalFeeIterations: 3, - BlockProposalFeeIncreasePercentage: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: big.NewInt(1000), + MaxTierFeePriceBumpIterations: 3, + TierFeePriceBump: common.Big2, }))) s.p = prop diff --git a/driver/driver_test.go b/driver/driver_test.go index a543b36fa..840aded58 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -53,20 +53,20 @@ func (s *DriverTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), p, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - BlockProposalFee: big.NewInt(1000), - BlockProposalFeeIterations: 3, - BlockProposalFeeIncreasePercentage: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: big.NewInt(1000), + MaxTierFeePriceBumpIterations: 3, + TierFeePriceBump: common.Big2, }))) s.p = p } diff --git a/proposer/config.go b/proposer/config.go index 9a4d76eec..9e13c2b81 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -36,9 +36,11 @@ type Config struct { WaitReceiptTimeout time.Duration ProposeBlockTxGasTipCap *big.Int ProverEndpoints []*url.URL - BlockProposalFee *big.Int - BlockProposalFeeIncreasePercentage *big.Int - BlockProposalFeeIterations uint64 + OptimisticTierFee *big.Int + SgxTierFee *big.Int + PseZkevmTierFee *big.Int + TierFeePriceBump *big.Int + MaxTierFeePriceBumpIterations uint64 } // NewConfigFromCliContext initializes a Config instance from @@ -114,11 +116,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { proverEndpoints = append(proverEndpoints, endpoint) } - blockProposalFee, ok := new(big.Int).SetString(c.String(flags.BlockProposalFee.Name), 10) - if !ok { - return nil, fmt.Errorf("invalid blockProposalFee: %v", c.String(flags.BlockProposalFee.Name)) - } - return &Config{ L1Endpoint: c.String(flags.L1WSEndpoint.Name), L2Endpoint: c.String(flags.L2HTTPEndpoint.Name), @@ -140,10 +137,10 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProposeBlockTxGasTipCap: proposeBlockTxGasTipCap, ProverEndpoints: proverEndpoints, - BlockProposalFee: blockProposalFee, - BlockProposalFeeIncreasePercentage: new(big.Int).SetUint64( - c.Uint64(flags.BlockProposalFeeIncreasePercentage.Name), - ), - BlockProposalFeeIterations: c.Uint64(flags.BlockProposalFeeIterations.Name), + OptimisticTierFee: new(big.Int).SetUint64(c.Uint64(flags.OptimisticTierFee.Name)), + SgxTierFee: new(big.Int).SetUint64(c.Uint64(flags.SgxTierFee.Name)), + PseZkevmTierFee: new(big.Int).SetUint64(c.Uint64(flags.PseZkevmTierFee.Name)), + TierFeePriceBump: new(big.Int).SetUint64(c.Uint64(flags.TierFeePriceBump.Name)), + MaxTierFeePriceBumpIterations: c.Uint64(flags.MaxTierFeePriceBumpIterations.Name), }, nil } diff --git a/proposer/config_test.go b/proposer/config_test.go index 270d6d292..503df69f3 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -55,10 +55,10 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { } fee, _ := new(big.Int).SetString(blockProposalFee, 10) - s.Equal(fee, c.BlockProposalFee) + s.Equal(fee, c.OptimisticTierFee) - s.Equal(uint64(15), c.BlockProposalFeeIncreasePercentage.Uint64()) - s.Equal(uint64(5), c.BlockProposalFeeIterations) + s.Equal(uint64(15), c.TierFeePriceBump.Uint64()) + s.Equal(uint64(5), c.MaxTierFeePriceBumpIterations) s.Nil(new(Proposer).InitFromCli(context.Background(), ctx)) return err @@ -81,9 +81,9 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { "--" + flags.ProposeBlockTxGasTipCap.Name, "100000", "--" + flags.ProposeBlockTxGasLimit.Name, "100000", "--" + flags.ProverEndpoints.Name, proverEndpoints, - "--" + flags.BlockProposalFee.Name, blockProposalFee, - "--" + flags.BlockProposalFeeIncreasePercentage.Name, "15", - "--" + flags.BlockProposalFeeIterations.Name, "5", + "--" + flags.OptimisticTierFee.Name, blockProposalFee, + "--" + flags.TierFeePriceBump.Name, "15", + "--" + flags.MaxTierFeePriceBumpIterations.Name, "5", })) } @@ -164,14 +164,14 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.DurationFlag{Name: flags.ProposeInterval.Name}, &cli.StringFlag{Name: flags.TxPoolLocals.Name}, &cli.StringFlag{Name: flags.ProverEndpoints.Name}, - &cli.Uint64Flag{Name: flags.BlockProposalFee.Name}, + &cli.Uint64Flag{Name: flags.OptimisticTierFee.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxReplacementMultiplier.Name}, &cli.DurationFlag{Name: flags.RPCTimeout.Name}, &cli.DurationFlag{Name: flags.WaitReceiptTimeout.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasTipCap.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasLimit.Name}, - &cli.Uint64Flag{Name: flags.BlockProposalFeeIncreasePercentage.Name}, - &cli.Uint64Flag{Name: flags.BlockProposalFeeIterations.Name}, + &cli.Uint64Flag{Name: flags.TierFeePriceBump.Name}, + &cli.Uint64Flag{Name: flags.MaxTierFeePriceBumpIterations.Name}, } app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) diff --git a/proposer/proposer.go b/proposer/proposer.go index a521ecbd9..e426f9c05 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -129,30 +129,16 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { return err } - - // TODO: use flags to set tier fees - for _, tier := range p.tiers { - log.Info( - "Protocol tier", - "id", tier.ID, - "name", string(tier.VerifierName[:]), - "validityBond", tier.ValidityBond, - "contestBond", tier.ContestBond, - "provingWindow", tier.ProvingWindow, - "cooldownWindow", tier.CooldownWindow, - ) - - p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: common.Big256}) - } + p.initTierFees() if p.proverSelector, err = selector.NewETHFeeEOASelector( &protocolConfigs, p.rpc, cfg.TaikoL1Address, p.tierFees, - cfg.BlockProposalFeeIncreasePercentage, + cfg.TierFeePriceBump, cfg.ProverEndpoints, - cfg.BlockProposalFeeIterations, + cfg.MaxTierFeePriceBumpIterations, proverAssignmentTimeout, requestProverServerTimeout, ); err != nil { @@ -352,11 +338,11 @@ func (p *Proposer) sendProposeBlockTx( txListBytes []byte, nonce *uint64, signedAssignment []byte, - fee *big.Int, + maxFee *big.Int, isReplacement bool, ) (*types.Transaction, error) { // Propose the transactions list - opts, err := getTxOpts(ctx, p.rpc.L1, p.proposerPrivKey, p.rpc.L1ChainID, fee) + opts, err := getTxOpts(ctx, p.rpc.L1, p.proposerPrivKey, p.rpc.L1ChainID, maxFee) if err != nil { return nil, err } @@ -400,7 +386,7 @@ func (p *Proposer) ProposeTxList( txNum uint, nonce *uint64, ) error { - signedAssignment, fee, err := p.proverSelector.AssignProver( + signedAssignment, maxFee, err := p.proverSelector.AssignProver( ctx, p.tierFees, crypto.Keccak256Hash(txListBytes), @@ -423,7 +409,7 @@ func (p *Proposer) ProposeTxList( txListBytes, nonce, signedAssignment, - fee, + maxFee, isReplacement, ); err != nil { log.Warn("Failed to send propose block transaction", "error", encoding.TryParsingCustomError(err)) @@ -497,6 +483,33 @@ func (p *Proposer) Name() string { return "proposer" } +func (p *Proposer) initTierFees() { + for _, tier := range p.tiers { + log.Info( + "Protocol tier", + "id", tier.ID, + "name", string(tier.VerifierName[:]), + "validityBond", tier.ValidityBond, + "contestBond", tier.ContestBond, + "provingWindow", tier.ProvingWindow, + "cooldownWindow", tier.CooldownWindow, + ) + + switch tier.ID { + case encoding.TierOptimisticID: + p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: p.cfg.OptimisticTierFee}) + case encoding.TierSgxID: + p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: p.cfg.SgxTierFee}) + case encoding.TierPseZkevmID: + p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: p.cfg.PseZkevmTierFee}) + case encoding.TierGuardianID: + p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: common.Big0}) + default: + log.Warn("Unknown tier", "id", tier.ID, "name", string(tier.VerifierName[:])) + } + } +} + // getTxOpts creates a bind.TransactOpts instance using the given private key. func getTxOpts( ctx context.Context, diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 7e2ce87f4..bccd48ce0 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -46,9 +46,9 @@ func (s *ProposerTestSuite) SetupTest() { ProposeBlockTxReplacementMultiplier: 2, WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: s.ProverEndpoints, - BlockProposalFee: common.Big256, - BlockProposalFeeIncreasePercentage: common.Big2, - BlockProposalFeeIterations: 3, + OptimisticTierFee: common.Big256, + TierFeePriceBump: common.Big2, + MaxTierFeePriceBumpIterations: 3, }))) s.p = p @@ -186,7 +186,7 @@ func (s *ProposerTestSuite) TestAssignProverSuccessFirstRound() { _, fee, err := s.p.proverSelector.AssignProver(context.Background(), s.p.tierFees, testutils.RandomHash()) s.Nil(err) - s.Equal(fee.Uint64(), s.p.cfg.BlockProposalFee.Uint64()) + s.Equal(fee.Uint64(), s.p.cfg.OptimisticTierFee.Uint64()) } func (s *ProposerTestSuite) TestUpdateProposingTicker() { diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index 6b041d8da..80b053a9e 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -30,15 +30,15 @@ var ( // ETHFeeEOASelector is a prover selector implementation which use ETHs as prover fee and // all provers selected must be EOA accounts. type ETHFeeEOASelector struct { - protocolConfigs *bindings.TaikoDataConfig - rpc *rpc.Client - taikoL1Address common.Address - tiersFee []encoding.TierFee - feeIncreasePercentage *big.Int - proverEndpoints []*url.URL - proposalFeeIterations uint64 - proposalExpiry time.Duration - requestTimeout time.Duration + protocolConfigs *bindings.TaikoDataConfig + rpc *rpc.Client + taikoL1Address common.Address + tiersFee []encoding.TierFee + tierFeePriceBump *big.Int + proverEndpoints []*url.URL + maxTierFeePriceBumpIterations uint64 + proposalExpiry time.Duration + requestTimeout time.Duration } // NewETHFeeEOASelector creates a new ETHFeeEOASelector instance. @@ -47,9 +47,9 @@ func NewETHFeeEOASelector( rpc *rpc.Client, taikoL1Address common.Address, tiersFee []encoding.TierFee, - feeIncreasePercentage *big.Int, + tierFeePriceBump *big.Int, proverEndpoints []*url.URL, - proposalFeeIterations uint64, + maxTierFeePriceBumpIterations uint64, proposalExpiry time.Duration, requestTimeout time.Duration, ) (*ETHFeeEOASelector, error) { @@ -68,9 +68,9 @@ func NewETHFeeEOASelector( rpc, taikoL1Address, tiersFee, - feeIncreasePercentage, + tierFeePriceBump, proverEndpoints, - proposalFeeIterations, + maxTierFeePriceBumpIterations, proposalExpiry, requestTimeout, }, nil @@ -93,22 +93,31 @@ func (s *ETHFeeEOASelector) AssignProver( if err != nil { return nil, nil, err } + + var ( + expiry = uint64(time.Now().Add(s.proposalExpiry).Unix()) + fees = make([]encoding.TierFee, len(tierFees)) + big100 = new(big.Int).SetUint64(uint64(100)) + maxProverFee = common.Big0 + ) + copy(fees, tierFees) + // Iterate over each configured endpoint, and see if someone wants to accept this block. // If it is denied, we continue on to the next endpoint. // If we do not find a prover, we can increase the fee up to a point, or give up. - for i := 0; i < int(s.proposalFeeIterations); i++ { - var ( - expiry = uint64(time.Now().Add(s.proposalExpiry).Unix()) - ) - - // Increase fee on each failed loop - // TODO: fix this - // if i > 0 { - // cumulativePercent := new(big.Int).Mul(s.feeIncreasePercentage, big.NewInt(int64(i))) - // increase := new(big.Int).Mul(fee, cumulativePercent) - // increase.Div(increase, big.NewInt(100)) - // fee.Add(fee, increase) - // } + for i := 0; i < int(s.maxTierFeePriceBumpIterations); i++ { + // Bump tier fee on each failed loop + if i > 0 { + cumulativeBumpPercent := new(big.Int).Mul(s.tierFeePriceBump, new(big.Int).SetUint64(uint64(i))) + for idx := range fees { + fee := new(big.Int).Mul(fees[idx].Fee, cumulativeBumpPercent) + fees[idx].Fee = fees[idx].Fee.Add(fees[idx].Fee, fee.Div(fee, big100)) + + if fees[idx].Fee.Cmp(maxProverFee) > 0 { + maxProverFee = fees[idx].Fee + } + } + } for _, endpoint := range s.shuffleProverEndpoints() { encodedAssignment, proverAddress, err := assignProver( ctx, @@ -133,8 +142,7 @@ func (s *ETHFeeEOASelector) AssignProver( continue } - // TODO: fix fee value - return encodedAssignment, common.Big256, nil + return encodedAssignment, maxProverFee, nil } } diff --git a/prover/config.go b/prover/config.go index 7880f2270..a1138eba3 100644 --- a/prover/config.go +++ b/prover/config.go @@ -125,7 +125,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { Graffiti: c.String(flags.Graffiti.Name), BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), - CheckProofWindowExpiredInterval: c.Duration(flags.CheckProofWindowExpiredInterval.Name), ProveUnassignedBlocks: c.Bool(flags.ProveUnassignedBlocks.Name), RPCTimeout: timeout, WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), diff --git a/prover/config_test.go b/prover/config_test.go index 74787c101..917696ff9 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -77,7 +77,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { "--" + flags.ProveBlockMaxTxGasTipCap.Name, "256", "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.Graffiti.Name, "", - "--" + flags.CheckProofWindowExpiredInterval.Name, "30s", "--" + flags.TempCapacityExpiresAt.Name, "15s", "--" + flags.ProveUnassignedBlocks.Name, })) @@ -138,7 +137,6 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.BoolFlag{Name: flags.GuardianProver.Name}, &cli.StringFlag{Name: flags.GuardianProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, - &cli.DurationFlag{Name: flags.CheckProofWindowExpiredInterval.Name}, &cli.BoolFlag{Name: flags.ProveUnassignedBlocks.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxReplacementMultiplier.Name}, &cli.Uint64Flag{Name: flags.ProveBlockMaxTxGasTipCap.Name}, diff --git a/prover/proof_submitter/valid_proof_submitter_test.go b/prover/proof_submitter/valid_proof_submitter_test.go index cf5dca26d..b9e9bd8e7 100644 --- a/prover/proof_submitter/valid_proof_submitter_test.go +++ b/prover/proof_submitter/valid_proof_submitter_test.go @@ -80,20 +80,20 @@ func (s *ProofSubmitterTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - BlockProposalFee: big.NewInt(1000), - BlockProposalFeeIterations: 3, - BlockProposalFeeIncreasePercentage: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: big.NewInt(1000), + MaxTierFeePriceBumpIterations: 3, + TierFeePriceBump: common.Big2, }))) s.proposer = prop diff --git a/prover/prover_test.go b/prover/prover_test.go index 308ef6a0e..b6b31bf3d 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -92,20 +92,20 @@ func (s *ProverTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: []*url.URL{proverServerUrl}, - BlockProposalFee: common.Big256, - BlockProposalFeeIterations: 3, - BlockProposalFeeIncreasePercentage: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []*url.URL{proverServerUrl}, + OptimisticTierFee: common.Big256, + MaxTierFeePriceBumpIterations: 3, + TierFeePriceBump: common.Big2, }))) s.proposer = prop From c2347e95bbd20ed5cb3e80b140e7941ef0945441 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Oct 2023 12:52:59 +0800 Subject: [PATCH 24/63] feat(prover): update prover server --- driver/chain_syncer/calldata/syncer_test.go | 4 +- driver/chain_syncer/chain_syncer_test.go | 5 ++- driver/driver_test.go | 4 +- proposer/config_test.go | 44 ++++++++++--------- proposer/proposer.go | 11 +++-- proposer/proposer_test.go | 2 + .../prover_selector/eth_fee_eoa_selector.go | 15 ++++--- prover/config.go | 1 - prover/config_test.go | 1 - .../valid_proof_submitter_test.go | 5 ++- prover/prover_test.go | 34 +++++++------- prover/server/api.go | 2 +- 12 files changed, 72 insertions(+), 56 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer_test.go b/driver/chain_syncer/calldata/syncer_test.go index 6e3d38345..11fec4a76 100644 --- a/driver/chain_syncer/calldata/syncer_test.go +++ b/driver/chain_syncer/calldata/syncer_test.go @@ -58,7 +58,9 @@ func (s *CalldataSyncerTestSuite) SetupTest() { MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: big.NewInt(1000), + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, MaxTierFeePriceBumpIterations: 3, TierFeePriceBump: common.Big2, }))) diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index 992d025c5..8fe500d85 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -2,7 +2,6 @@ package chainSyncer import ( "context" - "math/big" "os" "testing" @@ -60,7 +59,9 @@ func (s *ChainSyncerTestSuite) SetupTest() { MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: big.NewInt(1000), + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, MaxTierFeePriceBumpIterations: 3, TierFeePriceBump: common.Big2, }))) diff --git a/driver/driver_test.go b/driver/driver_test.go index 840aded58..6b343d70b 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -64,7 +64,9 @@ func (s *DriverTestSuite) SetupTest() { MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: big.NewInt(1000), + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, MaxTierFeePriceBumpIterations: 3, TierFeePriceBump: common.Big2, }))) diff --git a/proposer/config_test.go b/proposer/config_test.go index 503df69f3..2660dc9bf 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -2,7 +2,7 @@ package proposer import ( "context" - "math/big" + "fmt" "os" "strings" "time" @@ -14,15 +14,15 @@ import ( ) var ( - l1Endpoint = os.Getenv("L1_NODE_WS_ENDPOINT") - l2Endpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") - proverEndpoints = "http://localhost:9876,http://localhost:1234" - taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") - taikoToken = os.Getenv("TAIKO_TOKEN_ADDRESS") - blockProposalFee = "10000000000" - proposeInterval = "10s" - rpcTimeout = 5 * time.Second + l1Endpoint = os.Getenv("L1_NODE_WS_ENDPOINT") + l2Endpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") + taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") + taikoToken = os.Getenv("TAIKO_TOKEN_ADDRESS") + proverEndpoints = "http://localhost:9876,http://localhost:1234" + tierFee = 102400000000 + proposeInterval = "10s" + rpcTimeout = "5s" ) func (s *ProposerTestSuite) TestNewConfigFromCliContext() { @@ -48,20 +48,20 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { s.Equal(1, len(c.LocalAddresses)) s.Equal(goldenTouchAddress, c.LocalAddresses[0]) s.Equal(uint64(5), c.ProposeBlockTxReplacementMultiplier) - s.Equal(rpcTimeout, *c.RPCTimeout) + s.Equal(5*time.Second, *c.RPCTimeout) s.Equal(10*time.Second, c.WaitReceiptTimeout) + s.Equal(uint64(tierFee), c.OptimisticTierFee.Uint64()) + s.Equal(uint64(tierFee), c.SgxTierFee.Uint64()) + s.Equal(uint64(tierFee), c.PseZkevmTierFee.Uint64()) + s.Equal(uint64(15), c.TierFeePriceBump.Uint64()) + s.Equal(uint64(5), c.MaxTierFeePriceBumpIterations) + for i, e := range strings.Split(proverEndpoints, ",") { s.Equal(c.ProverEndpoints[i].String(), e) } - fee, _ := new(big.Int).SetString(blockProposalFee, 10) - s.Equal(fee, c.OptimisticTierFee) - - s.Equal(uint64(15), c.TierFeePriceBump.Uint64()) - s.Equal(uint64(5), c.MaxTierFeePriceBumpIterations) s.Nil(new(Proposer).InitFromCli(context.Background(), ctx)) - - return err + return nil } s.Nil(app.Run([]string{ @@ -76,12 +76,14 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { "--" + flags.ProposeInterval.Name, proposeInterval, "--" + flags.TxPoolLocals.Name, goldenTouchAddress.Hex(), "--" + flags.ProposeBlockTxReplacementMultiplier.Name, "5", - "--" + flags.RPCTimeout.Name, "5s", + "--" + flags.RPCTimeout.Name, rpcTimeout, "--" + flags.WaitReceiptTimeout.Name, "10s", "--" + flags.ProposeBlockTxGasTipCap.Name, "100000", "--" + flags.ProposeBlockTxGasLimit.Name, "100000", "--" + flags.ProverEndpoints.Name, proverEndpoints, - "--" + flags.OptimisticTierFee.Name, blockProposalFee, + "--" + flags.OptimisticTierFee.Name, fmt.Sprint(tierFee), + "--" + flags.SgxTierFee.Name, fmt.Sprint(tierFee), + "--" + flags.PseZkevmTierFee.Name, fmt.Sprint(tierFee), "--" + flags.TierFeePriceBump.Name, "15", "--" + flags.MaxTierFeePriceBumpIterations.Name, "5", })) @@ -165,6 +167,8 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.TxPoolLocals.Name}, &cli.StringFlag{Name: flags.ProverEndpoints.Name}, &cli.Uint64Flag{Name: flags.OptimisticTierFee.Name}, + &cli.Uint64Flag{Name: flags.SgxTierFee.Name}, + &cli.Uint64Flag{Name: flags.PseZkevmTierFee.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxReplacementMultiplier.Name}, &cli.DurationFlag{Name: flags.RPCTimeout.Name}, &cli.DurationFlag{Name: flags.WaitReceiptTimeout.Name}, diff --git a/proposer/proposer.go b/proposer/proposer.go index e426f9c05..45b71d25e 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -129,7 +129,9 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { return err } - p.initTierFees() + if err := p.initTierFees(); err != nil { + return err + } if p.proverSelector, err = selector.NewETHFeeEOASelector( &protocolConfigs, @@ -483,7 +485,7 @@ func (p *Proposer) Name() string { return "proposer" } -func (p *Proposer) initTierFees() { +func (p *Proposer) initTierFees() error { for _, tier := range p.tiers { log.Info( "Protocol tier", @@ -503,11 +505,14 @@ func (p *Proposer) initTierFees() { case encoding.TierPseZkevmID: p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: p.cfg.PseZkevmTierFee}) case encoding.TierGuardianID: + // Guardian prover should not charge any fee. p.tierFees = append(p.tierFees, encoding.TierFee{Tier: tier.ID, Fee: common.Big0}) default: - log.Warn("Unknown tier", "id", tier.ID, "name", string(tier.VerifierName[:])) + return fmt.Errorf("unknown tier: %d", tier.ID) } } + + return nil } // getTxOpts creates a bind.TransactOpts instance using the given private key. diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index bccd48ce0..4099f111e 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -47,6 +47,8 @@ func (s *ProposerTestSuite) SetupTest() { WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: s.ProverEndpoints, OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, TierFeePriceBump: common.Big2, MaxTierFeePriceBumpIterations: 3, }))) diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index 80b053a9e..4106e087d 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -107,17 +107,17 @@ func (s *ETHFeeEOASelector) AssignProver( // If we do not find a prover, we can increase the fee up to a point, or give up. for i := 0; i < int(s.maxTierFeePriceBumpIterations); i++ { // Bump tier fee on each failed loop - if i > 0 { - cumulativeBumpPercent := new(big.Int).Mul(s.tierFeePriceBump, new(big.Int).SetUint64(uint64(i))) - for idx := range fees { + cumulativeBumpPercent := new(big.Int).Mul(s.tierFeePriceBump, new(big.Int).SetUint64(uint64(i))) + for idx := range fees { + if i > 0 { fee := new(big.Int).Mul(fees[idx].Fee, cumulativeBumpPercent) fees[idx].Fee = fees[idx].Fee.Add(fees[idx].Fee, fee.Div(fee, big100)) - - if fees[idx].Fee.Cmp(maxProverFee) > 0 { - maxProverFee = fees[idx].Fee - } + } + if fees[idx].Fee.Cmp(maxProverFee) > 0 { + maxProverFee = fees[idx].Fee } } + for _, endpoint := range s.shuffleProverEndpoints() { encodedAssignment, proverAddress, err := assignProver( ctx, @@ -245,6 +245,7 @@ func assignProver( "Prover assigned", "address", result.Prover, "endpoint", endpoint, + "tierFees", tierFees, "expiry", expiry, ) diff --git a/prover/config.go b/prover/config.go index a1138eba3..0c7eae12d 100644 --- a/prover/config.go +++ b/prover/config.go @@ -34,7 +34,6 @@ type Config struct { Graffiti string BackOffMaxRetrys uint64 BackOffRetryInterval time.Duration - CheckProofWindowExpiredInterval time.Duration ProveUnassignedBlocks bool RPCTimeout *time.Duration WaitReceiptTimeout time.Duration diff --git a/prover/config_test.go b/prover/config_test.go index 917696ff9..90d136909 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -43,7 +43,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { crypto.PubkeyToAddress(c.GuardianProverPrivateKey.PublicKey), ) s.Equal("", c.Graffiti) - s.Equal(30*time.Second, c.CheckProofWindowExpiredInterval) s.Equal(true, c.ProveUnassignedBlocks) s.Equal(rpcTimeout, *c.RPCTimeout) s.Equal(uint64(8), c.Capacity) diff --git a/prover/proof_submitter/valid_proof_submitter_test.go b/prover/proof_submitter/valid_proof_submitter_test.go index b9e9bd8e7..6b29fd47f 100644 --- a/prover/proof_submitter/valid_proof_submitter_test.go +++ b/prover/proof_submitter/valid_proof_submitter_test.go @@ -3,7 +3,6 @@ package submitter import ( "bytes" "context" - "math/big" "os" "sync" "testing" @@ -91,7 +90,9 @@ func (s *ProofSubmitterTestSuite) SetupTest() { MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: big.NewInt(1000), + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, MaxTierFeePriceBumpIterations: 3, TierFeePriceBump: common.Big2, }))) diff --git a/prover/prover_test.go b/prover/prover_test.go index b6b31bf3d..1a149e51b 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -42,22 +42,21 @@ func (s *ProverTestSuite) SetupTest() { ctx, cancel := context.WithCancel(context.Background()) p := new(Prover) s.Nil(InitFromConfig(ctx, p, (&Config{ - L1WsEndpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L1HttpEndpoint: os.Getenv("L1_NODE_HTTP_ENDPOINT"), - L2WsEndpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - L2HttpEndpoint: os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - L1ProverPrivKey: l1ProverPrivKey, - GuardianProverPrivateKey: l1ProverPrivKey, - GuardianProver: false, - Dummy: true, - MaxConcurrentProvingJobs: 1, - CheckProofWindowExpiredInterval: 5 * time.Second, - ProveUnassignedBlocks: true, - Capacity: 1024, - MinProofFee: common.Big1, - HTTPServerPort: uint64(port), + L1WsEndpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L1HttpEndpoint: os.Getenv("L1_NODE_HTTP_ENDPOINT"), + L2WsEndpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + L2HttpEndpoint: os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + L1ProverPrivKey: l1ProverPrivKey, + GuardianProverPrivateKey: l1ProverPrivKey, + GuardianProver: false, + Dummy: true, + MaxConcurrentProvingJobs: 1, + ProveUnassignedBlocks: true, + Capacity: 1024, + MinProofFee: common.Big1, + HTTPServerPort: uint64(port), }))) p.srv = testutils.NewTestProverServer( &s.ClientTestSuite, @@ -104,6 +103,8 @@ func (s *ProverTestSuite) SetupTest() { WaitReceiptTimeout: 10 * time.Second, ProverEndpoints: []*url.URL{proverServerUrl}, OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, MaxTierFeePriceBumpIterations: 3, TierFeePriceBump: common.Big2, }))) @@ -134,7 +135,6 @@ func (s *ProverTestSuite) TestInitError() { GuardianProverPrivateKey: l1ProverPrivKey, Dummy: true, MaxConcurrentProvingJobs: 1, - CheckProofWindowExpiredInterval: 5 * time.Second, ProveUnassignedBlocks: true, ProveBlockTxReplacementMultiplier: 2, })), "dial tcp:") diff --git a/prover/server/api.go b/prover/server/api.go index 5cabe51b4..dbf04fffd 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -104,7 +104,7 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { } for _, tier := range req.TierFees { - if tier.Fee.Cmp(srv.minProofFee) < 0 { + if tier.Tier != encoding.TierGuardianID && tier.Fee.Cmp(srv.minProofFee) < 0 { log.Warn( "Proof fee too low", "tier", tier.Tier, From 8e766aff4e1dff6e6f9f649651a25fd6f1590acf Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Oct 2023 13:25:01 +0800 Subject: [PATCH 25/63] feat(prover): update prover server --- bindings/encoding/struct.go | 8 +-- cmd/flags/prover.go | 25 +++++--- pkg/rpc/utils_test.go | 39 ------------ prover/config.go | 13 ++-- prover/config_test.go | 19 ++++-- .../proof_submitter/valid_proof_submitter.go | 7 ++- prover/prover.go | 18 +++--- prover/prover_test.go | 4 +- prover/server/api.go | 37 ++++++++--- prover/server/api_test.go | 12 +++- prover/server/server.go | 62 ++++++++++--------- prover/server/server_test.go | 20 +++--- testutils/helper.go | 18 +++--- 13 files changed, 154 insertions(+), 128 deletions(-) diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index 206387b3b..7bf9aa659 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -10,10 +10,10 @@ import ( // Tier IDs defined in protocol. const ( - TierOptimisticID = 100 - TierSgxID = 200 - TierPseZkevmID = 300 - TierGuardianID = 1000 + TierOptimisticID uint16 = 100 + TierSgxID uint16 = 200 + TierPseZkevmID uint16 = 300 + TierGuardianID uint16 = 1000 ) // BlockHeader represents an Ethereum block header. diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index ee7322a7f..19c964051 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -26,12 +26,6 @@ var ( Required: true, Category: proverCategory, } - MinProofFee = &cli.StringFlag{ - Name: "prover.minProofFee", - Usage: "Minimum accepted fee for accepting proving a block", - Required: true, - Category: proverCategory, - } ProverCapacity = &cli.Uint64Flag{ Name: "prover.capacity", Usage: "Capacity of prover", @@ -42,6 +36,21 @@ var ( // Optional flags used by prover. var ( + MinOptimisticTierFee = &cli.Uint64Flag{ + Name: "minTierFee.optimistic", + Usage: "Minimum accepted fee for generating an optimistic proof", + Category: proverCategory, + } + MinSgxTierFee = &cli.Uint64Flag{ + Name: "minTierFee.sgx", + Usage: "Minimum accepted fee for generating a SGX proof", + Category: proverCategory, + } + MinPseZkevmTierFee = &cli.Uint64Flag{ + Name: "minTierFee.pseZKEvm", + Usage: "Minimum accepted fee for generating a PSE zkEVM proof", + Category: proverCategory, + } StartingBlockID = &cli.Uint64Flag{ Name: "startingBlockID", Usage: "If set, prover will start proving blocks from the block with this ID", @@ -138,7 +147,9 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ ZkEvmRpcdEndpoint, ZkEvmRpcdParamsPath, L1ProverPrivKey, - MinProofFee, + MinOptimisticTierFee, + MinSgxTierFee, + MinPseZkevmTierFee, StartingBlockID, MaxConcurrentProvingJobs, Dummy, diff --git a/pkg/rpc/utils_test.go b/pkg/rpc/utils_test.go index face3594f..7a4edac67 100644 --- a/pkg/rpc/utils_test.go +++ b/pkg/rpc/utils_test.go @@ -26,45 +26,6 @@ func TestWaitReceiptTimeout(t *testing.T) { require.ErrorContains(t, err, "context deadline exceeded") } -// TODO: fix this, need to propose/prove/execute tx before this'll work -// func TestWaitReceiptRevert(t *testing.T) { -// client := newTestClient(t) -// testAddrPrivKey, err := crypto.ToECDSA( -// common.Hex2Bytes("ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"), -// ) -// require.Nil(t, err) -// testAddr := common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266") - -// // build transaction -// nonce, err := client.L2.PendingNonceAt(context.Background(), testAddr) -// require.Nil(t, err) -// data := []byte("invalid") -// parent, err := client.L2.BlockByNumber(context.Background(), nil) -// require.Nil(t, err) -// baseFee, err := client.TaikoL2.GetBasefee(nil, 1, uint32(parent.GasUsed())) -// require.Nil(t, err) -// tx := types.NewTx(&types.DynamicFeeTx{ -// ChainID: client.L2ChainID, -// Nonce: nonce, -// GasTipCap: common.Big0, -// GasFeeCap: new(big.Int).SetUint64(baseFee.Uint64() * 2), -// Gas: uint64(22000), -// To: &testAddr, -// Value: common.Big0, -// Data: data, -// }) - -// // sign transaction and send -// signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(client.L2ChainID), testAddrPrivKey) -// require.Nil(t, err) -// require.Nil(t, client.L2.SendTransaction(context.Background(), signedTx)) - -// _, err2 := WaitReceipt( -// context.Background(), client.L2, signedTx, -// ) -// require.ErrorContains(t, err2, "transaction reverted,") -// } - func TestSetHead(t *testing.T) { require.Nil(t, SetHead(context.Background(), newTestClient(t).L2RawRPC, common.Big0)) } diff --git a/prover/config.go b/prover/config.go index 0c7eae12d..c686305dc 100644 --- a/prover/config.go +++ b/prover/config.go @@ -43,7 +43,9 @@ type Config struct { HTTPServerPort uint64 Capacity uint64 TempCapacityExpiresAt time.Duration - MinProofFee *big.Int + MinOptimisticTierFee *big.Int + MinSgxTierFee *big.Int + MinPseZkevmTierFee *big.Int MaxExpiry time.Duration } @@ -85,11 +87,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { proveBlockTxGasLimit = &gasLimit } - minProofFee, ok := new(big.Int).SetString(c.String(flags.MinProofFee.Name), 10) - if !ok { - return nil, fmt.Errorf("invalid minProofFee: %v", minProofFee) - } - proveBlockTxReplacementMultiplier := c.Uint64(flags.ProveBlockTxReplacementMultiplier.Name) if proveBlockTxReplacementMultiplier == 0 { return nil, fmt.Errorf( @@ -133,7 +130,9 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { ProveBlockTxReplacementMultiplier: proveBlockTxReplacementMultiplier, ProveBlockMaxTxGasTipCap: proveBlockMaxTxGasTipCap, HTTPServerPort: c.Uint64(flags.ProverHTTPServerPort.Name), - MinProofFee: minProofFee, + MinOptimisticTierFee: new(big.Int).SetUint64(c.Uint64(flags.MinOptimisticTierFee.Name)), + MinSgxTierFee: new(big.Int).SetUint64(c.Uint64(flags.MinSgxTierFee.Name)), + MinPseZkevmTierFee: new(big.Int).SetUint64(c.Uint64(flags.MinPseZkevmTierFee.Name)), MaxExpiry: c.Duration(flags.MaxExpiry.Name), }, nil } diff --git a/prover/config_test.go b/prover/config_test.go index 90d136909..5b764aa9d 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -2,6 +2,7 @@ package prover import ( "context" + "fmt" "os" "time" @@ -18,7 +19,7 @@ var ( taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") rpcTimeout = 5 * time.Second - minProofFee = "1024" + minTierFee = 1024 ) func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { @@ -46,7 +47,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { s.Equal(true, c.ProveUnassignedBlocks) s.Equal(rpcTimeout, *c.RPCTimeout) s.Equal(uint64(8), c.Capacity) - s.Equal(minProofFee, c.MinProofFee.String()) + s.Equal(uint64(minTierFee), c.MinOptimisticTierFee.Uint64()) + s.Equal(uint64(minTierFee), c.MinSgxTierFee.Uint64()) + s.Equal(uint64(minTierFee), c.MinPseZkevmTierFee.Uint64()) s.Equal(uint64(3), c.ProveBlockTxReplacementMultiplier) s.Equal(uint64(256), c.ProveBlockMaxTxGasTipCap.Uint64()) s.Equal(15*time.Second, c.TempCapacityExpiresAt) @@ -69,7 +72,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { "--" + flags.RPCTimeout.Name, "5s", "--" + flags.ProveBlockTxGasLimit.Name, "100000", "--" + flags.Dummy.Name, - "--" + flags.MinProofFee.Name, minProofFee, + "--" + flags.MinOptimisticTierFee.Name, fmt.Sprint(minTierFee), + "--" + flags.MinSgxTierFee.Name, fmt.Sprint(minTierFee), + "--" + flags.MinPseZkevmTierFee.Name, fmt.Sprint(minTierFee), "--" + flags.ProverCapacity.Name, "8", "--" + flags.GuardianProver.Name, "--" + flags.ProveBlockTxReplacementMultiplier.Name, "3", @@ -97,7 +102,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProverError() { "--" + flags.GuardianProver.Name, "--" + flags.Graffiti.Name, "", "--" + flags.RPCTimeout.Name, "5s", - "--" + flags.MinProofFee.Name, minProofFee, + "--" + flags.MinOptimisticTierFee.Name, fmt.Sprint(minTierFee), + "--" + flags.MinSgxTierFee.Name, fmt.Sprint(minTierFee), + "--" + flags.MinPseZkevmTierFee.Name, fmt.Sprint(minTierFee), }), "guardianProver flag set without guardianProverPrivateKey set") } @@ -141,7 +148,9 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.Uint64Flag{Name: flags.ProveBlockMaxTxGasTipCap.Name}, &cli.DurationFlag{Name: flags.RPCTimeout.Name}, &cli.Uint64Flag{Name: flags.ProverCapacity.Name}, - &cli.Uint64Flag{Name: flags.MinProofFee.Name}, + &cli.Uint64Flag{Name: flags.MinOptimisticTierFee.Name}, + &cli.Uint64Flag{Name: flags.MinSgxTierFee.Name}, + &cli.Uint64Flag{Name: flags.MinPseZkevmTierFee.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxGasLimit.Name}, &cli.DurationFlag{Name: flags.TempCapacityExpiresAt.Name}, } diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index 35faa3979..9f96950f5 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -221,13 +221,18 @@ func (s *ValidProofSubmitter) SubmitProof( return fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) } + tier := encoding.TierPseZkevmID + if s.isGuardianProver { + tier = encoding.TierGuardianID + } + evidence := &encoding.BlockEvidence{ MetaHash: proofWithHeader.Opts.MetaHash, ParentHash: proofWithHeader.Opts.ParentHash, BlockHash: proofWithHeader.Opts.BlockHash, SignalRoot: proofWithHeader.Opts.SignalRoot, Graffiti: s.graffiti, - Tier: 0, // TODO: update tier + Tier: tier, Proof: zkProof, } diff --git a/prover/prover.go b/prover/prover.go index 4b1a4412d..d84850b96 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -196,14 +196,16 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { // Prover server proverServerOpts := &server.NewProverServerOpts{ - ProverPrivateKey: p.cfg.L1ProverPrivKey, - MinProofFee: p.cfg.MinProofFee, - MaxExpiry: p.cfg.MaxExpiry, - CapacityManager: p.capacityManager, - TaikoL1Address: p.cfg.TaikoL1Address, - Rpc: p.rpc, - Bond: protocolConfigs.LivenessBond, - IsGuardian: p.cfg.GuardianProver, + ProverPrivateKey: p.cfg.L1ProverPrivKey, + MinOptimisticTierFee: p.cfg.MinOptimisticTierFee, + MinSgxTierFee: p.cfg.MinSgxTierFee, + MinPseZkevmTierFee: p.cfg.MinPseZkevmTierFee, + MaxExpiry: p.cfg.MaxExpiry, + CapacityManager: p.capacityManager, + TaikoL1Address: p.cfg.TaikoL1Address, + Rpc: p.rpc, + Bond: protocolConfigs.LivenessBond, + IsGuardian: p.cfg.GuardianProver, } if p.cfg.GuardianProver { proverServerOpts.ProverPrivateKey = p.cfg.GuardianProverPrivateKey diff --git a/prover/prover_test.go b/prover/prover_test.go index 1a149e51b..ab8c68bf6 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -55,7 +55,9 @@ func (s *ProverTestSuite) SetupTest() { MaxConcurrentProvingJobs: 1, ProveUnassignedBlocks: true, Capacity: 1024, - MinProofFee: common.Big1, + MinOptimisticTierFee: common.Big1, + MinSgxTierFee: common.Big1, + MinPseZkevmTierFee: common.Big1, HTTPServerPort: uint64(port), }))) p.srv = testutils.NewTestProverServer( diff --git a/prover/server/api.go b/prover/server/api.go index dbf04fffd..6ca06ce61 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -1,6 +1,7 @@ package server import ( + "math/big" "net/http" "time" @@ -22,9 +23,11 @@ type CreateAssignmentRequestBody struct { // Status represents the current prover server status. type Status struct { - MinProofFee uint64 `json:"minProofFee"` - MaxExpiry uint64 `json:"maxExpiry"` - CurrentCapacity uint64 `json:"currentCapacity"` + MinOptimisticTierFee uint64 `json:"minOptimisticTierFee"` + MinSgxTierFee uint64 `json:"minSgxTierFee"` + MinPseZkevmTierFee uint64 `json:"minPseZkevmTierFee"` + MaxExpiry uint64 `json:"maxExpiry"` + CurrentCapacity uint64 `json:"currentCapacity"` } // GetStatus handles a query to the current prover server status. @@ -37,9 +40,11 @@ type Status struct { // @Router /status [get] func (srv *ProverServer) GetStatus(c echo.Context) error { return c.JSON(http.StatusOK, &Status{ - MinProofFee: srv.minProofFee.Uint64(), - MaxExpiry: uint64(srv.maxExpiry.Seconds()), - CurrentCapacity: srv.capacityManager.ReadCapacity(), + MinOptimisticTierFee: srv.minOptimisticTierFee.Uint64(), + MinSgxTierFee: srv.minSgxTierFee.Uint64(), + MinPseZkevmTierFee: srv.minPseZkevmTierFee.Uint64(), + MaxExpiry: uint64(srv.maxExpiry.Seconds()), + CurrentCapacity: srv.capacityManager.ReadCapacity(), }) } @@ -104,12 +109,28 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { } for _, tier := range req.TierFees { - if tier.Tier != encoding.TierGuardianID && tier.Fee.Cmp(srv.minProofFee) < 0 { + if tier.Tier == encoding.TierGuardianID { + continue + } + + var minTierFee *big.Int + switch tier.Tier { + case encoding.TierOptimisticID: + minTierFee = srv.minOptimisticTierFee + case encoding.TierSgxID: + minTierFee = srv.minSgxTierFee + case encoding.TierPseZkevmID: + minTierFee = srv.minPseZkevmTierFee + default: + log.Warn("Unknown tier", "tier", tier.Tier, "fee", tier.Fee, "proposerIP", c.RealIP()) + } + + if tier.Fee.Cmp(minTierFee) < 0 { log.Warn( "Proof fee too low", "tier", tier.Tier, "fee", tier.Fee, - "srvMinProofFee", srv.minProofFee.String(), + "minTierFee", minTierFee, "proposerIP", c.RealIP(), ) return echo.NewHTTPError(http.StatusUnprocessableEntity, "proof fee too low") diff --git a/prover/server/api_test.go b/prover/server/api_test.go index d066d4579..9d3e6cb30 100644 --- a/prover/server/api_test.go +++ b/prover/server/api_test.go @@ -22,15 +22,21 @@ func (s *ProverServerTestSuite) TestGetStatusSuccess() { s.Nil(err) s.Nil(json.Unmarshal(b, &status)) - s.Equal(s.s.minProofFee.Uint64(), status.MinProofFee) + s.Equal(s.s.minOptimisticTierFee.Uint64(), status.MinOptimisticTierFee) + s.Equal(s.s.minSgxTierFee.Uint64(), status.MinSgxTierFee) + s.Equal(s.s.minPseZkevmTierFee.Uint64(), status.MinPseZkevmTierFee) s.Equal(uint64(s.s.maxExpiry.Seconds()), status.MaxExpiry) s.Greater(status.CurrentCapacity, uint64(0)) } func (s *ProverServerTestSuite) TestProposeBlockSuccess() { data, err := json.Marshal(CreateAssignmentRequestBody{ - FeeToken: (common.Address{}), - TierFees: []encoding.TierFee{{Tier: 0, Fee: common.Big256}}, + FeeToken: (common.Address{}), + TierFees: []encoding.TierFee{ + {Tier: encoding.TierOptimisticID, Fee: common.Big256}, + {Tier: encoding.TierSgxID, Fee: common.Big256}, + {Tier: encoding.TierPseZkevmID, Fee: common.Big256}, + }, Expiry: uint64(time.Now().Add(time.Minute).Unix()), TxListHash: common.BigToHash(common.Big1), }) diff --git a/prover/server/server.go b/prover/server/server.go index 85fddc586..7101da8c7 100644 --- a/prover/server/server.go +++ b/prover/server/server.go @@ -30,43 +30,49 @@ import ( // @host prover-api.test.taiko.xyz // ProverServer represents a prover server instance. type ProverServer struct { - echo *echo.Echo - proverPrivateKey *ecdsa.PrivateKey - proverAddress common.Address - minProofFee *big.Int - maxExpiry time.Duration - capacityManager *capacity.CapacityManager - taikoL1Address common.Address - rpc *rpc.Client - bond *big.Int - isGuardian bool + echo *echo.Echo + proverPrivateKey *ecdsa.PrivateKey + proverAddress common.Address + minOptimisticTierFee *big.Int + minSgxTierFee *big.Int + minPseZkevmTierFee *big.Int + maxExpiry time.Duration + capacityManager *capacity.CapacityManager + taikoL1Address common.Address + rpc *rpc.Client + bond *big.Int + isGuardian bool } // NewProverServerOpts contains all configurations for creating a prover server instance. type NewProverServerOpts struct { - ProverPrivateKey *ecdsa.PrivateKey - MinProofFee *big.Int - MaxExpiry time.Duration - CapacityManager *capacity.CapacityManager - TaikoL1Address common.Address - Rpc *rpc.Client - Bond *big.Int - IsGuardian bool + ProverPrivateKey *ecdsa.PrivateKey + MinOptimisticTierFee *big.Int + MinSgxTierFee *big.Int + MinPseZkevmTierFee *big.Int + MaxExpiry time.Duration + CapacityManager *capacity.CapacityManager + TaikoL1Address common.Address + Rpc *rpc.Client + Bond *big.Int + IsGuardian bool } // New creates a new prover server instance. func New(opts *NewProverServerOpts) (*ProverServer, error) { srv := &ProverServer{ - proverPrivateKey: opts.ProverPrivateKey, - proverAddress: crypto.PubkeyToAddress(opts.ProverPrivateKey.PublicKey), - echo: echo.New(), - minProofFee: opts.MinProofFee, - maxExpiry: opts.MaxExpiry, - capacityManager: opts.CapacityManager, - taikoL1Address: opts.TaikoL1Address, - rpc: opts.Rpc, - bond: opts.Bond, - isGuardian: opts.IsGuardian, + proverPrivateKey: opts.ProverPrivateKey, + proverAddress: crypto.PubkeyToAddress(opts.ProverPrivateKey.PublicKey), + echo: echo.New(), + minOptimisticTierFee: opts.MinOptimisticTierFee, + minSgxTierFee: opts.MinSgxTierFee, + minPseZkevmTierFee: opts.MinPseZkevmTierFee, + maxExpiry: opts.MaxExpiry, + capacityManager: opts.CapacityManager, + taikoL1Address: opts.TaikoL1Address, + rpc: opts.Rpc, + bond: opts.Bond, + isGuardian: opts.IsGuardian, } srv.echo.HideBanner = true diff --git a/prover/server/server_test.go b/prover/server/server_test.go index d007c94f1..943b08aa5 100644 --- a/prover/server/server_test.go +++ b/prover/server/server_test.go @@ -47,15 +47,17 @@ func (s *ProverServerTestSuite) SetupTest() { s.Nil(err) p := &ProverServer{ - echo: echo.New(), - proverPrivateKey: l1ProverPrivKey, - minProofFee: common.Big1, - maxExpiry: 24 * time.Hour, - capacityManager: capacity.New(1024, 100*time.Second), - taikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - rpc: rpcClient, - bond: common.Big0, - isGuardian: false, + echo: echo.New(), + proverPrivateKey: l1ProverPrivKey, + minOptimisticTierFee: common.Big1, + minSgxTierFee: common.Big1, + minPseZkevmTierFee: common.Big1, + maxExpiry: 24 * time.Hour, + capacityManager: capacity.New(1024, 100*time.Second), + taikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + rpc: rpcClient, + bond: common.Big0, + isGuardian: false, } p.echo.HideBanner = true diff --git a/testutils/helper.go b/testutils/helper.go index 85d51d276..63c3f60c0 100644 --- a/testutils/helper.go +++ b/testutils/helper.go @@ -182,14 +182,16 @@ func NewTestProverServer( s.Nil(err) srv, err := server.New(&server.NewProverServerOpts{ - ProverPrivateKey: proverPrivKey, - MinProofFee: common.Big1, - MaxExpiry: 24 * time.Hour, - CapacityManager: capacityManager, - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - Rpc: s.RpcClient, - Bond: protocolConfig.LivenessBond, - IsGuardian: true, + ProverPrivateKey: proverPrivKey, + MinOptimisticTierFee: common.Big1, + MinSgxTierFee: common.Big1, + MinPseZkevmTierFee: common.Big1, + MaxExpiry: 24 * time.Hour, + CapacityManager: capacityManager, + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + Rpc: s.RpcClient, + Bond: protocolConfig.LivenessBond, + IsGuardian: true, }) s.Nil(err) From 412e23d9f7b5ac4c41a7af451df385ff5104e510 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Oct 2023 13:37:48 +0800 Subject: [PATCH 26/63] chore: update ci --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b1491c56..64cc60533 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main] + branches: [main,contestable-zkrollup] tags: - "v*" From 74176a2e371f111e9afe2ba59c0e2b4b0bbd6428 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Oct 2023 15:10:46 +0800 Subject: [PATCH 27/63] feat(driver): handle extra data --- driver/chain_syncer/calldata/syncer.go | 2 ++ go.mod | 2 +- go.sum | 4 ++-- integration_test/nodes/docker-compose.yml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index bbb703289..db84f6226 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -427,6 +427,7 @@ func (s *Syncer) createExecutionPayloads( Timestamp: event.Meta.Timestamp, TxList: txListBytes, MixHash: event.Meta.Difficulty, + ExtraData: event.Meta.ExtraData[:], }, BaseFeePerGas: baseFee, L1Origin: l1Origin, @@ -444,6 +445,7 @@ func (s *Syncer) createExecutionPayloads( "timestamp", attributes.BlockMetadata.Timestamp, "mixHash", attributes.BlockMetadata.MixHash, "baseFee", attributes.BaseFeePerGas, + "extraData", string(attributes.BlockMetadata.ExtraData), "l1OriginHeight", attributes.L1Origin.L1BlockHeight, "l1OriginHash", attributes.L1Origin.L1BlockHash, ) diff --git a/go.mod b/go.mod index 8f938d890..4cbcd5ef5 100644 --- a/go.mod +++ b/go.mod @@ -108,4 +108,4 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.12.2 => github.com/taikoxyz/taiko-geth v0.0.0-20230814083522-76b7e96ec36f +replace github.com/ethereum/go-ethereum v1.12.2 => github.com/taikoxyz/taiko-geth v0.0.0-20231007070640-4929cc148e80 diff --git a/go.sum b/go.sum index 687afadb4..df52cbc05 100644 --- a/go.sum +++ b/go.sum @@ -394,8 +394,8 @@ github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/taikoxyz/taiko-geth v0.0.0-20230814083522-76b7e96ec36f h1:tbDbbWKensnOvnKyMdSScFOj0bZSjeUUmte/gmOEMm8= -github.com/taikoxyz/taiko-geth v0.0.0-20230814083522-76b7e96ec36f/go.mod h1:1cRAEV+rp/xX0zraSCBnu9Py3HQ+geRMj3HdR+k0wfI= +github.com/taikoxyz/taiko-geth v0.0.0-20231007070640-4929cc148e80 h1:Yfo+sFVw8hi19oiOiS/2SUXeqDx8W4nlqU4YOGU2bag= +github.com/taikoxyz/taiko-geth v0.0.0-20231007070640-4929cc148e80/go.mod h1:1cRAEV+rp/xX0zraSCBnu9Py3HQ+geRMj3HdR+k0wfI= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e/go.mod h1:Tu4lItkATkonrYuvtVjG0/rhy15qrNGNTjPdaphtZ/8= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= diff --git a/integration_test/nodes/docker-compose.yml b/integration_test/nodes/docker-compose.yml index 18b4c5d47..64a816b99 100644 --- a/integration_test/nodes/docker-compose.yml +++ b/integration_test/nodes/docker-compose.yml @@ -14,7 +14,7 @@ services: - "0.0.0.0" l2_execution_engine: - image: gcr.io/evmchain/taiko-geth:sha-6a5990c + image: gcr.io/evmchain/taiko-geth:taiko restart: unless-stopped pull_policy: always volumes: From 3a3f7d1a5dd564fff15ce06615f878c369dda8cd Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Oct 2023 10:13:00 +0800 Subject: [PATCH 28/63] test(driver): test `block.extraData` --- driver/chain_syncer/chain_syncer_test.go | 4 +++- proposer/proposer.go | 3 ++- proposer/proposer_test.go | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index 8fe500d85..b8a8b7a5c 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -1,6 +1,7 @@ package chainSyncer import ( + "bytes" "context" "os" @@ -64,6 +65,7 @@ func (s *ChainSyncerTestSuite) SetupTest() { PseZkevmTierFee: common.Big256, MaxTierFeePriceBumpIterations: 3, TierFeePriceBump: common.Big2, + ExtraData: "test", }))) s.p = prop @@ -97,7 +99,7 @@ func (s *ChainSyncerTestSuite) TestAheadOfProtocolVerifiedHead2() { l2Head, err := s.RpcClient.L2.HeaderByNumber(context.Background(), nil) s.Nil(err) - + s.Equal("test", string(bytes.TrimRight(l2Head.Extra, "\x00"))) log.Info("L1HeaderByNumber head", "number", head.Number) // (equiv to s.state.GetL2Head().Number) log.Info("L2HeaderByNumber head", "number", l2Head.Number) diff --git a/proposer/proposer.go b/proposer/proposer.go index 45b71d25e..90a4c2544 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -1,6 +1,7 @@ package proposer import ( + "bytes" "context" "crypto/ecdsa" "errors" @@ -490,7 +491,7 @@ func (p *Proposer) initTierFees() error { log.Info( "Protocol tier", "id", tier.ID, - "name", string(tier.VerifierName[:]), + "name", string(bytes.TrimRight(tier.VerifierName[:], "\x00")), "validityBond", tier.ValidityBond, "contestBond", tier.ContestBond, "provingWindow", tier.ProvingWindow, diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 4099f111e..f4ee146db 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -51,6 +51,7 @@ func (s *ProposerTestSuite) SetupTest() { PseZkevmTierFee: common.Big256, TierFeePriceBump: common.Big2, MaxTierFeePriceBumpIterations: 3, + ExtraData: "test", }))) s.p = p From da658f46bf3f5049cc1288ae63813a1f308db2ba Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Oct 2023 10:57:44 +0800 Subject: [PATCH 29/63] feat(prover): improve proof submitter --- .github/workflows/docker.yml | 2 +- ...mmy_producer.go => optimistic_producer.go} | 18 +- ...er_test.go => optimistic_producer_test.go} | 12 +- prover/proof_producer/proof_producer.go | 3 +- prover/proof_producer/zkevm_cmd_producer.go | 165 ------------------ .../proof_producer/zkevm_cmd_producer_test.go | 26 --- prover/proof_producer/zkevm_rpcd_producer.go | 8 +- .../zkevm_rpcd_producer_test.go | 2 +- prover/proof_submitter/interface.go | 2 +- ..._proof_submitter.go => proof_submitter.go} | 38 ++-- ...mitter_test.go => proof_submitter_test.go} | 7 +- prover/prover.go | 15 +- prover/prover_test.go | 8 +- 13 files changed, 59 insertions(+), 247 deletions(-) rename prover/proof_producer/{dummy_producer.go => optimistic_producer.go} (59%) rename prover/proof_producer/{dummy_producer_test.go => optimistic_producer_test.go} (86%) delete mode 100644 prover/proof_producer/zkevm_cmd_producer.go delete mode 100644 prover/proof_producer/zkevm_cmd_producer_test.go rename prover/proof_submitter/{valid_proof_submitter.go => proof_submitter.go} (89%) rename prover/proof_submitter/{valid_proof_submitter_test.go => proof_submitter_test.go} (97%) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 64cc60533..1b1491c56 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main,contestable-zkrollup] + branches: [main] tags: - "v*" diff --git a/prover/proof_producer/dummy_producer.go b/prover/proof_producer/optimistic_producer.go similarity index 59% rename from prover/proof_producer/dummy_producer.go rename to prover/proof_producer/optimistic_producer.go index c5a4fd129..0fc4d16ae 100644 --- a/prover/proof_producer/dummy_producer.go +++ b/prover/proof_producer/optimistic_producer.go @@ -8,13 +8,14 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" ) -// DummyProofProducer always returns a dummy proof. -type DummyProofProducer struct{} +// OptimisticProofProducer always returns an optimistic (dummy) proof. +type OptimisticProofProducer struct{} // RequestProof implements the ProofProducer interface. -func (d *DummyProofProducer) RequestProof( +func (o *OptimisticProofProducer) RequestProof( ctx context.Context, opts *ProofRequestOptions, blockID *big.Int, @@ -23,7 +24,7 @@ func (d *DummyProofProducer) RequestProof( resultCh chan *ProofWithHeader, ) error { log.Info( - "Request dummy proof", + "Request optimistic proof", "blockID", blockID, "coinbase", meta.Coinbase, "height", header.Number, @@ -34,7 +35,7 @@ func (d *DummyProofProducer) RequestProof( BlockID: blockID, Meta: meta, Header: header, - ZkProof: bytes.Repeat([]byte{0xff}, 100), + Proof: bytes.Repeat([]byte{0xff}, 100), Degree: CircuitsIdx, Opts: opts, } @@ -42,7 +43,12 @@ func (d *DummyProofProducer) RequestProof( return nil } +// Tier implements the ProofProducer interface. +func (o *OptimisticProofProducer) Tier() uint16 { + return encoding.TierOptimisticID +} + // Cancel cancels an existing proof generation. -func (d *DummyProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { +func (o *OptimisticProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { return nil } diff --git a/prover/proof_producer/dummy_producer_test.go b/prover/proof_producer/optimistic_producer_test.go similarity index 86% rename from prover/proof_producer/dummy_producer_test.go rename to prover/proof_producer/optimistic_producer_test.go index e97756b56..8a4663c90 100644 --- a/prover/proof_producer/dummy_producer_test.go +++ b/prover/proof_producer/optimistic_producer_test.go @@ -14,7 +14,7 @@ import ( ) func TestRequestProof(t *testing.T) { - dummyProofProducer := &DummyProofProducer{} + optimisticProofProducer := &OptimisticProofProducer{} resCh := make(chan *ProofWithHeader, 1) @@ -35,7 +35,7 @@ func TestRequestProof(t *testing.T) { MixDigest: randHash(), Nonce: types.BlockNonce{}, } - require.Nil(t, dummyProofProducer.RequestProof( + require.Nil(t, optimisticProofProducer.RequestProof( context.Background(), &ProofRequestOptions{}, blockID, @@ -47,11 +47,11 @@ func TestRequestProof(t *testing.T) { res := <-resCh require.Equal(t, res.BlockID, blockID) require.Equal(t, res.Header, header) - require.NotEmpty(t, res.ZkProof) + require.NotEmpty(t, res.Proof) } func TestProofCancel(t *testing.T) { - dummyProofProducer := &DummyProofProducer{} + optimisticProofProducer := &OptimisticProofProducer{} resCh := make(chan *ProofWithHeader, 1) @@ -72,7 +72,7 @@ func TestProofCancel(t *testing.T) { MixDigest: randHash(), Nonce: types.BlockNonce{}, } - require.Nil(t, dummyProofProducer.RequestProof( + require.Nil(t, optimisticProofProducer.RequestProof( context.Background(), &ProofRequestOptions{}, blockID, @@ -82,7 +82,7 @@ func TestProofCancel(t *testing.T) { )) // Cancel the proof request, should return nil - require.Nil(t, dummyProofProducer.Cancel(context.Background(), blockID)) + require.Nil(t, optimisticProofProducer.Cancel(context.Background(), blockID)) } func randHash() common.Hash { diff --git a/prover/proof_producer/proof_producer.go b/prover/proof_producer/proof_producer.go index dd842864c..63fe522f4 100644 --- a/prover/proof_producer/proof_producer.go +++ b/prover/proof_producer/proof_producer.go @@ -35,7 +35,7 @@ type ProofWithHeader struct { BlockID *big.Int Meta *bindings.TaikoDataBlockMetadata Header *types.Header - ZkProof []byte + Proof []byte Degree uint64 Opts *ProofRequestOptions } @@ -50,6 +50,7 @@ type ProofProducer interface { resultCh chan *ProofWithHeader, ) error Cancel(ctx context.Context, blockID *big.Int) error + Tier() uint16 } func DegreeToCircuitsIdx(degree uint64) (uint16, error) { diff --git a/prover/proof_producer/zkevm_cmd_producer.go b/prover/proof_producer/zkevm_cmd_producer.go deleted file mode 100644 index a664b0b35..000000000 --- a/prover/proof_producer/zkevm_cmd_producer.go +++ /dev/null @@ -1,165 +0,0 @@ -package producer - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "math/big" - "os" - "os/exec" - "path/filepath" - "strings" - "time" - - "github.com/cenkalti/backoff/v4" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/taikoxyz/taiko-client/bindings" -) - -// ZkevmCmdProducer is responsible for generating zk proofs from the given command line binary file. -type ZkevmCmdProducer struct { - CmdPath string - L2Endpoint string // a L2 execution engine's RPC endpoint -} - -// NewZkevmCmdProducer creates a new NewZkevmCmdProducer instance. -func NewZkevmCmdProducer( - cmdPath string, - l2Endpoint string, -) (*ZkevmCmdProducer, error) { - return &ZkevmCmdProducer{cmdPath, l2Endpoint}, nil -} - -// RequestProof implements the ProofProducer interface. -func (p *ZkevmCmdProducer) RequestProof( - ctx context.Context, - opts *ProofRequestOptions, - blockID *big.Int, - meta *bindings.TaikoDataBlockMetadata, - header *types.Header, - resultCh chan *ProofWithHeader, -) error { - log.Info( - "Request proof from ZKEVM CMD", - "blockID", blockID, - "coinbase", meta.Coinbase, - "height", header.Number, - "hash", header.Hash(), - "cmd", p.CmdPath, - ) - - var ( - proof []byte - err error - ) - if err := backoff.Retry(func() error { - if proof, err = p.ExecProverCmd(opts.Height); err != nil { - log.Error("Execute prover cmd error", "error", err) - return err - } - - return nil - }, backoff.NewConstantBackOff(3*time.Second)); err != nil { - log.Error("Failed to generate proof", "error", err) - } - - resultCh <- &ProofWithHeader{ - BlockID: blockID, - Header: header, - Meta: meta, - ZkProof: proof, - Degree: CircuitsIdx, - Opts: opts, - } - - return nil -} - -type ProverCmdOutput struct { - Instances []string `json:"instances"` - Proof []byte `json:"proof"` -} - -func (p *ZkevmCmdProducer) ExecProverCmd(height *big.Int) ([]byte, error) { - start := time.Now() - cmd := exec.Command(p.CmdPath, p.L2Endpoint, height.String()) - - var stdout, stderr bytes.Buffer - - cmd.Stdout = &stdout - cmd.Stderr = &stderr - - if err := cmd.Run(); err != nil { - log.Info("Exec output", "stdout", stdout.String(), "stderr", stderr.String()) - return nil, err - } - - wd, err := os.Getwd() - if err != nil { - return nil, err - } - outputPath := filepath.Join(wd, fmt.Sprintf("./block-%s_proof.json", height)) - - log.Info("Exec prover cmd finished", "outputPath", outputPath, "time", time.Since(start)) - - if _, err := os.Stat(outputPath); err != nil { - return nil, err - } - - defer func() { - if err := os.Remove(outputPath); err != nil { - log.Warn("Remove prover cmd output file error", "error", err) - } - }() - - outputJSONBytes, err := os.ReadFile(outputPath) - if err != nil { - return nil, err - } - - var proverCmdOutput ProverCmdOutput - if err := json.Unmarshal(outputJSONBytes, &proverCmdOutput); err != nil { - return nil, err - } - - return p.outputToCalldata(&proverCmdOutput), nil -} - -func (p *ZkevmCmdProducer) outputToCalldata(output *ProverCmdOutput) []byte { - calldata := []byte{} - bufLen := len(output.Instances)*32 + len(output.Proof) - - for i := 0; i < len(output.Instances); i++ { - uint256Bytes := [32]byte{} - evenHexLen := len(output.Instances[i]) - 2 + (len(output.Instances[i]) % 2) - instanceHex := output.Instances[i][2:] - if len(instanceHex) < evenHexLen { - instanceHex = strings.Repeat("0", evenHexLen-len(instanceHex)) + instanceHex - } - instanceBytes := common.Hex2Bytes(instanceHex) - - for j := 0; j < len(instanceBytes); j++ { - uint256Bytes[31-j] = instanceBytes[len(instanceBytes)-1-j] - } - for k := 0; k < 32; k++ { - calldata = append(calldata, uint256Bytes[k]) - } - } - - for i := 0; i < len(output.Proof); i++ { - calldata = append(calldata, output.Proof...) - } - - return calldata[:bufLen] -} - -// Cancel cancels an existing proof generation. -// Right now, it is just a stub that does nothing, because it is not possible to cnacel the proof -// with the current zkevm software. -func (p *ZkevmCmdProducer) Cancel(ctx context.Context, blockID *big.Int) error { - log.Info("Cancel proof generation for block", "blockId", blockID) - return nil -} diff --git a/prover/proof_producer/zkevm_cmd_producer_test.go b/prover/proof_producer/zkevm_cmd_producer_test.go deleted file mode 100644 index 27e8b07b4..000000000 --- a/prover/proof_producer/zkevm_cmd_producer_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package producer - -import ( - "encoding/json" - "os" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/stretchr/testify/require" -) - -func TestZkevmCmdProducerOutputToCalldata(t *testing.T) { - output, err := os.ReadFile("../../testutils/testdata/block-5_proof.json") - require.Nil(t, err) - - var ( - testCalldataHexHash = common.HexToHash("0xfbc74eec1aa02cadd59cf2fdfb8c311b199a4f83d0046fd20a1a53081bb0de22") - proverCmdOutput ProverCmdOutput - ) - require.Nil(t, json.Unmarshal(output, &proverCmdOutput)) - - calldata := new(ZkevmCmdProducer).outputToCalldata(&proverCmdOutput) - - require.Equal(t, testCalldataHexHash, crypto.Keccak256Hash(calldata)) -} diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index 341ca042d..ce6d6b0ec 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -16,6 +16,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" ) var ( @@ -154,7 +155,7 @@ func (p *ZkevmRpcdProducer) RequestProof( BlockID: blockID, Header: header, Meta: meta, - ZkProof: proof, + Proof: proof, Degree: degree, Opts: opts, } @@ -268,6 +269,11 @@ func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput return output.Result, nil } +// Tier implements the ProofProducer interface. +func (p *ZkevmRpcdProducer) Tier() uint16 { + return encoding.TierPseZkevmID +} + // Cancel cancels an existing proof generation. // Right now, it is just a stub that does nothing, because it is not possible to cancel the proof // with the current zkevm software. diff --git a/prover/proof_producer/zkevm_rpcd_producer_test.go b/prover/proof_producer/zkevm_rpcd_producer_test.go index 2650d8e60..87ae7af1d 100644 --- a/prover/proof_producer/zkevm_rpcd_producer_test.go +++ b/prover/proof_producer/zkevm_rpcd_producer_test.go @@ -58,5 +58,5 @@ func TestNewZkevmRpcdProducer(t *testing.T) { res := <-resCh require.Equal(t, res.BlockID, blockID) require.Equal(t, res.Header, header) - require.NotEmpty(t, res.ZkProof) + require.NotEmpty(t, res.Proof) } diff --git a/prover/proof_submitter/interface.go b/prover/proof_submitter/interface.go index 84973585f..13c3a6fcb 100644 --- a/prover/proof_submitter/interface.go +++ b/prover/proof_submitter/interface.go @@ -8,7 +8,7 @@ import ( proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" ) -type ProofSubmitter interface { +type Submitter interface { RequestProof(ctx context.Context, event *bindings.TaikoL1ClientBlockProposed) error SubmitProof(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) error CancelProof(ctx context.Context, blockID *big.Int) error diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/proof_submitter.go similarity index 89% rename from prover/proof_submitter/valid_proof_submitter.go rename to prover/proof_submitter/proof_submitter.go index 9f96950f5..5966ee78e 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -23,11 +23,11 @@ import ( proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" ) -var _ ProofSubmitter = (*ValidProofSubmitter)(nil) +var _ Submitter = (*ProofSubmitter)(nil) -// ValidProofSubmitter is responsible requesting zk proofs for the given valid L2 +// ProofSubmitter is responsible requesting proofs for the given L2 // blocks, and submitting the generated proofs to the TaikoL1 smart contract. -type ValidProofSubmitter struct { +type ProofSubmitter struct { rpc *rpc.Client proofProducer proofProducer.ProofProducer resultCh chan *proofProducer.ProofWithHeader @@ -38,7 +38,6 @@ type ValidProofSubmitter struct { l1SignalService common.Address l2SignalService common.Address mutex *sync.Mutex - isGuardianProver bool graffiti [32]byte submissionMaxRetry uint64 retryInterval time.Duration @@ -48,7 +47,7 @@ type ValidProofSubmitter struct { proveBlockMaxTxGasTipCap *big.Int } -// NewValidProofSubmitter creates a new ValidProofSubmitter instance. +// NewValidProofSubmitter creates a new Submitter instance. func NewValidProofSubmitter( rpcClient *rpc.Client, proofProducer proofProducer.ProofProducer, @@ -56,7 +55,6 @@ func NewValidProofSubmitter( taikoL2Address common.Address, proverPrivKey *ecdsa.PrivateKey, mutex *sync.Mutex, - isGuardianProver bool, graffiti string, submissionMaxRetry uint64, retryInterval time.Duration, @@ -64,7 +62,7 @@ func NewValidProofSubmitter( proveBlockTxGasLimit *uint64, txReplacementTipMultiplier uint64, proveBlockMaxTxGasTipCap *big.Int, -) (*ValidProofSubmitter, error) { +) (*ProofSubmitter, error) { anchorValidator, err := anchorTxValidator.New(taikoL2Address, rpcClient.L2ChainID, rpcClient) if err != nil { return nil, err @@ -80,7 +78,7 @@ func NewValidProofSubmitter( return nil, err } - return &ValidProofSubmitter{ + return &ProofSubmitter{ rpc: rpcClient, proofProducer: proofProducer, resultCh: resultCh, @@ -91,7 +89,6 @@ func NewValidProofSubmitter( l2SignalService: l2SignalService, taikoL2Address: taikoL2Address, mutex: mutex, - isGuardianProver: isGuardianProver, graffiti: rpc.StringToBytes32(graffiti), submissionMaxRetry: submissionMaxRetry, retryInterval: retryInterval, @@ -102,8 +99,8 @@ func NewValidProofSubmitter( }, nil } -// RequestProof implements the ProofSubmitter interface. -func (s *ValidProofSubmitter) RequestProof(ctx context.Context, event *bindings.TaikoL1ClientBlockProposed) error { +// RequestProof implements the Submitter interface. +func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.TaikoL1ClientBlockProposed) error { l1Origin, err := s.rpc.WaitL1Origin(ctx, event.BlockId) if err != nil { return fmt.Errorf("failed to fetch l1Origin, blockID: %d, err: %w", event.BlockId, err) @@ -169,8 +166,8 @@ func (s *ValidProofSubmitter) RequestProof(ctx context.Context, event *bindings. return nil } -// SubmitProof implements the ProofSubmitter interface. -func (s *ValidProofSubmitter) SubmitProof( +// SubmitProof implements the Submitter interface. +func (s *ProofSubmitter) SubmitProof( ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader, ) (err error) { @@ -179,13 +176,13 @@ func (s *ValidProofSubmitter) SubmitProof( "blockID", proofWithHeader.BlockID, "proposer", proofWithHeader.Meta.Coinbase, "hash", proofWithHeader.Header.Hash(), - "proof", common.Bytes2Hex(proofWithHeader.ZkProof), + "proof", common.Bytes2Hex(proofWithHeader.Proof), "graffiti", common.Bytes2Hex(s.graffiti[:]), ) var ( blockID = proofWithHeader.BlockID header = proofWithHeader.Header - zkProof = proofWithHeader.ZkProof + zkProof = proofWithHeader.Proof ) metrics.ProverReceivedProofCounter.Inc(1) @@ -221,18 +218,13 @@ func (s *ValidProofSubmitter) SubmitProof( return fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) } - tier := encoding.TierPseZkevmID - if s.isGuardianProver { - tier = encoding.TierGuardianID - } - evidence := &encoding.BlockEvidence{ MetaHash: proofWithHeader.Opts.MetaHash, ParentHash: proofWithHeader.Opts.ParentHash, BlockHash: proofWithHeader.Opts.BlockHash, SignalRoot: proofWithHeader.Opts.SignalRoot, Graffiti: s.graffiti, - Tier: tier, + Tier: s.proofProducer.Tier(), Proof: zkProof, } @@ -280,7 +272,7 @@ func (s *ValidProofSubmitter) SubmitProof( } maxRetry := &s.submissionMaxRetry - if s.isGuardianProver { + if s.proofProducer.Tier() == encoding.TierGuardianID { maxRetry = nil } @@ -313,7 +305,7 @@ func (s *ValidProofSubmitter) SubmitProof( // CancelProof cancels an existing proof generation. // Right now, it is just a stub that does nothing, because it is not possible to cancel the proof // with the current zkevm software. -func (s *ValidProofSubmitter) CancelProof(ctx context.Context, blockID *big.Int) error { +func (s *ProofSubmitter) CancelProof(ctx context.Context, blockID *big.Int) error { return s.proofProducer.Cancel(ctx, blockID) } diff --git a/prover/proof_submitter/valid_proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go similarity index 97% rename from prover/proof_submitter/valid_proof_submitter_test.go rename to prover/proof_submitter/proof_submitter_test.go index 6b29fd47f..349475f82 100644 --- a/prover/proof_submitter/valid_proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -23,7 +23,7 @@ import ( type ProofSubmitterTestSuite struct { testutils.ClientTestSuite - validProofSubmitter *ValidProofSubmitter + validProofSubmitter *ProofSubmitter calldataSyncer *calldata.Syncer proposer *proposer.Proposer validProofCh chan *proofProducer.ProofWithHeader @@ -41,12 +41,11 @@ func (s *ProofSubmitterTestSuite) SetupTest() { s.validProofSubmitter, err = NewValidProofSubmitter( s.RpcClient, - &proofProducer.DummyProofProducer{}, + &proofProducer.OptimisticProofProducer{}, s.validProofCh, common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), l1ProverPrivKey, &sync.Mutex{}, - false, "test", 1, 12*time.Second, @@ -117,7 +116,7 @@ func (s *ProofSubmitterTestSuite) TestValidProofSubmitterSubmitProofMetadataNotF BlockID: common.Big256, Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, - ZkProof: bytes.Repeat([]byte{0xff}, 100), + Proof: bytes.Repeat([]byte{0xff}, 100), }, ), ) diff --git a/prover/prover.go b/prover/prover.go index d84850b96..a3e11598b 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -58,7 +58,7 @@ type Prover struct { tiers []*rpc.TierProviderTierWithID // Proof submitters - validProofSubmitter proofSubmitter.ProofSubmitter + proofSubmitter proofSubmitter.Submitter // Subscriptions blockProposedCh chan *bindings.TaikoL1ClientBlockProposed @@ -156,7 +156,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { var producer proofProducer.ProofProducer if cfg.Dummy { - producer = &proofProducer.DummyProofProducer{} + producer = &proofProducer.OptimisticProofProducer{} } else { if producer, err = proofProducer.NewZkevmRpcdProducer( cfg.ZKEvmRpcdEndpoint, @@ -171,14 +171,13 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { } // Proof submitter - if p.validProofSubmitter, err = proofSubmitter.NewValidProofSubmitter( + if p.proofSubmitter, err = proofSubmitter.NewValidProofSubmitter( p.rpc, producer, p.proofGenerationCh, p.cfg.TaikoL2Address, p.cfg.L1ProverPrivKey, p.submitProofTxMutex, - p.cfg.GuardianProver, p.cfg.Graffiti, p.cfg.ProofSubmissionMaxRetry, p.cfg.BackOffRetryInterval, @@ -481,7 +480,7 @@ func (p *Prover) onBlockProposed( // If set not to prove unassigned blocks, this block is still not provable // by us even though its open proving. - if provingWindowExpired && !p.cfg.ProveUnassignedBlocks { + if provingWindowExpired && event.AssignedProver == p.proverAddress && !p.cfg.ProveUnassignedBlocks { log.Info("Skip proving expired blocks", "blockID", event.BlockId) return nil } @@ -501,7 +500,7 @@ func (p *Prover) onBlockProposed( } } - return p.validProofSubmitter.RequestProof(ctx, event) + return p.proofSubmitter.RequestProof(ctx, event) } p.proposeConcurrencyGuard <- struct{}{} @@ -542,7 +541,7 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc if err := backoff.Retry( func() error { - err := p.validProofSubmitter.SubmitProof(p.ctx, proofWithHeader) + err := p.proofSubmitter.SubmitProof(p.ctx, proofWithHeader) if err != nil { log.Error("Submit proof error", "error", err) return err @@ -737,7 +736,7 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) erro p.proposeConcurrencyGuard <- struct{}{} - return p.validProofSubmitter.RequestProof(ctx, event) + return p.proofSubmitter.RequestProof(ctx, event) } handleBlockProposedEvent := func() error { diff --git a/prover/prover_test.go b/prover/prover_test.go index ab8c68bf6..f1f434995 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -151,7 +151,7 @@ func (s *ProverTestSuite) TestOnBlockProposed() { // Valid block e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) s.Nil(s.p.onBlockProposed(context.Background(), e, func() {})) - s.Nil(s.p.validProofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + s.Nil(s.p.proofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) // Empty blocks for _, e = range testutils.ProposeAndInsertEmptyBlocks( @@ -161,7 +161,7 @@ func (s *ProverTestSuite) TestOnBlockProposed() { ) { s.Nil(s.p.onBlockProposed(context.Background(), e, func() {})) - s.Nil(s.p.validProofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + s.Nil(s.p.proofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) } } @@ -178,7 +178,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { BlockID: common.Big1, Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, - ZkProof: []byte{}, + Proof: []byte{}, }) }) s.NotPanics(func() { @@ -186,7 +186,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { BlockID: common.Big1, Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, - ZkProof: []byte{}, + Proof: []byte{}, }) }) } From ef82501aa762c6d9eb82b30d0547db4fd79830c9 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Oct 2023 12:32:35 +0800 Subject: [PATCH 30/63] feat(prover): remove unused fields --- metrics/metrics.go | 22 +++++++------------ prover/proof_submitter/proof_submitter.go | 20 +++++++---------- .../proof_submitter/proof_submitter_test.go | 2 -- prover/prover.go | 20 ++--------------- 4 files changed, 18 insertions(+), 46 deletions(-) diff --git a/metrics/metrics.go b/metrics/metrics.go index 1ee8a68b3..a43c1929f 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -29,20 +29,14 @@ var ( ProposerBlockFeeGauge = metrics.NewRegisteredGauge("proposer/blockFee", nil) // Prover - ProverLatestVerifiedIDGauge = metrics.NewRegisteredGauge("prover/latestVerified/id", nil) - ProverLatestProvenBlockIDGauge = metrics.NewRegisteredGauge("prover/latestProven/id", nil) - ProverQueuedProofCounter = metrics.NewRegisteredCounter("prover/proof/all/queued", nil) - ProverQueuedValidProofCounter = metrics.NewRegisteredCounter("prover/proof/valid/queued", nil) - ProverQueuedInvalidProofCounter = metrics.NewRegisteredCounter("prover/proof/invalid/queued", nil) - ProverReceivedProofCounter = metrics.NewRegisteredCounter("prover/proof/all/received", nil) - ProverReceivedValidProofCounter = metrics.NewRegisteredCounter("prover/proof/valid/received", nil) - ProverReceivedInvalidProofCounter = metrics.NewRegisteredCounter("prover/proof/invalid/received", nil) - ProverSentProofCounter = metrics.NewRegisteredCounter("prover/proof/all/sent", nil) - ProverSentValidProofCounter = metrics.NewRegisteredCounter("prover/proof/valid/sent", nil) - ProverSentInvalidProofCounter = metrics.NewRegisteredCounter("prover/proof/invalid/sent", nil) - ProverProofsAssigned = metrics.NewRegisteredCounter("prover/proof/assigned", nil) - ProverReceivedProposedBlockGauge = metrics.NewRegisteredGauge("prover/proposed/received", nil) - ProverReceivedProvenBlockGauge = metrics.NewRegisteredGauge("prover/proven/received", nil) + ProverLatestVerifiedIDGauge = metrics.NewRegisteredGauge("prover/latestVerified/id", nil) + ProverLatestProvenBlockIDGauge = metrics.NewRegisteredGauge("prover/latestProven/id", nil) + ProverQueuedProofCounter = metrics.NewRegisteredCounter("prover/proof/all/queued", nil) + ProverReceivedProofCounter = metrics.NewRegisteredCounter("prover/proof/all/received", nil) + ProverSentProofCounter = metrics.NewRegisteredCounter("prover/proof/all/sent", nil) + ProverProofsAssigned = metrics.NewRegisteredCounter("prover/proof/assigned", nil) + ProverReceivedProposedBlockGauge = metrics.NewRegisteredGauge("prover/proposed/received", nil) + ProverReceivedProvenBlockGauge = metrics.NewRegisteredGauge("prover/proven/received", nil) ) // Serve starts the metrics server on the given address, will be closed when the given diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index 5966ee78e..d10b3d96b 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -37,7 +37,6 @@ type ProofSubmitter struct { taikoL2Address common.Address l1SignalService common.Address l2SignalService common.Address - mutex *sync.Mutex graffiti [32]byte submissionMaxRetry uint64 retryInterval time.Duration @@ -45,6 +44,7 @@ type ProofSubmitter struct { proveBlockTxGasLimit *uint64 txReplacementTipMultiplier uint64 proveBlockMaxTxGasTipCap *big.Int + mutex *sync.Mutex } // NewValidProofSubmitter creates a new Submitter instance. @@ -54,7 +54,6 @@ func NewValidProofSubmitter( resultCh chan *proofProducer.ProofWithHeader, taikoL2Address common.Address, proverPrivKey *ecdsa.PrivateKey, - mutex *sync.Mutex, graffiti string, submissionMaxRetry uint64, retryInterval time.Duration, @@ -88,7 +87,6 @@ func NewValidProofSubmitter( l1SignalService: l1SignalService, l2SignalService: l2SignalService, taikoL2Address: taikoL2Address, - mutex: mutex, graffiti: rpc.StringToBytes32(graffiti), submissionMaxRetry: submissionMaxRetry, retryInterval: retryInterval, @@ -96,6 +94,7 @@ func NewValidProofSubmitter( proveBlockTxGasLimit: proveBlockTxGasLimit, txReplacementTipMultiplier: txReplacementTipMultiplier, proveBlockMaxTxGasTipCap: proveBlockMaxTxGasTipCap, + mutex: new(sync.Mutex), }, nil } @@ -112,6 +111,10 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko return fmt.Errorf("failed to get the current L2 block by hash (%s): %w", l1Origin.L2BlockHash, err) } + if block.Transactions().Len() == 0 { + return errors.New("no transaction in block") + } + parent, err := s.rpc.L2.BlockByHash(ctx, block.ParentHash()) if err != nil { return fmt.Errorf("failed to get the L2 parent block by hash (%s): %w", block.ParentHash(), err) @@ -122,13 +125,9 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko return err } - if block.Transactions().Len() == 0 { - return errors.New("no transaction in block") - } - signalRoot, err := s.rpc.GetStorageRoot(ctx, s.rpc.L2GethClient, s.l2SignalService, block.Number()) if err != nil { - return fmt.Errorf("failed to get storage root: %w", err) + return fmt.Errorf("failed to get L2 signal service storage root: %w", err) } // Request proof. @@ -161,7 +160,6 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko } metrics.ProverQueuedProofCounter.Inc(1) - metrics.ProverQueuedValidProofCounter.Inc(1) return nil } @@ -172,7 +170,7 @@ func (s *ProofSubmitter) SubmitProof( proofWithHeader *proofProducer.ProofWithHeader, ) (err error) { log.Info( - "New valid block proof", + "New block proof", "blockID", proofWithHeader.BlockID, "proposer", proofWithHeader.Meta.Coinbase, "hash", proofWithHeader.Header.Hash(), @@ -186,7 +184,6 @@ func (s *ProofSubmitter) SubmitProof( ) metrics.ProverReceivedProofCounter.Inc(1) - metrics.ProverReceivedValidProofCounter.Inc(1) // Get the corresponding L2 block. block, err := s.rpc.L2.BlockByHash(ctx, header.Hash()) @@ -296,7 +293,6 @@ func (s *ProofSubmitter) SubmitProof( } metrics.ProverSentProofCounter.Inc(1) - metrics.ProverSentValidProofCounter.Inc(1) metrics.ProverLatestProvenBlockIDGauge.Update(proofWithHeader.BlockID.Int64()) return nil diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index 349475f82..2c4a4074a 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "os" - "sync" "testing" "time" @@ -45,7 +44,6 @@ func (s *ProofSubmitterTestSuite) SetupTest() { s.validProofCh, common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), l1ProverPrivKey, - &sync.Mutex{}, "test", 1, 12*time.Second, diff --git a/prover/prover.go b/prover/prover.go index a3e11598b..f4ff9ca28 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -36,9 +36,8 @@ var ( // Prover keep trying to prove new proposed blocks valid/invalid. type Prover struct { // Configurations - cfg *Config - proverAddress common.Address - guardianProverAddress common.Address + cfg *Config + proverAddress common.Address // Clients rpc *rpc.Client @@ -76,7 +75,6 @@ type Prover struct { // Concurrency guards proposeConcurrencyGuard chan struct{} submitProofConcurrencyGuard chan struct{} - submitProofTxMutex *sync.Mutex // capacity-related configs capacityManager *capacity.CapacityManager @@ -124,7 +122,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { log.Info("Protocol configs", "configs", p.protocolConfigs) - p.submitProofTxMutex = &sync.Mutex{} p.proverAddress = crypto.PubkeyToAddress(p.cfg.L1ProverPrivKey.PublicKey) chBufferSize := p.protocolConfigs.BlockMaxProposals @@ -142,18 +139,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.proposeConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) p.submitProofConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) - guardianProverAddress, err := p.rpc.TaikoL1.Resolve( - &bind.CallOpts{Context: ctx}, - p.rpc.L1ChainID, - rpc.StringToBytes32("guardian"), - true, - ) - if err != nil { - return err - } - - p.guardianProverAddress = guardianProverAddress - var producer proofProducer.ProofProducer if cfg.Dummy { producer = &proofProducer.OptimisticProofProducer{} @@ -177,7 +162,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.proofGenerationCh, p.cfg.TaikoL2Address, p.cfg.L1ProverPrivKey, - p.submitProofTxMutex, p.cfg.Graffiti, p.cfg.ProofSubmissionMaxRetry, p.cfg.BackOffRetryInterval, From eb28b05f3060bf62e20100a6c1a907c8cd2bd2d2 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Oct 2023 12:50:12 +0800 Subject: [PATCH 31/63] feat(prover): rename some variables --- prover/proof_submitter/proof_submitter.go | 23 +++++++++++++---------- prover/prover.go | 3 ++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index d10b3d96b..d394c233e 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -175,16 +175,18 @@ func (s *ProofSubmitter) SubmitProof( "proposer", proofWithHeader.Meta.Coinbase, "hash", proofWithHeader.Header.Hash(), "proof", common.Bytes2Hex(proofWithHeader.Proof), + "tier", s.proofProducer.Tier(), "graffiti", common.Bytes2Hex(s.graffiti[:]), ) + + metrics.ProverReceivedProofCounter.Inc(1) + var ( blockID = proofWithHeader.BlockID header = proofWithHeader.Header - zkProof = proofWithHeader.Proof + proof = proofWithHeader.Proof ) - metrics.ProverReceivedProofCounter.Inc(1) - // Get the corresponding L2 block. block, err := s.rpc.L2.BlockByHash(ctx, header.Hash()) if err != nil { @@ -210,8 +212,7 @@ func (s *ProofSubmitter) SubmitProof( } // Get and validate this anchor transaction's receipt. - _, err = s.anchorTxValidator.GetAndValidateAnchorTxReceipt(ctx, anchorTx) - if err != nil { + if _, err = s.anchorTxValidator.GetAndValidateAnchorTxReceipt(ctx, anchorTx); err != nil { return fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) } @@ -222,14 +223,16 @@ func (s *ProofSubmitter) SubmitProof( SignalRoot: proofWithHeader.Opts.SignalRoot, Graffiti: s.graffiti, Tier: s.proofProducer.Tier(), - Proof: zkProof, + Proof: proof, } - circuitsIdx, err := proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) - if err != nil { - return err + if s.proofProducer.Tier() == encoding.TierPseZkevmID { + circuitsIdx, err := proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) + if err != nil { + return err + } + evidence.Proof = append(uint16ToBytes(circuitsIdx), evidence.Proof...) } - evidence.Proof = append(uint16ToBytes(circuitsIdx), evidence.Proof...) input, err := encoding.EncodeEvidence(evidence) if err != nil { diff --git a/prover/prover.go b/prover/prover.go index f4ff9ca28..f6b1c5df6 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -141,7 +141,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { var producer proofProducer.ProofProducer if cfg.Dummy { - producer = &proofProducer.OptimisticProofProducer{} + producer = new(proofProducer.OptimisticProofProducer) } else { if producer, err = proofProducer.NewZkevmRpcdProducer( cfg.ZKEvmRpcdEndpoint, @@ -474,6 +474,7 @@ func (p *Prover) onBlockProposed( "blockID", event.BlockId, "prover", event.AssignedProver, "expiresAt", provingWindowExpiresAt, + "minTier", event.MinTier, ) metrics.ProverProofsAssigned.Inc(1) From 422728d758babc86d3d970c2907d8a441dd1b215 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Oct 2023 14:17:37 +0800 Subject: [PATCH 32/63] feat(prover): improve submitters --- bindings/encoding/struct.go | 11 +- cmd/flags/prover.go | 7 + prover/config.go | 2 + prover/proof_producer/dummy_producer.go | 35 +++++ prover/proof_producer/guardian_producer.go | 44 ++++++ prover/proof_producer/optimistic_producer.go | 14 +- prover/proof_producer/proof_producer.go | 3 +- prover/proof_producer/sgx_producer.go | 44 ++++++ prover/proof_producer/zkevm_rpcd_producer.go | 32 ++-- prover/proof_submitter/interface.go | 1 + prover/proof_submitter/proof_submitter.go | 13 +- .../proof_submitter/proof_submitter_test.go | 2 +- prover/prover.go | 139 ++++++++++++------ prover/prover_test.go | 4 +- 14 files changed, 272 insertions(+), 79 deletions(-) create mode 100644 prover/proof_producer/dummy_producer.go create mode 100644 prover/proof_producer/guardian_producer.go create mode 100644 prover/proof_producer/sgx_producer.go diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index 7bf9aa659..86c52f730 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -9,11 +9,12 @@ import ( ) // Tier IDs defined in protocol. -const ( - TierOptimisticID uint16 = 100 - TierSgxID uint16 = 200 - TierPseZkevmID uint16 = 300 - TierGuardianID uint16 = 1000 +var ( + TierOptimisticID uint16 = 100 + TierSgxID uint16 = 200 + TierPseZkevmID uint16 = 300 + TierGuardianID uint16 = 1000 + ProtocolTiers []uint16 = []uint16{TierOptimisticID, TierSgxID, TierPseZkevmID, TierGuardianID} ) // BlockHeader represents an Ethereum block header. diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 19c964051..df8fe0d4e 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -96,6 +96,12 @@ var ( Category: proverCategory, Value: false, } + ContestControversialProofs = &cli.BoolFlag{ + Name: "prover.contestControversialProofs", + Usage: "Whether you want to contest proofs with different L2 hashes with higher tier proofs", + Category: proverCategory, + Value: false, + } ProveBlockTxGasLimit = &cli.Uint64Flag{ Name: "prover.proveBlockTxGasLimit", Usage: "Gas limit will be used for TaikoL1.proveBlock transactions", @@ -161,6 +167,7 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ ProveBlockMaxTxGasTipCap, Graffiti, ProveUnassignedBlocks, + ContestControversialProofs, ProveBlockTxGasLimit, ProverHTTPServerPort, ProverCapacity, diff --git a/prover/config.go b/prover/config.go index c686305dc..bf9733ea7 100644 --- a/prover/config.go +++ b/prover/config.go @@ -35,6 +35,7 @@ type Config struct { BackOffMaxRetrys uint64 BackOffRetryInterval time.Duration ProveUnassignedBlocks bool + ContestControversialProofs bool RPCTimeout *time.Duration WaitReceiptTimeout time.Duration ProveBlockGasLimit *uint64 @@ -122,6 +123,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), ProveUnassignedBlocks: c.Bool(flags.ProveUnassignedBlocks.Name), + ContestControversialProofs: c.Bool(flags.ContestControversialProofs.Name), RPCTimeout: timeout, WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProveBlockGasLimit: proveBlockTxGasLimit, diff --git a/prover/proof_producer/dummy_producer.go b/prover/proof_producer/dummy_producer.go new file mode 100644 index 000000000..59de6be52 --- /dev/null +++ b/prover/proof_producer/dummy_producer.go @@ -0,0 +1,35 @@ +package producer + +import ( + "bytes" + "context" + "math/big" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/taikoxyz/taiko-client/bindings" +) + +// OptimisticProofProducer always returns a dummy proof. +type DummyProofProducer struct{} + +// RequestProof returns a dummy proof to the result channel. +func (o *DummyProofProducer) RequestProof( + ctx context.Context, + opts *ProofRequestOptions, + blockID *big.Int, + meta *bindings.TaikoDataBlockMetadata, + header *types.Header, + tier uint16, + resultCh chan *ProofWithHeader, +) error { + resultCh <- &ProofWithHeader{ + BlockID: blockID, + Meta: meta, + Header: header, + Proof: bytes.Repeat([]byte{0xff}, 100), + Degree: CircuitsIdx, + Opts: opts, + } + + return nil +} diff --git a/prover/proof_producer/guardian_producer.go b/prover/proof_producer/guardian_producer.go new file mode 100644 index 000000000..451d0681e --- /dev/null +++ b/prover/proof_producer/guardian_producer.go @@ -0,0 +1,44 @@ +package producer + +import ( + "context" + "math/big" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" +) + +// GuardianProofProducer always returns an optimistic (dummy) proof. +type GuardianProofProducer struct{ *DummyProofProducer } + +// RequestProof implements the ProofProducer interface. +func (g *GuardianProofProducer) RequestProof( + ctx context.Context, + opts *ProofRequestOptions, + blockID *big.Int, + meta *bindings.TaikoDataBlockMetadata, + header *types.Header, + resultCh chan *ProofWithHeader, +) error { + log.Info( + "Request guardian proof", + "blockID", blockID, + "coinbase", meta.Coinbase, + "height", header.Number, + "hash", header.Hash(), + ) + + return g.DummyProofProducer.RequestProof(ctx, opts, blockID, meta, header, g.Tier(), resultCh) +} + +// Tier implements the ProofProducer interface. +func (g *GuardianProofProducer) Tier() uint16 { + return encoding.TierGuardianID +} + +// Cancel cancels an existing proof generation. +func (g *GuardianProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { + return nil +} diff --git a/prover/proof_producer/optimistic_producer.go b/prover/proof_producer/optimistic_producer.go index 0fc4d16ae..9ab5dc21d 100644 --- a/prover/proof_producer/optimistic_producer.go +++ b/prover/proof_producer/optimistic_producer.go @@ -1,7 +1,6 @@ package producer import ( - "bytes" "context" "math/big" @@ -12,7 +11,7 @@ import ( ) // OptimisticProofProducer always returns an optimistic (dummy) proof. -type OptimisticProofProducer struct{} +type OptimisticProofProducer struct{ *DummyProofProducer } // RequestProof implements the ProofProducer interface. func (o *OptimisticProofProducer) RequestProof( @@ -31,16 +30,7 @@ func (o *OptimisticProofProducer) RequestProof( "hash", header.Hash(), ) - resultCh <- &ProofWithHeader{ - BlockID: blockID, - Meta: meta, - Header: header, - Proof: bytes.Repeat([]byte{0xff}, 100), - Degree: CircuitsIdx, - Opts: opts, - } - - return nil + return o.DummyProofProducer.RequestProof(ctx, opts, blockID, meta, header, o.Tier(), resultCh) } // Tier implements the ProofProducer interface. diff --git a/prover/proof_producer/proof_producer.go b/prover/proof_producer/proof_producer.go index 63fe522f4..dc58c7a8c 100644 --- a/prover/proof_producer/proof_producer.go +++ b/prover/proof_producer/proof_producer.go @@ -15,7 +15,7 @@ const ( // ProofRequestOptions contains all options that need to be passed to zkEVM rpcd service. type ProofRequestOptions struct { - Height *big.Int // the block number + BlockID *big.Int ProverAddress common.Address ProposeBlockTxHash common.Hash L1SignalService common.Address @@ -38,6 +38,7 @@ type ProofWithHeader struct { Proof []byte Degree uint64 Opts *ProofRequestOptions + Tier uint16 } type ProofProducer interface { diff --git a/prover/proof_producer/sgx_producer.go b/prover/proof_producer/sgx_producer.go new file mode 100644 index 000000000..e70680bba --- /dev/null +++ b/prover/proof_producer/sgx_producer.go @@ -0,0 +1,44 @@ +package producer + +import ( + "context" + "math/big" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" +) + +// SGXProofProducer generates a SGX proof for the given block. +type SGXProofProducer struct{ *DummyProofProducer } + +// RequestProof implements the ProofProducer interface. +func (s *SGXProofProducer) RequestProof( + ctx context.Context, + opts *ProofRequestOptions, + blockID *big.Int, + meta *bindings.TaikoDataBlockMetadata, + header *types.Header, + resultCh chan *ProofWithHeader, +) error { + log.Warn( + "SGX proof producer is unimplemented, will return a dummy proof instead", + "blockID", blockID, + "coinbase", meta.Coinbase, + "height", header.Number, + "hash", header.Hash(), + ) + + return s.DummyProofProducer.RequestProof(ctx, opts, blockID, meta, header, s.Tier(), resultCh) +} + +// Tier implements the ProofProducer interface. +func (s *SGXProofProducer) Tier() uint16 { + return encoding.TierSgxID +} + +// Cancel cancels an existing proof generation. +func (s *SGXProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { + return nil +} diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index ce6d6b0ec..96ac1f448 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -26,14 +26,15 @@ var ( // ZkevmRpcdProducer is responsible for requesting zk proofs from the given proverd endpoint. type ZkevmRpcdProducer struct { - RpcdEndpoint string // a proverd RPC endpoint - Param string // parameter file to use - L1Endpoint string // a L1 node RPC endpoint - L2Endpoint string // a L2 execution engine's RPC endpoint - Retry bool // retry proof computation if error - CustomProofHook func() ([]byte, uint64, error) // only for testing purposes - ProofTimeTarget uint64 // used for calculating proof delay - ProtocolConfig *bindings.TaikoDataConfig // protocol configurations + RpcdEndpoint string // a proverd RPC endpoint + Param string // parameter file to use + L1Endpoint string // a L1 node RPC endpoint + L2Endpoint string // a L2 execution engine's RPC endpoint + Retry bool // retry proof computation if error + ProofTimeTarget uint64 // used for calculating proof delay + ProtocolConfig *bindings.TaikoDataConfig // protocol configurations + CustomProofHook func() ([]byte, uint64, error) // only for testing purposes + *DummyProofProducer // only for testing purposes } // RequestProofBody represents the JSON body for requesting the proof. @@ -137,6 +138,10 @@ func (p *ZkevmRpcdProducer) RequestProof( "hash", header.Hash(), ) + if p.DummyProofProducer != nil { + return p.DummyProofProducer.RequestProof(ctx, opts, blockID, meta, header, p.Tier(), resultCh) + } + var ( proof []byte degree uint64 @@ -158,6 +163,7 @@ func (p *ZkevmRpcdProducer) RequestProof( Proof: proof, Degree: degree, Opts: opts, + Tier: p.Tier(), } return nil @@ -176,12 +182,12 @@ func (p *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofReq } output, err := p.requestProof(opts) if err != nil { - log.Error("Failed to request proof", "height", opts.Height, "err", err, "endpoint", p.RpcdEndpoint) + log.Error("Failed to request proof", "height", opts.BlockID, "err", err, "endpoint", p.RpcdEndpoint) return err } if output == nil { - log.Info("Proof generating", "height", opts.Height, "time", time.Since(start)) + log.Info("Proof generating", "height", opts.BlockID, "time", time.Since(start)) return errProofGenerating } @@ -195,7 +201,7 @@ func (p *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofReq proof = common.Hex2Bytes(proofOutput) degree = output.Aggregation.Degree - log.Info("Proof generated", "height", opts.Height, "degree", degree, "time", time.Since(start)) + log.Info("Proof generated", "height", opts.BlockID, "degree", degree, "time", time.Since(start)) return nil }, backoff.NewConstantBackOff(proofPollingInterval)); err != nil { return nil, 0, err @@ -211,7 +217,7 @@ func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput Method: "proof", Params: []*RequestProofBodyParam{{ Circuit: "super", - Block: opts.Height, + Block: opts.BlockID, L2RPC: p.L2Endpoint, Retry: true, Param: p.Param, @@ -249,7 +255,7 @@ func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput defer res.Body.Close() if res.StatusCode != http.StatusOK { - return nil, fmt.Errorf("failed to request proof, id: %d, statusCode: %d", opts.Height, res.StatusCode) + return nil, fmt.Errorf("failed to request proof, id: %d, statusCode: %d", opts.BlockID, res.StatusCode) } resBytes, err := io.ReadAll(res.Body) diff --git a/prover/proof_submitter/interface.go b/prover/proof_submitter/interface.go index 13c3a6fcb..f72e83f00 100644 --- a/prover/proof_submitter/interface.go +++ b/prover/proof_submitter/interface.go @@ -12,4 +12,5 @@ type Submitter interface { RequestProof(ctx context.Context, event *bindings.TaikoL1ClientBlockProposed) error SubmitProof(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) error CancelProof(ctx context.Context, blockID *big.Int) error + Tier() uint16 } diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index d394c233e..8fb5cfc54 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -47,8 +47,8 @@ type ProofSubmitter struct { mutex *sync.Mutex } -// NewValidProofSubmitter creates a new Submitter instance. -func NewValidProofSubmitter( +// New creates a new ProofSubmitter instance. +func New( rpcClient *rpc.Client, proofProducer proofProducer.ProofProducer, resultCh chan *proofProducer.ProofWithHeader, @@ -132,7 +132,7 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko // Request proof. opts := &proofProducer.ProofRequestOptions{ - Height: block.Number(), + BlockID: block.Number(), ProverAddress: s.proverAddress, ProposeBlockTxHash: event.Raw.TxHash, L1SignalService: s.l1SignalService, @@ -194,7 +194,7 @@ func (s *ProofSubmitter) SubmitProof( } log.Debug( - "Get the L2 block to prove", + "L2 block to prove", "blockID", blockID, "hash", block.Hash(), "root", header.Root.String(), @@ -308,6 +308,11 @@ func (s *ProofSubmitter) CancelProof(ctx context.Context, blockID *big.Int) erro return s.proofProducer.Cancel(ctx, blockID) } +// Tier returns the proof tier of the current proof submitter. +func (s *ProofSubmitter) Tier() uint16 { + return s.proofProducer.Tier() +} + // uint16ToBytes converts an uint16 to bytes. func uint16ToBytes(i uint16) []byte { b := make([]byte, 2) diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index 2c4a4074a..b896cc618 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -38,7 +38,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() { s.validProofCh = make(chan *proofProducer.ProofWithHeader, 1024) s.invalidProofCh = make(chan *proofProducer.ProofWithHeader, 1024) - s.validProofSubmitter, err = NewValidProofSubmitter( + s.validProofSubmitter, err = New( s.RpcClient, &proofProducer.OptimisticProofProducer{}, s.validProofCh, diff --git a/prover/prover.go b/prover/prover.go index f6b1c5df6..cd6ca900b 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -18,6 +18,7 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/metrics" eventIterator "github.com/taikoxyz/taiko-client/pkg/chain_iterator/event_iterator" "github.com/taikoxyz/taiko-client/pkg/rpc" @@ -57,7 +58,7 @@ type Prover struct { tiers []*rpc.TierProviderTierWithID // Proof submitters - proofSubmitter proofSubmitter.Submitter + proofSubmitters []proofSubmitter.Submitter // Subscriptions blockProposedCh chan *bindings.TaikoL1ClientBlockProposed @@ -139,42 +140,60 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.proposeConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) p.submitProofConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) - var producer proofProducer.ProofProducer - if cfg.Dummy { - producer = new(proofProducer.OptimisticProofProducer) - } else { - if producer, err = proofProducer.NewZkevmRpcdProducer( - cfg.ZKEvmRpcdEndpoint, - cfg.ZkEvmRpcdParamsPath, - cfg.L1HttpEndpoint, - cfg.L2HttpEndpoint, - true, - p.protocolConfigs, + // Protocol proof tiers + if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { + return err + } + + // Proof submitters + for _, tier := range p.tiers { + var ( + producer proofProducer.ProofProducer + submitter proofSubmitter.Submitter + ) + switch tier.ID { + case encoding.TierOptimisticID: + producer = &proofProducer.OptimisticProofProducer{DummyProofProducer: new(proofProducer.DummyProofProducer)} + case encoding.TierSgxID: + producer = &proofProducer.SGXProofProducer{DummyProofProducer: new(proofProducer.DummyProofProducer)} + case encoding.TierPseZkevmID: + zkEvmRpcdProducer, err := proofProducer.NewZkevmRpcdProducer( + cfg.ZKEvmRpcdEndpoint, + cfg.ZkEvmRpcdParamsPath, + cfg.L1HttpEndpoint, + cfg.L2HttpEndpoint, + true, + p.protocolConfigs, + ) + if err != nil { + return err + } + if p.cfg.Dummy { + zkEvmRpcdProducer.DummyProofProducer = new(proofProducer.DummyProofProducer) + } + producer = zkEvmRpcdProducer + case encoding.TierGuardianID: + producer = &proofProducer.GuardianProofProducer{DummyProofProducer: new(proofProducer.DummyProofProducer)} + } + + if submitter, err = proofSubmitter.New( + p.rpc, + producer, + p.proofGenerationCh, + p.cfg.TaikoL2Address, + p.cfg.L1ProverPrivKey, + p.cfg.Graffiti, + p.cfg.ProofSubmissionMaxRetry, + p.cfg.BackOffRetryInterval, + p.cfg.WaitReceiptTimeout, + p.cfg.ProveBlockGasLimit, + p.cfg.ProveBlockTxReplacementMultiplier, + p.cfg.ProveBlockMaxTxGasTipCap, ); err != nil { return err } - } - // Proof submitter - if p.proofSubmitter, err = proofSubmitter.NewValidProofSubmitter( - p.rpc, - producer, - p.proofGenerationCh, - p.cfg.TaikoL2Address, - p.cfg.L1ProverPrivKey, - p.cfg.Graffiti, - p.cfg.ProofSubmissionMaxRetry, - p.cfg.BackOffRetryInterval, - p.cfg.WaitReceiptTimeout, - p.cfg.ProveBlockGasLimit, - p.cfg.ProveBlockTxReplacementMultiplier, - p.cfg.ProveBlockMaxTxGasTipCap, - ); err != nil { - return err - } - - if p.tiers, err = p.rpc.GetTiers(ctx); err != nil { - return err + p.proofSubmitters = append(p.proofSubmitters, submitter) } // Prover server @@ -485,7 +504,11 @@ func (p *Prover) onBlockProposed( } } - return p.proofSubmitter.RequestProof(ctx, event) + if proofSubmitter := p.selectSubmitter(event.MinTier); proofSubmitter != nil { + return proofSubmitter.RequestProof(ctx, event) + } + + return nil } p.proposeConcurrencyGuard <- struct{}{} @@ -526,8 +549,12 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc if err := backoff.Retry( func() error { - err := p.proofSubmitter.SubmitProof(p.ctx, proofWithHeader) - if err != nil { + proofSubmitter := p.getSubmitterByTier(proofWithHeader.Tier) + if proofSubmitter == nil { + return nil + } + + if err := proofSubmitter.SubmitProof(p.ctx, proofWithHeader); err != nil { log.Error("Submit proof error", "error", err) return err } @@ -663,7 +690,7 @@ func (p *Prover) isValidProof( func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) - if !p.cfg.GuardianProver { + if !p.cfg.ContestControversialProofs { return nil } @@ -686,11 +713,11 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 return err } - return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(L1Height)) + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(L1Height), true) } // requestProofByBlockID performs a proving operation for the given block. -func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) error { +func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int, contestOldProof bool) error { onBlockProposed := func( ctx context.Context, event *bindings.TaikoL1ClientBlockProposed, @@ -721,7 +748,11 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int) erro p.proposeConcurrencyGuard <- struct{}{} - return p.proofSubmitter.RequestProof(ctx, event) + if proofSubmitter := p.selectSubmitter(event.MinTier); proofSubmitter != nil { + return proofSubmitter.RequestProof(ctx, event) + } + + return nil } handleBlockProposedEvent := func() error { @@ -767,7 +798,7 @@ func (p *Prover) onProvingWindowExpired(ctx context.Context, e *bindings.TaikoL1 return nil } - return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber)) + return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber), false) } // getProvingWindow returns the provingWindow of the given proposed block. @@ -780,3 +811,29 @@ func (p *Prover) getProvingWindow(e *bindings.TaikoL1ClientBlockProposed) (time. return 0, errTierNotFound } + +// selectSubmitter returns the proof submitter with the given minTier. +func (p *Prover) selectSubmitter(minTier uint16) proofSubmitter.Submitter { + for _, s := range p.proofSubmitters { + if s.Tier() >= minTier { + return s + } + } + + log.Warn("No proof producer / submitter found for the given minTier", "minTier", minTier) + + return nil +} + +// getSubmitterByTier returns the proof submitter with the given tier. +func (p *Prover) getSubmitterByTier(tier uint16) proofSubmitter.Submitter { + for _, s := range p.proofSubmitters { + if s.Tier() == tier { + return s + } + } + + log.Warn("No proof producer / submitter found for the given tier", "tier", tier) + + return nil +} diff --git a/prover/prover_test.go b/prover/prover_test.go index f1f434995..e63d1dee5 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -151,7 +151,7 @@ func (s *ProverTestSuite) TestOnBlockProposed() { // Valid block e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) s.Nil(s.p.onBlockProposed(context.Background(), e, func() {})) - s.Nil(s.p.proofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + s.Nil(s.p.selectSubmitter(e.MinTier).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) // Empty blocks for _, e = range testutils.ProposeAndInsertEmptyBlocks( @@ -161,7 +161,7 @@ func (s *ProverTestSuite) TestOnBlockProposed() { ) { s.Nil(s.p.onBlockProposed(context.Background(), e, func() {})) - s.Nil(s.p.proofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + s.Nil(s.p.selectSubmitter(e.MinTier).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) } } From eb887491bb683d7559d6b8e62ad2140ad2e4c475 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 8 Oct 2023 18:53:00 +0800 Subject: [PATCH 33/63] feat(prover): update `requestProofByBlockID` --- prover/prover.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prover/prover.go b/prover/prover.go index cd6ca900b..38b3cea71 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -748,7 +748,12 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int, cont p.proposeConcurrencyGuard <- struct{}{} - if proofSubmitter := p.selectSubmitter(event.MinTier); proofSubmitter != nil { + var minTier = event.MinTier + if contestOldProof { + minTier += 1 + } + + if proofSubmitter := p.selectSubmitter(minTier); proofSubmitter != nil { return proofSubmitter.RequestProof(ctx, event) } From dc6802d0b158cd492cfb167c049f36cc6fd95245 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 12:37:41 +0800 Subject: [PATCH 34/63] test(prover): add more tests for `capacityManager` --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 28 ++-- prover/capacity_manager/capacity_manager.go | 116 ++++++----------- .../capacity_manager/capacity_manager_test.go | 79 +++-------- prover/capacity_manager/slots_manager.go | 109 ++++++++++++++++ prover/capacity_manager/slots_manager_test.go | 123 ++++++++++++++++++ prover/prover.go | 2 +- prover/server/api.go | 6 +- prover/server/server_test.go | 2 +- testutils/suite.go | 3 +- 10 files changed, 315 insertions(+), 155 deletions(-) create mode 100644 prover/capacity_manager/slots_manager.go create mode 100644 prover/capacity_manager/slots_manager_test.go diff --git a/bindings/.githead b/bindings/.githead index dceed7fc9..0eac5b95c 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -a74f44f1d710185c9b29d88e60e73794893ba99d +4c78ddbd357b00aa98332e8d63d088bda070ae8f diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index 9d4bd4caf..ff5293694 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -75,8 +75,9 @@ type TaikoDataConfig struct { BlockMaxGasLimit uint32 BlockFeeBaseGas uint32 BlockMaxTxListBytes *big.Int - ProposerRewardPerSecond *big.Int + ProposerRewardPerL1Block *big.Int ProposerRewardMax *big.Int + ProposerRewardPoolPctg uint8 LivenessBond *big.Int EthDepositRingBufferSize *big.Int EthDepositMinCountPerBlock uint64 @@ -110,6 +111,12 @@ type TaikoDataSlotB struct { LastVerifiedBlockId uint64 } +// TaikoDataSlotC is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataSlotC struct { + AccumulatedReward *big.Int + LastProposedHeight uint64 +} + // TaikoDataStateVariables is an auto generated low-level Go binding around an user-defined struct. type TaikoDataStateVariables struct { GenesisHeight uint64 @@ -136,7 +143,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardPerL1Block\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"proposerRewardPoolPctg\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -380,7 +387,7 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlock(blockId uint64) (Taik // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint128,uint128,uint8,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getConfig") @@ -397,14 +404,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (Taiko // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint128,uint128,uint8,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint128,uint128,uint8,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } @@ -752,10 +759,11 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) Resolve0(name [32]byte, allowZ // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB) +// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB, (uint128,uint64) slotC) func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { SlotA TaikoDataSlotA SlotB TaikoDataSlotB + SlotC TaikoDataSlotC }, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "state") @@ -763,6 +771,7 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { outstruct := new(struct { SlotA TaikoDataSlotA SlotB TaikoDataSlotB + SlotC TaikoDataSlotC }) if err != nil { return *outstruct, err @@ -770,6 +779,7 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { outstruct.SlotA = *abi.ConvertType(out[0], new(TaikoDataSlotA)).(*TaikoDataSlotA) outstruct.SlotB = *abi.ConvertType(out[1], new(TaikoDataSlotB)).(*TaikoDataSlotB) + outstruct.SlotC = *abi.ConvertType(out[2], new(TaikoDataSlotC)).(*TaikoDataSlotC) return *outstruct, err @@ -777,20 +787,22 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB) +// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB, (uint128,uint64) slotC) func (_TaikoL1Client *TaikoL1ClientSession) State() (struct { SlotA TaikoDataSlotA SlotB TaikoDataSlotB + SlotC TaikoDataSlotC }, error) { return _TaikoL1Client.Contract.State(&_TaikoL1Client.CallOpts) } // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB) +// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB, (uint128,uint64) slotC) func (_TaikoL1Client *TaikoL1ClientCallerSession) State() (struct { SlotA TaikoDataSlotA SlotB TaikoDataSlotB + SlotC TaikoDataSlotC }, error) { return _TaikoL1Client.Contract.State(&_TaikoL1Client.CallOpts) } diff --git a/prover/capacity_manager/capacity_manager.go b/prover/capacity_manager/capacity_manager.go index 92b58db16..d1c8c0ff3 100644 --- a/prover/capacity_manager/capacity_manager.go +++ b/prover/capacity_manager/capacity_manager.go @@ -9,20 +9,14 @@ import ( // CapacityManager manages the prover capacity concurrent-safely. type CapacityManager struct { - capacity map[uint64]bool - tempCapacity []time.Time - tempCapacityExpiresAt time.Duration - maxCapacity uint64 - mutex sync.RWMutex + slotsManager *slotsManager + mutex sync.RWMutex } // New creates a new CapacityManager instance. -func New(capacity uint64, tempCapacityExpiresAt time.Duration) *CapacityManager { +func New(capacity uint64) *CapacityManager { return &CapacityManager{ - capacity: make(map[uint64]bool), - maxCapacity: capacity, - tempCapacity: make([]time.Time, 0), - tempCapacityExpiresAt: tempCapacityExpiresAt, + slotsManager: &slotsManager{[]*capacitySlot{}, capacity}, } } @@ -33,13 +27,12 @@ func (m *CapacityManager) ReadCapacity() uint64 { log.Info( "Reading capacity", - "maxCapacity", m.maxCapacity, - "currentCapacity", m.maxCapacity-uint64(len(m.capacity)), - "currentUsage", len(m.capacity), - "currentTempCapacityUsage", len(m.tempCapacity), + "maxCapacity", m.slotsManager.MaxSlots(), + "currentCapacity", m.slotsManager.MaxSlots()-m.slotsManager.Len(), + "currentUsage", m.slotsManager.Len(), ) - return m.maxCapacity - uint64((len(m.capacity))) + return m.slotsManager.MaxSlots() - m.slotsManager.Len() } // ReleaseOneCapacity releases one capacity. @@ -47,28 +40,37 @@ func (m *CapacityManager) ReleaseOneCapacity(blockID uint64) (uint64, bool) { m.mutex.Lock() defer m.mutex.Unlock() - if _, ok := m.capacity[blockID]; !ok { + if blockID == BlockIDPlaceHolder { + return m.slotsManager.MaxSlots() - m.slotsManager.Len(), false + } + + if ok := m.slotsManager.removeItemByBlockID(blockID); !ok { log.Info( "Can not release capacity", "blockID", blockID, - "maxCapacity", m.maxCapacity, - "currentCapacity", m.maxCapacity-uint64(len(m.capacity)), - "currentUsage", len(m.capacity), + "maxCapacity", m.slotsManager.MaxSlots(), + "currentCapacity", m.slotsManager.MaxSlots()-m.slotsManager.Len(), + "currentUsage", m.slotsManager.Len(), ) - return uint64(len(m.capacity)), false + return m.slotsManager.MaxSlots() - m.slotsManager.Len(), false } - delete(m.capacity, blockID) - log.Info( "Released capacity", "blockID", blockID, - "maxCapacity", m.maxCapacity, - "currentCapacityAfterRelease", m.maxCapacity-uint64(len(m.capacity)), - "currentUsageAfterRelease", len(m.capacity), + "maxCapacity", m.slotsManager.MaxSlots(), + "currentCapacity", m.slotsManager.MaxSlots()-m.slotsManager.Len(), + "currentUsage", m.slotsManager.Len(), ) - return m.maxCapacity - uint64(len(m.capacity)), true + return m.slotsManager.MaxSlots() - m.slotsManager.Len(), true +} + +func (m *CapacityManager) HoldOneCapacity(expiry time.Duration) bool { + m.mutex.Lock() + defer m.mutex.Unlock() + + return m.slotsManager.HoldOneSlot(expiry) } // TakeOneCapacity takes one capacity. @@ -76,67 +78,25 @@ func (m *CapacityManager) TakeOneCapacity(blockID uint64) (uint64, bool) { m.mutex.Lock() defer m.mutex.Unlock() - if len(m.capacity) == int(m.maxCapacity) { + if ok := m.slotsManager.TakeOneSlot(blockID); !ok { log.Info( "Could not take one capacity", "blockID", blockID, - "maxCapacity", m.maxCapacity, - "currentCapacity", m.maxCapacity-uint64(len(m.capacity)), - "currentUsage", len(m.capacity), + "maxCapacity", m.slotsManager.MaxSlots(), + "currentCapacity", m.slotsManager.MaxSlots()-m.slotsManager.Len(), + "currentUsage", m.slotsManager.Len(), ) - return 0, false - } - m.capacity[blockID] = true + return m.slotsManager.MaxSlots() - m.slotsManager.Len(), true + } log.Info( "Took one capacity", "blockID", blockID, - "maxCapacity", m.maxCapacity, - "currentCapacityAfterTaking", m.maxCapacity-uint64(len(m.capacity)), - "currentUsageAfterTaking", len(m.capacity), + "maxCapacity", m.slotsManager.MaxSlots(), + "currentCapacity", m.slotsManager.MaxSlots()-m.slotsManager.Len(), + "currentUsage", m.slotsManager.Len(), ) - return m.maxCapacity - uint64((len(m.capacity))), true -} - -func (m *CapacityManager) TakeOneTempCapacity() (uint64, bool) { - m.mutex.Lock() - defer m.mutex.Unlock() - - // clear expired tempCapacities - - m.clearExpiredTempCapacities() - - if len(m.capacity)+len(m.tempCapacity) >= int(m.maxCapacity) { - log.Info( - "Could not take one temp capacity", - "maxCapacity", m.maxCapacity, - "currentCapacityAfterTaking", m.maxCapacity-uint64(len(m.capacity)), - "currentUsageAfterTaking", len(m.capacity), - "tempCapacity", m.maxCapacity-uint64(len((m.tempCapacity))), - "tempCapacityUsage", len(m.tempCapacity), - ) - return 0, false - } - - m.tempCapacity = append(m.tempCapacity, time.Now().UTC()) - - return m.maxCapacity - uint64(len(m.capacity)) - uint64((len(m.tempCapacity))), true -} - -func (m *CapacityManager) clearExpiredTempCapacities() { - for i, c := range m.tempCapacity { - if time.Now().UTC().Sub(c) > m.tempCapacityExpiresAt { - m.tempCapacity = append(m.tempCapacity[:i], m.tempCapacity[i+1:]...) - log.Info( - "Cleared one temp capacity", - "maxCapacity", m.maxCapacity, - "currentCapacityAfterClearing", m.maxCapacity-uint64(len(m.capacity)), - "currentUsageAfterClearing", len(m.capacity), - "tempCapacity", m.maxCapacity-uint64(len((m.tempCapacity))), - "tempCapacityUsage", len(m.tempCapacity), - ) - } - } + return m.slotsManager.MaxSlots() - m.slotsManager.Len(), true } diff --git a/prover/capacity_manager/capacity_manager_test.go b/prover/capacity_manager/capacity_manager_test.go index 1e7d7b4c4..62c8c13be 100644 --- a/prover/capacity_manager/capacity_manager_test.go +++ b/prover/capacity_manager/capacity_manager_test.go @@ -1,14 +1,14 @@ package capacity_manager import ( + "testing" "time" "github.com/stretchr/testify/suite" ) var ( - testCapacity uint64 = 5 - tempCapacityExpiresAt time.Duration = 5 * time.Second + testCapacity uint64 = 5 ) type CapacityManagerTestSuite struct { @@ -17,80 +17,37 @@ type CapacityManagerTestSuite struct { } func (s *CapacityManagerTestSuite) SetupTest() { - s.m = New(testCapacity, tempCapacityExpiresAt) + s.m = New(testCapacity) } func (s *CapacityManagerTestSuite) TestReadCapacity() { s.Equal(testCapacity, s.m.ReadCapacity()) } -func (s *CapacityManagerTestSuite) TestReleaseOneCapacity() { - var blockID uint64 = 1 - _, released := s.m.ReleaseOneCapacity(blockID) - s.Equal(false, released) - - _, ok := s.m.TakeOneCapacity(blockID) - - s.Equal(true, ok) - - capacity, released := s.m.ReleaseOneCapacity(blockID) - s.Equal(true, released) - - s.Equal(testCapacity+1, capacity) - s.Equal(testCapacity+1, s.m.ReadCapacity()) -} - func (s *CapacityManagerTestSuite) TestTakeOneCapacity() { - var blockID uint64 = 1 - - capacity, ok := s.m.TakeOneCapacity(blockID) + s.True(s.m.HoldOneCapacity(1 * time.Minute)) + capacity, ok := s.m.TakeOneCapacity(1) s.True(ok) s.Equal(testCapacity-1, capacity) s.Equal(testCapacity-1, s.m.ReadCapacity()) } -func (s *CapacityManagerTestSuite) TestTakeOneTempCapacity() { - // take 3 actual capacity - var sl []uint64 = []uint64{1, 2, 3} - - for _, c := range sl { - _, ok := s.m.TakeOneCapacity(c) - s.True(ok) - } - - // should be 2 temp capacity left to take - capacity, ok := s.m.TakeOneTempCapacity() - s.True(ok) - s.Equal(int(testCapacity)-len(sl)-1, capacity) - - capacity, ok = s.m.TakeOneTempCapacity() - s.True(ok) - s.Equal(int(testCapacity)-len(sl)-2, capacity) - - // now it should fail, 3 capacity + 2 temp capacity - capacity, ok = s.m.TakeOneTempCapacity() - s.False(ok) - s.Equal(int(testCapacity)-len(sl)-2, capacity) - - // wait until they expire - time.Sleep(s.m.tempCapacityExpiresAt) +func (s *CapacityManagerTestSuite) TestReleaseOneCapacity() { + var blockID uint64 = 1 + _, released := s.m.ReleaseOneCapacity(blockID) + s.Equal(false, released) - // both should be expired, we should be able to take two more - capacity, ok = s.m.TakeOneTempCapacity() + s.True(s.m.HoldOneCapacity(1 * time.Minute)) + _, ok := s.m.TakeOneCapacity(blockID) s.True(ok) - s.Equal(int(testCapacity)-len(sl)-1, capacity) - capacity, ok = s.m.TakeOneTempCapacity() - s.True(ok) - s.Equal(int(testCapacity)-len(sl)-2, capacity) + capacity, released := s.m.ReleaseOneCapacity(blockID) + s.True(released) - // now remove one actual capacity, simulate "block done being proven" - capacity, ok = s.m.ReleaseOneCapacity(sl[0]) - s.True(ok) - s.Equal(int(testCapacity)-len(sl)-1, capacity) + s.Equal(testCapacity, capacity) + s.Equal(testCapacity, s.m.ReadCapacity()) +} - // and we should be able to take another temp capacity - capacity, ok = s.m.TakeOneTempCapacity() - s.True(ok) - s.Equal(int(testCapacity)-len(sl)-2, capacity) +func TestCapacityManagerTestSuite(t *testing.T) { + suite.Run(t, new(CapacityManagerTestSuite)) } diff --git a/prover/capacity_manager/slots_manager.go b/prover/capacity_manager/slots_manager.go new file mode 100644 index 000000000..b37d157bc --- /dev/null +++ b/prover/capacity_manager/slots_manager.go @@ -0,0 +1,109 @@ +package capacity_manager + +import ( + "sort" + "time" +) + +const ( + BlockIDPlaceHolder = 0 +) + +type capacitySlot struct { + blockID uint64 + expiredAt *time.Time +} + +type slotsManager struct { + slots []*capacitySlot + maxSlots uint64 +} + +func (s *slotsManager) sort() { + sort.Slice(s.slots, func(i, j int) bool { + if s.slots[i].expiredAt == nil && s.slots[j].expiredAt == nil { + return false + } + if s.slots[i].expiredAt == nil && s.slots[j].expiredAt != nil { + return false + } + if s.slots[i].expiredAt != nil && s.slots[j].expiredAt == nil { + return true + } + + return s.slots[i].expiredAt.Before(*s.slots[j].expiredAt) + }) +} + +func (s *slotsManager) removeItemByBlockID(id uint64) bool { + defer s.sort() + + if len(s.slots) == 0 { + return false + } + + if id == BlockIDPlaceHolder { + if s.slots[0].expiredAt != nil { + s.slots[0] = s.slots[len(s.slots)-1] + s.slots = s.slots[:len(s.slots)-1] + return true + } + + return false + } + + for i := range s.slots { + if s.slots[i].blockID == id { + s.slots[i] = s.slots[len(s.slots)-1] + s.slots = s.slots[:len(s.slots)-1] + return true + } + } + + return false +} + +func (s *slotsManager) clearOneExpiredSlots() { + defer s.sort() + + for i := range s.slots { + if s.slots[i].expiredAt != nil && s.slots[i].expiredAt.Before(time.Now()) { + s.slots[i] = s.slots[len(s.slots)-1] + s.slots = s.slots[:len(s.slots)-1] + return + } + } +} + +func (s *slotsManager) HoldOneSlot(expiry time.Duration) bool { + defer s.sort() + + s.clearOneExpiredSlots() + + if len(s.slots) >= int(s.maxSlots) { + return false + } + + expiredAt := time.Now().Add(expiry) + s.slots = append(s.slots, &capacitySlot{blockID: BlockIDPlaceHolder, expiredAt: &expiredAt}) + return true +} + +func (s *slotsManager) TakeOneSlot(blockID uint64) bool { + defer s.sort() + + if ok := s.removeItemByBlockID(BlockIDPlaceHolder); !ok { + return false + } + + s.slots = append(s.slots, &capacitySlot{blockID: blockID}) + return true +} + +func (s *slotsManager) Len() uint64 { + return uint64(len(s.slots)) +} + +func (s *slotsManager) MaxSlots() uint64 { + return s.maxSlots +} diff --git a/prover/capacity_manager/slots_manager_test.go b/prover/capacity_manager/slots_manager_test.go new file mode 100644 index 000000000..9533a8e25 --- /dev/null +++ b/prover/capacity_manager/slots_manager_test.go @@ -0,0 +1,123 @@ +package capacity_manager + +import ( + "testing" + "time" + + "github.com/stretchr/testify/suite" +) + +type SlotsManagerTestSuite struct { + suite.Suite + m *slotsManager +} + +func (s *SlotsManagerTestSuite) SetupTest() { + now := time.Now() + oneHourLater := time.Now().Add(1 * time.Hour) + + s.m = &slotsManager{[]*capacitySlot{ + {blockID: BlockIDPlaceHolder, expiredAt: &now}, + {blockID: BlockIDPlaceHolder, expiredAt: &oneHourLater}, + {blockID: 3, expiredAt: nil}, + }, testCapacity} +} + +func (s *SlotsManagerTestSuite) TestSort() { + now := time.Now() + oneHourLater := time.Now().Add(1 * time.Hour) + + s.m.slots = []*capacitySlot{ + {blockID: 1, expiredAt: nil}, + {blockID: 2, expiredAt: &oneHourLater}, + {blockID: 3, expiredAt: &now}, + } + + s.m.sort() + s.Equal(3, int(s.m.slots[0].blockID)) + s.Equal(2, int(s.m.slots[1].blockID)) + s.Equal(1, int(s.m.slots[2].blockID)) + + s.m.slots = []*capacitySlot{ + {blockID: 1, expiredAt: &now}, + {blockID: 2, expiredAt: &oneHourLater}, + {blockID: 3, expiredAt: nil}, + } + + s.m.sort() + s.Equal(1, int(s.m.slots[0].blockID)) + s.Equal(2, int(s.m.slots[1].blockID)) + s.Equal(3, int(s.m.slots[2].blockID)) +} + +func (s *SlotsManagerTestSuite) TestRemoveItemByBlockID() { + s.True(s.m.removeItemByBlockID(3)) + s.Equal(2, len(s.m.slots)) + s.Equal(BlockIDPlaceHolder, int(s.m.slots[0].blockID)) + s.Equal(BlockIDPlaceHolder, int(s.m.slots[1].blockID)) +} + +func (s *SlotsManagerTestSuite) TestRemoveItemByBlockIDWithPlaceHolder() { + s.True(s.m.removeItemByBlockID(BlockIDPlaceHolder)) + s.Equal(2, len(s.m.slots)) + s.Equal(BlockIDPlaceHolder, int(s.m.slots[0].blockID)) + s.Equal(3, int(s.m.slots[1].blockID)) +} + +func (s *SlotsManagerTestSuite) TestClearOneExpiredSlots() { + oneHourBefore := time.Now().Add(-1 * time.Hour) + + s.m.slots = []*capacitySlot{ + {blockID: 1, expiredAt: &oneHourBefore}, + {blockID: 2, expiredAt: nil}, + {blockID: 3, expiredAt: nil}, + } + + s.m.clearOneExpiredSlots() + + s.Equal(2, len(s.m.slots)) + s.Equal(3, int(s.m.slots[0].blockID)) + s.Equal(2, int(s.m.slots[1].blockID)) +} + +func (s *SlotsManagerTestSuite) TestHoldOneSlot() { + oneHourLater := time.Now().Add(1 * time.Hour) + twoHoursLater := time.Now().Add(2 * time.Hour) + + s.m = &slotsManager{[]*capacitySlot{ + {blockID: BlockIDPlaceHolder, expiredAt: &oneHourLater}, + {blockID: BlockIDPlaceHolder, expiredAt: &twoHoursLater}, + {blockID: 3, expiredAt: nil}, + }, testCapacity} + + s.m.HoldOneSlot(30 * time.Minute) + + s.Equal(uint64(4), s.m.Len()) +} + +func (s *SlotsManagerTestSuite) TestTakeOneSlot() { + oneHourLater := time.Now().Add(1 * time.Hour) + twoHoursLater := time.Now().Add(2 * time.Hour) + + s.m = &slotsManager{[]*capacitySlot{ + {blockID: BlockIDPlaceHolder, expiredAt: &oneHourLater}, + {blockID: BlockIDPlaceHolder, expiredAt: &twoHoursLater}, + {blockID: 3, expiredAt: nil}, + }, testCapacity} + + s.m.TakeOneSlot(4) + + s.Equal(uint64(3), s.m.Len()) + + for _, slot := range s.m.slots { + if slot.blockID == 4 { + return + } + } + + s.FailNow("slot has not been taken correctly") +} + +func TestSlotsManagerTestSuite(t *testing.T) { + suite.Run(t, new(SlotsManagerTestSuite)) +} diff --git a/prover/prover.go b/prover/prover.go index 38b3cea71..b40c439a5 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -98,7 +98,7 @@ func (p *Prover) InitFromCli(ctx context.Context, c *cli.Context) error { func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.cfg = cfg p.ctx = ctx - p.capacityManager = capacity.New(cfg.Capacity, cfg.TempCapacityExpiresAt) + p.capacityManager = capacity.New(cfg.Capacity) // Clients if p.rpc, err = rpc.NewClient(p.ctx, &rpc.ClientConfig{ diff --git a/prover/server/api.go b/prover/server/api.go index 6ca06ce61..3c2f9fadb 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -78,7 +78,7 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { } log.Info( - "Propose block data", + "Proof assignment request body", "feeToken", req.FeeToken, "expiry", req.Expiry, "tierFees", req.TierFees, @@ -147,8 +147,8 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { return echo.NewHTTPError(http.StatusUnprocessableEntity, "expiry too long") } - if _, ok := srv.capacityManager.TakeOneTempCapacity(); !ok { - log.Warn("Prover unable to take a temporary capacity", "proposerIP", c.RealIP()) + if ok := srv.capacityManager.HoldOneCapacity(time.Duration(req.Expiry) * time.Second); !ok { + log.Warn("Prover unable to hold a capacity", "proposerIP", c.RealIP()) return echo.NewHTTPError(http.StatusUnprocessableEntity, "prover does not have capacity") } diff --git a/prover/server/server_test.go b/prover/server/server_test.go index 943b08aa5..c09f3eaf5 100644 --- a/prover/server/server_test.go +++ b/prover/server/server_test.go @@ -53,7 +53,7 @@ func (s *ProverServerTestSuite) SetupTest() { minSgxTierFee: common.Big1, minPseZkevmTierFee: common.Big1, maxExpiry: 24 * time.Hour, - capacityManager: capacity.New(1024, 100*time.Second), + capacityManager: capacity.New(1024), taikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), rpc: rpcClient, bond: common.Big0, diff --git a/testutils/suite.go b/testutils/suite.go index 5ae1b09cd..fc9713782 100644 --- a/testutils/suite.go +++ b/testutils/suite.go @@ -6,7 +6,6 @@ import ( "math/big" "net/url" "os" - "time" "github.com/cenkalti/backoff/v4" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -75,7 +74,7 @@ func (s *ClientTestSuite) SetupTest() { s.Nil(err) s.ProverEndpoints = []*url.URL{LocalRandomProverEndpoint()} - s.proverServer = NewTestProverServer(s, l1ProverPrivKey, capacity.New(1024, 100*time.Second), s.ProverEndpoints[0]) + s.proverServer = NewTestProverServer(s, l1ProverPrivKey, capacity.New(1024), s.ProverEndpoints[0]) tokenBalance, err := rpcCli.TaikoL1.GetTaikoTokenBalance(nil, crypto.PubkeyToAddress(l1ProverPrivKey.PublicKey)) s.Nil(err) From 9ac14c229d615fd554b707c02b45577f9c1e8ac4 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 16:11:46 +0800 Subject: [PATCH 35/63] chore(prover): add more comments --- prover/capacity_manager/slots_manager.go | 16 +++++++++++++--- prover/proof_producer/guardian_producer.go | 5 +++++ prover/proof_producer/optimistic_producer.go | 5 +++++ prover/proof_producer/proof_producer.go | 1 + prover/proof_producer/sgx_producer.go | 5 +++++ prover/proof_producer/zkevm_rpcd_producer.go | 5 +++++ prover/proof_submitter/interface.go | 3 +-- prover/proof_submitter/proof_submitter.go | 8 +++----- prover/prover.go | 20 +++++++++++++++++--- 9 files changed, 55 insertions(+), 13 deletions(-) diff --git a/prover/capacity_manager/slots_manager.go b/prover/capacity_manager/slots_manager.go index b37d157bc..89297631b 100644 --- a/prover/capacity_manager/slots_manager.go +++ b/prover/capacity_manager/slots_manager.go @@ -5,20 +5,22 @@ import ( "time" ) -const ( - BlockIDPlaceHolder = 0 -) +// BlockIDPlaceHolder is a special blockID which represents a temporarily holen slot with no blockID. +const BlockIDPlaceHolder = 0 +// capacitySlot represents a block slot with an expired time. type capacitySlot struct { blockID uint64 expiredAt *time.Time } +// slotsManager manages all the block slots with a max capacity. type slotsManager struct { slots []*capacitySlot maxSlots uint64 } +// sort sorts the slots by expired time, if a slot has no expired time, it will be put at the end. func (s *slotsManager) sort() { sort.Slice(s.slots, func(i, j int) bool { if s.slots[i].expiredAt == nil && s.slots[j].expiredAt == nil { @@ -35,6 +37,8 @@ func (s *slotsManager) sort() { }) } +// removeItemByBlockID removes a slot by blockID, if the blockID is BlockIDPlaceHolder, +// it will remove the first slot with expired time, otherwise it will remove the slot with the blockID. func (s *slotsManager) removeItemByBlockID(id uint64) bool { defer s.sort() @@ -63,6 +67,7 @@ func (s *slotsManager) removeItemByBlockID(id uint64) bool { return false } +// clearOneExpiredSlots tries to remove one expired slot. func (s *slotsManager) clearOneExpiredSlots() { defer s.sort() @@ -75,6 +80,7 @@ func (s *slotsManager) clearOneExpiredSlots() { } } +// HoldOneSlot holds one slot with an expired time. func (s *slotsManager) HoldOneSlot(expiry time.Duration) bool { defer s.sort() @@ -89,6 +95,8 @@ func (s *slotsManager) HoldOneSlot(expiry time.Duration) bool { return true } +// TakeOneSlot tries to taken one holden slot (blockID == BlockIDPlaceHolder), if there is no holden slot, +// it will return false. func (s *slotsManager) TakeOneSlot(blockID uint64) bool { defer s.sort() @@ -100,10 +108,12 @@ func (s *slotsManager) TakeOneSlot(blockID uint64) bool { return true } +// Len returns the current usage of the slots. func (s *slotsManager) Len() uint64 { return uint64(len(s.slots)) } +// MaxSlots returns the max capacity of the slots. func (s *slotsManager) MaxSlots() uint64 { return s.maxSlots } diff --git a/prover/proof_producer/guardian_producer.go b/prover/proof_producer/guardian_producer.go index 451d0681e..f30629a43 100644 --- a/prover/proof_producer/guardian_producer.go +++ b/prover/proof_producer/guardian_producer.go @@ -38,6 +38,11 @@ func (g *GuardianProofProducer) Tier() uint16 { return encoding.TierGuardianID } +// Cancellable implements the ProofProducer interface. +func (g *GuardianProofProducer) Cancellable() bool { + return false +} + // Cancel cancels an existing proof generation. func (g *GuardianProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { return nil diff --git a/prover/proof_producer/optimistic_producer.go b/prover/proof_producer/optimistic_producer.go index 9ab5dc21d..186f2d2f6 100644 --- a/prover/proof_producer/optimistic_producer.go +++ b/prover/proof_producer/optimistic_producer.go @@ -38,6 +38,11 @@ func (o *OptimisticProofProducer) Tier() uint16 { return encoding.TierOptimisticID } +// Cancellable implements the ProofProducer interface. +func (o *OptimisticProofProducer) Cancellable() bool { + return false +} + // Cancel cancels an existing proof generation. func (o *OptimisticProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { return nil diff --git a/prover/proof_producer/proof_producer.go b/prover/proof_producer/proof_producer.go index dc58c7a8c..914879d90 100644 --- a/prover/proof_producer/proof_producer.go +++ b/prover/proof_producer/proof_producer.go @@ -50,6 +50,7 @@ type ProofProducer interface { header *types.Header, resultCh chan *ProofWithHeader, ) error + Cancellable() bool Cancel(ctx context.Context, blockID *big.Int) error Tier() uint16 } diff --git a/prover/proof_producer/sgx_producer.go b/prover/proof_producer/sgx_producer.go index e70680bba..2ff017a95 100644 --- a/prover/proof_producer/sgx_producer.go +++ b/prover/proof_producer/sgx_producer.go @@ -38,6 +38,11 @@ func (s *SGXProofProducer) Tier() uint16 { return encoding.TierSgxID } +// Cancellable implements the ProofProducer interface. +func (s *SGXProofProducer) Cancellable() bool { + return false +} + // Cancel cancels an existing proof generation. func (s *SGXProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { return nil diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index 96ac1f448..b39dc3995 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -280,6 +280,11 @@ func (p *ZkevmRpcdProducer) Tier() uint16 { return encoding.TierPseZkevmID } +// Cancellable implements the ProofProducer interface. +func (p *ZkevmRpcdProducer) Cancellable() bool { + return false +} + // Cancel cancels an existing proof generation. // Right now, it is just a stub that does nothing, because it is not possible to cancel the proof // with the current zkevm software. diff --git a/prover/proof_submitter/interface.go b/prover/proof_submitter/interface.go index f72e83f00..3c088c90c 100644 --- a/prover/proof_submitter/interface.go +++ b/prover/proof_submitter/interface.go @@ -2,7 +2,6 @@ package submitter import ( "context" - "math/big" "github.com/taikoxyz/taiko-client/bindings" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" @@ -11,6 +10,6 @@ import ( type Submitter interface { RequestProof(ctx context.Context, event *bindings.TaikoL1ClientBlockProposed) error SubmitProof(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) error - CancelProof(ctx context.Context, blockID *big.Int) error + Producer() proofProducer.ProofProducer Tier() uint16 } diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index 8fb5cfc54..c6cc63261 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -301,11 +301,9 @@ func (s *ProofSubmitter) SubmitProof( return nil } -// CancelProof cancels an existing proof generation. -// Right now, it is just a stub that does nothing, because it is not possible to cancel the proof -// with the current zkevm software. -func (s *ProofSubmitter) CancelProof(ctx context.Context, blockID *big.Int) error { - return s.proofProducer.Cancel(ctx, blockID) +// Producer returns the inner proof producer. +func (s *ProofSubmitter) Producer() proofProducer.ProofProducer { + return s.proofProducer } // Tier returns the proof tier of the current proof submitter. diff --git a/prover/prover.go b/prover/prover.go index b40c439a5..43bbe6e4c 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -542,7 +542,7 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc if !p.cfg.GuardianProver { _, released := p.capacityManager.ReleaseOneCapacity(proofWithHeader.Meta.Id) if !released { - log.Error("unable to release capacity") + log.Error("Failed to release capacity", "id", proofWithHeader.Meta.Id) } } }() @@ -687,9 +687,23 @@ func (p *Prover) isValidProof( return false, nil } +// onTransitionProved verifies the proven block hash and will try contesting it if the block hash is wrong. func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) + // If the proof generation is cancellable, cancel it and release the capacity. + proofSubmitter := p.getSubmitterByTier(event.Tier) + if proofSubmitter != nil && proofSubmitter.Producer().Cancellable() { + if err := proofSubmitter.Producer().Cancel(ctx, event.BlockId); err != nil { + return err + } + // No need to check if the release is successful here, since this L2 block might + // be assigned to other provers. + p.capacityManager.ReleaseOneCapacity(event.BlockId.Uint64()) + } + + // If this prover is in contest mode, we check the validity of this proof and if it's invalid, + // contest it with a higher tier proof. if !p.cfg.ContestControversialProofs { return nil } @@ -708,12 +722,12 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 return nil } - L1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}) + l1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}) if err != nil { return err } - return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(L1Height), true) + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height), true) } // requestProofByBlockID performs a proving operation for the given block. From 5d64321d5889033c2255c8f5fb4ec3f50048bff7 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 16:25:15 +0800 Subject: [PATCH 36/63] test(prover): more tests --- driver/chain_syncer/calldata/syncer.go | 2 +- prover/prover.go | 2 +- prover/prover_test.go | 27 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index db84f6226..33a2c60c7 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -141,7 +141,7 @@ func (s *Syncer) onBlockProposed( } if !s.progressTracker.Triggered() { - // Check whteher we need to reorg the L2 chain at first. + // Check whether we need to reorg the L2 chain at first. // 1. Last verified block var ( reorged bool diff --git a/prover/prover.go b/prover/prover.go index 43bbe6e4c..da2b74074 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -350,7 +350,7 @@ func (p *Prover) onBlockProposed( return fmt.Errorf("failed to check whether L1 chain was reorged from L2EE (eventID %d): %w", event.BlockId, err) } - // then check the l1Current cursor at first, to see if the L1 chain has been reorged. + // Then check the l1Current cursor at first, to see if the L1 chain has been reorged. if !reorged { if reorged, l1CurrentToReset, lastHandledBlockIDToReset, err = p.rpc.CheckL1ReorgFromL1Cursor( ctx, diff --git a/prover/prover_test.go b/prover/prover_test.go index e63d1dee5..da2ce4154 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -2,6 +2,7 @@ package prover import ( "context" + "math/big" "net/url" "os" "strconv" @@ -13,6 +14,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/driver" "github.com/taikoxyz/taiko-client/pkg/jwt" "github.com/taikoxyz/taiko-client/proposer" @@ -191,6 +193,31 @@ func (s *ProverTestSuite) TestSubmitProofOp() { }) } +func (s *ProverTestSuite) TestSelectSubmitter() { + submitter := s.p.selectSubmitter(encoding.TierGuardianID - 1) + s.NotNil(submitter) + s.Equal(encoding.TierGuardianID, submitter.Tier()) +} + +func (s *ProverTestSuite) TestGetSubmitterByTier() { + submitter := s.p.getSubmitterByTier(encoding.TierGuardianID) + s.NotNil(submitter) + s.Equal(encoding.TierGuardianID, submitter.Tier()) +} + +func (s *ProverTestSuite) TestIsBlockVerified() { + vars, err := s.p.rpc.TaikoL1.GetStateVariables(nil) + s.Nil(err) + + verified, err := s.p.isBlockVerified(new(big.Int).SetUint64(vars.LastVerifiedBlockId)) + s.Nil(err) + s.True(verified) + + verified, err = s.p.isBlockVerified(new(big.Int).SetUint64(vars.LastVerifiedBlockId + 1)) + s.Nil(err) + s.False(verified) +} + func (s *ProverTestSuite) TestStartSubscription() { s.NotPanics(s.p.initSubscription) s.NotPanics(s.p.closeSubscription) From 2979cf8dba13bec918aa87ce6abf9fb020ce780c Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 21:19:22 +0800 Subject: [PATCH 37/63] test(prover): more prover tests --- .../proof_submitter/proof_submitter_test.go | 42 +++++++--------- prover/prover.go | 48 +++++++++++++----- prover/prover_test.go | 49 +++++++++++++++++++ testutils/testdata/block-5_proof.json | 1 - testutils/testdata/zkchain_proof.json | 45 ----------------- 5 files changed, 103 insertions(+), 82 deletions(-) delete mode 100644 testutils/testdata/block-5_proof.json delete mode 100644 testutils/testdata/zkchain_proof.json diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index b896cc618..7bac151b3 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -22,11 +22,10 @@ import ( type ProofSubmitterTestSuite struct { testutils.ClientTestSuite - validProofSubmitter *ProofSubmitter - calldataSyncer *calldata.Syncer - proposer *proposer.Proposer - validProofCh chan *proofProducer.ProofWithHeader - invalidProofCh chan *proofProducer.ProofWithHeader + proofSubmitter *ProofSubmitter + calldataSyncer *calldata.Syncer + proposer *proposer.Proposer + proofCh chan *proofProducer.ProofWithHeader } func (s *ProofSubmitterTestSuite) SetupTest() { @@ -35,13 +34,12 @@ func (s *ProofSubmitterTestSuite) SetupTest() { l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) s.Nil(err) - s.validProofCh = make(chan *proofProducer.ProofWithHeader, 1024) - s.invalidProofCh = make(chan *proofProducer.ProofWithHeader, 1024) + s.proofCh = make(chan *proofProducer.ProofWithHeader, 1024) - s.validProofSubmitter, err = New( + s.proofSubmitter, err = New( s.RpcClient, &proofProducer.OptimisticProofProducer{}, - s.validProofCh, + s.proofCh, common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), l1ProverPrivKey, "test", @@ -97,19 +95,19 @@ func (s *ProofSubmitterTestSuite) SetupTest() { s.proposer = prop } -func (s *ProofSubmitterTestSuite) TestValidProofSubmitterRequestProofDeadlineExceeded() { +func (s *ProofSubmitterTestSuite) TestProofSubmitterRequestProofDeadlineExceeded() { ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() s.ErrorContains( - s.validProofSubmitter.RequestProof( + s.proofSubmitter.RequestProof( ctx, &bindings.TaikoL1ClientBlockProposed{BlockId: common.Big256}), "context deadline exceeded", ) } -func (s *ProofSubmitterTestSuite) TestValidProofSubmitterSubmitProofMetadataNotFound() { +func (s *ProofSubmitterTestSuite) TestProofSubmitterSubmitProofMetadataNotFound() { s.Error( - s.validProofSubmitter.SubmitProof( + s.proofSubmitter.SubmitProof( context.Background(), &proofProducer.ProofWithHeader{ BlockID: common.Big256, Meta: &bindings.TaikoDataBlockMetadata{}, @@ -120,26 +118,22 @@ func (s *ProofSubmitterTestSuite) TestValidProofSubmitterSubmitProofMetadataNotF ) } -func (s *ProofSubmitterTestSuite) TestValidSubmitProofs() { +func (s *ProofSubmitterTestSuite) TestSubmitProofs() { events := testutils.ProposeAndInsertEmptyBlocks(&s.ClientTestSuite, s.proposer, s.calldataSyncer) for _, e := range events { - s.Nil(s.validProofSubmitter.RequestProof(context.Background(), e)) - proofWithHeader := <-s.validProofCh - s.Nil(s.validProofSubmitter.SubmitProof(context.Background(), proofWithHeader)) + s.Nil(s.proofSubmitter.RequestProof(context.Background(), e)) + proofWithHeader := <-s.proofCh + s.Nil(s.proofSubmitter.SubmitProof(context.Background(), proofWithHeader)) } } -func (s *ProofSubmitterTestSuite) TestValidProofSubmitterRequestProofCancelled() { +func (s *ProofSubmitterTestSuite) TestProofSubmitterRequestProofCancelled() { ctx, cancel := context.WithCancel(context.Background()) - go func() { - time.AfterFunc(2*time.Second, func() { - cancel() - }) - }() + go func() { time.AfterFunc(2*time.Second, func() { cancel() }) }() s.ErrorContains( - s.validProofSubmitter.RequestProof( + s.proofSubmitter.RequestProof( ctx, &bindings.TaikoL1ClientBlockProposed{BlockId: common.Big256}), "context canceled", ) } diff --git a/prover/prover.go b/prover/prover.go index da2b74074..7fbc3ad27 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -84,7 +84,7 @@ type Prover struct { wg sync.WaitGroup } -// New initializes the given prover instance based on the command line flags. +// InitFromCli initializes the given prover instance based on the command line flags. func (p *Prover) InitFromCli(ctx context.Context, c *cli.Context) error { cfg, err := NewConfigFromCliContext(c) if err != nil { @@ -262,6 +262,7 @@ func (p *Prover) eventLoop() { case <-p.ctx.Done(): return case proofWithHeader := <-p.proofGenerationCh: + log.Info("111888") p.submitProofOp(p.ctx, proofWithHeader) case <-p.proveNotify: if err := p.proveOp(); err != nil { @@ -312,6 +313,7 @@ func (p *Prover) proveOp() error { OnBlockProposedEvent: p.onBlockProposed, }) if err != nil { + log.Error("Failed to start event iterator", "event", "BlockProposed", "error", err) return err } @@ -341,7 +343,7 @@ func (p *Prover) onBlockProposed( return fmt.Errorf("failed to wait L1Origin (eventID %d): %w", event.BlockId, err) } - // Check whether the L2 EE's recorded L1 info, to see if the L1 chain has been reorged. + // Check whether the L2 EE's anchored L1 info, to see if the L1 chain has been reorged. reorged, l1CurrentToReset, lastHandledBlockIDToReset, err := p.rpc.CheckL1ReorgFromL2EE( ctx, new(big.Int).Sub(event.BlockId, common.Big1), @@ -708,6 +710,7 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 return nil } + // TODO(david): check signalRoot isValidProof, err := p.isValidProof( ctx, event.BlockId.Uint64(), @@ -727,18 +730,28 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 return err } - return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height), true) + log.Info( + "Contest a proven block", + "blockID", event.BlockId, + "l1Height", l1Height, + "tier", event.Tier, + "parentHash", common.Bytes2Hex(event.ParentHash[:]), + "blockHash", common.Bytes2Hex(event.BlockHash[:]), + "signalRoot", common.Bytes2Hex(event.SignalRoot[:]), + ) + + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), true) } // requestProofByBlockID performs a proving operation for the given block. -func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int, contestOldProof bool) error { +func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, contestOldProof bool) error { onBlockProposed := func( ctx context.Context, event *bindings.TaikoL1ClientBlockProposed, end eventIterator.EndBlockProposedEventIterFunc, ) error { // Only filter for exact blockID we want - if event.BlockId.Cmp(blockId) != 0 { + if event.BlockId.Cmp(blockID) != 0 { return nil } @@ -764,7 +777,11 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int, cont var minTier = event.MinTier if contestOldProof { - minTier += 1 + if p.cfg.GuardianProver { + minTier = encoding.TierGuardianID + } else { + minTier += 1 + } } if proofSubmitter := p.selectSubmitter(minTier); proofSubmitter != nil { @@ -776,19 +793,26 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int, cont handleBlockProposedEvent := func() error { defer func() { <-p.proposeConcurrencyGuard }() - + l1Head, err := p.rpc.L1.BlockNumber(p.ctx) + if err != nil { + log.Error("Failed to get L1 block head", "error", err) + return err + } + end := new(big.Int).Add(l1Height, common.Big1) + if end.Uint64() > l1Head { + end = new(big.Int).SetUint64(l1Head) + } iter, err := eventIterator.NewBlockProposedIterator(p.ctx, &eventIterator.BlockProposedIteratorConfig{ Client: p.rpc.L1, TaikoL1: p.rpc.TaikoL1, - StartHeight: l1Height, - EndHeight: new(big.Int).Add(l1Height, common.Big1), + StartHeight: new(big.Int).Sub(l1Height, common.Big1), + EndHeight: end, OnBlockProposedEvent: onBlockProposed, - FilterQuery: []*big.Int{blockId}, }) if err != nil { + log.Error("Failed to start event iterator", "event", "BlockProposed", "error", err) return err } - return iter.Iter() } @@ -797,7 +821,7 @@ func (p *Prover) requestProofByBlockID(blockId *big.Int, l1Height *big.Int, cont func() error { return handleBlockProposedEvent() }, backoff.WithMaxRetries(backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), p.cfg.BackOffMaxRetrys), ); err != nil { - log.Error("Failed to request proof with a given block ID", "blockID", blockId, "error", err) + log.Error("Failed to request proof with a given block ID", "blockID", blockID, "error", err) } }() diff --git a/prover/prover_test.go b/prover/prover_test.go index da2ce4154..b14dbd611 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -193,6 +193,55 @@ func (s *ProverTestSuite) TestSubmitProofOp() { }) } +func (s *ProverTestSuite) TestOnBlockVerified() { + id := testutils.RandomHash().Big().Uint64() + s.Nil(s.p.onBlockVerified(context.Background(), &bindings.TaikoL1ClientBlockVerified{ + BlockId: testutils.RandomHash().Big(), + Raw: types.Log{ + BlockHash: testutils.RandomHash(), + BlockNumber: id, + }, + })) + s.Equal(id, s.p.latestVerifiedL1Height) +} + +func (s *ProverTestSuite) TestContestWrongBlocks() { + s.p.cfg.ContestControversialProofs = false + e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) + s.Nil(s.p.onTransitionProved(context.Background(), &bindings.TaikoL1ClientTransitionProved{ + BlockId: e.BlockId, + Tier: e.MinTier, + })) + s.p.cfg.ContestControversialProofs = true + s.p.cfg.GuardianProver = true + sink := make(chan *bindings.TaikoL1ClientTransitionProved) + + sub, err := s.p.rpc.TaikoL1.WatchTransitionProved(nil, sink, nil) + s.Nil(err) + defer func() { + sub.Unsubscribe() + close(sink) + }() + + header, err := s.p.rpc.L2.HeaderByNumber(context.Background(), e.BlockId) + s.Nil(err) + s.Greater(header.Number.Uint64(), uint64(0)) + s.Nil(s.p.onTransitionProved(context.Background(), &bindings.TaikoL1ClientTransitionProved{ + BlockId: e.BlockId, + Tier: encoding.TierPseZkevmID, + ParentHash: header.ParentHash, + BlockHash: testutils.RandomHash(), + SignalRoot: testutils.RandomHash(), + })) + s.Nil(s.p.selectSubmitter(encoding.TierGuardianID).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + + event := <-sink + s.Equal(header.Number.Uint64(), event.BlockId.Uint64()) + s.Equal(header.Hash(), common.BytesToHash(event.BlockHash[:])) + s.Equal(header.ParentHash, common.BytesToHash(event.ParentHash[:])) + s.Equal(encoding.TierGuardianID, event.Tier) +} + func (s *ProverTestSuite) TestSelectSubmitter() { submitter := s.p.selectSubmitter(encoding.TierGuardianID - 1) s.NotNil(submitter) diff --git a/testutils/testdata/block-5_proof.json b/testutils/testdata/block-5_proof.json deleted file mode 100644 index 61cd232fd..000000000 --- a/testutils/testdata/block-5_proof.json +++ /dev/null @@ -1 +0,0 @@ -{"instances":["0x101","0x7d6fea5a2ec7de4f8ad149ee45e7f69f0993d672ed4af3eaf6b288d6ea1cdb3","0xa7","0x8d3152434aeef619d040e5af9f52f53ac448fa790574c2837cca4fab02e3cc","0x68f992ffe139695e56ab109a0e4a8199588eb5e262720f4e8980e44ab2980f6"],"proof":[45,139,232,183,176,204,244,27,25,119,31,104,82,182,26,120,99,162,127,227,219,66,89,204,129,246,79,177,250,135,23,63,27,16,176,166,235,134,215,51,65,239,34,199,46,36,116,176,43,5,25,108,133,124,63,214,70,161,149,48,27,3,116,17,12,168,100,180,191,5,254,8,206,122,33,116,6,131,85,178,60,161,225,65,160,180,39,167,174,28,86,91,69,13,232,209,36,46,134,43,110,228,112,75,217,154,144,117,152,62,12,90,145,6,55,241,206,35,75,214,66,85,84,229,146,240,232,118,10,36,233,91,144,126,80,163,77,179,223,90,202,129,248,155,226,33,71,175,88,199,142,172,39,104,3,220,176,95,88,248,18,25,179,254,109,89,63,230,164,74,230,161,20,44,2,131,181,79,53,224,54,210,198,162,85,79,109,32,154,4,134,187,28,99,71,174,52,51,251,186,84,164,54,207,30,255,89,181,231,9,135,194,212,196,201,237,233,80,1,119,157,71,123,165,9,203,83,123,23,156,174,11,130,124,226,50,176,113,89,81,7,57,228,12,74,15,81,7,28,141,65,217,183,188,157,228,17,24,83,92,189,242,92,33,98,214,15,227,113,195,86,146,246,199,17,239,151,71,231,91,79,145,137,227,80,105,152,190,4,100,242,125,253,63,10,4,2,18,138,90,235,217,23,147,167,165,195,153,57,158,138,203,238,184,232,148,82,88,23,96,29,244,170,105,245,242,76,225,135,179,29,248,9,83,83,111,183,230,48,78,234,4,145,97,80,5,235,145,113,99,226,194,23,178,37,36,163,36,180,197,140,236,153,255,49,86,230,142,155,138,247,60,255,170,5,6,174,206,139,148,68,131,12,103,40,2,167,99,175,186,93,61,22,188,168,4,32,75,245,63,80,73,225,26,73,227,8,100,118,122,17,198,2,200,132,37,16,9,137,127,59,16,201,213,253,156,56,146,26,85,182,246,72,218,92,219,29,55,39,173,176,95,104,252,188,183,148,128,11,194,11,173,138,161,164,76,34,93,94,219,72,188,116,205,142,94,199,175,240,184,248,28,47,154,233,182,57,168,195,18,3,102,153,29,69,62,33,222,234,18,123,4,45,108,105,118,41,37,123,99,93,230,245,58,9,13,158,101,103,122,220,39,0,137,5,252,240,35,123,146,37,227,166,73,66,58,43,88,63,237,240,8,87,33,131,0,115,84,148,56,120,131,245,154,26,251,120,61,88,138,240,22,25,201,212,112,210,98,49,68,199,108,84,235,14,47,135,228,109,194,186,31,255,64,232,10,2,158,36,249,182,183,79,246,69,228,170,101,92,102,248,214,172,3,122,186,66,17,161,11,231,208,117,236,215,35,34,217,22,241,100,15,207,240,68,46,3,90,122,125,41,131,230,248,212,81,56,219,83,123,135,219,67,20,74,210,50,177,227,253,6,33,118,175,5,254,22,166,197,120,190,187,154,240,40,154,61,224,187,43,49,114,218,109,110,132,174,26,14,102,75,182,37,136,25,185,231,165,179,52,117,141,186,247,249,97,138,190,29,57,88,216,100,149,68,76,72,69,189,20,159,58,24,62,16,246,31,75,212,222,222,54,167,117,117,32,243,235,231,171,3,130,230,88,27,20,110,33,127,50,12,147,36,219,89,187,42,165,238,247,129,98,37,225,168,215,81,78,32,13,64,45,34,207,122,39,69,211,121,231,64,127,201,72,234,198,72,104,29,247,206,94,148,77,248,189,153,240,186,76,32,128,241,52,207,170,54,135,226,229,135,51,26,154,172,191,58,248,128,57,39,120,157,208,81,81,223,103,0,99,32,140,214,104,230,41,250,36,209,166,152,87,227,128,132,238,215,122,253,86,230,130,3,79,152,233,227,232,17,70,119,113,39,39,244,228,224,55,252,27,247,230,202,33,6,198,86,145,144,168,126,164,201,176,17,21,13,193,6,5,198,92,4,0,138,126,89,232,20,199,185,100,104,153,201,248,2,199,85,241,29,238,150,1,31,7,44,226,170,225,22,140,107,219,188,108,33,14,59,220,78,151,195,65,40,57,99,169,206,248,137,71,183,121,156,131,158,227,14,249,163,50,187,168,80,113,109,94,10,47,18,154,219,229,206,21,208,186,5,122,54,90,131,219,28,71,130,245,43,13,2,40,98,84,154,150,71,37,146,21,150,139,175,186,249,241,151,139,19,108,255,28,215,236,12,117,21,164,144,202,255,7,29,215,25,103,154,7,213,24,16,66,110,19,23,86,253,128,91,108,223,194,100,163,38,202,227,223,63,2,210,32,119,39,40,95,235,251,253,72,122,57,94,239,233,121,188,70,222,182,68,195,176,91,18,191,49,31,32,94,119,93,81,135,84,134,23,241,162,159,15,61,41,217,52,99,255,4,78,26,201,122,181,6,134,237,174,177,161,41,146,247,103,242,97,39,8,160,16,41,240,151,168,79,82,148,236,142,154,104,180,53,155,82,204,220,35,116,132,33,90,142,79,94,78,120,59,214,4,57,4,93,50,243,90,225,94,62,80,71,214,251,148,193,120,39,16,192,1,66,205,86,8,234,78,13,220,155,124,8,113,102,34,93,34,5,60,123,248,218,223,28,33,209,214,150,145,141,221,36,14,10,42,162,74,89,225,45,90,179,234,137,136,99,8,82,180,121,11,97,125,110,2,94,208,114,154,162,118,93,93,223,32,138,138,69,252,142,183,225,110,119,80,180,49,216,39,31,136,15,171,230,98,87,85,195,254,162,229,172,175,107,49,221,48,83,192,150,29,27,194,85,246,53,31,100,218,2,44,93,243,18,63,128,203,227,253,162,153,78,171,36,216,220,255,195,68,222,215,103,79,165,180,88,19,114,1,210,35,23,34,234,250,7,44,20,71,116,252,96,165,62,50,12,196,170,22,193,178,231,238,120,214,240,23,165,128,107,31,216,130,208,9,216,58,8,244,241,165,64,254,34,129,183,254,185,151,104,168,213,24,169,197,2,236,172,213,231,59,100,252,142,15,161,22,7,158,24,225,38,131,105,38,234,69,156,172,190,126,92,55,162,44,185,165,253,108,39,192,116,198,4,181,132,24,248,45,126,63,224,136,236,95,116,181,208,219,111,242,165,148,62,182,165,31,224,231,90,155,10,226,176,111,168,4,4,243,8,27,13,103,186,151,212,60,227,57,82,93,188,10,0,1,52,5,103,156,213,199,178,97,244,39,186,74,81,98,30,118,71,11,163,168,106,248,216,35,35,196,25,48,188,119,180,58,117,212,173,179,184,241,53,162,164,32,210,215,27,223,206,129,32,16,78,40,20,140,238,237,211,152,227,7,104,240,166,90,173,95,131,105,91,109,60,243,13,226,11,1,229,110,254,158,225,5,129,232,7,43,195,112,49,40,68,234,178,10,213,166,166,200,95,196,83,103,7,199,252,214,222,83,75,94,191,16,214,18,155,7,231,205,53,65,91,91,73,159,165,104,6,28,67,191,127,251,159,215,221,5,187,230,42,136,69,223,24,43,206,41,230,125,95,19,147,21,25,116,206,216,210,129,33,197,51,61,211,142,45,47,105,66,199,202,79,20,23,51,120,192,211,28,149,188,112,89,75,250,199,39,253,123,242,186,37,164,37,212,101,29,208,201,36,52,164,199,188,21,48,97,13,16,149,43,189,89,76,189,246,52,241,69,127,115,34,182,100,16,115,125,246,51,199,158,221,243,177,151,174,150,223,206,243,69,128,28,204,44,22,157,203,99,92,64,80,52,136,211,0,87,143,45,138,242,160,220,161,102,12,179,75,88,96,117,85,111,156,29,39,135,24,186,246,92,52,34,95,220,39,251,183,201,228,79,88,7,212,53,126,118,177,10,39,144,158,175,52,88,84,38,191,12,237,96,231,247,199,190,115,46,223,134,243,100,158,153,2,185,78,123,153,190,21,205,97,127,136,94,225,73,28,32,12,9,185,222,221,91,174,32,170,237,86,54,248,220,112,85,193,150,74,105,176,150,136,192,31,78,254,187,210,39,7,27,176,182,88,36,19,3,186,103,215,245,99,95,158,6,28,161,175,124,177,202,210,242,73,72,82,55,156,79,213,187,231,30,194,31,247,18,0,225,3,224,56,150,69,46,196,243,68,189,29,171,73,119,249,178,94,221,68,24,169,176,45,148,185,41,161,22,241,128,108,26,163,40,76,154,120,80,242,172,206,140,33,164,169,98,214,83,141,168,90,161,170,155,47,51,194,5,204,117,140,185,248,104,100,21,151,19,83,120,240,63,147,10,32,162,7,216,12,7,139,243,98,17,137,78,241,45,1,6,175,45,140,53,155,203,212,91,52,174,195,100,20,60,110,7,27,29,43,52,151,164,78,102,55,50,193,61,84,224,187,23,243,100,210,131,95,126,166,229,25,19,127,146,24,220,91,252,146,83,202,39,250,5,189,92,157,102,200,234,103,27,171,33,17,58,1,112,36,13,111,107,181,17,189,41,49,205,105,60,5,111,215,182,186,86,93,187,150,38,247,27,135,55,102,43,45,197,127,204,246,236,42,185,94,76,46,120,220,53,218,213,141,63,142,50,162,42,201,138,131,7,251,44,127,189,151,28,59,128,51,92,216,168,89,146,95,71,229,88,67,221,111,191,197,229,19,183,171,110,181,192,191,59,167,55,232,252,221,38,193,89,75,63,168,17,169,164,53,146,126,127,112,211,21,25,147,68,153,161,75,104,228,175,181,90,148,166,141,30,17,32,126,134,184,202,106,181,251,154,63,85,118,98,27,102,210,26,149,32,30,138,127,157,182,212,116,111,167,48,96,81,190,44,163,63,87,190,17,254,93,228,164,189,58,88,107,255,33,96,129,77,7,22,48,34,89,14,33,214,56,159,22,94,9,10,80,249,184,8,37,51,157,195,49,222,186,15,245,42,89,197,97,163,131,252,182,165,113,6,193,163,90,119,95,23,101,27,129,252,226,0,28,125,99,66,184,21,56,52,22,122,52,26,127,84,102,37,18,113,12,117,69,115,46,154,14,46,129,11,52,114,35,180,130,39,163,206,65,44,221,226,84,202,143,51,141,109,71,137,202,31,54,243,36,106,127,170,250,15,252,0,150,188,114,4,169,117,45,189,130,236,67,181,98,34,178,155,240,109,44,173,93,56,158,188,80,3,114,8,208,180,148,13,44,15,91,172,138,195,177,28,106,172,91,82,7,142,99,166,141,173,19,15,177,53,208,66,111,27,221,112,171,161,116,25,150,83,50,185,96,101,137,103,131,53,139,78,131,150,190,144,172,19,83,19,49,55,82,88,162,46,233,249,125,197,38,33,56,9,192,45,19,142,30,13,41,133,103,213,76,140,242,79,63,159,215,1,153,81,69,118,180,183,154,11,71,69,89,2,208,189,28,184,76,241,244,189,237,9,95,12,168,236,131,109,143,77,157,140,218,143,108,75,26,221,167,138,90,98,13,9,248,241,146,130,7,222,118,249,94,148,239,42,117,160,19,17,236,112,229,115,88,240,219,111,26,204,59,181,59,182,44,19,98,241,151,58,204,65,74,118,119,89,30,169,61,96,80,224,96,171,153,170,211,94,105,108,236,47,214,117,38,86,213,12,229,98,174,67,168,183,67,190,255,71,48,225,110,109,246,225,204,194,46,43,67,134,181,44,152,54,156,151,87,119,152,41,252,0,158,3,138,105,191,238,231,176,202,245,186,162,71,186,16,213,248,175,254,80,173,230,253,58,64,46,55,154,39,10,48,1,14,61,132,12,7,193,218,216,122,240,155,222,99,44,185,216,168,250,251,237,113,30,120,62,99,139,195,186,124,44,232,22,158,172,78,117,32,190,237,38,249,185,20,245,52,247,192,102,247,162,217,212,114,78,187,213,23,178,213,171,251,17,187,17,226,105,122,241,155,226,191,50,206,161,250,64,175,105,31,225,59,12,104,130,188,69,152,72,114,219,249,205,84,14,242,162,43,169,112,8,114,118,60,4,164,215,115,197,70,124,104,70,70,130,94,88,4,4,94,114,98,214,78,241,233,16,146,251,33,77,182,213,58,180,103,185,166,172,215,111,143,72,1,169,205,121,255,242,217,144,121,169,54,169,146,10,33,32,159,73,16,196,247,193,143,30,187,15,84,216,186,242,30,238,54,105,12,249,143,223,45,70,208,51,135,178,134,91,237,35,2,222,171,138,113,147,152,64,46,59,253,143,235,1,28,83,144,8,110,146,26,39,130,162,85,78,159,106,214,82,14,23,222,67,147,82,68,219,243,97,171,63,180,82,116,33,123,59,193,48,77,192,86,250,40,252,221,189,183,58,112,12,132,27,34,240,41,178,191,214,219,95,163,209,60,96,201,38,194,41,51,75,172,155,230,219,65,108,132,201,95,219,168,253,224,25,132,247,165,229,163,241,18,59,61,93,123,26,246,109,241,111,38,26,85,135,252,11,176,57,210,198,1,111,123,184,13,9,142,83,46,60,181,58,229,133,212,47,215,248,255,251,145,222,236,165,195,12,50,186,103,47,147,229,111,192,138,173,108,7,36,177,108,158,63,50,56,163,65,214,253,47,253,247,80,149,106,179,249,244,95,128,30,227,169,153,134,46,53,238,98,19,68,227,13,220,47,26,173,27,114,212,233,243,109,47,67,161,217,179,128,107,129,108,131,109,88,130,243,20,48,183,51,4,139,116,88,100,120,222,72,248,236,21,144,49,140,67,23,244,10,69,129,251,137,202,121,156,150,193,244,58,26,106,137,17,87,175,218,160,231,184,188,11,213,216,221,238,117,34,98,140,202,143,182,21,128,252,18,34,249,73,186,215,132,101,143,30,200,189,166,224,208,116,4,85,127,34,206,182,156,182,154,47,66,254,241,36,95,32,158,70,38,88,132,54,178,28,52,40,253,230,161,204,197,78,132,197,115,174,71,18,77,224,208,25,189,24,155,18,86,119,226,152,185,195,220,157,179,12,177,37,224,178,105,115,47,90,236,254,162,36,194,163,57,11,0,245,147,174,104,249,135,99,213,169,81,206,53,156,113,42,188,6,118,25,194,238,138,82,78,252,239,16,163,22,230,179,37,224,118,100,199,108,203,106,28,209,247,97,250,216,83,211,255,26,165,127,249,83,200,119,252,51,237,35,2,151,70,149,226,222,128,52,233,103,115,69,1,187,183,103,84,32,33,179,0,48,69,116,114,242,138,169,4,50,163,119,183,80,75,245,21,51,245,10,82,17,218,131,251,70,16,24,224,80,90,196,87,30,198,153,228,198,229,252,161,187,197,1,159,23,126,240,22,253,94,97,114,123,108,106,251,57,209,185,208,85,67,32,3,21,118,112,14,189,250,56,153,19,118,91,64,178,24,185,53,190,231,104,126,94,142,77,75,114,212,211,247,124,173,28,160,13,204,2,13,124,218,70,20,188,170,174,243,207,216,19,233,138,194,218,200,163,198,240,207,104,66,139,242,110,62,51,203,12,0,226,147,212,226,84,83,120,128,230,82,54,145,108,93,241,37,80,46,112,239,96,170,244,186,205,248,138,124,65,151,12,119,113,204,150,83,38,90,61,121,255,25,20,82,13,148,99,150,120,148,62,238,231,84,43,209,249,69,244,225,77,130,7,107,162,217,117,118,142,57,41,40,141,139,121,32,219,237,251,101,59,43,160,7,87,192,163,117,149,2,28,253,238,115,15,49,208,218,95,77,68,163,106,201,91,173,185,147,196,79,79,166,17,118,254,199,214,235,18,238,82,224,14,243,216,2,37,241,199,82,101,240,214,227,238,192,28,221,92,104,199,37,165,203,12,225,78,168,96,62,110,197,85,226,26,23,81,247,44,120,26,81,223,210,173,75,44,98,55,181,119,100,67,57,183,26,138,72,216,1,197,54,9,71,21,55,86,135,182,73,16,77,140,128,92,26,108,51,90,189,138,232,83,26,25,17,55,32,131,223,124,11,201,144,225,111,125,136,163,194,177,10,19,110,194,152,218,165,23,95,115,48,199,17,229,59,222,69,144,155,110,166,16,161,86,14,26,30,76,174,133,150,162,154,24,50,247,238,51,82,159,154,222,2,81,149,116,53,2,91,165,228,67,238,111,29,223,255,184,239,36,241,165,13,93,83,5,4,12,161,128,18,146,248,50,184,78,145,57,168,2,253,88,65,220,130,114,227,86,225,244,206,145,62,6,107,124,58,6,219,90,159,250,202,240,18,116,31,26,132,12,55,67,165,146,59,167,101,25,228,226,236,98,203,11,143,37,239,8,8,19,105,48,173,194,17,172,169,41,94,50,48,28,40,3,180,188,19,63,168,87,48,3,186,129,138,102,221,7,221,90,38,36,219,156,200,207,228,167,175,104,27,128,29,153,69,242,113,115,24,143,225,64,21,26,44,38,30,190,1,16,243,154,216,16,74,225,225,98,238,158,220,180,169,125,80,83,34,159,230,151,53,170,56,23,27,166,158,35,238,117,70,248,187,238,22,45,145,68,17,237,220,194,198,188,87,66,171,179,173,201,62,19,142,78,140,34,129,107,209,236,253,78,241,102,21,173,129]} \ No newline at end of file diff --git a/testutils/testdata/zkchain_proof.json b/testutils/testdata/zkchain_proof.json deleted file mode 100644 index f0ed728d7..000000000 --- a/testutils/testdata/zkchain_proof.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "aggregation": { - "duration": 276176, - "instance": [ - "0x00000000000000000000000000000000ddaaede96e2ecd386556d4d3a708772c", - "0x0000000000000000000000000000000014259cc4685da43ecb73b241f0c63e54", - "0x000000000000000000000000000000000000000000000007eed1cf8ff77aef74", - "0x00000000000000000000000000000000000000000000000fa773ef9ec7ce0726", - "0x00000000000000000000000000000000000000000000000b1f8d7a4b882df364", - "0x00000000000000000000000000000000000000000000000000006fee4348abf4", - "0x00000000000000000000000000000000000000000000000cea83d6f1c53916fc", - "0x000000000000000000000000000000000000000000000006085eded6b36aff9c", - "0x0000000000000000000000000000000000000000000000049d3fa0c3eee77969", - "0x0000000000000000000000000000000000000000000000000000dfea17975271", - "0x00000000000000000000000000000000000000000000000656a4f6132836f967", - "0x00000000000000000000000000000000000000000000000b2f687f67cc2a0f3a", - "0x000000000000000000000000000000000000000000000009c4256b4b8d3d5b56", - "0x0000000000000000000000000000000000000000000000000000e3bfe610b631", - "0x00000000000000000000000000000000000000000000000279a6c68bd46b5242", - "0x000000000000000000000000000000000000000000000001ce586bca9845679d", - "0x00000000000000000000000000000000000000000000000e612c9ba637b98007", - "0x0000000000000000000000000000000000000000000000000001bae7f495655e" - ], - "k": 20, - "label": "pi-300000", - "proof": "0x25ea129334f31df21a3153b7bc547537acd96b1ac5bf9306623653da2bef563d304cfbf67cb1869fe1a225a20dd1bfaa2cb51e2afe78b23ef734daa01e0b67c00cac83d36cb241f9b8e9ef3860b62586947e3e6f76d83aff0b11f15a14ba642a26ef1f867efe5f30ab3d71f7a06900f995a1f369a72da8143054cd6c85966da3015bc1f1d19dfcb350d92f70098369c96f0a8fb284c4bc0aa27765e7b3833bb413dc80bc80e6753f745390bc5d9c64d94fc9daef7930f02f6183af82295388f41379ca854b012a922b9ef3ce76452b8ad26b34fcc1ceb37cfc87b6544658b2c82d3f1cf31bf1b15f6bb3cd986b76ab0e9594fc3ad6fcf5e8c7c80726d85c666920352562ed745b8f861eaccc709acf717c2051b3cbd474e2a30e97ac914aedda0997e4c1e38ed39bec2ffa1d4dd10f64e6a6c840329ed8031d802582829c2917190ffee4e76a03f748bc43bbd9aabeef45b5c2b5784c681738569f72be8f35de139c2a7030e55d9631dab075419841283b1faf3319d79f3a46ffd1323a28ca10268439ba1adbb6eec9eb78d93459b04667ce0cad2a03167c681207a2539354470698c698e2fdcaa00d34b1f038bfb8b8ab1a4809b8e942364bd23269cad3833c2b1a94f5db0bdfedc69a368081021bb89b0e2404a4e5301ec126db00b86487e0285909754b2ff8a9c6f5121bebe8f8860ca0220eae28eff5b5bbe18c2d8b891716034437ca3ed93a8014d909c50e26479ef56d532363ce544cc7a297b86d22041fc5bfa837baf459d5ad9f1d7205012d5cddb156fe0033a40f3b8ebdaf2dc8da062c1112a7a6d40682b5bbe7c12a88eff31e302fde6a7648438bced0108f7da223293473c6297184f6b649c840fc18c168629e8dfdd810e1becc3e628c9d1e9a081bf5163f40ab582a767300316084af824361948b7173440d87875188ccbcfc2ef8e2a9c7b94ecfd077a0a73febff067826d2f547bf5842072a9fd933afd406266209888fd0a028efdb9dad735a3ab7926a1b8a34dda5b728b3f9c5eebd510b115ed8aa99cee724f3ce2620315379f5f84a99eec04d00101677f35cda09ba540d68a6ce67fe4fb91020ea4ba2fea07503cd7835ad3d9500fdf8f5bf692fb8de0ce87bc70c48d0eb24bf28d984f5a4497ce545da83f098e387921b66f26b783d07c83433ee5c4d62b35a355f747f6b3a37ef5eeed42a7ba567fa4c571aa002422d478be4fc1f5a6ab615c923cf18b4f9fc6f59c6c096b5ce8c55a146acea3b251401e55052af714370ebd24f15bf492036ed34e0cc2f29361eec56a83a683b150b0cdce35056c92c201903708503921b678ef8a1d509d755d66bb20266ac1fb9031f6ce5143ec727eb31b43f1da2891273bee70dbc850a84742b85030334f76e0c3a0c7a72f3776cbabd0ce9b856958352ac094af95cd867ee08257b9d1e61b2296c5e6a65ec4e4b83fbe4041be82d0bdc9febc389f5c235c4d006b99774de7413e20fd33d7d8d93cc3ff6a83ec53dbfc82c704da4f0f8abd8dc8e8f058a4c1c1384fd39c7aadb848dccad9552293697599d6d760d41852b65033a9d9915bd5319990b2e1d119998d641a9396fdef9a96620c2fdf41baa71f26c6e7642dc69b22396262c440cdad70b5c295cc80e9809075a60eb96938ac116e7e1ad6cdb699413a51ba86b0896921df764009e66925e6fcd8866d78196352ef6017b8920a09b0ae7f0be08d48376c4c62828ed381753437445b2014eaca8d842b78599eda34600f91a3d9eeae69cb00f0c3358cb1f20e0bc8a776411a4289a7606165b4e926614bda68dfe972344e2c09ab65d120029c786c9a4b3464c648684cf61d4542ecf284da4a3c54697f8f9f7b9c67f9f6e122a9a4912d3bf3b39b37c542095728aa91686cf824583b925b4f3f977fddf02a8e79960534871ea82d073e79660ee266d2a1bb3473255feb80c75ca0112839119aa6b46a5123fe3be960994090b064991124c4a49854fbbe7260d35b2f7e667cc9ec72f8b36ce78057e48f8a35ceb0ec12d251041c45e4547a953fb0006c136f9d482fc596339633d68ce0a5c6759a97d185ebb2fca81281852326667cf4419025be0af4786d291f0354371e658e0903617b1c06609d62b34bb91aee5f4a346ad7b31ea00174ba603ecc31f1091109c5c29dd60412e9f69e1e0fe58a1321309b213fdc19dd09f71fbd67e6844def43b972b1a5ad652b78a024b3962e5d544d7a2d95a4cc731a658ef9eff6c5e25ea129b09e0642b42c39551ec2b5432038f3d76525509c565bbd3de3837fed6ebef4c62101b2c6f2cc3b7534e7b0942eae7b1aebea3ba5ad498bba08afaee6dc61568de2669d5ac8f3f95b31281d5582b4c4e46e8ad14c47e22e9d0aaedba3781258fc91000f01f6512769fa0b54e52329a4141d3c907c63cea66c087168df5a1d97d0304236fe0769a8d1f9a7606c466cf99d0ea6894a440c27dfc03de1719976b1ce7001ffd98e5830a0d5b3b10363e58bc14d4b7702c4f38699523fd2a307c1d75b50194c266bdef7775256f4271aa246005917d0935d520399645e34b2064297ee21745ae4af80c07b99afa292065163baa8e2746ad086d6cec18fcc199843731ea14a86e804f91fc0aa3e1b67136d5ac58c97a758a92afc3ee9f337c4a7e05f51f162ec81f91e84671ee027f0261d0214214cf57685ce58a8f8cb9c282828c48600cd84cf2ea1ffd443f96652ec2a47be5be44b08c9d6a879ac249a1e071ea1c6122d0bd0d94d63b41d1c50fa9a0a6dce5f6e655bfdcb8a03a4759b439f348cd2e052d9feac81e1fc4f4854c6e13662746d95e4d5ef0f142caab4dc24b7753b0f60f799f1f3ccbafdb2067d563b262ed42ed23bf3f97764c357abfac6b9a9dca60293c502c135d6d7ac086fda849c026740607139a0f6a9f02b7acffd8183f8fd226286fafdf1206956b67ef83c40c1526416716ba9a1b76279bbebc9699131b532c54b116fb49fe268f0eeedd97710d7e6b87ce8e9ae184bdf5ef62dddc2d4e6b0caa9bb1765d0d34cb956db725303eee1366b23d51810013540edb5dd44c992f1406a10cde626fbc2dea75334e77fe1a05ceb14665044bcca6b3da8da368925f05bd0118c1d4336e47fc8c168b9d1a4a75e2274dcbabd8723acbbab9689a7abf15e15ac114b5182a342ac218f6c66f46355d1c5bba009464048ba9e547ffdf0e103b9c6d1ab444e4344f1b87d7720495ce69fe5a0a5a1827741a569707b1cf942a4016181d648dc24b03573cd0997850317b3a9e11aefcea5b0383797940f8b015c016f8b008714175d7f5fbfe6c867be8a27e45afbcd48ee5f220471a2008e809e8dda3a1fdbce7566dcdb9c18e659da7863a22c7c88e9f91f7fc2ae6f3650d1d4e06da928043913bc4e09c5785f367b41470d1b6c547bc597b24645099be470749d19297a63708ed8e88265d52b2eb907f7d60e5ea6ea4d54c99de176458b703680224c5cabecbd0e339907f45c3f3366f1bb007ef310de8a995f73e98258a2cea76901c324fa3124669fabb8d6ba0dc051a7bf00064673e2206a6f51b69fb04ed376bbfc9c19cde520ccb8c0da2b34a8da1552b35d46d3ef0839fb9b53eaf10aaaa767213e9db31e28c856087fc261fbe33110c771852c0b5186159b55c9324daf9b78fde7118049b0716c65c60d53e231b0b942e579bfda05a7ffba2650800c1131f76b2d03343b35d09acca83278551caef4c88c854775502139c94ddfc22c8b578721a315bd16ea3bc2f99748eee81f80de55d2981671d53f825f0d7cf1c56215f20cb23acfc6050dd643962901eeb856a5bed4152fa7c0b0ba12588080c6fa77a733a1877c697b806b25c432083d1f9bdec3b0d7a7045b166146a93702796d1861f12bdc01d380717ec0444876223e07c90246e3ed14f3dfdf73f2bd21b3f1492f32e47037164b7f7fbba703d3a15891daaa9c41460c33715af49c02b03eaf2c4c34eba7bbec7ebcdc10cd90a1ef60f906e272f11a8c2bdc00e4498d91d4b2a33d45333f2a1a50e89706178605482bcc3dbd1774f39844c3cd9a040df244134235e45d0c513b969b4a3ce0e4dd8896f9e69222b7f216174948a44f84006817ce631df4760cf9f6b0310eacb352afb5ee221fafa2dbb38030fc92950be0546a559aab15f3433976cc46f80cd98bb846015477e6143f9db1fdf9bbcbfa1300eaa515b358fba504ec958081f717b0818f31141ceda76298376d36065b5311449fe4e503da733074bcfde90cc50318ea42c1b52f95ba8b30e0b09ae06d7002de5a9d7b29b2d0697e6a76d8dc76baf6d9c77719003bfb8209cc6a1d4e49f0d13eea1003abea0f4ef72b2ad2e0c1b31b2e61e5d2752c04d1a4eef82e1a64dd21715b3d961f58f56a15c1b6f90ccff04399a6fb8f56de3ff40b15260116ca0bd157071f2ff43243895276a7035fad39df0a36701119e77611acae5ddc96ee6c40709330f44465cf25bc76050a5f9f16a9e2d14e929d0c62d468b3a9d16e253d80df587890102ffec99ba150ffb96337768978899d0290f28edefe966af621b1e204852bd8d4ca5dbff6be94f36293b773d47b77b19d8312b89ca7d2116d60b4007b29fa4d8e43bfef61574deb5d3969562e1a10ff437be1225484215bacdb6211bf36d0ab0e530f7be7c7ae7828cd2051eb03b5af58720cbe872835324f7b93805fee0960122b691118b46627b4b2be970f09641dc178fef98a1ba765f08ce180532ba4120021fe4b00dbbc22b0d1e76c944d83306dd5b97c9c5cc7c3e728ab21fb65736f4e2335ab05c7c092a3cfb07d35c2d1b06096e7039af145fcc931f7e2b864bca1e47cb4bda0dc63937d9b0eaac96b7a5708b792235aa080178246c361ff5dd49bf1ce44e94043b82cda677f117e4b74b3e62c62f10f1af03273014dc1b7453940b97cad12ad544b59d5339670b49627fb78edb9b23ad2fc10250b54021ac49d0eb05b89639b723bcca67265889fc8875ab0cf3ae685588c5ad309ecb0246aba9faa737eeda58e118c76abb13acbbada67a2b5495711201ef6e79d3b02191b8a3a6918d1bf82607d11dfac78c56da8920c087d59afadfb7bd08886f6426d92fb8b576623b431217b712106464f00e6a02b4de08b3aa2f85dd0b1962db0ce7088fcb219173051d174ee2fcdd356316eda52cc7ac8f9fd27d9a119aedb605b415ab86c264b29232b03265a93b51a3e382ab8b9ddaec01f81a92bc405bdf118cef9327e2c176772dba4cddbfd5e832ea2bdba913b3afebe74edad55e68ca099a00f7d0b2beb1dfd2980c42db24b76efeb50f0e8c5ab90b6e2576725e69de12f69077c5d0e12a637844849e30e897b3a49072fb2b994f4340214cfac473f6", - "randomness": "0x" - }, - "config": { - "block_gas_limit": 300000, - "keccak_padding": 336000, - "max_bytecode": 24634, - "max_calldata": 105000, - "max_rws": 476052, - "max_txs": 40, - "min_k": 20, - "min_k_aggregation": 26, - "pad_to": 476052 - }, - "gas": 21000 - } -} From b73c227bce463e21d96a2413e794a023b084323d Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 22:25:05 +0800 Subject: [PATCH 38/63] test(prover): more prover tests --- integration_test/entrypoint.sh | 2 +- prover/prover.go | 1 - prover/prover_test.go | 29 +++++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index a63ef3e5a..abb5488b3 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -56,7 +56,7 @@ if [ "$RUN_TESTS" == "true" ]; then TREASURY=0xdf09A0afD09a63fb04ab3573922437e1e637dE8b \ PREMINT_TOKEN_AMOUNT=$PREMINT_TOKEN_AMOUNT \ JWT_SECRET=$DIR/nodes/jwt.hex \ - go test -v -p=1 ./$PACKAGE -coverprofile=coverage.out -covermode=atomic -timeout=300s + go test -v -p=1 ./prover/... -coverprofile=coverage.out -covermode=atomic -timeout=300s else echo "💻 Local dev net started" docker compose -f $TESTNET_CONFIG logs -f l2_execution_engine diff --git a/prover/prover.go b/prover/prover.go index 7fbc3ad27..ed4ab25c9 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -262,7 +262,6 @@ func (p *Prover) eventLoop() { case <-p.ctx.Done(): return case proofWithHeader := <-p.proofGenerationCh: - log.Info("111888") p.submitProofOp(p.ctx, proofWithHeader) case <-p.proveNotify: if err := p.proveOp(); err != nil { diff --git a/prover/prover_test.go b/prover/prover_test.go index b14dbd611..11c32081f 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -170,8 +170,8 @@ func (s *ProverTestSuite) TestOnBlockProposed() { func (s *ProverTestSuite) TestOnBlockVerifiedEmptyBlockHash() { s.Nil(s.p.onBlockVerified(context.Background(), &bindings.TaikoL1ClientBlockVerified{ BlockId: common.Big1, - BlockHash: common.Hash{}}, - )) + BlockHash: common.Hash{}, + })) } func (s *ProverTestSuite) TestSubmitProofOp() { @@ -181,6 +181,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, Proof: []byte{}, + Tier: encoding.TierOptimisticID, }) }) s.NotPanics(func() { @@ -189,6 +190,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, Proof: []byte{}, + Tier: encoding.TierOptimisticID, }) }) } @@ -242,6 +244,29 @@ func (s *ProverTestSuite) TestContestWrongBlocks() { s.Equal(encoding.TierGuardianID, event.Tier) } +func (s *ProverTestSuite) TestProveExpiredUnassignedBlock() { + e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) + sink := make(chan *bindings.TaikoL1ClientTransitionProved) + + header, err := s.p.rpc.L2.HeaderByNumber(context.Background(), e.BlockId) + s.Nil(err) + + sub, err := s.p.rpc.TaikoL1.WatchTransitionProved(nil, sink, nil) + s.Nil(err) + defer func() { + sub.Unsubscribe() + close(sink) + }() + + s.Nil(s.p.onProvingWindowExpired(context.Background(), e)) + s.Nil(s.p.selectSubmitter(e.MinTier).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + + event := <-sink + s.Equal(header.Number.Uint64(), event.BlockId.Uint64()) + s.Equal(header.Hash(), common.BytesToHash(event.BlockHash[:])) + s.Equal(header.ParentHash, common.BytesToHash(event.ParentHash[:])) +} + func (s *ProverTestSuite) TestSelectSubmitter() { submitter := s.p.selectSubmitter(encoding.TierGuardianID - 1) s.NotNil(submitter) From 0bc65cc8afaadaa10df2e9bc66d34669312b4a98 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 22:25:16 +0800 Subject: [PATCH 39/63] test(prover): more prover tests --- integration_test/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index abb5488b3..a63ef3e5a 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -56,7 +56,7 @@ if [ "$RUN_TESTS" == "true" ]; then TREASURY=0xdf09A0afD09a63fb04ab3573922437e1e637dE8b \ PREMINT_TOKEN_AMOUNT=$PREMINT_TOKEN_AMOUNT \ JWT_SECRET=$DIR/nodes/jwt.hex \ - go test -v -p=1 ./prover/... -coverprofile=coverage.out -covermode=atomic -timeout=300s + go test -v -p=1 ./$PACKAGE -coverprofile=coverage.out -covermode=atomic -timeout=300s else echo "💻 Local dev net started" docker compose -f $TESTNET_CONFIG logs -f l2_execution_engine From f3c3960932a21b7ac66a01a4391df6642a006edf Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Oct 2023 23:49:38 +0800 Subject: [PATCH 40/63] test(prover): more tests --- prover/prover_test.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/prover/prover_test.go b/prover/prover_test.go index 11c32081f..512ef3d98 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -273,12 +273,22 @@ func (s *ProverTestSuite) TestSelectSubmitter() { s.Equal(encoding.TierGuardianID, submitter.Tier()) } +func (s *ProverTestSuite) TestSelectSubmitterNotFound() { + submitter := s.p.selectSubmitter(encoding.TierGuardianID + 1) + s.Nil(submitter) +} + func (s *ProverTestSuite) TestGetSubmitterByTier() { submitter := s.p.getSubmitterByTier(encoding.TierGuardianID) s.NotNil(submitter) s.Equal(encoding.TierGuardianID, submitter.Tier()) } +func (s *ProverTestSuite) TestGetProvingWindowNotFound() { + _, err := s.p.getProvingWindow(&bindings.TaikoL1ClientBlockProposed{MinTier: encoding.TierGuardianID + 1}) + s.ErrorIs(err, errTierNotFound) +} + func (s *ProverTestSuite) TestIsBlockVerified() { vars, err := s.p.rpc.TaikoL1.GetStateVariables(nil) s.Nil(err) @@ -292,6 +302,29 @@ func (s *ProverTestSuite) TestIsBlockVerified() { s.False(verified) } +func (s *ProverTestSuite) TestProveOp() { + e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) + sink := make(chan *bindings.TaikoL1ClientTransitionProved) + + header, err := s.p.rpc.L2.HeaderByNumber(context.Background(), e.BlockId) + s.Nil(err) + + sub, err := s.p.rpc.TaikoL1.WatchTransitionProved(nil, sink, nil) + s.Nil(err) + defer func() { + sub.Unsubscribe() + close(sink) + }() + + s.Nil(s.p.proveOp()) + s.Nil(s.p.selectSubmitter(e.MinTier).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + + event := <-sink + s.Equal(header.Number.Uint64(), event.BlockId.Uint64()) + s.Equal(header.Hash(), common.BytesToHash(event.BlockHash[:])) + s.Equal(header.ParentHash, common.BytesToHash(event.ParentHash[:])) +} + func (s *ProverTestSuite) TestStartSubscription() { s.NotPanics(s.p.initSubscription) s.NotPanics(s.p.closeSubscription) From c25845a525fcb7202aa0b13e233d03e1794f0b74 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 00:09:49 +0800 Subject: [PATCH 41/63] test(prover): more tests --- .../anchor_tx_validator.go | 8 ------ prover/server/api.go | 1 + prover/server/server.go | 2 -- prover/server/server_test.go | 27 +++++++++---------- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/prover/anchor_tx_validator/anchor_tx_validator.go b/prover/anchor_tx_validator/anchor_tx_validator.go index dddfca704..de2febb37 100644 --- a/prover/anchor_tx_validator/anchor_tx_validator.go +++ b/prover/anchor_tx_validator/anchor_tx_validator.go @@ -73,11 +73,3 @@ func (v *AnchorTxValidator) GetAndValidateAnchorTxReceipt( return receipt, nil } - -// GetAnchoredSignalRoot gets the anchored signal service state root in the given `TaikoL2.anchor` transaction. -func (v *AnchorTxValidator) GetAnchoredSignalRoot( - ctx context.Context, - tx *types.Transaction, -) (common.Hash, error) { - return common.BytesToHash(tx.Data()[4+32 : 4+32+32]), nil -} diff --git a/prover/server/api.go b/prover/server/api.go index 3c2f9fadb..26baaa7b6 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -94,6 +94,7 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { } if !srv.isGuardian { + // TODO: use tier bond ok, err := rpc.CheckProverBalance(c.Request().Context(), srv.rpc, srv.proverAddress, srv.taikoL1Address, srv.bond) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err) diff --git a/prover/server/server.go b/prover/server/server.go index 7101da8c7..0e18601de 100644 --- a/prover/server/server.go +++ b/prover/server/server.go @@ -102,8 +102,6 @@ func LogSkipper(c echo.Context) bool { switch c.Request().URL.Path { case "/healthz": return true - case "/metrics": - return true default: return true } diff --git a/prover/server/server_test.go b/prover/server/server_test.go index c09f3eaf5..bce02e9b7 100644 --- a/prover/server/server_test.go +++ b/prover/server/server_test.go @@ -15,7 +15,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/go-resty/resty/v2" - echo "github.com/labstack/echo/v4" "github.com/phayes/freeport" "github.com/stretchr/testify/suite" "github.com/taikoxyz/taiko-client/pkg/rpc" @@ -46,19 +45,19 @@ func (s *ProverServerTestSuite) SetupTest() { }) s.Nil(err) - p := &ProverServer{ - echo: echo.New(), - proverPrivateKey: l1ProverPrivKey, - minOptimisticTierFee: common.Big1, - minSgxTierFee: common.Big1, - minPseZkevmTierFee: common.Big1, - maxExpiry: 24 * time.Hour, - capacityManager: capacity.New(1024), - taikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - rpc: rpcClient, - bond: common.Big0, - isGuardian: false, - } + p, err := New(&NewProverServerOpts{ + ProverPrivateKey: l1ProverPrivKey, + MinOptimisticTierFee: common.Big1, + MinSgxTierFee: common.Big1, + MinPseZkevmTierFee: common.Big1, + MaxExpiry: time.Hour, + CapacityManager: capacity.New(1024), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + Rpc: rpcClient, + Bond: common.Big0, + IsGuardian: false, + }) + s.Nil(err) p.echo.HideBanner = true p.configureMiddleware() From f8f09dd1a6ab23451aa68c4681e1b05f84684166 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 00:28:37 +0800 Subject: [PATCH 42/63] test(prover): rename some variables --- pkg/rpc/utils.go | 8 ++++---- prover/prover.go | 34 +++++++++++++++++++++------------- prover/server/api.go | 9 +++++++-- prover/server/server.go | 6 +++--- prover/server/server_test.go | 2 +- testutils/helper.go | 2 +- 6 files changed, 37 insertions(+), 24 deletions(-) diff --git a/pkg/rpc/utils.go b/pkg/rpc/utils.go index e934e2059..dacef4ba6 100644 --- a/pkg/rpc/utils.go +++ b/pkg/rpc/utils.go @@ -45,7 +45,7 @@ func CheckProverBalance( rpc *Client, prover common.Address, taikoL1Address common.Address, - bond *big.Int, + livenessBond *big.Int, ) (bool, error) { ctxWithTimeout, cancel := ctxWithTimeoutOrDefault(ctx, defaultTimeout) defer cancel() @@ -57,7 +57,7 @@ func CheckProverBalance( log.Info("Prover's deposited taikoTokenBalance", "balance", depositedBalance.String(), "address", prover.Hex()) - if bond.Cmp(depositedBalance) > 0 { + if livenessBond.Cmp(depositedBalance) > 0 { // Check allowance on taiko token contract allowance, err := rpc.TaikoToken.Allowance(&bind.CallOpts{Context: ctxWithTimeout}, prover, taikoL1Address) if err != nil { @@ -74,14 +74,14 @@ func CheckProverBalance( log.Info("Prover's wallet taiko token balance", "balance", balance.String(), "address", prover.Hex()) - if bond.Cmp(allowance) > 0 || bond.Cmp(balance) > 0 { + if livenessBond.Cmp(allowance) > 0 || livenessBond.Cmp(balance) > 0 { log.Info( "Assigned prover does not have required on-chain token balance or allowance", "providedProver", prover.Hex(), "depositedBalance", depositedBalance.String(), "taikoTokenBalance", balance, "allowance", allowance.String(), - "proofBond", bond, + "proofBond", livenessBond, ) return false, nil } diff --git a/prover/prover.go b/prover/prover.go index ed4ab25c9..0844f478d 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -206,7 +206,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { CapacityManager: p.capacityManager, TaikoL1Address: p.cfg.TaikoL1Address, Rpc: p.rpc, - Bond: protocolConfigs.LivenessBond, + LivenessBond: protocolConfigs.LivenessBond, IsGuardian: p.cfg.GuardianProver, } if p.cfg.GuardianProver { @@ -667,25 +667,36 @@ func (p *Prover) closeSubscription() { // isValidProof checks if the given proof is a valid one. func (p *Prover) isValidProof( ctx context.Context, - blockID uint64, - parentHash common.Hash, - blockHash common.Hash, + event *bindings.TaikoL1ClientTransitionProved, ) (bool, error) { - parent, err := p.rpc.L2ParentByBlockId(ctx, new(big.Int).SetUint64(blockID)) + parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) if err != nil { return false, err } - block, err := p.rpc.L2.BlockByNumber(ctx, new(big.Int).SetUint64(blockID)) + block, err := p.rpc.L2.BlockByNumber(ctx, event.BlockId) if err != nil { return false, err } - if parent.Hash() == parentHash && blockHash == block.Hash() { - return true, nil + l2SignalService, err := p.rpc.TaikoL2.Resolve0(nil, rpc.StringToBytes32("signal_service"), false) + if err != nil { + return false, err + } + + signalRoot, err := p.rpc.GetStorageRoot( + ctx, + p.rpc.L2GethClient, + l2SignalService, + event.BlockId, + ) + if err != nil { + return false, err } - return false, nil + return parent.Hash() == event.ParentHash && + block.Hash() == event.BlockHash && + signalRoot == event.SignalRoot, nil } // onTransitionProved verifies the proven block hash and will try contesting it if the block hash is wrong. @@ -709,12 +720,9 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 return nil } - // TODO(david): check signalRoot isValidProof, err := p.isValidProof( ctx, - event.BlockId.Uint64(), - event.ParentHash, - event.BlockHash, + event, ) if err != nil { return err diff --git a/prover/server/api.go b/prover/server/api.go index 26baaa7b6..6f530afc6 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -94,8 +94,13 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error { } if !srv.isGuardian { - // TODO: use tier bond - ok, err := rpc.CheckProverBalance(c.Request().Context(), srv.rpc, srv.proverAddress, srv.taikoL1Address, srv.bond) + ok, err := rpc.CheckProverBalance( + c.Request().Context(), + srv.rpc, + srv.proverAddress, + srv.taikoL1Address, + srv.livenessBond, + ) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, err) } diff --git a/prover/server/server.go b/prover/server/server.go index 0e18601de..3efd052b5 100644 --- a/prover/server/server.go +++ b/prover/server/server.go @@ -40,7 +40,7 @@ type ProverServer struct { capacityManager *capacity.CapacityManager taikoL1Address common.Address rpc *rpc.Client - bond *big.Int + livenessBond *big.Int isGuardian bool } @@ -54,7 +54,7 @@ type NewProverServerOpts struct { CapacityManager *capacity.CapacityManager TaikoL1Address common.Address Rpc *rpc.Client - Bond *big.Int + LivenessBond *big.Int IsGuardian bool } @@ -71,7 +71,7 @@ func New(opts *NewProverServerOpts) (*ProverServer, error) { capacityManager: opts.CapacityManager, taikoL1Address: opts.TaikoL1Address, rpc: opts.Rpc, - bond: opts.Bond, + livenessBond: opts.LivenessBond, isGuardian: opts.IsGuardian, } diff --git a/prover/server/server_test.go b/prover/server/server_test.go index bce02e9b7..2af455486 100644 --- a/prover/server/server_test.go +++ b/prover/server/server_test.go @@ -54,7 +54,7 @@ func (s *ProverServerTestSuite) SetupTest() { CapacityManager: capacity.New(1024), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), Rpc: rpcClient, - Bond: common.Big0, + LivenessBond: common.Big0, IsGuardian: false, }) s.Nil(err) diff --git a/testutils/helper.go b/testutils/helper.go index 63c3f60c0..825ad77b2 100644 --- a/testutils/helper.go +++ b/testutils/helper.go @@ -190,7 +190,7 @@ func NewTestProverServer( CapacityManager: capacityManager, TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), Rpc: s.RpcClient, - Bond: protocolConfig.LivenessBond, + LivenessBond: protocolConfig.LivenessBond, IsGuardian: true, }) s.Nil(err) From ad9ca1a480fc6c18eb433eac853bc570b3212b47 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 00:45:55 +0800 Subject: [PATCH 43/63] feat(cmd): update flags --- README.md | 8 +++----- cmd/flags/common.go | 10 ++++++++-- cmd/flags/proposer.go | 7 +------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a43c789eb..c7bb37a1f 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,6 @@ Then, run the integration tests: 2. Perform a `pnpm install` in `taiko-mono/packages/protocol` 3. Replace `` and execute: - ```bash - TAIKO_MONO_DIR= \ - COMPILE_PROTOCOL=true \ - make test - ``` +```sh +TAIKO_MONO_DIR= make test +``` diff --git a/cmd/flags/common.go b/cmd/flags/common.go index be4eb2c07..ec974e60d 100644 --- a/cmd/flags/common.go +++ b/cmd/flags/common.go @@ -43,13 +43,19 @@ var ( } TaikoL1Address = &cli.StringFlag{ Name: "taikoL1", - Usage: "TaikoL1 contract address", + Usage: "TaikoL1 contract `address`", Required: true, Category: commonCategory, } TaikoL2Address = &cli.StringFlag{ Name: "taikoL2", - Usage: "TaikoL2 contract address", + Usage: "TaikoL2 contract `address`", + Required: true, + Category: commonCategory, + } + TaikoTokenAddress = &cli.StringFlag{ + Name: "taikoToken", + Usage: "TaikoToken contract `address`", Required: true, Category: commonCategory, } diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index abaac37da..1836a1d51 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -24,12 +24,6 @@ var ( Required: true, Category: proposerCategory, } - TaikoTokenAddress = &cli.StringFlag{ - Name: "taikoToken", - Usage: "TaikoToken contract address", - Required: true, - Category: proposerCategory, - } ) // Optional flags used by proposer. @@ -90,6 +84,7 @@ var ( } MaxProposedTxListsPerEpoch = &cli.Uint64Flag{ Name: "maxProposedTxListsPerEpoch", + Usage: "Maximum number of transaction lists which will be proposed inside one proposing epoch", Value: 1, Category: proposerCategory, } From 468e5f4bac1191ca2a81ffc067f8aa90b2dae269 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 12:40:38 +0800 Subject: [PATCH 44/63] feat(bindings): update bindings --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 75 ++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 0eac5b95c..b0c59dd3c 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -4c78ddbd357b00aa98332e8d63d088bda070ae8f +49efd75726c21df8ba84a28b32322ee2164faa68 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index ff5293694..f2d7293ca 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -31,11 +31,12 @@ var ( // ITierProviderTier is an auto generated low-level Go binding around an user-defined struct. type ITierProviderTier struct { - VerifierName [32]byte - ValidityBond *big.Int - ContestBond *big.Int - CooldownWindow *big.Int - ProvingWindow uint16 + VerifierName [32]byte + ValidityBond *big.Int + ContestBond *big.Int + CooldownWindow *big.Int + ProvingWindow uint16 + MaxBlocksToVerify uint8 } // TaikoDataBlock is an auto generated low-level Go binding around an user-defined struct. @@ -67,25 +68,25 @@ type TaikoDataBlockMetadata struct { // TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. type TaikoDataConfig struct { - ChainId *big.Int - RelaySignalRoot bool - BlockMaxProposals uint64 - BlockRingBufferSize uint64 - BlockMaxVerificationsPerTx uint64 - BlockMaxGasLimit uint32 - BlockFeeBaseGas uint32 - BlockMaxTxListBytes *big.Int - ProposerRewardPerL1Block *big.Int - ProposerRewardMax *big.Int - ProposerRewardPoolPctg uint8 - LivenessBond *big.Int - EthDepositRingBufferSize *big.Int - EthDepositMinCountPerBlock uint64 - EthDepositMaxCountPerBlock uint64 - EthDepositMinAmount *big.Int - EthDepositMaxAmount *big.Int - EthDepositGas *big.Int - EthDepositMaxFee *big.Int + ChainId *big.Int + RelaySignalRoot bool + BlockMaxProposals uint64 + BlockRingBufferSize uint64 + MaxBlocksToVerifyPerProposal uint64 + BlockMaxGasLimit uint32 + BlockFeeBaseGas uint32 + BlockMaxTxListBytes *big.Int + ProposerRewardPerL1Block *big.Int + ProposerRewardMax *big.Int + ProposerRewardPoolPctg uint8 + LivenessBond *big.Int + EthDepositRingBufferSize *big.Int + EthDepositMinCountPerBlock uint64 + EthDepositMaxCountPerBlock uint64 + EthDepositMinAmount *big.Int + EthDepositMaxAmount *big.Int + EthDepositGas *big.Int + EthDepositMaxFee *big.Int } // TaikoDataEthDeposit is an auto generated low-level Go binding around an user-defined struct. @@ -143,7 +144,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardPerL1Block\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"proposerRewardPoolPctg\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardPerL1Block\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"proposerRewardPoolPctg\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -573,7 +574,7 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTaikoTokenBalance(user comm // GetTier is a free data retrieval call binding the contract method 0x576c3de7. // -// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16)) +// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16,uint8)) func (_TaikoL1Client *TaikoL1ClientCaller) GetTier(opts *bind.CallOpts, tierId uint16) (ITierProviderTier, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getTier", tierId) @@ -590,14 +591,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetTier(opts *bind.CallOpts, tierId u // GetTier is a free data retrieval call binding the contract method 0x576c3de7. // -// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16)) +// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16,uint8)) func (_TaikoL1Client *TaikoL1ClientSession) GetTier(tierId uint16) (ITierProviderTier, error) { return _TaikoL1Client.Contract.GetTier(&_TaikoL1Client.CallOpts, tierId) } // GetTier is a free data retrieval call binding the contract method 0x576c3de7. // -// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16)) +// Solidity: function getTier(uint16 tierId) view returns((bytes32,uint96,uint96,uint24,uint16,uint8)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTier(tierId uint16) (ITierProviderTier, error) { return _TaikoL1Client.Contract.GetTier(&_TaikoL1Client.CallOpts, tierId) } @@ -998,23 +999,23 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) TransferOwnership(newOwner // VerifyBlocks is a paid mutator transaction binding the contract method 0x8778209d. // -// Solidity: function verifyBlocks(uint64 maxBlocks) returns() -func (_TaikoL1Client *TaikoL1ClientTransactor) VerifyBlocks(opts *bind.TransactOpts, maxBlocks uint64) (*types.Transaction, error) { - return _TaikoL1Client.contract.Transact(opts, "verifyBlocks", maxBlocks) +// Solidity: function verifyBlocks(uint64 maxBlocksToVerify) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) VerifyBlocks(opts *bind.TransactOpts, maxBlocksToVerify uint64) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "verifyBlocks", maxBlocksToVerify) } // VerifyBlocks is a paid mutator transaction binding the contract method 0x8778209d. // -// Solidity: function verifyBlocks(uint64 maxBlocks) returns() -func (_TaikoL1Client *TaikoL1ClientSession) VerifyBlocks(maxBlocks uint64) (*types.Transaction, error) { - return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocks) +// Solidity: function verifyBlocks(uint64 maxBlocksToVerify) returns() +func (_TaikoL1Client *TaikoL1ClientSession) VerifyBlocks(maxBlocksToVerify uint64) (*types.Transaction, error) { + return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocksToVerify) } // VerifyBlocks is a paid mutator transaction binding the contract method 0x8778209d. // -// Solidity: function verifyBlocks(uint64 maxBlocks) returns() -func (_TaikoL1Client *TaikoL1ClientTransactorSession) VerifyBlocks(maxBlocks uint64) (*types.Transaction, error) { - return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocks) +// Solidity: function verifyBlocks(uint64 maxBlocksToVerify) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) VerifyBlocks(maxBlocksToVerify uint64) (*types.Transaction, error) { + return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocksToVerify) } // WithdrawTaikoToken is a paid mutator transaction binding the contract method 0x5043f059. From 6ff40bb95a9a050f2c0d4915e7b7c96d97f4cc32 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 21:42:01 +0800 Subject: [PATCH 45/63] feat(prover): introduce `evidence.Assembler` --- prover/proof_producer/dummy_producer.go | 1 + prover/proof_submitter/evidence/assembler.go | 98 +++++++++++ prover/proof_submitter/proof_submitter.go | 101 ++--------- .../proof_submitter/proof_submitter_test.go | 1 + .../proof_submitter/{util.go => tx_sender.go} | 161 ++++++++++-------- .../{util_test.go => tx_sender_test.go} | 37 ++-- prover/prover_test.go | 2 + 7 files changed, 219 insertions(+), 182 deletions(-) create mode 100644 prover/proof_submitter/evidence/assembler.go rename prover/proof_submitter/{util.go => tx_sender.go} (62%) rename prover/proof_submitter/{util_test.go => tx_sender_test.go} (76%) diff --git a/prover/proof_producer/dummy_producer.go b/prover/proof_producer/dummy_producer.go index 59de6be52..4a33d3a0c 100644 --- a/prover/proof_producer/dummy_producer.go +++ b/prover/proof_producer/dummy_producer.go @@ -29,6 +29,7 @@ func (o *DummyProofProducer) RequestProof( Proof: bytes.Repeat([]byte{0xff}, 100), Degree: CircuitsIdx, Opts: opts, + Tier: tier, } return nil diff --git a/prover/proof_submitter/evidence/assembler.go b/prover/proof_submitter/evidence/assembler.go new file mode 100644 index 000000000..b2ee9d621 --- /dev/null +++ b/prover/proof_submitter/evidence/assembler.go @@ -0,0 +1,98 @@ +package evidence + +import ( + "context" + "encoding/binary" + "fmt" + + "github.com/ethereum/go-ethereum/log" + "github.com/taikoxyz/taiko-client/bindings/encoding" + "github.com/taikoxyz/taiko-client/pkg/rpc" + anchorTxValidator "github.com/taikoxyz/taiko-client/prover/anchor_tx_validator" + proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" +) + +// Assembler is responsible for assembling evidence for the given L2 block proof. +type Assembler struct { + rpc *rpc.Client + anchorTxValidator *anchorTxValidator.AnchorTxValidator + graffiti [32]byte +} + +// NewAssembler creates a new EvidenceAssembler instance. +func NewAssembler(cli *rpc.Client, anchorTxValidator *anchorTxValidator.AnchorTxValidator, graffiti string) *Assembler { + return &Assembler{ + rpc: cli, + anchorTxValidator: anchorTxValidator, + graffiti: rpc.StringToBytes32(graffiti), + } +} + +// assembleEvidence assembles the evidence for the given L2 block proof. +func (a *Assembler) AssembleEvidence( + ctx context.Context, + proofWithHeader *proofProducer.ProofWithHeader, +) (*encoding.BlockEvidence, error) { + var ( + blockID = proofWithHeader.BlockID + header = proofWithHeader.Header + proof = proofWithHeader.Proof + ) + + log.Info( + "Assemble new evidence", + "blockID", blockID, + "parentHash", proofWithHeader.Header.ParentHash, + "hash", proofWithHeader.Header.Hash(), + "signalRoot", proofWithHeader.Opts.SignalRoot, + "tier", proofWithHeader.Tier, + ) + + // Get the corresponding L2 block. + block, err := a.rpc.L2.BlockByHash(ctx, header.Hash()) + if err != nil { + return nil, fmt.Errorf("failed to get L2 block with given hash %s: %w", header.Hash(), err) + } + + if block.Transactions().Len() == 0 { + return nil, fmt.Errorf("invalid block without anchor transaction, blockID %s", blockID) + } + + // Validate TaikoL2.anchor transaction inside the L2 block. + anchorTx := block.Transactions()[0] + if err := a.anchorTxValidator.ValidateAnchorTx(ctx, anchorTx); err != nil { + return nil, fmt.Errorf("invalid anchor transaction: %w", err) + } + + // Get and validate this anchor transaction's receipt. + if _, err = a.anchorTxValidator.GetAndValidateAnchorTxReceipt(ctx, anchorTx); err != nil { + return nil, fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) + } + + evidence := &encoding.BlockEvidence{ + MetaHash: proofWithHeader.Opts.MetaHash, + ParentHash: proofWithHeader.Opts.ParentHash, + BlockHash: proofWithHeader.Opts.BlockHash, + SignalRoot: proofWithHeader.Opts.SignalRoot, + Graffiti: a.graffiti, + Tier: proofWithHeader.Tier, + Proof: proof, + } + + if proofWithHeader.Tier == encoding.TierPseZkevmID { + circuitsIdx, err := proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) + if err != nil { + return nil, err + } + evidence.Proof = append(uint16ToBytes(circuitsIdx), evidence.Proof...) + } + + return evidence, nil +} + +// uint16ToBytes converts an uint16 to bytes. +func uint16ToBytes(i uint16) []byte { + b := make([]byte, 2) + binary.BigEndian.PutUint16(b, i) + return b +} diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index c6cc63261..60a349803 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -3,7 +3,6 @@ package submitter import ( "context" "crypto/ecdsa" - "encoding/binary" "errors" "fmt" "math/big" @@ -21,6 +20,7 @@ import ( "github.com/taikoxyz/taiko-client/pkg/rpc" anchorTxValidator "github.com/taikoxyz/taiko-client/prover/anchor_tx_validator" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" + "github.com/taikoxyz/taiko-client/prover/proof_submitter/evidence" ) var _ Submitter = (*ProofSubmitter)(nil) @@ -31,16 +31,14 @@ type ProofSubmitter struct { rpc *rpc.Client proofProducer proofProducer.ProofProducer resultCh chan *proofProducer.ProofWithHeader - anchorTxValidator *anchorTxValidator.AnchorTxValidator + evidenceAssembler *evidence.Assembler + txSender *TxSender proverPrivKey *ecdsa.PrivateKey proverAddress common.Address taikoL2Address common.Address l1SignalService common.Address l2SignalService common.Address graffiti [32]byte - submissionMaxRetry uint64 - retryInterval time.Duration - waitReceiptTimeout time.Duration proveBlockTxGasLimit *uint64 txReplacementTipMultiplier uint64 proveBlockMaxTxGasTipCap *big.Int @@ -77,20 +75,23 @@ func New( return nil, err } + maxRetry := &submissionMaxRetry + if proofProducer.Tier() == encoding.TierGuardianID { + maxRetry = nil + } + return &ProofSubmitter{ rpc: rpcClient, proofProducer: proofProducer, resultCh: resultCh, - anchorTxValidator: anchorValidator, + evidenceAssembler: evidence.NewAssembler(rpcClient, anchorValidator, graffiti), + txSender: NewTxSender(rpcClient, retryInterval, maxRetry, waitReceiptTimeout), proverPrivKey: proverPrivKey, proverAddress: crypto.PubkeyToAddress(proverPrivKey.PublicKey), l1SignalService: l1SignalService, l2SignalService: l2SignalService, taikoL2Address: taikoL2Address, graffiti: rpc.StringToBytes32(graffiti), - submissionMaxRetry: submissionMaxRetry, - retryInterval: retryInterval, - waitReceiptTimeout: waitReceiptTimeout, proveBlockTxGasLimit: proveBlockTxGasLimit, txReplacementTipMultiplier: txReplacementTipMultiplier, proveBlockMaxTxGasTipCap: proveBlockMaxTxGasTipCap, @@ -175,63 +176,14 @@ func (s *ProofSubmitter) SubmitProof( "proposer", proofWithHeader.Meta.Coinbase, "hash", proofWithHeader.Header.Hash(), "proof", common.Bytes2Hex(proofWithHeader.Proof), - "tier", s.proofProducer.Tier(), - "graffiti", common.Bytes2Hex(s.graffiti[:]), + "tier", proofWithHeader.Tier, ) metrics.ProverReceivedProofCounter.Inc(1) - var ( - blockID = proofWithHeader.BlockID - header = proofWithHeader.Header - proof = proofWithHeader.Proof - ) - - // Get the corresponding L2 block. - block, err := s.rpc.L2.BlockByHash(ctx, header.Hash()) + evidence, err := s.evidenceAssembler.AssembleEvidence(ctx, proofWithHeader) if err != nil { - return fmt.Errorf("failed to get L2 block with given hash %s: %w", header.Hash(), err) - } - - log.Debug( - "L2 block to prove", - "blockID", blockID, - "hash", block.Hash(), - "root", header.Root.String(), - "transactions", len(block.Transactions()), - ) - - if block.Transactions().Len() == 0 { - return fmt.Errorf("invalid block without anchor transaction, blockID %s", blockID) - } - - // Validate TaikoL2.anchor transaction inside the L2 block. - anchorTx := block.Transactions()[0] - if err := s.anchorTxValidator.ValidateAnchorTx(ctx, anchorTx); err != nil { - return fmt.Errorf("invalid anchor transaction: %w", err) - } - - // Get and validate this anchor transaction's receipt. - if _, err = s.anchorTxValidator.GetAndValidateAnchorTxReceipt(ctx, anchorTx); err != nil { - return fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) - } - - evidence := &encoding.BlockEvidence{ - MetaHash: proofWithHeader.Opts.MetaHash, - ParentHash: proofWithHeader.Opts.ParentHash, - BlockHash: proofWithHeader.Opts.BlockHash, - SignalRoot: proofWithHeader.Opts.SignalRoot, - Graffiti: s.graffiti, - Tier: s.proofProducer.Tier(), - Proof: proof, - } - - if s.proofProducer.Tier() == encoding.TierPseZkevmID { - circuitsIdx, err := proofProducer.DegreeToCircuitsIdx(proofWithHeader.Degree) - if err != nil { - return err - } - evidence.Proof = append(uint16ToBytes(circuitsIdx), evidence.Proof...) + return fmt.Errorf("failed to assemble evidence: %w", err) } input, err := encoding.EncodeEvidence(evidence) @@ -268,26 +220,10 @@ func (s *ProofSubmitter) SubmitProof( } } - return s.rpc.TaikoL1.ProveBlock(txOpts, blockID.Uint64(), input) + return s.rpc.TaikoL1.ProveBlock(txOpts, proofWithHeader.BlockID.Uint64(), input) } - maxRetry := &s.submissionMaxRetry - if s.proofProducer.Tier() == encoding.TierGuardianID { - maxRetry = nil - } - - if err := sendTxWithBackoff( - ctx, - s.rpc, - blockID, - proofWithHeader.Opts.EventL1Hash, - block.Header().Time, - proofWithHeader.Meta, - sendTx, - s.retryInterval, - maxRetry, - s.waitReceiptTimeout, - ); err != nil { + if err := s.txSender.Send(ctx, proofWithHeader, sendTx); err != nil { if errors.Is(err, errUnretryable) { return nil } @@ -310,10 +246,3 @@ func (s *ProofSubmitter) Producer() proofProducer.ProofProducer { func (s *ProofSubmitter) Tier() uint16 { return s.proofProducer.Tier() } - -// uint16ToBytes converts an uint16 to bytes. -func uint16ToBytes(i uint16) []byte { - b := make([]byte, 2) - binary.BigEndian.PutUint16(b, i) - return b -} diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index 7bac151b3..ec35ae5e9 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -112,6 +112,7 @@ func (s *ProofSubmitterTestSuite) TestProofSubmitterSubmitProofMetadataNotFound( BlockID: common.Big256, Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, + Opts: &proofProducer.ProofRequestOptions{}, Proof: bytes.Repeat([]byte{0xff}, 100), }, ), diff --git a/prover/proof_submitter/util.go b/prover/proof_submitter/tx_sender.go similarity index 62% rename from prover/proof_submitter/util.go rename to prover/proof_submitter/tx_sender.go index 8f08c58b5..40f8d6be5 100644 --- a/prover/proof_submitter/util.go +++ b/prover/proof_submitter/tx_sender.go @@ -11,132 +11,112 @@ import ( "github.com/cenkalti/backoff/v4" "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "github.com/taikoxyz/taiko-client/bindings" "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/pkg/rpc" + proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" ) var ( errUnretryable = errors.New("unretryable") ) -// isSubmitProofTxErrorRetryable checks whether the error returned by a proof submission transaction -// is retryable. -func isSubmitProofTxErrorRetryable(err error, blockID *big.Int) bool { - if !strings.HasPrefix(err.Error(), "L1_") { - return true - } +type TxAssembler func(*big.Int) (*types.Transaction, error) - log.Warn("🤷 Unretryable proof submission error", "error", err, "blockID", blockID) - return false +// TxSender is responsible for sending proof submission transactions with a backoff policy. +type TxSender struct { + rpc *rpc.Client + backOffPolicy backoff.BackOff + maxRetry *uint64 + waitReceiptTimeout time.Duration } -// getProveBlocksTxOpts creates a bind.TransactOpts instance using the given private key. -// Used for creating TaikoL1.proveBlock and TaikoL1.proveBlockInvalid transactions. -func getProveBlocksTxOpts( - ctx context.Context, - cli *rpc.EthClient, - chainID *big.Int, - proverPrivKey *ecdsa.PrivateKey, -) (*bind.TransactOpts, error) { - opts, err := bind.NewKeyedTransactorWithChainID(proverPrivKey, chainID) - if err != nil { - return nil, err - } - gasTipCap, err := cli.SuggestGasTipCap(ctx) - if err != nil { - if rpc.IsMaxPriorityFeePerGasNotFoundError(err) { - gasTipCap = rpc.FallbackGasTipCap - } else { - return nil, err - } +// NewTxSender creates a new TxSender instance. +func NewTxSender( + cli *rpc.Client, + retryInterval time.Duration, + maxRetry *uint64, + waitReceiptTimeout time.Duration, +) *TxSender { + var backOffPolicy backoff.BackOff = backoff.NewConstantBackOff(retryInterval) + if maxRetry != nil { + backOffPolicy = backoff.WithMaxRetries(backOffPolicy, *maxRetry) } - opts.GasTipCap = gasTipCap - - return opts, nil + return &TxSender{ + rpc: cli, + backOffPolicy: backOffPolicy, + maxRetry: maxRetry, + waitReceiptTimeout: waitReceiptTimeout, + } } -// sendTxWithBackoff tries to send the given proof submission transaction with a backoff policy. -func sendTxWithBackoff( +// Send sends the given proof to the TaikoL1 smart contract with a backoff policy. +func (s *TxSender) Send( ctx context.Context, - cli *rpc.Client, - blockID *big.Int, - eventL1Hash common.Hash, - proposedAt uint64, - meta *bindings.TaikoDataBlockMetadata, - sendTxFunc func(*big.Int) (*types.Transaction, error), - retryInterval time.Duration, - maxRetry *uint64, - waitReceiptTimeout time.Duration, + proofWithHeader *proofProducer.ProofWithHeader, + txAssembler TxAssembler, ) error { var ( isUnretryableError bool nonce *big.Int - backOffPolicy backoff.BackOff = backoff.NewConstantBackOff(retryInterval) ) - if maxRetry != nil { - backOffPolicy = backoff.WithMaxRetries(backOffPolicy, *maxRetry) - } - if err := backoff.Retry(func() error { if ctx.Err() != nil { return nil } // Check if the corresponding L1 block is still in the canonical chain. - l1Header, err := cli.L1.HeaderByNumber(ctx, new(big.Int).SetUint64(meta.L1Height+1)) + l1Header, err := s.rpc.L1.HeaderByNumber(ctx, new(big.Int).SetUint64(proofWithHeader.Meta.L1Height+1)) if err != nil { log.Warn( "Failed to fetch L1 block", - "blockID", blockID, - "l1Height", meta.L1Height+1, + "blockID", proofWithHeader.BlockID, + "l1Height", proofWithHeader.Meta.L1Height+1, "error", err, ) return err } - if l1Header.Hash() != eventL1Hash { + if l1Header.Hash() != proofWithHeader.Opts.EventL1Hash { log.Warn( "Reorg detected, skip the current proof submission", - "blockID", blockID, - "l1Height", meta.L1Height+1, - "l1HashOld", eventL1Hash, + "blockID", proofWithHeader.BlockID, + "l1Height", proofWithHeader.Meta.L1Height+1, + "l1HashOld", proofWithHeader.Opts.EventL1Hash, "l1HashNew", l1Header.Hash(), ) return nil } // check if latest verified head is ahead of this block proof - stateVars, err := cli.GetProtocolStateVariables(&bind.CallOpts{Context: ctx}) + stateVars, err := s.rpc.GetProtocolStateVariables(&bind.CallOpts{Context: ctx}) if err != nil { log.Warn( "Failed to fetch state variables", - "blockID", blockID, + "blockID", proofWithHeader.BlockID, "error", err, ) return err } latestVerifiedId := stateVars.LastVerifiedBlockId - if new(big.Int).SetUint64(latestVerifiedId).Cmp(blockID) >= 0 { - log.Warn( + if new(big.Int).SetUint64(latestVerifiedId).Cmp(proofWithHeader.BlockID) >= 0 { + log.Info( "Block is already verified, skip current proof submission", - "blockID", blockID.Uint64(), + "blockID", proofWithHeader.BlockID.Uint64(), "latestVerifiedId", latestVerifiedId, ) return nil } - tx, err := sendTxFunc(nonce) + tx, err := txAssembler(nonce) if err != nil { err = encoding.TryParsingCustomError(err) - if isSubmitProofTxErrorRetryable(err, blockID) { - log.Info("Retry sending TaikoL1.proveBlock transaction", "blockID", blockID, "reason", err) + if isSubmitProofTxErrorRetryable(err, proofWithHeader.BlockID) { + log.Info("Retry sending TaikoL1.proveBlock transaction", "blockID", proofWithHeader.BlockID, "reason", err) if strings.Contains(err.Error(), core.ErrNonceTooLow.Error()) { nonce = nil } @@ -148,16 +128,14 @@ func sendTxWithBackoff( return nil } - nonce = new(big.Int).SetUint64(tx.Nonce()) - ctxWithTimeout, cancel := context.WithTimeout(ctx, waitReceiptTimeout) + ctxWithTimeout, cancel := context.WithTimeout(ctx, s.waitReceiptTimeout) defer cancel() - if _, err := rpc.WaitReceipt(ctxWithTimeout, cli.L1, tx); err != nil { + if _, err := rpc.WaitReceipt(ctxWithTimeout, s.rpc.L1, tx); err != nil { log.Warn( "Failed to wait till transaction executed", - "blockID", blockID, + "blockID", proofWithHeader.BlockID, "txHash", tx.Hash(), - "nonce", nonce, "error", err, ) return err @@ -165,16 +143,14 @@ func sendTxWithBackoff( log.Info( "💰 Your block proof was accepted", - "blockID", blockID, + "blockID", proofWithHeader.BlockID, "txHash", tx.Hash(), - "nonce", nonce, - "proposedAt", proposedAt, ) return nil - }, backOffPolicy); err != nil { - if maxRetry != nil { - log.Error("Failed to send TaikoL1.proveBlock transaction", "error", err, "maxRetry", *maxRetry) + }, s.backOffPolicy); err != nil { + if s.maxRetry != nil { + log.Error("Failed to send TaikoL1.proveBlock transaction", "error", err, "maxRetry", *s.maxRetry) return errUnretryable } return fmt.Errorf("failed to send TaikoL1.proveBlock transaction: %w", err) @@ -186,3 +162,40 @@ func sendTxWithBackoff( return nil } + +// isSubmitProofTxErrorRetryable checks whether the error returned by a proof submission transaction +// is retryable. +func isSubmitProofTxErrorRetryable(err error, blockID *big.Int) bool { + if !strings.HasPrefix(err.Error(), "L1_") { + return true + } + + log.Warn("🤷 Unretryable proof submission error", "error", err, "blockID", blockID) + return false +} + +// getProveBlocksTxOpts creates a bind.TransactOpts instance using the given private key. +// Used for creating TaikoL1.proveBlock and TaikoL1.proveBlockInvalid transactions. +func getProveBlocksTxOpts( + ctx context.Context, + cli *rpc.EthClient, + chainID *big.Int, + proverPrivKey *ecdsa.PrivateKey, +) (*bind.TransactOpts, error) { + opts, err := bind.NewKeyedTransactorWithChainID(proverPrivKey, chainID) + if err != nil { + return nil, err + } + gasTipCap, err := cli.SuggestGasTipCap(ctx) + if err != nil { + if rpc.IsMaxPriorityFeePerGasNotFoundError(err) { + gasTipCap = rpc.FallbackGasTipCap + } else { + return nil, err + } + } + + opts.GasTipCap = gasTipCap + + return opts, nil +} diff --git a/prover/proof_submitter/util_test.go b/prover/proof_submitter/tx_sender_test.go similarity index 76% rename from prover/proof_submitter/util_test.go rename to prover/proof_submitter/tx_sender_test.go index 116a039a1..4f283864e 100644 --- a/prover/proof_submitter/util_test.go +++ b/prover/proof_submitter/tx_sender_test.go @@ -4,18 +4,17 @@ import ( "context" "errors" "math/big" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/taikoxyz/taiko-client/bindings" + proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" ) var ( - testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") - testAddr = crypto.PubkeyToAddress(testKey.PublicKey) - testMaxRetry uint64 = 1 + testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") + testAddr = crypto.PubkeyToAddress(testKey.PublicKey) ) func (s *ProofSubmitterTestSuite) TestIsSubmitProofTxErrorRetryable() { @@ -41,26 +40,23 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { l1HeadChild, err := s.RpcClient.L1.HeaderByNumber(context.Background(), new(big.Int).Sub(l1Head.Number, common.Big1)) s.Nil(err) meta := &bindings.TaikoDataBlockMetadata{L1Height: l1HeadChild.Number.Uint64(), L1Hash: l1HeadChild.Hash()} - s.NotNil(sendTxWithBackoff( + s.NotNil(s.proofSubmitter.txSender.Send( context.Background(), - s.RpcClient, - common.Big1, - l1Head.Hash(), - 0, - meta, + &proofProducer.ProofWithHeader{ + Meta: meta, + BlockID: common.Big1, + Opts: &proofProducer.ProofRequestOptions{EventL1Hash: l1Head.Hash()}, + }, func(nonce *big.Int) (*types.Transaction, error) { return nil, errors.New("L1_TEST") }, - 12*time.Second, - &testMaxRetry, - 5*time.Second, )) - s.Nil(sendTxWithBackoff( + s.Nil(s.proofSubmitter.txSender.Send( context.Background(), - s.RpcClient, - common.Big1, - l1Head.Hash(), - 0, - meta, + &proofProducer.ProofWithHeader{ + Meta: meta, + BlockID: common.Big1, + Opts: &proofProducer.ProofRequestOptions{EventL1Hash: l1Head.Hash()}, + }, func(nonce *big.Int) (*types.Transaction, error) { height, err := s.RpcClient.L1.BlockNumber(context.Background()) s.Nil(err) @@ -77,8 +73,5 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { return block.Transactions()[0], nil }, - 12*time.Second, - &testMaxRetry, - 5*time.Second, )) } diff --git a/prover/prover_test.go b/prover/prover_test.go index 512ef3d98..5779699bc 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -182,6 +182,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { Header: &types.Header{}, Proof: []byte{}, Tier: encoding.TierOptimisticID, + Opts: &producer.ProofRequestOptions{}, }) }) s.NotPanics(func() { @@ -191,6 +192,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { Header: &types.Header{}, Proof: []byte{}, Tier: encoding.TierOptimisticID, + Opts: &producer.ProofRequestOptions{}, }) }) } From b34d353877cca06645c496a5cf2398d5305bb6c0 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 22:46:10 +0800 Subject: [PATCH 46/63] feat(bindings): update bindings --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 33 +++++++++++++++- prover/proof_submitter/proof_contester.go | 4 ++ prover/proof_submitter/proof_submitter.go | 33 ++++++++++++++-- .../proof_submitter/proof_submitter_test.go | 10 +++++ .../{ => transaction}/tx_sender.go | 35 ++--------------- .../{ => transaction}/tx_sender_test.go | 38 +++++++++++-------- 7 files changed, 104 insertions(+), 51 deletions(-) create mode 100644 prover/proof_submitter/proof_contester.go rename prover/proof_submitter/{ => transaction}/tx_sender.go (84%) rename prover/proof_submitter/{ => transaction}/tx_sender_test.go (75%) diff --git a/bindings/.githead b/bindings/.githead index b0c59dd3c..6fda9247f 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -49efd75726c21df8ba84a28b32322ee2164faa68 +2bcf2bf4b43456484ac3974d7360e5007accd741 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index f2d7293ca..0a313d77a 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -144,7 +144,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardPerL1Block\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"proposerRewardPoolPctg\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardPerL1Block\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"proposerRewardPoolPctg\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConfigValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -665,6 +665,37 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetTransition(blockId uint64, return _TaikoL1Client.Contract.GetTransition(&_TaikoL1Client.CallOpts, blockId, parentHash) } +// IsConfigValid is a free data retrieval call binding the contract method 0xe3f1bdc5. +// +// Solidity: function isConfigValid() pure returns(bool) +func (_TaikoL1Client *TaikoL1ClientCaller) IsConfigValid(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _TaikoL1Client.contract.Call(opts, &out, "isConfigValid") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsConfigValid is a free data retrieval call binding the contract method 0xe3f1bdc5. +// +// Solidity: function isConfigValid() pure returns(bool) +func (_TaikoL1Client *TaikoL1ClientSession) IsConfigValid() (bool, error) { + return _TaikoL1Client.Contract.IsConfigValid(&_TaikoL1Client.CallOpts) +} + +// IsConfigValid is a free data retrieval call binding the contract method 0xe3f1bdc5. +// +// Solidity: function isConfigValid() pure returns(bool) +func (_TaikoL1Client *TaikoL1ClientCallerSession) IsConfigValid() (bool, error) { + return _TaikoL1Client.Contract.IsConfigValid(&_TaikoL1Client.CallOpts) +} + // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) diff --git a/prover/proof_submitter/proof_contester.go b/prover/proof_submitter/proof_contester.go new file mode 100644 index 000000000..7f9be81bd --- /dev/null +++ b/prover/proof_submitter/proof_contester.go @@ -0,0 +1,4 @@ +package submitter + +type ProofContester struct { +} diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index 60a349803..c6a215dcc 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -21,6 +21,7 @@ import ( anchorTxValidator "github.com/taikoxyz/taiko-client/prover/anchor_tx_validator" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" "github.com/taikoxyz/taiko-client/prover/proof_submitter/evidence" + "github.com/taikoxyz/taiko-client/prover/proof_submitter/transaction" ) var _ Submitter = (*ProofSubmitter)(nil) @@ -32,7 +33,7 @@ type ProofSubmitter struct { proofProducer proofProducer.ProofProducer resultCh chan *proofProducer.ProofWithHeader evidenceAssembler *evidence.Assembler - txSender *TxSender + txSender *transaction.TxSender proverPrivKey *ecdsa.PrivateKey proverAddress common.Address taikoL2Address common.Address @@ -85,7 +86,7 @@ func New( proofProducer: proofProducer, resultCh: resultCh, evidenceAssembler: evidence.NewAssembler(rpcClient, anchorValidator, graffiti), - txSender: NewTxSender(rpcClient, retryInterval, maxRetry, waitReceiptTimeout), + txSender: transaction.NewTxSender(rpcClient, retryInterval, maxRetry, waitReceiptTimeout), proverPrivKey: proverPrivKey, proverAddress: crypto.PubkeyToAddress(proverPrivKey.PublicKey), l1SignalService: l1SignalService, @@ -224,7 +225,7 @@ func (s *ProofSubmitter) SubmitProof( } if err := s.txSender.Send(ctx, proofWithHeader, sendTx); err != nil { - if errors.Is(err, errUnretryable) { + if errors.Is(err, transaction.ErrUnretryable) { return nil } @@ -237,6 +238,32 @@ func (s *ProofSubmitter) SubmitProof( return nil } +// getProveBlocksTxOpts creates a bind.TransactOpts instance using the given private key. +// Used for creating TaikoL1.proveBlock and TaikoL1.proveBlockInvalid transactions. +func getProveBlocksTxOpts( + ctx context.Context, + cli *rpc.EthClient, + chainID *big.Int, + proverPrivKey *ecdsa.PrivateKey, +) (*bind.TransactOpts, error) { + opts, err := bind.NewKeyedTransactorWithChainID(proverPrivKey, chainID) + if err != nil { + return nil, err + } + gasTipCap, err := cli.SuggestGasTipCap(ctx) + if err != nil { + if rpc.IsMaxPriorityFeePerGasNotFoundError(err) { + gasTipCap = rpc.FallbackGasTipCap + } else { + return nil, err + } + } + + opts.GasTipCap = gasTipCap + + return opts, nil +} + // Producer returns the inner proof producer. func (s *ProofSubmitter) Producer() proofProducer.ProofProducer { return s.proofProducer diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index ec35ae5e9..a71fcf7bc 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -139,6 +139,16 @@ func (s *ProofSubmitterTestSuite) TestProofSubmitterRequestProofCancelled() { ) } +func (s *ProofSubmitterTestSuite) TestGetProveBlocksTxOpts() { + optsL1, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L1, s.RpcClient.L1ChainID, s.TestAddrPrivKey) + s.Nil(err) + s.Greater(optsL1.GasTipCap.Uint64(), uint64(0)) + + optsL2, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L2, s.RpcClient.L2ChainID, s.TestAddrPrivKey) + s.Nil(err) + s.Greater(optsL2.GasTipCap.Uint64(), uint64(0)) +} + func TestProofSubmitterTestSuite(t *testing.T) { suite.Run(t, new(ProofSubmitterTestSuite)) } diff --git a/prover/proof_submitter/tx_sender.go b/prover/proof_submitter/transaction/tx_sender.go similarity index 84% rename from prover/proof_submitter/tx_sender.go rename to prover/proof_submitter/transaction/tx_sender.go index 40f8d6be5..99eac9e9b 100644 --- a/prover/proof_submitter/tx_sender.go +++ b/prover/proof_submitter/transaction/tx_sender.go @@ -1,8 +1,7 @@ -package submitter +package transaction import ( "context" - "crypto/ecdsa" "errors" "fmt" "math/big" @@ -20,7 +19,7 @@ import ( ) var ( - errUnretryable = errors.New("unretryable") + ErrUnretryable = errors.New("unretryable") ) type TxAssembler func(*big.Int) (*types.Transaction, error) @@ -151,13 +150,13 @@ func (s *TxSender) Send( }, s.backOffPolicy); err != nil { if s.maxRetry != nil { log.Error("Failed to send TaikoL1.proveBlock transaction", "error", err, "maxRetry", *s.maxRetry) - return errUnretryable + return ErrUnretryable } return fmt.Errorf("failed to send TaikoL1.proveBlock transaction: %w", err) } if isUnretryableError { - return errUnretryable + return ErrUnretryable } return nil @@ -173,29 +172,3 @@ func isSubmitProofTxErrorRetryable(err error, blockID *big.Int) bool { log.Warn("🤷 Unretryable proof submission error", "error", err, "blockID", blockID) return false } - -// getProveBlocksTxOpts creates a bind.TransactOpts instance using the given private key. -// Used for creating TaikoL1.proveBlock and TaikoL1.proveBlockInvalid transactions. -func getProveBlocksTxOpts( - ctx context.Context, - cli *rpc.EthClient, - chainID *big.Int, - proverPrivKey *ecdsa.PrivateKey, -) (*bind.TransactOpts, error) { - opts, err := bind.NewKeyedTransactorWithChainID(proverPrivKey, chainID) - if err != nil { - return nil, err - } - gasTipCap, err := cli.SuggestGasTipCap(ctx) - if err != nil { - if rpc.IsMaxPriorityFeePerGasNotFoundError(err) { - gasTipCap = rpc.FallbackGasTipCap - } else { - return nil, err - } - } - - opts.GasTipCap = gasTipCap - - return opts, nil -} diff --git a/prover/proof_submitter/tx_sender_test.go b/prover/proof_submitter/transaction/tx_sender_test.go similarity index 75% rename from prover/proof_submitter/tx_sender_test.go rename to prover/proof_submitter/transaction/tx_sender_test.go index 4f283864e..4dce45670 100644 --- a/prover/proof_submitter/tx_sender_test.go +++ b/prover/proof_submitter/transaction/tx_sender_test.go @@ -1,15 +1,19 @@ -package submitter +package transaction import ( "context" "errors" "math/big" + "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/suite" "github.com/taikoxyz/taiko-client/bindings" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" + "github.com/taikoxyz/taiko-client/testutils" ) var ( @@ -17,30 +21,30 @@ var ( testAddr = crypto.PubkeyToAddress(testKey.PublicKey) ) -func (s *ProofSubmitterTestSuite) TestIsSubmitProofTxErrorRetryable() { +type TxSenderTestSuite struct { + testutils.ClientTestSuite + sender *TxSender +} + +func (s *TxSenderTestSuite) SetupTest() { + s.ClientTestSuite.SetupTest() + s.sender = NewTxSender(s.RpcClient, 5*time.Second, nil, 1*time.Minute) +} + +func (s *TxSenderTestSuite) TestIsSubmitProofTxErrorRetryable() { s.True(isSubmitProofTxErrorRetryable(errors.New(testAddr.String()), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_SPECIAL_PROVER"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_DUP_PROVERS"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_"+testAddr.String()), common.Big0)) } -func (s *ProofSubmitterTestSuite) TestGetProveBlocksTxOpts() { - optsL1, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L1, s.RpcClient.L1ChainID, s.TestAddrPrivKey) - s.Nil(err) - s.Greater(optsL1.GasTipCap.Uint64(), uint64(0)) - - optsL2, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L2, s.RpcClient.L2ChainID, s.TestAddrPrivKey) - s.Nil(err) - s.Greater(optsL2.GasTipCap.Uint64(), uint64(0)) -} - -func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { +func (s *TxSenderTestSuite) TestSendTxWithBackoff() { l1Head, err := s.RpcClient.L1.HeaderByNumber(context.Background(), nil) s.Nil(err) l1HeadChild, err := s.RpcClient.L1.HeaderByNumber(context.Background(), new(big.Int).Sub(l1Head.Number, common.Big1)) s.Nil(err) meta := &bindings.TaikoDataBlockMetadata{L1Height: l1HeadChild.Number.Uint64(), L1Hash: l1HeadChild.Hash()} - s.NotNil(s.proofSubmitter.txSender.Send( + s.NotNil(s.sender.Send( context.Background(), &proofProducer.ProofWithHeader{ Meta: meta, @@ -50,7 +54,7 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { func(nonce *big.Int) (*types.Transaction, error) { return nil, errors.New("L1_TEST") }, )) - s.Nil(s.proofSubmitter.txSender.Send( + s.Nil(s.sender.Send( context.Background(), &proofProducer.ProofWithHeader{ Meta: meta, @@ -75,3 +79,7 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { }, )) } + +func TestTxSenderTestSuite(t *testing.T) { + suite.Run(t, new(TxSenderTestSuite)) +} From e34bde93afe840a0fb055310562840af4b856c5e Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Oct 2023 23:37:44 +0800 Subject: [PATCH 47/63] feat(prover): introduce `txBuild` && `txSender` --- .../evidence/{assembler.go => builder.go} | 16 +-- prover/proof_submitter/proof_contester.go | 4 - prover/proof_submitter/proof_submitter.go | 133 +++++------------- .../proof_submitter/proof_submitter_test.go | 10 -- prover/proof_submitter/transaction/builder.go | 107 ++++++++++++++ .../transaction/builder_test.go | 15 ++ .../transaction/{tx_sender.go => sender.go} | 114 ++++++++------- .../{tx_sender_test.go => sender_test.go} | 14 +- 8 files changed, 241 insertions(+), 172 deletions(-) rename prover/proof_submitter/evidence/{assembler.go => builder.go} (85%) delete mode 100644 prover/proof_submitter/proof_contester.go create mode 100644 prover/proof_submitter/transaction/builder.go create mode 100644 prover/proof_submitter/transaction/builder_test.go rename prover/proof_submitter/transaction/{tx_sender.go => sender.go} (56%) rename prover/proof_submitter/transaction/{tx_sender_test.go => sender_test.go} (87%) diff --git a/prover/proof_submitter/evidence/assembler.go b/prover/proof_submitter/evidence/builder.go similarity index 85% rename from prover/proof_submitter/evidence/assembler.go rename to prover/proof_submitter/evidence/builder.go index b2ee9d621..297f90ebd 100644 --- a/prover/proof_submitter/evidence/assembler.go +++ b/prover/proof_submitter/evidence/builder.go @@ -12,24 +12,24 @@ import ( proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" ) -// Assembler is responsible for assembling evidence for the given L2 block proof. -type Assembler struct { +// Builder is responsible for building evidence for the given L2 block proof. +type Builder struct { rpc *rpc.Client anchorTxValidator *anchorTxValidator.AnchorTxValidator graffiti [32]byte } -// NewAssembler creates a new EvidenceAssembler instance. -func NewAssembler(cli *rpc.Client, anchorTxValidator *anchorTxValidator.AnchorTxValidator, graffiti string) *Assembler { - return &Assembler{ +// NewBuilder creates a new Builder instance. +func NewBuilder(cli *rpc.Client, anchorTxValidator *anchorTxValidator.AnchorTxValidator, graffiti string) *Builder { + return &Builder{ rpc: cli, anchorTxValidator: anchorTxValidator, graffiti: rpc.StringToBytes32(graffiti), } } -// assembleEvidence assembles the evidence for the given L2 block proof. -func (a *Assembler) AssembleEvidence( +// Build creates the evidence for the given L2 block proof. +func (a *Builder) Build( ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader, ) (*encoding.BlockEvidence, error) { @@ -40,7 +40,7 @@ func (a *Assembler) AssembleEvidence( ) log.Info( - "Assemble new evidence", + "Create new evidence", "blockID", blockID, "parentHash", proofWithHeader.Header.ParentHash, "hash", proofWithHeader.Header.Hash(), diff --git a/prover/proof_submitter/proof_contester.go b/prover/proof_submitter/proof_contester.go deleted file mode 100644 index 7f9be81bd..000000000 --- a/prover/proof_submitter/proof_contester.go +++ /dev/null @@ -1,4 +0,0 @@ -package submitter - -type ProofContester struct { -} diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index c6a215dcc..b9036f49f 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -6,12 +6,10 @@ import ( "errors" "fmt" "math/big" - "sync" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" @@ -29,21 +27,17 @@ var _ Submitter = (*ProofSubmitter)(nil) // ProofSubmitter is responsible requesting proofs for the given L2 // blocks, and submitting the generated proofs to the TaikoL1 smart contract. type ProofSubmitter struct { - rpc *rpc.Client - proofProducer proofProducer.ProofProducer - resultCh chan *proofProducer.ProofWithHeader - evidenceAssembler *evidence.Assembler - txSender *transaction.TxSender - proverPrivKey *ecdsa.PrivateKey - proverAddress common.Address - taikoL2Address common.Address - l1SignalService common.Address - l2SignalService common.Address - graffiti [32]byte - proveBlockTxGasLimit *uint64 - txReplacementTipMultiplier uint64 - proveBlockMaxTxGasTipCap *big.Int - mutex *sync.Mutex + rpc *rpc.Client + proofProducer proofProducer.ProofProducer + resultCh chan *proofProducer.ProofWithHeader + evidenceBuilder *evidence.Builder + txBuilder *transaction.ProveBlockTxBuilder + txSender *transaction.Sender + proverAddress common.Address + taikoL2Address common.Address + l1SignalService common.Address + l2SignalService common.Address + graffiti [32]byte } // New creates a new ProofSubmitter instance. @@ -76,27 +70,35 @@ func New( return nil, err } - maxRetry := &submissionMaxRetry + var ( + maxRetry = &submissionMaxRetry + txGasLimit *big.Int + ) if proofProducer.Tier() == encoding.TierGuardianID { maxRetry = nil } + if proveBlockTxGasLimit != nil { + txGasLimit = new(big.Int).SetUint64(*proveBlockTxGasLimit) + } return &ProofSubmitter{ - rpc: rpcClient, - proofProducer: proofProducer, - resultCh: resultCh, - evidenceAssembler: evidence.NewAssembler(rpcClient, anchorValidator, graffiti), - txSender: transaction.NewTxSender(rpcClient, retryInterval, maxRetry, waitReceiptTimeout), - proverPrivKey: proverPrivKey, - proverAddress: crypto.PubkeyToAddress(proverPrivKey.PublicKey), - l1SignalService: l1SignalService, - l2SignalService: l2SignalService, - taikoL2Address: taikoL2Address, - graffiti: rpc.StringToBytes32(graffiti), - proveBlockTxGasLimit: proveBlockTxGasLimit, - txReplacementTipMultiplier: txReplacementTipMultiplier, - proveBlockMaxTxGasTipCap: proveBlockMaxTxGasTipCap, - mutex: new(sync.Mutex), + rpc: rpcClient, + proofProducer: proofProducer, + resultCh: resultCh, + evidenceBuilder: evidence.NewBuilder(rpcClient, anchorValidator, graffiti), + txBuilder: transaction.NewProveBlockTxBuilder( + rpcClient, + proverPrivKey, + txGasLimit, + proveBlockMaxTxGasTipCap, + new(big.Int).SetUint64(txReplacementTipMultiplier), + ), + txSender: transaction.NewSender(rpcClient, retryInterval, maxRetry, waitReceiptTimeout), + proverAddress: crypto.PubkeyToAddress(proverPrivKey.PublicKey), + l1SignalService: l1SignalService, + l2SignalService: l2SignalService, + taikoL2Address: taikoL2Address, + graffiti: rpc.StringToBytes32(graffiti), }, nil } @@ -150,6 +152,7 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko ParentGasUsed: parent.GasUsed(), } + // Send the generated proof. if err := s.proofProducer.RequestProof( ctx, opts, @@ -182,9 +185,9 @@ func (s *ProofSubmitter) SubmitProof( metrics.ProverReceivedProofCounter.Inc(1) - evidence, err := s.evidenceAssembler.AssembleEvidence(ctx, proofWithHeader) + evidence, err := s.evidenceBuilder.Build(ctx, proofWithHeader) if err != nil { - return fmt.Errorf("failed to assemble evidence: %w", err) + return fmt.Errorf("failed to create evidence: %w", err) } input, err := encoding.EncodeEvidence(evidence) @@ -192,39 +195,7 @@ func (s *ProofSubmitter) SubmitProof( return fmt.Errorf("failed to encode TaikoL1.proveBlock inputs: %w", err) } - // Send the TaikoL1.proveBlock transaction. - sendTx := func(nonce *big.Int) (*types.Transaction, error) { - s.mutex.Lock() - defer s.mutex.Unlock() - - txOpts, err := getProveBlocksTxOpts(ctx, s.rpc.L1, s.rpc.L1ChainID, s.proverPrivKey) - if err != nil { - return nil, err - } - - if s.proveBlockTxGasLimit != nil { - txOpts.GasLimit = *s.proveBlockTxGasLimit - } - - if nonce != nil { - txOpts.Nonce = nonce - - if txOpts, err = rpc.IncreaseGasTipCap( - ctx, - s.rpc, - txOpts, - s.proverAddress, - new(big.Int).SetUint64(s.txReplacementTipMultiplier), - s.proveBlockMaxTxGasTipCap, - ); err != nil { - return nil, err - } - } - - return s.rpc.TaikoL1.ProveBlock(txOpts, proofWithHeader.BlockID.Uint64(), input) - } - - if err := s.txSender.Send(ctx, proofWithHeader, sendTx); err != nil { + if err := s.txSender.Send(ctx, proofWithHeader, s.txBuilder.Build(ctx, proofWithHeader.BlockID, input)); err != nil { if errors.Is(err, transaction.ErrUnretryable) { return nil } @@ -238,32 +209,6 @@ func (s *ProofSubmitter) SubmitProof( return nil } -// getProveBlocksTxOpts creates a bind.TransactOpts instance using the given private key. -// Used for creating TaikoL1.proveBlock and TaikoL1.proveBlockInvalid transactions. -func getProveBlocksTxOpts( - ctx context.Context, - cli *rpc.EthClient, - chainID *big.Int, - proverPrivKey *ecdsa.PrivateKey, -) (*bind.TransactOpts, error) { - opts, err := bind.NewKeyedTransactorWithChainID(proverPrivKey, chainID) - if err != nil { - return nil, err - } - gasTipCap, err := cli.SuggestGasTipCap(ctx) - if err != nil { - if rpc.IsMaxPriorityFeePerGasNotFoundError(err) { - gasTipCap = rpc.FallbackGasTipCap - } else { - return nil, err - } - } - - opts.GasTipCap = gasTipCap - - return opts, nil -} - // Producer returns the inner proof producer. func (s *ProofSubmitter) Producer() proofProducer.ProofProducer { return s.proofProducer diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index a71fcf7bc..ec35ae5e9 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -139,16 +139,6 @@ func (s *ProofSubmitterTestSuite) TestProofSubmitterRequestProofCancelled() { ) } -func (s *ProofSubmitterTestSuite) TestGetProveBlocksTxOpts() { - optsL1, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L1, s.RpcClient.L1ChainID, s.TestAddrPrivKey) - s.Nil(err) - s.Greater(optsL1.GasTipCap.Uint64(), uint64(0)) - - optsL2, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L2, s.RpcClient.L2ChainID, s.TestAddrPrivKey) - s.Nil(err) - s.Greater(optsL2.GasTipCap.Uint64(), uint64(0)) -} - func TestProofSubmitterTestSuite(t *testing.T) { suite.Run(t, new(ProofSubmitterTestSuite)) } diff --git a/prover/proof_submitter/transaction/builder.go b/prover/proof_submitter/transaction/builder.go new file mode 100644 index 000000000..da9a142b7 --- /dev/null +++ b/prover/proof_submitter/transaction/builder.go @@ -0,0 +1,107 @@ +package transaction + +import ( + "context" + "crypto/ecdsa" + "math/big" + "sync" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/taikoxyz/taiko-client/pkg/rpc" +) + +// TxBuiler will build a transaction with the given nonce. +type TxBuiler func(nonce *big.Int) (*types.Transaction, error) + +// ProveBlockTxBuilder is responsible for building ProveBlock transactions. +type ProveBlockTxBuilder struct { + rpc *rpc.Client + proverPrivateKey *ecdsa.PrivateKey + proverAddress common.Address + gasLimit *big.Int + gasTipCap *big.Int + gasTipMultiplier *big.Int + mutex *sync.Mutex +} + +// NewProveBlockTxBuilder creates a new ProveBlockTxBuilder instance. +func NewProveBlockTxBuilder( + rpc *rpc.Client, + proverPrivateKey *ecdsa.PrivateKey, + gasLimit *big.Int, + gasTipCap *big.Int, + gasTipMultiplier *big.Int, +) *ProveBlockTxBuilder { + return &ProveBlockTxBuilder{ + rpc: rpc, + proverPrivateKey: proverPrivateKey, + proverAddress: crypto.PubkeyToAddress(proverPrivateKey.PublicKey), + gasLimit: gasLimit, + gasTipCap: gasTipCap, + gasTipMultiplier: gasTipMultiplier, + mutex: new(sync.Mutex), + } +} + +// Build creates a new ProveBlock transaction with the given nonce. +func (a *ProveBlockTxBuilder) Build(ctx context.Context, blockID *big.Int, input []byte) TxBuiler { + return func(nonce *big.Int) (*types.Transaction, error) { + a.mutex.Lock() + defer a.mutex.Unlock() + + txOpts, err := getProveBlocksTxOpts(ctx, a.rpc.L1, a.rpc.L1ChainID, a.proverPrivateKey) + if err != nil { + return nil, err + } + + if a.gasLimit != nil { + txOpts.GasLimit = a.gasLimit.Uint64() + } + + if nonce != nil { + txOpts.Nonce = nonce + + if txOpts, err = rpc.IncreaseGasTipCap( + ctx, + a.rpc, + txOpts, + a.proverAddress, + a.gasTipMultiplier, + a.gasTipCap, + ); err != nil { + return nil, err + } + } + + return a.rpc.TaikoL1.ProveBlock(txOpts, blockID.Uint64(), input) + } +} + +// getProveBlocksTxOpts creates a bind.TransactOpts instance using the given private key. +// Used for creating TaikoL1.proveBlock and TaikoL1.proveBlockInvalid transactions. +func getProveBlocksTxOpts( + ctx context.Context, + cli *rpc.EthClient, + chainID *big.Int, + proverPrivKey *ecdsa.PrivateKey, +) (*bind.TransactOpts, error) { + opts, err := bind.NewKeyedTransactorWithChainID(proverPrivKey, chainID) + if err != nil { + return nil, err + } + gasTipCap, err := cli.SuggestGasTipCap(ctx) + if err != nil { + if rpc.IsMaxPriorityFeePerGasNotFoundError(err) { + gasTipCap = rpc.FallbackGasTipCap + } else { + return nil, err + } + } + + opts.GasTipCap = gasTipCap + + return opts, nil +} diff --git a/prover/proof_submitter/transaction/builder_test.go b/prover/proof_submitter/transaction/builder_test.go new file mode 100644 index 000000000..ff35e43fa --- /dev/null +++ b/prover/proof_submitter/transaction/builder_test.go @@ -0,0 +1,15 @@ +package transaction + +import ( + "context" +) + +func (s *TransactionTestSuite) TestGetProveBlocksTxOpts() { + optsL1, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L1, s.RpcClient.L1ChainID, s.TestAddrPrivKey) + s.Nil(err) + s.Greater(optsL1.GasTipCap.Uint64(), uint64(0)) + + optsL2, err := getProveBlocksTxOpts(context.Background(), s.RpcClient.L2, s.RpcClient.L2ChainID, s.TestAddrPrivKey) + s.Nil(err) + s.Greater(optsL2.GasTipCap.Uint64(), uint64(0)) +} diff --git a/prover/proof_submitter/transaction/tx_sender.go b/prover/proof_submitter/transaction/sender.go similarity index 56% rename from prover/proof_submitter/transaction/tx_sender.go rename to prover/proof_submitter/transaction/sender.go index 99eac9e9b..dba02ad83 100644 --- a/prover/proof_submitter/transaction/tx_sender.go +++ b/prover/proof_submitter/transaction/sender.go @@ -11,7 +11,6 @@ import ( "github.com/cenkalti/backoff/v4" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/pkg/rpc" @@ -22,29 +21,28 @@ var ( ErrUnretryable = errors.New("unretryable") ) -type TxAssembler func(*big.Int) (*types.Transaction, error) - -// TxSender is responsible for sending proof submission transactions with a backoff policy. -type TxSender struct { +// Sender is responsible for sending proof submission transactions with a backoff policy, if +// the transaction should not be retried anymore, it will return an `ErrUnretryable` error. +type Sender struct { rpc *rpc.Client backOffPolicy backoff.BackOff maxRetry *uint64 waitReceiptTimeout time.Duration } -// NewTxSender creates a new TxSender instance. -func NewTxSender( +// NewSender creates a new Sener instance. +func NewSender( cli *rpc.Client, retryInterval time.Duration, maxRetry *uint64, waitReceiptTimeout time.Duration, -) *TxSender { +) *Sender { var backOffPolicy backoff.BackOff = backoff.NewConstantBackOff(retryInterval) if maxRetry != nil { backOffPolicy = backoff.WithMaxRetries(backOffPolicy, *maxRetry) } - return &TxSender{ + return &Sender{ rpc: cli, backOffPolicy: backOffPolicy, maxRetry: maxRetry, @@ -52,11 +50,12 @@ func NewTxSender( } } -// Send sends the given proof to the TaikoL1 smart contract with a backoff policy. -func (s *TxSender) Send( +// Send sends the given proof to the TaikoL1 smart contract with a backoff policy, if +// the transaction should not be retried anymore, it will return an `ErrUnretryable` error. +func (s *Sender) Send( ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader, - txAssembler TxAssembler, + txAssembler TxBuiler, ) error { var ( isUnretryableError bool @@ -68,49 +67,16 @@ func (s *TxSender) Send( return nil } - // Check if the corresponding L1 block is still in the canonical chain. - l1Header, err := s.rpc.L1.HeaderByNumber(ctx, new(big.Int).SetUint64(proofWithHeader.Meta.L1Height+1)) - if err != nil { - log.Warn( - "Failed to fetch L1 block", - "blockID", proofWithHeader.BlockID, - "l1Height", proofWithHeader.Meta.L1Height+1, - "error", err, - ) - return err - } - if l1Header.Hash() != proofWithHeader.Opts.EventL1Hash { - log.Warn( - "Reorg detected, skip the current proof submission", - "blockID", proofWithHeader.BlockID, - "l1Height", proofWithHeader.Meta.L1Height+1, - "l1HashOld", proofWithHeader.Opts.EventL1Hash, - "l1HashNew", l1Header.Hash(), - ) - return nil - } - - // check if latest verified head is ahead of this block proof - stateVars, err := s.rpc.GetProtocolStateVariables(&bind.CallOpts{Context: ctx}) + // Check if this proof is still needed to be submitted. + ok, err := s.validateProof(ctx, proofWithHeader) if err != nil { - log.Warn( - "Failed to fetch state variables", - "blockID", proofWithHeader.BlockID, - "error", err, - ) return err } - - latestVerifiedId := stateVars.LastVerifiedBlockId - if new(big.Int).SetUint64(latestVerifiedId).Cmp(proofWithHeader.BlockID) >= 0 { - log.Info( - "Block is already verified, skip current proof submission", - "blockID", proofWithHeader.BlockID.Uint64(), - "latestVerifiedId", latestVerifiedId, - ) + if !ok { return nil } + // Assemble the taikoL1.proveBlock transaction. tx, err := txAssembler(nonce) if err != nil { err = encoding.TryParsingCustomError(err) @@ -127,6 +93,7 @@ func (s *TxSender) Send( return nil } + // Wait for the transaction receipt. ctxWithTimeout, cancel := context.WithTimeout(ctx, s.waitReceiptTimeout) defer cancel() @@ -144,6 +111,7 @@ func (s *TxSender) Send( "💰 Your block proof was accepted", "blockID", proofWithHeader.BlockID, "txHash", tx.Hash(), + "tier", proofWithHeader.Tier, ) return nil @@ -162,6 +130,54 @@ func (s *TxSender) Send( return nil } +// validateProof checks if the proof's corresponding L1 block is still in the canonical chain and if the +// latest verified head is not ahead of this block proof. +func (s *Sender) validateProof(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) (bool, error) { + // 1. Check if the corresponding L1 block is still in the canonical chain. + l1Header, err := s.rpc.L1.HeaderByNumber(ctx, new(big.Int).SetUint64(proofWithHeader.Meta.L1Height+1)) + if err != nil { + log.Warn( + "Failed to fetch L1 block", + "blockID", proofWithHeader.BlockID, + "l1Height", proofWithHeader.Meta.L1Height+1, + "error", err, + ) + return false, err + } + if l1Header.Hash() != proofWithHeader.Opts.EventL1Hash { + log.Warn( + "Reorg detected, skip the current proof submission", + "blockID", proofWithHeader.BlockID, + "l1Height", proofWithHeader.Meta.L1Height+1, + "l1HashOld", proofWithHeader.Opts.EventL1Hash, + "l1HashNew", l1Header.Hash(), + ) + return false, nil + } + + // 2. Check if latest verified head is ahead of this block proof. + stateVars, err := s.rpc.GetProtocolStateVariables(&bind.CallOpts{Context: ctx}) + if err != nil { + log.Warn( + "Failed to fetch state variables", + "blockID", proofWithHeader.BlockID, + "error", err, + ) + return false, err + } + latestVerifiedId := stateVars.LastVerifiedBlockId + if new(big.Int).SetUint64(latestVerifiedId).Cmp(proofWithHeader.BlockID) >= 0 { + log.Info( + "Block is already verified, skip current proof submission", + "blockID", proofWithHeader.BlockID.Uint64(), + "latestVerifiedId", latestVerifiedId, + ) + return false, nil + } + + return true, nil +} + // isSubmitProofTxErrorRetryable checks whether the error returned by a proof submission transaction // is retryable. func isSubmitProofTxErrorRetryable(err error, blockID *big.Int) bool { diff --git a/prover/proof_submitter/transaction/tx_sender_test.go b/prover/proof_submitter/transaction/sender_test.go similarity index 87% rename from prover/proof_submitter/transaction/tx_sender_test.go rename to prover/proof_submitter/transaction/sender_test.go index 4dce45670..1ca00de66 100644 --- a/prover/proof_submitter/transaction/tx_sender_test.go +++ b/prover/proof_submitter/transaction/sender_test.go @@ -21,24 +21,24 @@ var ( testAddr = crypto.PubkeyToAddress(testKey.PublicKey) ) -type TxSenderTestSuite struct { +type TransactionTestSuite struct { testutils.ClientTestSuite - sender *TxSender + sender *Sender } -func (s *TxSenderTestSuite) SetupTest() { +func (s *TransactionTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() - s.sender = NewTxSender(s.RpcClient, 5*time.Second, nil, 1*time.Minute) + s.sender = NewSender(s.RpcClient, 5*time.Second, nil, 1*time.Minute) } -func (s *TxSenderTestSuite) TestIsSubmitProofTxErrorRetryable() { +func (s *TransactionTestSuite) TestIsSubmitProofTxErrorRetryable() { s.True(isSubmitProofTxErrorRetryable(errors.New(testAddr.String()), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_SPECIAL_PROVER"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_DUP_PROVERS"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_"+testAddr.String()), common.Big0)) } -func (s *TxSenderTestSuite) TestSendTxWithBackoff() { +func (s *TransactionTestSuite) TestSendTxWithBackoff() { l1Head, err := s.RpcClient.L1.HeaderByNumber(context.Background(), nil) s.Nil(err) l1HeadChild, err := s.RpcClient.L1.HeaderByNumber(context.Background(), new(big.Int).Sub(l1Head.Number, common.Big1)) @@ -81,5 +81,5 @@ func (s *TxSenderTestSuite) TestSendTxWithBackoff() { } func TestTxSenderTestSuite(t *testing.T) { - suite.Run(t, new(TxSenderTestSuite)) + suite.Run(t, new(TransactionTestSuite)) } From 1c56cd17458d1e1c818bafa41939fc5e8b52fc3a Mon Sep 17 00:00:00 2001 From: David Date: Wed, 11 Oct 2023 15:23:42 +0800 Subject: [PATCH 48/63] test(testutils): improve testutils --- bindings/gen_address_manager.go | 769 ++++++++++++++++++++++++++++++++ integration_test/entrypoint.sh | 2 + prover/prover.go | 74 ++- scripts/gen_bindings.sh | 4 + testutils/suite.go | 28 +- 5 files changed, 857 insertions(+), 20 deletions(-) create mode 100644 bindings/gen_address_manager.go diff --git a/bindings/gen_address_manager.go b/bindings/gen_address_manager.go new file mode 100644 index 000000000..ae7eed3df --- /dev/null +++ b/bindings/gen_address_manager.go @@ -0,0 +1,769 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// AddressManagerMetaData contains all meta data concerning the AddressManager contract. +var AddressManagerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"EOA_OWNER_NOT_ALLOWED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"domain\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"AddressSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"domain\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"domain\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// AddressManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use AddressManagerMetaData.ABI instead. +var AddressManagerABI = AddressManagerMetaData.ABI + +// AddressManager is an auto generated Go binding around an Ethereum contract. +type AddressManager struct { + AddressManagerCaller // Read-only binding to the contract + AddressManagerTransactor // Write-only binding to the contract + AddressManagerFilterer // Log filterer for contract events +} + +// AddressManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type AddressManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AddressManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type AddressManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AddressManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type AddressManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AddressManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type AddressManagerSession struct { + Contract *AddressManager // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AddressManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type AddressManagerCallerSession struct { + Contract *AddressManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// AddressManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type AddressManagerTransactorSession struct { + Contract *AddressManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AddressManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type AddressManagerRaw struct { + Contract *AddressManager // Generic contract binding to access the raw methods on +} + +// AddressManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type AddressManagerCallerRaw struct { + Contract *AddressManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// AddressManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type AddressManagerTransactorRaw struct { + Contract *AddressManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewAddressManager creates a new instance of AddressManager, bound to a specific deployed contract. +func NewAddressManager(address common.Address, backend bind.ContractBackend) (*AddressManager, error) { + contract, err := bindAddressManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &AddressManager{AddressManagerCaller: AddressManagerCaller{contract: contract}, AddressManagerTransactor: AddressManagerTransactor{contract: contract}, AddressManagerFilterer: AddressManagerFilterer{contract: contract}}, nil +} + +// NewAddressManagerCaller creates a new read-only instance of AddressManager, bound to a specific deployed contract. +func NewAddressManagerCaller(address common.Address, caller bind.ContractCaller) (*AddressManagerCaller, error) { + contract, err := bindAddressManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &AddressManagerCaller{contract: contract}, nil +} + +// NewAddressManagerTransactor creates a new write-only instance of AddressManager, bound to a specific deployed contract. +func NewAddressManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*AddressManagerTransactor, error) { + contract, err := bindAddressManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &AddressManagerTransactor{contract: contract}, nil +} + +// NewAddressManagerFilterer creates a new log filterer instance of AddressManager, bound to a specific deployed contract. +func NewAddressManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*AddressManagerFilterer, error) { + contract, err := bindAddressManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &AddressManagerFilterer{contract: contract}, nil +} + +// bindAddressManager binds a generic wrapper to an already deployed contract. +func bindAddressManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := AddressManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AddressManager *AddressManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AddressManager.Contract.AddressManagerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AddressManager *AddressManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.Contract.AddressManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AddressManager *AddressManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AddressManager.Contract.AddressManagerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AddressManager *AddressManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AddressManager.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AddressManager *AddressManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AddressManager *AddressManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AddressManager.Contract.contract.Transact(opts, method, params...) +} + +// GetAddress is a free data retrieval call binding the contract method 0x656b06a4. +// +// Solidity: function getAddress(uint256 domain, bytes32 name) view returns(address) +func (_AddressManager *AddressManagerCaller) GetAddress(opts *bind.CallOpts, domain *big.Int, name [32]byte) (common.Address, error) { + var out []interface{} + err := _AddressManager.contract.Call(opts, &out, "getAddress", domain, name) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetAddress is a free data retrieval call binding the contract method 0x656b06a4. +// +// Solidity: function getAddress(uint256 domain, bytes32 name) view returns(address) +func (_AddressManager *AddressManagerSession) GetAddress(domain *big.Int, name [32]byte) (common.Address, error) { + return _AddressManager.Contract.GetAddress(&_AddressManager.CallOpts, domain, name) +} + +// GetAddress is a free data retrieval call binding the contract method 0x656b06a4. +// +// Solidity: function getAddress(uint256 domain, bytes32 name) view returns(address) +func (_AddressManager *AddressManagerCallerSession) GetAddress(domain *big.Int, name [32]byte) (common.Address, error) { + return _AddressManager.Contract.GetAddress(&_AddressManager.CallOpts, domain, name) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AddressManager *AddressManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AddressManager.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AddressManager *AddressManagerSession) Owner() (common.Address, error) { + return _AddressManager.Contract.Owner(&_AddressManager.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AddressManager *AddressManagerCallerSession) Owner() (common.Address, error) { + return _AddressManager.Contract.Owner(&_AddressManager.CallOpts) +} + +// Init is a paid mutator transaction binding the contract method 0xe1c7392a. +// +// Solidity: function init() returns() +func (_AddressManager *AddressManagerTransactor) Init(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "init") +} + +// Init is a paid mutator transaction binding the contract method 0xe1c7392a. +// +// Solidity: function init() returns() +func (_AddressManager *AddressManagerSession) Init() (*types.Transaction, error) { + return _AddressManager.Contract.Init(&_AddressManager.TransactOpts) +} + +// Init is a paid mutator transaction binding the contract method 0xe1c7392a. +// +// Solidity: function init() returns() +func (_AddressManager *AddressManagerTransactorSession) Init() (*types.Transaction, error) { + return _AddressManager.Contract.Init(&_AddressManager.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AddressManager *AddressManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AddressManager *AddressManagerSession) RenounceOwnership() (*types.Transaction, error) { + return _AddressManager.Contract.RenounceOwnership(&_AddressManager.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AddressManager *AddressManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _AddressManager.Contract.RenounceOwnership(&_AddressManager.TransactOpts) +} + +// SetAddress is a paid mutator transaction binding the contract method 0xdecd8e39. +// +// Solidity: function setAddress(uint256 domain, bytes32 name, address newAddress) returns() +func (_AddressManager *AddressManagerTransactor) SetAddress(opts *bind.TransactOpts, domain *big.Int, name [32]byte, newAddress common.Address) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "setAddress", domain, name, newAddress) +} + +// SetAddress is a paid mutator transaction binding the contract method 0xdecd8e39. +// +// Solidity: function setAddress(uint256 domain, bytes32 name, address newAddress) returns() +func (_AddressManager *AddressManagerSession) SetAddress(domain *big.Int, name [32]byte, newAddress common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.SetAddress(&_AddressManager.TransactOpts, domain, name, newAddress) +} + +// SetAddress is a paid mutator transaction binding the contract method 0xdecd8e39. +// +// Solidity: function setAddress(uint256 domain, bytes32 name, address newAddress) returns() +func (_AddressManager *AddressManagerTransactorSession) SetAddress(domain *big.Int, name [32]byte, newAddress common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.SetAddress(&_AddressManager.TransactOpts, domain, name, newAddress) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AddressManager *AddressManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AddressManager *AddressManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.TransferOwnership(&_AddressManager.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AddressManager *AddressManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.TransferOwnership(&_AddressManager.TransactOpts, newOwner) +} + +// AddressManagerAddressSetIterator is returned from FilterAddressSet and is used to iterate over the raw logs and unpacked data for AddressSet events raised by the AddressManager contract. +type AddressManagerAddressSetIterator struct { + Event *AddressManagerAddressSet // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *AddressManagerAddressSetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(AddressManagerAddressSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(AddressManagerAddressSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *AddressManagerAddressSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AddressManagerAddressSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AddressManagerAddressSet represents a AddressSet event raised by the AddressManager contract. +type AddressManagerAddressSet struct { + Domain *big.Int + Name [32]byte + NewAddress common.Address + OldAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddressSet is a free log retrieval operation binding the contract event 0xe41a6e8584d6e19a0dfc5f9331be4ebe61b5f025d45da164c9ca6ee9b837cea9. +// +// Solidity: event AddressSet(uint256 indexed domain, bytes32 indexed name, address newAddress, address oldAddress) +func (_AddressManager *AddressManagerFilterer) FilterAddressSet(opts *bind.FilterOpts, domain []*big.Int, name [][32]byte) (*AddressManagerAddressSetIterator, error) { + + var domainRule []interface{} + for _, domainItem := range domain { + domainRule = append(domainRule, domainItem) + } + var nameRule []interface{} + for _, nameItem := range name { + nameRule = append(nameRule, nameItem) + } + + logs, sub, err := _AddressManager.contract.FilterLogs(opts, "AddressSet", domainRule, nameRule) + if err != nil { + return nil, err + } + return &AddressManagerAddressSetIterator{contract: _AddressManager.contract, event: "AddressSet", logs: logs, sub: sub}, nil +} + +// WatchAddressSet is a free log subscription operation binding the contract event 0xe41a6e8584d6e19a0dfc5f9331be4ebe61b5f025d45da164c9ca6ee9b837cea9. +// +// Solidity: event AddressSet(uint256 indexed domain, bytes32 indexed name, address newAddress, address oldAddress) +func (_AddressManager *AddressManagerFilterer) WatchAddressSet(opts *bind.WatchOpts, sink chan<- *AddressManagerAddressSet, domain []*big.Int, name [][32]byte) (event.Subscription, error) { + + var domainRule []interface{} + for _, domainItem := range domain { + domainRule = append(domainRule, domainItem) + } + var nameRule []interface{} + for _, nameItem := range name { + nameRule = append(nameRule, nameItem) + } + + logs, sub, err := _AddressManager.contract.WatchLogs(opts, "AddressSet", domainRule, nameRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(AddressManagerAddressSet) + if err := _AddressManager.contract.UnpackLog(event, "AddressSet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddressSet is a log parse operation binding the contract event 0xe41a6e8584d6e19a0dfc5f9331be4ebe61b5f025d45da164c9ca6ee9b837cea9. +// +// Solidity: event AddressSet(uint256 indexed domain, bytes32 indexed name, address newAddress, address oldAddress) +func (_AddressManager *AddressManagerFilterer) ParseAddressSet(log types.Log) (*AddressManagerAddressSet, error) { + event := new(AddressManagerAddressSet) + if err := _AddressManager.contract.UnpackLog(event, "AddressSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AddressManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the AddressManager contract. +type AddressManagerInitializedIterator struct { + Event *AddressManagerInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *AddressManagerInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(AddressManagerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(AddressManagerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *AddressManagerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AddressManagerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AddressManagerInitialized represents a Initialized event raised by the AddressManager contract. +type AddressManagerInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_AddressManager *AddressManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*AddressManagerInitializedIterator, error) { + + logs, sub, err := _AddressManager.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &AddressManagerInitializedIterator{contract: _AddressManager.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_AddressManager *AddressManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *AddressManagerInitialized) (event.Subscription, error) { + + logs, sub, err := _AddressManager.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(AddressManagerInitialized) + if err := _AddressManager.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_AddressManager *AddressManagerFilterer) ParseInitialized(log types.Log) (*AddressManagerInitialized, error) { + event := new(AddressManagerInitialized) + if err := _AddressManager.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AddressManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the AddressManager contract. +type AddressManagerOwnershipTransferredIterator struct { + Event *AddressManagerOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *AddressManagerOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(AddressManagerOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(AddressManagerOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *AddressManagerOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AddressManagerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AddressManagerOwnershipTransferred represents a OwnershipTransferred event raised by the AddressManager contract. +type AddressManagerOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_AddressManager *AddressManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AddressManagerOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _AddressManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &AddressManagerOwnershipTransferredIterator{contract: _AddressManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_AddressManager *AddressManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AddressManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _AddressManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(AddressManagerOwnershipTransferred) + if err := _AddressManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_AddressManager *AddressManagerFilterer) ParseOwnershipTransferred(log types.Log) (*AddressManagerOwnershipTransferred, error) { + event := new(AddressManagerOwnershipTransferred) + if err := _AddressManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index a63ef3e5a..fc031924e 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -29,6 +29,7 @@ DEPLOYMENT_JSON=$(cat $TAIKO_MONO_DIR/packages/protocol/deployments/deploy_l1.js TAIKO_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko' | sed 's/\"//g') L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.signal_service' | sed 's/\"//g') TAIKO_TOKEN_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko_token' | sed 's/\"//g') +ADDRESS_MANAGER_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.address_manager' | sed 's/\"//g') trap "docker compose -f $TESTNET_CONFIG down -v" EXIT INT KILL ERR @@ -48,6 +49,7 @@ if [ "$RUN_TESTS" == "true" ]; then TAIKO_L1_ADDRESS=$TAIKO_L1_CONTRACT_ADDRESS \ TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ TAIKO_TOKEN_ADDRESS=$TAIKO_TOKEN_CONTRACT_ADDRESS \ + ADDRESS_MANAGER_CONTRACT_ADDRESS=$ADDRESS_MANAGER_CONTRACT_ADDRESS \ L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$L1_SIGNAL_SERVICE_CONTRACT_ADDRESS \ L1_CONTRACT_OWNER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ L1_PROPOSER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ diff --git a/prover/prover.go b/prover/prover.go index 0844f478d..5d8f1e2a3 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -465,28 +465,54 @@ func (p *Prover) onBlockProposed( provingWindowExpired = now > provingWindowExpiresAt timeToExpire = time.Duration(provingWindowExpiresAt-now) * time.Second ) - if event.AssignedProver != p.proverAddress && !provingWindowExpired { + + if provingWindowExpired { + // If the proving window is expired, we need to check if the current prover is the assigned prover + // at first, if yes, we should skip proving this block, if no, then we check if the current prover + // wants to prove unassigned blocks. log.Info( - "Proposed block is not provable", + "Proposed block's proving window has expired", "blockID", event.BlockId, "prover", event.AssignedProver, "expiresAt", provingWindowExpiresAt, - "timeToExpire", timeToExpire, ) - - if p.cfg.ProveUnassignedBlocks { - log.Info("Add proposed block to wait for proof window expiration", "blockID", event.BlockId) - time.AfterFunc(timeToExpire, func() { p.proofWindowExpiredCh <- event }) + if event.AssignedProver == p.proverAddress { + log.Warn( + "Assigned prover is the current prover, but the proving window has expired, skip proving", + "blockID", event.BlockId, + "prover", event.AssignedProver, + "expiresAt", provingWindowExpiresAt, + ) + return nil } + if !p.cfg.ProveUnassignedBlocks { + log.Info( + "Skip proving expired blocks", + "blockID", event.BlockId, + "prover", event.AssignedProver, + "expiresAt", provingWindowExpiresAt, + ) + return nil + } + } else { + // If the proving window is not expired, we need to check if the current prover is the assigned prover, + // if no and the current prover wants to prove unassigned blocks, then we should wait for its expiration. + if event.AssignedProver != p.proverAddress { + log.Info( + "Proposed block is not provable", + "blockID", event.BlockId, + "prover", event.AssignedProver, + "expiresAt", provingWindowExpiresAt, + "timeToExpire", timeToExpire, + ) + + if p.cfg.ProveUnassignedBlocks { + log.Info("Add proposed block to wait for proof window expiration", "blockID", event.BlockId) + time.AfterFunc(timeToExpire, func() { p.proofWindowExpiredCh <- event }) + } - return nil - } - - // If set not to prove unassigned blocks, this block is still not provable - // by us even though its open proving. - if provingWindowExpired && event.AssignedProver == p.proverAddress && !p.cfg.ProveUnassignedBlocks { - log.Info("Skip proving expired blocks", "blockID", event.BlockId) - return nil + return nil + } } log.Info( @@ -512,8 +538,6 @@ func (p *Prover) onBlockProposed( return nil } - p.proposeConcurrencyGuard <- struct{}{} - newL1Current, err := p.rpc.L1.HeaderByHash(ctx, event.Raw.BlockHash) if err != nil { return err @@ -523,7 +547,21 @@ func (p *Prover) onBlockProposed( go func() { if err := backoff.Retry( - func() error { return handleBlockProposedEvent() }, + func() error { + p.proposeConcurrencyGuard <- struct{}{} + + if err := handleBlockProposedEvent(); err != nil { + log.Error( + "Failed to handle BlockProposed event", + "error", err, + "blockID", event.BlockId, + "minTier", event.MinTier, + "maxRetrys", p.cfg.BackOffMaxRetrys, + ) + return err + } + return nil + }, backoff.WithMaxRetries(backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), p.cfg.BackOffMaxRetrys), ); err != nil { log.Error("Handle new BlockProposed event error", "error", err) diff --git a/scripts/gen_bindings.sh b/scripts/gen_bindings.sh index 75bd002e4..4c9ba86ae 100755 --- a/scripts/gen_bindings.sh +++ b/scripts/gen_bindings.sh @@ -39,6 +39,10 @@ cat ${TAIKO_MONO_DIR}/packages/protocol/out/TaikoToken.sol/TaikoToken.json | jq .abi | ${ABIGEN_BIN} --abi - --type TaikoToken --pkg bindings --out $DIR/../bindings/gen_taiko_token.go +cat ${TAIKO_MONO_DIR}/packages/protocol/out/AddressManager.sol/AddressManager.json | + jq .abi | + ${ABIGEN_BIN} --abi - --type AddressManager --pkg bindings --out $DIR/../bindings/gen_address_manager.go + git -C ${TAIKO_MONO_DIR} log --format="%H" -n 1 >./bindings/.githead echo "🍻 Go contract bindings generated!" diff --git a/testutils/suite.go b/testutils/suite.go index fc9713782..49caa9857 100644 --- a/testutils/suite.go +++ b/testutils/suite.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/stretchr/testify/suite" + "github.com/taikoxyz/taiko-client/bindings" "github.com/taikoxyz/taiko-client/pkg/jwt" "github.com/taikoxyz/taiko-client/pkg/rpc" capacity "github.com/taikoxyz/taiko-client/prover/capacity_manager" @@ -26,6 +27,7 @@ type ClientTestSuite struct { TestAddrPrivKey *ecdsa.PrivateKey TestAddr common.Address ProverEndpoints []*url.URL + AddressManager *bindings.AddressManager proverServer *server.ProverServer } @@ -80,7 +82,29 @@ func (s *ClientTestSuite) SetupTest() { s.Nil(err) if tokenBalance.Cmp(common.Big0) == 0 { - opts, err := bind.NewKeyedTransactorWithChainID(l1ProverPrivKey, rpcCli.L1ChainID) + // Do not verify zk proofs in tests. + addressManager, err := bindings.NewAddressManager( + common.HexToAddress(os.Getenv("ADDRESS_MANAGER_CONTRACT_ADDRESS")), + rpcCli.L1, + ) + s.Nil(err) + + chainID, err := rpcCli.L1.ChainID(context.Background()) + s.Nil(err) + + ownerPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_CONTRACT_OWNER_PRIVATE_KEY"))) + s.Nil(err) + + opts, err := bind.NewKeyedTransactorWithChainID(ownerPrivKey, rpcCli.L1ChainID) + s.Nil(err) + + tx, err := addressManager.SetAddress(opts, chainID, rpc.StringToBytes32("tier_pse_zkevm"), common.Address{}) + s.Nil(err) + _, err = rpc.WaitReceipt(context.Background(), rpcCli.L1, tx) + s.Nil(err) + + // Deposit taiko tokens for provers. + opts, err = bind.NewKeyedTransactorWithChainID(l1ProverPrivKey, rpcCli.L1ChainID) s.Nil(err) premintAmount, ok := new(big.Int).SetString(os.Getenv("PREMINT_TOKEN_AMOUNT"), 10) @@ -90,7 +114,7 @@ func (s *ClientTestSuite) SetupTest() { _, err = rpcCli.TaikoToken.Approve(opts, common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), premintAmount) s.Nil(err) - tx, err := rpcCli.TaikoL1.DepositTaikoToken(opts, premintAmount) + tx, err = rpcCli.TaikoL1.DepositTaikoToken(opts, premintAmount) s.Nil(err) _, err = rpc.WaitReceipt(context.Background(), rpcCli.L1, tx) s.Nil(err) From 86cfbb5fcf0cf0bad205de8c63d836f384408c01 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 11 Oct 2023 17:01:49 +0800 Subject: [PATCH 49/63] feat(cmd): remove unused flags --- cmd/flags/prover.go | 7 -- prover/config.go | 2 - prover/config_test.go | 3 - prover/prover.go | 215 +++++++++++++++++++++++++----------------- prover/prover_test.go | 1 + 5 files changed, 129 insertions(+), 99 deletions(-) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index df8fe0d4e..467d95a4d 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -130,12 +130,6 @@ var ( Value: 1 * time.Hour, Category: proverCategory, } - TempCapacityExpiresAt = &cli.DurationFlag{ - Name: "prover.tempCapacityExpiresAt", - Usage: "time in seconds temporary capacity lives for (format: 36s)", - Value: 36 * time.Second, - Category: proverCategory, - } // Special flags for testing. Dummy = &cli.BoolFlag{ Name: "dummy", @@ -173,5 +167,4 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ ProverCapacity, MaxExpiry, TaikoTokenAddress, - TempCapacityExpiresAt, }) diff --git a/prover/config.go b/prover/config.go index bf9733ea7..7cd7aa2cf 100644 --- a/prover/config.go +++ b/prover/config.go @@ -43,7 +43,6 @@ type Config struct { ProveBlockMaxTxGasTipCap *big.Int HTTPServerPort uint64 Capacity uint64 - TempCapacityExpiresAt time.Duration MinOptimisticTierFee *big.Int MinSgxTierFee *big.Int MinPseZkevmTierFee *big.Int @@ -128,7 +127,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProveBlockGasLimit: proveBlockTxGasLimit, Capacity: c.Uint64(flags.ProverCapacity.Name), - TempCapacityExpiresAt: c.Duration(flags.TempCapacityExpiresAt.Name), ProveBlockTxReplacementMultiplier: proveBlockTxReplacementMultiplier, ProveBlockMaxTxGasTipCap: proveBlockMaxTxGasTipCap, HTTPServerPort: c.Uint64(flags.ProverHTTPServerPort.Name), diff --git a/prover/config_test.go b/prover/config_test.go index 5b764aa9d..1b3652747 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -52,7 +52,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { s.Equal(uint64(minTierFee), c.MinPseZkevmTierFee.Uint64()) s.Equal(uint64(3), c.ProveBlockTxReplacementMultiplier) s.Equal(uint64(256), c.ProveBlockMaxTxGasTipCap.Uint64()) - s.Equal(15*time.Second, c.TempCapacityExpiresAt) s.Nil(new(Prover).InitFromCli(context.Background(), ctx)) s.True(c.ProveUnassignedBlocks) @@ -81,7 +80,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { "--" + flags.ProveBlockMaxTxGasTipCap.Name, "256", "--" + flags.GuardianProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "--" + flags.Graffiti.Name, "", - "--" + flags.TempCapacityExpiresAt.Name, "15s", "--" + flags.ProveUnassignedBlocks.Name, })) } @@ -152,7 +150,6 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.Uint64Flag{Name: flags.MinSgxTierFee.Name}, &cli.Uint64Flag{Name: flags.MinPseZkevmTierFee.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxGasLimit.Name}, - &cli.DurationFlag{Name: flags.TempCapacityExpiresAt.Name}, } app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) diff --git a/prover/prover.go b/prover/prover.go index 5d8f1e2a3..0c97ec36d 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -330,7 +330,7 @@ func (p *Prover) onBlockProposed( event *bindings.TaikoL1ClientBlockProposed, end eventIterator.EndBlockProposedEventIterFunc, ) error { - // If there is newly generated proofs, we need to submit them as soon as possible. + // If there are newly generated proofs, we need to submit them as soon as possible. if len(p.proofGenerationCh) > 0 { log.Info("onBlockProposed early return", "proofGenerationChannelLength", len(p.proofGenerationCh)) @@ -525,10 +525,9 @@ func (p *Prover) onBlockProposed( metrics.ProverProofsAssigned.Inc(1) - if !p.cfg.GuardianProver { - if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { - return errNoCapacity - } + // Make sure to take a capacity before requesting proof. + if err := p.takeOneCapacity(event.BlockId); err != nil { + return err } if proofSubmitter := p.selectSubmitter(event.MinTier); proofSubmitter != nil { @@ -538,6 +537,7 @@ func (p *Prover) onBlockProposed( return nil } + // Move l1Current cursor. newL1Current, err := p.rpc.L1.HeaderByHash(ctx, event.Raw.BlockHash) if err != nil { return err @@ -545,6 +545,7 @@ func (p *Prover) onBlockProposed( p.l1Current = newL1Current p.lastHandledBlockID = event.BlockId.Uint64() + // Try generating a proof for the proposed block with the given backoff policy. go func() { if err := backoff.Retry( func() error { @@ -573,17 +574,12 @@ func (p *Prover) onBlockProposed( // submitProofOp performs a proof submission operation. func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) { - p.submitProofConcurrencyGuard <- struct{}{} - go func() { + p.submitProofConcurrencyGuard <- struct{}{} + defer func() { <-p.submitProofConcurrencyGuard - if !p.cfg.GuardianProver { - _, released := p.capacityManager.ReleaseOneCapacity(proofWithHeader.Meta.Id) - if !released { - log.Error("Failed to release capacity", "id", proofWithHeader.Meta.Id) - } - } + p.releaseOneCapacity(proofWithHeader.BlockID) }() if err := backoff.Retry( @@ -624,6 +620,57 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli return nil } +// onTransitionProved verifies the proven block hash and will try contesting it if the block hash is wrong. +func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { + metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) + + // If the proof generation is cancellable, cancel it and release the capacity. + proofSubmitter := p.getSubmitterByTier(event.Tier) + if proofSubmitter != nil && proofSubmitter.Producer().Cancellable() { + if err := proofSubmitter.Producer().Cancel(ctx, event.BlockId); err != nil { + return err + } + // No need to check if the release is successful here, since this L2 block might + // be assigned to other provers. + p.capacityManager.ReleaseOneCapacity(event.BlockId.Uint64()) + } + + // If this prover is in contest mode, we check the validity of this proof and if it's invalid, + // contest it with a higher tier proof. + if !p.cfg.ContestControversialProofs { + return nil + } + + isValidProof, err := p.isValidProof( + ctx, + event, + ) + if err != nil { + return err + } + + if isValidProof { + return nil + } + + l1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}) + if err != nil { + return err + } + + log.Info( + "Contest a proven block", + "blockID", event.BlockId, + "l1Height", l1Height, + "tier", event.Tier, + "parentHash", common.Bytes2Hex(event.ParentHash[:]), + "blockHash", common.Bytes2Hex(event.BlockHash[:]), + "signalRoot", common.Bytes2Hex(event.SignalRoot[:]), + ) + + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), true) +} + // Name returns the application name. func (p *Prover) Name() string { return "prover" @@ -679,7 +726,7 @@ func (p *Prover) initL1Current(startingBlockID *big.Int) error { return nil } -// isBlockVerified checks whether the given block has been verified by other provers. +// isBlockVerified checks whether the given L2 block has been verified. func (p *Prover) isBlockVerified(id *big.Int) (bool, error) { stateVars, err := p.rpc.GetProtocolStateVariables(&bind.CallOpts{Context: p.ctx}) if err != nil { @@ -700,13 +747,11 @@ func (p *Prover) initSubscription() { func (p *Prover) closeSubscription() { p.blockVerifiedSub.Unsubscribe() p.blockProposedSub.Unsubscribe() + p.transitionProvedSub.Unsubscribe() } -// isValidProof checks if the given proof is a valid one. -func (p *Prover) isValidProof( - ctx context.Context, - event *bindings.TaikoL1ClientTransitionProved, -) (bool, error) { +// isValidProof checks if the given proof is a valid one, comparing to current L2 node canonical chain. +func (p *Prover) isValidProof(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) (bool, error) { parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) if err != nil { return false, err @@ -717,11 +762,14 @@ func (p *Prover) isValidProof( return false, err } - l2SignalService, err := p.rpc.TaikoL2.Resolve0(nil, rpc.StringToBytes32("signal_service"), false) + l2SignalService, err := p.rpc.TaikoL2.Resolve0( + &bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}, + rpc.StringToBytes32("signal_service"), + false, + ) if err != nil { return false, err } - signalRoot, err := p.rpc.GetStorageRoot( ctx, p.rpc.L2GethClient, @@ -737,65 +785,16 @@ func (p *Prover) isValidProof( signalRoot == event.SignalRoot, nil } -// onTransitionProved verifies the proven block hash and will try contesting it if the block hash is wrong. -func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) error { - metrics.ProverReceivedProvenBlockGauge.Update(event.BlockId.Int64()) - - // If the proof generation is cancellable, cancel it and release the capacity. - proofSubmitter := p.getSubmitterByTier(event.Tier) - if proofSubmitter != nil && proofSubmitter.Producer().Cancellable() { - if err := proofSubmitter.Producer().Cancel(ctx, event.BlockId); err != nil { - return err - } - // No need to check if the release is successful here, since this L2 block might - // be assigned to other provers. - p.capacityManager.ReleaseOneCapacity(event.BlockId.Uint64()) - } - - // If this prover is in contest mode, we check the validity of this proof and if it's invalid, - // contest it with a higher tier proof. - if !p.cfg.ContestControversialProofs { - return nil - } - - isValidProof, err := p.isValidProof( - ctx, - event, - ) - if err != nil { - return err - } - - if isValidProof { - return nil - } - - l1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}) - if err != nil { - return err - } - - log.Info( - "Contest a proven block", - "blockID", event.BlockId, - "l1Height", l1Height, - "tier", event.Tier, - "parentHash", common.Bytes2Hex(event.ParentHash[:]), - "blockHash", common.Bytes2Hex(event.BlockHash[:]), - "signalRoot", common.Bytes2Hex(event.SignalRoot[:]), - ) - - return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), true) -} - // requestProofByBlockID performs a proving operation for the given block. -func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, contestOldProof bool) error { +func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, contestMode bool) error { + // NOTE: since this callback function will only be called after a L2 block's proving window is expired, + // or a wrong proof's submission, so we won't check if L1 chain has been reorged here. onBlockProposed := func( ctx context.Context, event *bindings.TaikoL1ClientBlockProposed, end eventIterator.EndBlockProposedEventIterFunc, ) error { - // Only filter for exact blockID we want + // Only filter for exact blockID we want. if event.BlockId.Cmp(blockID) != 0 { return nil } @@ -805,23 +804,20 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont if err != nil { return fmt.Errorf("failed to check if the current L2 block is verified: %w", err) } - if isVerified { log.Info("📋 Block has been verified", "blockID", event.BlockId) return nil } - // Make sure to take a capacity before requesting proof - if !p.cfg.GuardianProver { - if _, ok := p.capacityManager.TakeOneCapacity(event.BlockId.Uint64()); !ok { - return errNoCapacity - } + // Make sure to take a capacity before requesting proof. + if err := p.takeOneCapacity(event.BlockId); err != nil { + return err } - p.proposeConcurrencyGuard <- struct{}{} - + // If the current prover wants to contest a wrong proof, we will try + // to select a higher tier proof submitter. var minTier = event.MinTier - if contestOldProof { + if contestMode { if p.cfg.GuardianProver { minTier = encoding.TierGuardianID } else { @@ -829,6 +825,7 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont } } + // If there is no proof submitter selected, skip proving it. if proofSubmitter := p.selectSubmitter(minTier); proofSubmitter != nil { return proofSubmitter.RequestProof(ctx, event) } @@ -838,6 +835,8 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont handleBlockProposedEvent := func() error { defer func() { <-p.proposeConcurrencyGuard }() + + // Make sure `end` height is less than the latest L1 head. l1Head, err := p.rpc.L1.BlockNumber(p.ctx) if err != nil { log.Error("Failed to get L1 block head", "error", err) @@ -847,6 +846,7 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont if end.Uint64() > l1Head { end = new(big.Int).SetUint64(l1Head) } + iter, err := eventIterator.NewBlockProposedIterator(p.ctx, &eventIterator.BlockProposedIteratorConfig{ Client: p.rpc.L1, TaikoL1: p.rpc.TaikoL1, @@ -858,12 +858,24 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont log.Error("Failed to start event iterator", "event", "BlockProposed", "error", err) return err } + return iter.Iter() } go func() { if err := backoff.Retry( - func() error { return handleBlockProposedEvent() }, + func() error { + if err := handleBlockProposedEvent(); err != nil { + log.Error( + "Failed to handle BlockProposed event", + "error", err, + "blockID", blockID, + "maxRetrys", p.cfg.BackOffMaxRetrys, + ) + return err + } + return nil + }, backoff.WithMaxRetries(backoff.NewConstantBackOff(p.cfg.BackOffRetryInterval), p.cfg.BackOffMaxRetrys), ); err != nil { log.Error("Failed to request proof with a given block ID", "blockID", blockID, "error", err) @@ -875,13 +887,21 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont // onProvingWindowExpired tries to submit a proof for an expired block. func (p *Prover) onProvingWindowExpired(ctx context.Context, e *bindings.TaikoL1ClientBlockProposed) error { - log.Info("Block proving window is expired", "blockID", e.BlockId, "l1Height", e.Raw.BlockNumber) - + log.Info( + "Block proving window is expired", + "blockID", e.BlockId, + "assignedProver", e.AssignedProver, + "minTier", e.MinTier, + ) + // If proving window is expired, then the assigned prover can not submit new proofs for it anymore. + if p.proverAddress == e.AssignedProver { + return nil + } + // Check if we still need to generate a new proof for that block. needNewProof, err := rpc.NeedNewProof(ctx, p.rpc, e.BlockId, p.proverAddress) if err != nil { return err } - if !needNewProof { return nil } @@ -925,3 +945,24 @@ func (p *Prover) getSubmitterByTier(tier uint16) proofSubmitter.Submitter { return nil } + +// takeOneCapacity takes one capacity from the capacity manager. +func (p *Prover) takeOneCapacity(blockID *big.Int) error { + if !p.cfg.GuardianProver { + if _, ok := p.capacityManager.TakeOneCapacity(blockID.Uint64()); !ok { + return errNoCapacity + } + } + + return nil +} + +// releaseOneCapacity releases one capacity to the capacity manager. +func (p *Prover) releaseOneCapacity(blockID *big.Int) { + if !p.cfg.GuardianProver { + _, released := p.capacityManager.ReleaseOneCapacity(blockID.Uint64()) + if !released { + log.Error("Failed to release capacity", "id", blockID) + } + } +} diff --git a/prover/prover_test.go b/prover/prover_test.go index 5779699bc..8c93def3b 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -260,6 +260,7 @@ func (s *ProverTestSuite) TestProveExpiredUnassignedBlock() { close(sink) }() + e.AssignedProver = common.Address(testutils.RandomHash().Bytes()) s.Nil(s.p.onProvingWindowExpired(context.Background(), e)) s.Nil(s.p.selectSubmitter(e.MinTier).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) From d0952d474e4bdc9ffd587692099c02b71d83e850 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 11 Oct 2023 22:38:54 +0800 Subject: [PATCH 50/63] feat(cmd): rename some flags --- cmd/flags/proposer.go | 44 +++++---- cmd/flags/prover.go | 94 ++++++++++--------- driver/chain_syncer/calldata/syncer_test.go | 32 +++---- driver/chain_syncer/chain_syncer_test.go | 34 +++---- driver/driver_test.go | 32 +++---- proposer/config.go | 4 +- proposer/config_test.go | 6 +- proposer/proposer.go | 2 +- proposer/proposer_test.go | 2 +- .../proof_submitter/proof_submitter_test.go | 32 +++---- prover/prover.go | 1 - prover/prover_test.go | 32 +++---- 12 files changed, 163 insertions(+), 152 deletions(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 1836a1d51..b8f9a335b 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -1,6 +1,7 @@ package flags import ( + "github.com/taikoxyz/taiko-client/version" "github.com/urfave/cli/v2" ) @@ -28,12 +29,7 @@ var ( // Optional flags used by proposer. var ( - ExtraData = &cli.StringFlag{ - Name: "extraData", - Usage: "Block extra data set by the proposer", - Value: "", - Category: proposerCategory, - } + // Tier fee related. OptimisticTierFee = &cli.Uint64Flag{ Name: "tierFee.optimistic", Usage: "Initial tier fee (in wei) paid to prover to generate an optimistic proofs", @@ -55,17 +51,31 @@ var ( Value: 10, Category: proposerCategory, } - MaxTierFeePriceBumpIterations = &cli.Uint64Flag{ - Name: "tierFee.maxPriceBumpIterations", + MaxTierFeePriceBumps = &cli.Uint64Flag{ + Name: "tierFee.maxPriceBumps", Usage: "If nobody accepts block at initial tier fee, how many iterations to increase tier fee before giving up", Category: proposerCategory, Value: 3, } + // Proposing epoch related. ProposeInterval = &cli.DurationFlag{ - Name: "proposeInterval", + Name: "epoch.interval", Usage: "Time interval to propose L2 pending transactions", Category: proposerCategory, } + ProposeEmptyBlocksInterval = &cli.DurationFlag{ + Name: "epoch.emptyBlockInterval", + Usage: "Time interval to propose empty blocks", + Category: proposerCategory, + } + // Proposing metadata realted. + ExtraData = &cli.StringFlag{ + Name: "extraData", + Usage: "Block extra data set by the proposer (default = client version)", + Value: version.VersionWithCommit(), + Category: proposerCategory, + } + // Transactions pool related. TxPoolLocals = &cli.StringSliceFlag{ Name: "txpool.locals", Usage: "Comma separated accounts to treat as locals (priority inclusion)", @@ -77,30 +87,26 @@ var ( Value: false, Category: proposerCategory, } - ProposeEmptyBlocksInterval = &cli.DurationFlag{ - Name: "proposeEmptyBlockInterval", - Usage: "Time interval to propose empty blocks", - Category: proposerCategory, - } MaxProposedTxListsPerEpoch = &cli.Uint64Flag{ - Name: "maxProposedTxListsPerEpoch", + Name: "txpool.maxTxListsPerEpoch", Usage: "Maximum number of transaction lists which will be proposed inside one proposing epoch", Value: 1, Category: proposerCategory, } + // Transaction related. ProposeBlockTxGasLimit = &cli.Uint64Flag{ - Name: "proposeBlockTxGasLimit", + Name: "tx.gasLimit", Usage: "Gas limit will be used for TaikoL1.proposeBlock transactions", Category: proposerCategory, } ProposeBlockTxReplacementMultiplier = &cli.Uint64Flag{ - Name: "proposeBlockTxReplacementMultiplier", + Name: "tx.replacementMultiplier", Value: 2, Usage: "Gas tip multiplier when replacing a TaikoL1.proposeBlock transaction with same nonce", Category: proposerCategory, } ProposeBlockTxGasTipCap = &cli.Uint64Flag{ - Name: "proposeBlockTxGasTipCap", + Name: "tx.gasTipCap", Usage: "Gas tip cap (in wei) for a TaikoL1.proposeBlock transaction when doing the transaction replacement", Category: proposerCategory, } @@ -126,5 +132,5 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ SgxTierFee, PseZkevmTierFee, TierFeePriceBump, - MaxTierFeePriceBumpIterations, + MaxTierFeePriceBumps, }) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 467d95a4d..49ed2abc9 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -9,13 +9,13 @@ import ( // Required flags used by prover. var ( ZkEvmRpcdEndpoint = &cli.StringFlag{ - Name: "zkevmRpcdEndpoint", + Name: "zkevm.rpcdEndpoint", Usage: "RPC endpoint of a ZKEVM RPCD service", Required: true, Category: proverCategory, } ZkEvmRpcdParamsPath = &cli.StringFlag{ - Name: "zkevmRpcdParamsPath", + Name: "zkevm.rpcdParamsPath", Usage: "Path of ZKEVM parameters file to use", Required: true, Category: proverCategory, @@ -36,6 +36,31 @@ var ( // Optional flags used by prover. var ( + StartingBlockID = &cli.Uint64Flag{ + Name: "prover.startingBlockID", + Usage: "If set, prover will start proving blocks from the block with this ID", + Category: proverCategory, + } + MaxConcurrentProvingJobs = &cli.UintFlag{ + Name: "prover.maxConcurrentJobs", + Usage: "Limits the number of concurrent proving blocks jobs", + Value: 1, + Category: proverCategory, + } + Graffiti = &cli.StringFlag{ + Name: "prover.graffiti", + Usage: "When string is passed, adds additional graffiti info to proof evidence", + Category: proverCategory, + Value: "", + } + // Proving strategy. + ProveUnassignedBlocks = &cli.BoolFlag{ + Name: "prover.proveUnassignedBlocks", + Usage: "Whether you want to prove unassigned blocks, or only work on assigned proofs", + Category: proverCategory, + Value: false, + } + // Tier fee related. MinOptimisticTierFee = &cli.Uint64Flag{ Name: "minTierFee.optimistic", Usage: "Minimum accepted fee for generating an optimistic proof", @@ -51,88 +76,69 @@ var ( Usage: "Minimum accepted fee for generating a PSE zkEVM proof", Category: proverCategory, } - StartingBlockID = &cli.Uint64Flag{ - Name: "startingBlockID", - Usage: "If set, prover will start proving blocks from the block with this ID", - Category: proverCategory, - } - MaxConcurrentProvingJobs = &cli.UintFlag{ - Name: "maxConcurrentProvingJobs", - Usage: "Limits the number of concurrent proving blocks jobs", - Value: 1, - Category: proverCategory, - } + // Guardian prover related. GuardianProver = &cli.BoolFlag{ - Name: "guardianProver", + Name: "guardian", Usage: "Set whether prover should use guardian prover or not", Category: proverCategory, } GuardianProverPrivateKey = &cli.StringFlag{ - Name: "guardianProverPrivateKey", + Name: "guardian.privateKey", Usage: "Private key of guardian prover", Category: proverCategory, } GuardianProofSubmissionDelay = &cli.DurationFlag{ - Name: "guardianProofSubmissionDelay", + Name: "guardian.submissionDelay", Usage: "Guardian proof submission delay", Value: 0 * time.Second, Category: proverCategory, } + // Transaction related. ProofSubmissionMaxRetry = &cli.Uint64Flag{ - Name: "proofSubmissionMaxRetry", + Name: "tx.submissionMaxRetry", Usage: "Max retry counts for proof submission", Value: 3, Category: proverCategory, } - Graffiti = &cli.StringFlag{ - Name: "graffiti", - Usage: "When string is passed, adds additional graffiti info to proof evidence", - Category: proverCategory, - Value: "", - } - ProveUnassignedBlocks = &cli.BoolFlag{ - Name: "prover.proveUnassignedBlocks", - Usage: "Whether you want to prove unassigned blocks, or only work on assigned proofs", - Category: proverCategory, - Value: false, - } - ContestControversialProofs = &cli.BoolFlag{ - Name: "prover.contestControversialProofs", - Usage: "Whether you want to contest proofs with different L2 hashes with higher tier proofs", - Category: proverCategory, - Value: false, - } ProveBlockTxGasLimit = &cli.Uint64Flag{ - Name: "prover.proveBlockTxGasLimit", + Name: "tx.gasLimit", Usage: "Gas limit will be used for TaikoL1.proveBlock transactions", Category: proverCategory, } + ProveBlockMaxTxGasTipCap = &cli.Uint64Flag{ + Name: "tx.maxGasTipCap", + Usage: "Gas tip cap (in wei) for a TaikoL1.proveBlock transaction when doing the transaction replacement", + Category: proverCategory, + } ProveBlockTxReplacementMultiplier = &cli.Uint64Flag{ - Name: "proveBlockTxReplacementMultiplier", + Name: "tx.replacementMultiplier", Value: 2, Usage: "Gas tip multiplier when replacing a TaikoL1.proveBlock transaction with same nonce", Category: proverCategory, } - ProveBlockMaxTxGasTipCap = &cli.Uint64Flag{ - Name: "proveBlockMaxTxGasTipCap", - Usage: "Gas tip cap (in wei) for a TaikoL1.proveBlock transaction when doing the transaction replacement", + // Running mode + ContestControversialProofs = &cli.BoolFlag{ + Name: "mode.contest", + Usage: "Whether you want to contest wrong proofs with higher tier proofs", Category: proverCategory, + Value: false, } + // HTTP server related. ProverHTTPServerPort = &cli.Uint64Flag{ - Name: "prover.httpServerPort", + Name: "http.port", Usage: "Port to expose for http server", Category: proverCategory, Value: 9876, } MaxExpiry = &cli.DurationFlag{ - Name: "prover.maxExpiry", - Usage: "maximum accepted expiry in seconds for accepting proving a block", + Name: "http.maxExpiry", + Usage: "Maximum accepted expiry in seconds for accepting proving a block", Value: 1 * time.Hour, Category: proverCategory, } // Special flags for testing. Dummy = &cli.BoolFlag{ - Name: "dummy", + Name: "prover.dummy", Usage: "Produce dummy proofs, testing purposes only", Value: false, Category: proverCategory, diff --git a/driver/chain_syncer/calldata/syncer_test.go b/driver/chain_syncer/calldata/syncer_test.go index 11fec4a76..05718a902 100644 --- a/driver/chain_syncer/calldata/syncer_test.go +++ b/driver/chain_syncer/calldata/syncer_test.go @@ -47,22 +47,22 @@ func (s *CalldataSyncerTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: common.Big256, - SgxTierFee: common.Big256, - PseZkevmTierFee: common.Big256, - MaxTierFeePriceBumpIterations: 3, - TierFeePriceBump: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, + MaxTierFeePriceBumps: 3, + TierFeePriceBump: common.Big2, }))) s.p = prop diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index b8a8b7a5c..d31fdb348 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -49,23 +49,23 @@ func (s *ChainSyncerTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: common.Big256, - SgxTierFee: common.Big256, - PseZkevmTierFee: common.Big256, - MaxTierFeePriceBumpIterations: 3, - TierFeePriceBump: common.Big2, - ExtraData: "test", + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, + MaxTierFeePriceBumps: 3, + TierFeePriceBump: common.Big2, + ExtraData: "test", }))) s.p = prop diff --git a/driver/driver_test.go b/driver/driver_test.go index 6b343d70b..d3fdbcde2 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -53,22 +53,22 @@ func (s *DriverTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), p, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: common.Big256, - SgxTierFee: common.Big256, - PseZkevmTierFee: common.Big256, - MaxTierFeePriceBumpIterations: 3, - TierFeePriceBump: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, + MaxTierFeePriceBumps: 3, + TierFeePriceBump: common.Big2, }))) s.p = p } diff --git a/proposer/config.go b/proposer/config.go index 9e13c2b81..4a4f6a23b 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -40,7 +40,7 @@ type Config struct { SgxTierFee *big.Int PseZkevmTierFee *big.Int TierFeePriceBump *big.Int - MaxTierFeePriceBumpIterations uint64 + MaxTierFeePriceBumps uint64 } // NewConfigFromCliContext initializes a Config instance from @@ -141,6 +141,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { SgxTierFee: new(big.Int).SetUint64(c.Uint64(flags.SgxTierFee.Name)), PseZkevmTierFee: new(big.Int).SetUint64(c.Uint64(flags.PseZkevmTierFee.Name)), TierFeePriceBump: new(big.Int).SetUint64(c.Uint64(flags.TierFeePriceBump.Name)), - MaxTierFeePriceBumpIterations: c.Uint64(flags.MaxTierFeePriceBumpIterations.Name), + MaxTierFeePriceBumps: c.Uint64(flags.MaxTierFeePriceBumps.Name), }, nil } diff --git a/proposer/config_test.go b/proposer/config_test.go index 2660dc9bf..5d4faee0b 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -54,7 +54,7 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { s.Equal(uint64(tierFee), c.SgxTierFee.Uint64()) s.Equal(uint64(tierFee), c.PseZkevmTierFee.Uint64()) s.Equal(uint64(15), c.TierFeePriceBump.Uint64()) - s.Equal(uint64(5), c.MaxTierFeePriceBumpIterations) + s.Equal(uint64(5), c.MaxTierFeePriceBumps) for i, e := range strings.Split(proverEndpoints, ",") { s.Equal(c.ProverEndpoints[i].String(), e) @@ -85,7 +85,7 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { "--" + flags.SgxTierFee.Name, fmt.Sprint(tierFee), "--" + flags.PseZkevmTierFee.Name, fmt.Sprint(tierFee), "--" + flags.TierFeePriceBump.Name, "15", - "--" + flags.MaxTierFeePriceBumpIterations.Name, "5", + "--" + flags.MaxTierFeePriceBumps.Name, "5", })) } @@ -175,7 +175,7 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.Uint64Flag{Name: flags.ProposeBlockTxGasTipCap.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasLimit.Name}, &cli.Uint64Flag{Name: flags.TierFeePriceBump.Name}, - &cli.Uint64Flag{Name: flags.MaxTierFeePriceBumpIterations.Name}, + &cli.Uint64Flag{Name: flags.MaxTierFeePriceBumps.Name}, } app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) diff --git a/proposer/proposer.go b/proposer/proposer.go index 90a4c2544..33e9417ec 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -141,7 +141,7 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { p.tierFees, cfg.TierFeePriceBump, cfg.ProverEndpoints, - cfg.MaxTierFeePriceBumpIterations, + cfg.MaxTierFeePriceBumps, proverAssignmentTimeout, requestProverServerTimeout, ); err != nil { diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index f4ee146db..f841d0992 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -50,7 +50,7 @@ func (s *ProposerTestSuite) SetupTest() { SgxTierFee: common.Big256, PseZkevmTierFee: common.Big256, TierFeePriceBump: common.Big2, - MaxTierFeePriceBumpIterations: 3, + MaxTierFeePriceBumps: 3, ExtraData: "test", }))) diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index ec35ae5e9..3fa6828f1 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -74,22 +74,22 @@ func (s *ProofSubmitterTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: s.ProverEndpoints, - OptimisticTierFee: common.Big256, - SgxTierFee: common.Big256, - PseZkevmTierFee: common.Big256, - MaxTierFeePriceBumpIterations: 3, - TierFeePriceBump: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: s.ProverEndpoints, + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, + MaxTierFeePriceBumps: 3, + TierFeePriceBump: common.Big2, }))) s.proposer = prop diff --git a/prover/prover.go b/prover/prover.go index 0c97ec36d..9c9a609af 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -648,7 +648,6 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 if err != nil { return err } - if isValidProof { return nil } diff --git a/prover/prover_test.go b/prover/prover_test.go index 8c93def3b..433f3a8c6 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -95,22 +95,22 @@ func (s *ProverTestSuite) SetupTest() { proposeInterval := 1024 * time.Hour // No need to periodically propose transactions list in unit tests s.Nil(proposer.InitFromConfig(context.Background(), prop, (&proposer.Config{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), - L1ProposerPrivKey: l1ProposerPrivKey, - L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), - ProposeInterval: &proposeInterval, - MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, - ProverEndpoints: []*url.URL{proverServerUrl}, - OptimisticTierFee: common.Big256, - SgxTierFee: common.Big256, - PseZkevmTierFee: common.Big256, - MaxTierFeePriceBumpIterations: 3, - TierFeePriceBump: common.Big2, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L1ProposerPrivKey: l1ProposerPrivKey, + L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), + ProposeInterval: &proposeInterval, + MaxProposedTxListsPerEpoch: 1, + WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []*url.URL{proverServerUrl}, + OptimisticTierFee: common.Big256, + SgxTierFee: common.Big256, + PseZkevmTierFee: common.Big256, + MaxTierFeePriceBumps: 3, + TierFeePriceBump: common.Big2, }))) s.proposer = prop From c7cd1e9defa11679d11ce5ac35c3e34760298f0d Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 00:23:06 +0800 Subject: [PATCH 51/63] feat(prover): introduce `ProofContester` --- pkg/rpc/subscription.go | 18 +++ prover/proof_producer/guardian_producer.go | 1 + prover/proof_submitter/evidence/builder.go | 42 +++++- prover/proof_submitter/interface.go | 8 ++ prover/proof_submitter/proof_contester.go | 141 +++++++++++++++++++++ prover/proof_submitter/proof_submitter.go | 2 +- prover/prover.go | 66 ++++++---- prover/prover_test.go | 41 ++++-- 8 files changed, 277 insertions(+), 42 deletions(-) create mode 100644 prover/proof_submitter/proof_contester.go diff --git a/pkg/rpc/subscription.go b/pkg/rpc/subscription.go index 26b3d5a6c..8f9844ef4 100644 --- a/pkg/rpc/subscription.go +++ b/pkg/rpc/subscription.go @@ -99,6 +99,24 @@ func SubscribeTransitionProved( }) } +// SubscribeTransitionContested subscribes the protocol's TransitionContested events. +func SubscribeTransitionContested( + taikoL1 *bindings.TaikoL1Client, + ch chan *bindings.TaikoL1ClientTransitionContested, +) event.Subscription { + return SubscribeEvent("TransitionContested", func(ctx context.Context) (event.Subscription, error) { + sub, err := taikoL1.WatchTransitionContested(nil, ch, nil) + if err != nil { + log.Error("Create TaikoL1.TransitionContested subscription error", "error", err) + return nil, err + } + + defer sub.Unsubscribe() + + return waitSubErr(ctx, sub) + }) +} + // SubscribeChainHead subscribes the new chain heads. func SubscribeChainHead( client *EthClient, diff --git a/prover/proof_producer/guardian_producer.go b/prover/proof_producer/guardian_producer.go index f30629a43..278a6f257 100644 --- a/prover/proof_producer/guardian_producer.go +++ b/prover/proof_producer/guardian_producer.go @@ -14,6 +14,7 @@ import ( type GuardianProofProducer struct{ *DummyProofProducer } // RequestProof implements the ProofProducer interface. +// TODO: support returning `keccak256("RETURN_LIVENESS_BOND")` as proof. func (g *GuardianProofProducer) RequestProof( ctx context.Context, opts *ProofRequestOptions, diff --git a/prover/proof_submitter/evidence/builder.go b/prover/proof_submitter/evidence/builder.go index 297f90ebd..468e748d5 100644 --- a/prover/proof_submitter/evidence/builder.go +++ b/prover/proof_submitter/evidence/builder.go @@ -5,7 +5,11 @@ import ( "encoding/binary" "fmt" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" + "github.com/taikoxyz/taiko-client/bindings" "github.com/taikoxyz/taiko-client/bindings/encoding" "github.com/taikoxyz/taiko-client/pkg/rpc" anchorTxValidator "github.com/taikoxyz/taiko-client/prover/anchor_tx_validator" @@ -28,8 +32,8 @@ func NewBuilder(cli *rpc.Client, anchorTxValidator *anchorTxValidator.AnchorTxVa } } -// Build creates the evidence for the given L2 block proof. -func (a *Builder) Build( +// ForSubmission creates the evidence for the given L2 block proof. +func (b *Builder) ForSubmission( ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader, ) (*encoding.BlockEvidence, error) { @@ -49,7 +53,7 @@ func (a *Builder) Build( ) // Get the corresponding L2 block. - block, err := a.rpc.L2.BlockByHash(ctx, header.Hash()) + block, err := b.rpc.L2.BlockByHash(ctx, header.Hash()) if err != nil { return nil, fmt.Errorf("failed to get L2 block with given hash %s: %w", header.Hash(), err) } @@ -60,12 +64,12 @@ func (a *Builder) Build( // Validate TaikoL2.anchor transaction inside the L2 block. anchorTx := block.Transactions()[0] - if err := a.anchorTxValidator.ValidateAnchorTx(ctx, anchorTx); err != nil { + if err := b.anchorTxValidator.ValidateAnchorTx(ctx, anchorTx); err != nil { return nil, fmt.Errorf("invalid anchor transaction: %w", err) } // Get and validate this anchor transaction's receipt. - if _, err = a.anchorTxValidator.GetAndValidateAnchorTxReceipt(ctx, anchorTx); err != nil { + if _, err = b.anchorTxValidator.GetAndValidateAnchorTxReceipt(ctx, anchorTx); err != nil { return nil, fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) } @@ -74,7 +78,7 @@ func (a *Builder) Build( ParentHash: proofWithHeader.Opts.ParentHash, BlockHash: proofWithHeader.Opts.BlockHash, SignalRoot: proofWithHeader.Opts.SignalRoot, - Graffiti: a.graffiti, + Graffiti: b.graffiti, Tier: proofWithHeader.Tier, Proof: proof, } @@ -90,6 +94,32 @@ func (a *Builder) Build( return evidence, nil } +// ForContest creates the evidence for contesting a L2 transition. +func (b *Builder) ForContest( + ctx context.Context, + header *types.Header, + l2SignalService common.Address, + event *bindings.TaikoL1ClientTransitionProved, +) (*encoding.BlockEvidence, error) { + signalRoot, err := b.rpc.GetStorageRoot(ctx, b.rpc.L2GethClient, l2SignalService, event.BlockId) + if err != nil { + return nil, fmt.Errorf("failed to get L2 signal service storage root: %w", err) + } + blockInfo, err := b.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, event.BlockId.Uint64()) + if err != nil { + return nil, err + } + + return &encoding.BlockEvidence{ + MetaHash: blockInfo.MetaHash, + ParentHash: event.ParentHash, + BlockHash: header.Hash(), + SignalRoot: signalRoot, + Tier: event.Tier, + Proof: []byte{}, + }, nil +} + // uint16ToBytes converts an uint16 to bytes. func uint16ToBytes(i uint16) []byte { b := make([]byte, 2) diff --git a/prover/proof_submitter/interface.go b/prover/proof_submitter/interface.go index 3c088c90c..d6c0ef38e 100644 --- a/prover/proof_submitter/interface.go +++ b/prover/proof_submitter/interface.go @@ -13,3 +13,11 @@ type Submitter interface { Producer() proofProducer.ProofProducer Tier() uint16 } + +type Contester interface { + SubmitContest( + ctx context.Context, + blockProposedEvent *bindings.TaikoL1ClientBlockProposed, + transitionProvedEvent *bindings.TaikoL1ClientTransitionProved, + ) error +} diff --git a/prover/proof_submitter/proof_contester.go b/prover/proof_submitter/proof_contester.go new file mode 100644 index 000000000..2e976d100 --- /dev/null +++ b/prover/proof_submitter/proof_contester.go @@ -0,0 +1,141 @@ +package submitter + +import ( + "context" + "crypto/ecdsa" + "errors" + "fmt" + "math/big" + "strings" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/taikoxyz/taiko-client/bindings" + "github.com/taikoxyz/taiko-client/bindings/encoding" + "github.com/taikoxyz/taiko-client/pkg/rpc" + proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" + "github.com/taikoxyz/taiko-client/prover/proof_submitter/evidence" + "github.com/taikoxyz/taiko-client/prover/proof_submitter/transaction" +) + +var _ Contester = (*ProofContester)(nil) + +// ProofContester is responsible for contesting wrong L2 transitions. +type ProofContester struct { + rpc *rpc.Client + evidenceBuilder *evidence.Builder + txBuilder *transaction.ProveBlockTxBuilder + txSender *transaction.Sender + l2SignalService common.Address + graffiti [32]byte +} + +// NewProofContester creates a new ProofContester instance. +func NewProofContester( + rpcClient *rpc.Client, + proverPrivKey *ecdsa.PrivateKey, + proveBlockTxGasLimit *uint64, + txReplacementTipMultiplier uint64, + proveBlockMaxTxGasTipCap *big.Int, + submissionMaxRetry uint64, + retryInterval time.Duration, + waitReceiptTimeout time.Duration, + graffiti string, +) (*ProofContester, error) { + l2SignalService, err := rpcClient.TaikoL2.Resolve0(nil, rpc.StringToBytes32("signal_service"), false) + if err != nil { + return nil, err + } + + var txGasLimit *big.Int + if proveBlockTxGasLimit != nil { + txGasLimit = new(big.Int).SetUint64(*proveBlockTxGasLimit) + } + + return &ProofContester{ + rpc: rpcClient, + evidenceBuilder: evidence.NewBuilder(rpcClient, nil, graffiti), + txBuilder: transaction.NewProveBlockTxBuilder( + rpcClient, + proverPrivKey, + txGasLimit, + proveBlockMaxTxGasTipCap, + new(big.Int).SetUint64(txReplacementTipMultiplier), + ), + txSender: transaction.NewSender(rpcClient, retryInterval, &submissionMaxRetry, waitReceiptTimeout), + l2SignalService: l2SignalService, + graffiti: rpc.StringToBytes32(graffiti), + }, nil +} + +// SubmitContest submits a taikoL1.proveBlock transaction to contest a L2 block transition. +func (c *ProofContester) SubmitContest( + ctx context.Context, + blockProposedEvent *bindings.TaikoL1ClientBlockProposed, + transitionProvedEvent *bindings.TaikoL1ClientTransitionProved, +) error { + // Ensure the transition has not been contested yet. + transition, err := c.rpc.TaikoL1.GetTransition( + &bind.CallOpts{Context: ctx}, + transitionProvedEvent.BlockId.Uint64(), + transitionProvedEvent.ParentHash, + ) + if err != nil { + if !strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_") { + log.Warn( + "Failed to get transition", + "blockID", transitionProvedEvent.BlockId, + "parentHash", transitionProvedEvent.ParentHash, + "error", encoding.TryParsingCustomError(err), + ) + return nil + } + return err + } + if transition.Contester != (common.Address{}) { + log.Info( + "Transaction has already been contested", + "blockID", transitionProvedEvent.BlockId, + "parentHash", transitionProvedEvent.ParentHash, + "contester", transition.Contester, + ) + return nil + } + + header, err := c.rpc.L2.HeaderByNumber(ctx, transitionProvedEvent.BlockId) + if err != nil { + return err + } + + // Genreate an evidence for contest. + evidence, err := c.evidenceBuilder.ForContest(ctx, header, c.l2SignalService, transitionProvedEvent) + if err != nil { + return err + } + input, err := encoding.EncodeEvidence(evidence) + if err != nil { + return fmt.Errorf("failed to encode TaikoL1.proveBlock inputs: %w", err) + } + + if err := c.txSender.Send( + ctx, + &proofProducer.ProofWithHeader{ + BlockID: transitionProvedEvent.BlockId, + Meta: &blockProposedEvent.Meta, + Header: header, + Proof: []byte{}, + Opts: &proofProducer.ProofRequestOptions{EventL1Hash: blockProposedEvent.Raw.BlockHash}, + Tier: transitionProvedEvent.Tier, + }, + c.txBuilder.Build(ctx, transitionProvedEvent.BlockId, input), + ); err != nil { + if errors.Is(err, transaction.ErrUnretryable) { + return nil + } + + return err + } + return nil +} diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index b9036f49f..c4b62047e 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -185,7 +185,7 @@ func (s *ProofSubmitter) SubmitProof( metrics.ProverReceivedProofCounter.Inc(1) - evidence, err := s.evidenceBuilder.Build(ctx, proofWithHeader) + evidence, err := s.evidenceBuilder.ForSubmission(ctx, proofWithHeader) if err != nil { return fmt.Errorf("failed to create evidence: %w", err) } diff --git a/prover/prover.go b/prover/prover.go index 9c9a609af..187af6012 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -59,16 +59,19 @@ type Prover struct { // Proof submitters proofSubmitters []proofSubmitter.Submitter + proofContester proofSubmitter.Contester // Subscriptions - blockProposedCh chan *bindings.TaikoL1ClientBlockProposed - blockProposedSub event.Subscription - transitionProvedCh chan *bindings.TaikoL1ClientTransitionProved - transitionProvedSub event.Subscription - blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified - blockVerifiedSub event.Subscription - proofWindowExpiredCh chan *bindings.TaikoL1ClientBlockProposed - proveNotify chan struct{} + blockProposedCh chan *bindings.TaikoL1ClientBlockProposed + blockProposedSub event.Subscription + transitionProvedCh chan *bindings.TaikoL1ClientTransitionProved + transitionProvedSub event.Subscription + transitionContestedCh chan *bindings.TaikoL1ClientTransitionContested + transitionContestedSub event.Subscription + blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified + blockVerifiedSub event.Subscription + proofWindowExpiredCh chan *bindings.TaikoL1ClientBlockProposed + proveNotify chan struct{} // Proof related proofGenerationCh chan *proofProducer.ProofWithHeader @@ -129,6 +132,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.blockProposedCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.blockVerifiedCh = make(chan *bindings.TaikoL1ClientBlockVerified, chBufferSize) p.transitionProvedCh = make(chan *bindings.TaikoL1ClientTransitionProved, chBufferSize) + p.transitionContestedCh = make(chan *bindings.TaikoL1ClientTransitionContested, chBufferSize) p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) p.proofWindowExpiredCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.proveNotify = make(chan struct{}, 1) @@ -196,6 +200,22 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.proofSubmitters = append(p.proofSubmitters, submitter) } + // Proof contester + p.proofContester, err = proofSubmitter.NewProofContester( + p.rpc, + p.cfg.L1ProverPrivKey, + p.cfg.ProveBlockGasLimit, + p.cfg.ProveBlockTxReplacementMultiplier, + p.cfg.ProveBlockMaxTxGasTipCap, + p.cfg.ProofSubmissionMaxRetry, + p.cfg.BackOffRetryInterval, + p.cfg.WaitReceiptTimeout, + p.cfg.Graffiti, + ) + if err != nil { + return err + } + // Prover server proverServerOpts := &server.NewProverServerOpts{ ProverPrivateKey: p.cfg.L1ProverPrivKey, @@ -275,6 +295,9 @@ func (p *Prover) eventLoop() { if err := p.onTransitionProved(p.ctx, e); err != nil { log.Error("Handle TransitionProved event error", "error", err) } + case e := <-p.transitionContestedCh: + // TODO: add a listener. + log.Info("Transaction contested", "event", e) case e := <-p.proofWindowExpiredCh: if err := p.onProvingWindowExpired(p.ctx, e); err != nil { log.Error("Handle provingWindow expired event error", "error", err) @@ -426,7 +449,6 @@ func (p *Prover) onBlockProposed( if err != nil { return fmt.Errorf("failed to check if the current L2 block is verified: %w", err) } - if isVerified { log.Info("📋 Block has been verified", "blockID", event.BlockId) return nil @@ -667,7 +689,7 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 "signalRoot", common.Bytes2Hex(event.SignalRoot[:]), ) - return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), true) + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), event) } // Name returns the application name. @@ -740,6 +762,7 @@ func (p *Prover) initSubscription() { p.blockProposedSub = rpc.SubscribeBlockProposed(p.rpc.TaikoL1, p.blockProposedCh) p.blockVerifiedSub = rpc.SubscribeBlockVerified(p.rpc.TaikoL1, p.blockVerifiedCh) p.transitionProvedSub = rpc.SubscribeTransitionProved(p.rpc.TaikoL1, p.transitionProvedCh) + p.transitionContestedSub = rpc.SubscribeTransitionContested(p.rpc.TaikoL1, p.transitionContestedCh) } // closeSubscription closes all subscriptions. @@ -747,6 +770,7 @@ func (p *Prover) closeSubscription() { p.blockVerifiedSub.Unsubscribe() p.blockProposedSub.Unsubscribe() p.transitionProvedSub.Unsubscribe() + p.transitionContestedSub.Unsubscribe() } // isValidProof checks if the given proof is a valid one, comparing to current L2 node canonical chain. @@ -785,7 +809,12 @@ func (p *Prover) isValidProof(ctx context.Context, event *bindings.TaikoL1Client } // requestProofByBlockID performs a proving operation for the given block. -func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, contestMode bool) error { +func (p *Prover) requestProofByBlockID( + blockID *big.Int, + l1Height *big.Int, + // If this event is not nil, then the prover will try contesting the transition. + transitionProvedEvent *bindings.TaikoL1ClientTransitionProved, +) error { // NOTE: since this callback function will only be called after a L2 block's proving window is expired, // or a wrong proof's submission, so we won't check if L1 chain has been reorged here. onBlockProposed := func( @@ -813,19 +842,12 @@ func (p *Prover) requestProofByBlockID(blockID *big.Int, l1Height *big.Int, cont return err } - // If the current prover wants to contest a wrong proof, we will try - // to select a higher tier proof submitter. - var minTier = event.MinTier - if contestMode { - if p.cfg.GuardianProver { - minTier = encoding.TierGuardianID - } else { - minTier += 1 - } + if transitionProvedEvent != nil { + return p.proofContester.SubmitContest(ctx, event, transitionProvedEvent) } // If there is no proof submitter selected, skip proving it. - if proofSubmitter := p.selectSubmitter(minTier); proofSubmitter != nil { + if proofSubmitter := p.selectSubmitter(event.MinTier); proofSubmitter != nil { return proofSubmitter.RequestProof(ctx, event) } @@ -905,7 +927,7 @@ func (p *Prover) onProvingWindowExpired(ctx context.Context, e *bindings.TaikoL1 return nil } - return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber), false) + return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber), nil) } // getProvingWindow returns the provingWindow of the given proposed block. diff --git a/prover/prover_test.go b/prover/prover_test.go index 433f3a8c6..380df8c4f 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -218,7 +218,11 @@ func (s *ProverTestSuite) TestContestWrongBlocks() { })) s.p.cfg.ContestControversialProofs = true s.p.cfg.GuardianProver = true + + // Submit a wrong proof at first. sink := make(chan *bindings.TaikoL1ClientTransitionProved) + header, err := s.p.rpc.L2.HeaderByNumber(context.Background(), e.BlockId) + s.Nil(err) sub, err := s.p.rpc.TaikoL1.WatchTransitionProved(nil, sink, nil) s.Nil(err) @@ -227,23 +231,34 @@ func (s *ProverTestSuite) TestContestWrongBlocks() { close(sink) }() - header, err := s.p.rpc.L2.HeaderByNumber(context.Background(), e.BlockId) - s.Nil(err) - s.Greater(header.Number.Uint64(), uint64(0)) - s.Nil(s.p.onTransitionProved(context.Background(), &bindings.TaikoL1ClientTransitionProved{ - BlockId: e.BlockId, - Tier: encoding.TierPseZkevmID, - ParentHash: header.ParentHash, - BlockHash: testutils.RandomHash(), - SignalRoot: testutils.RandomHash(), - })) - s.Nil(s.p.selectSubmitter(encoding.TierGuardianID).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + s.Nil(s.p.proveOp()) + proofWithHeader := <-s.p.proofGenerationCh + proofWithHeader.Opts.BlockHash = testutils.RandomHash() + s.Nil(s.p.selectSubmitter(e.MinTier).SubmitProof(context.Background(), proofWithHeader)) event := <-sink s.Equal(header.Number.Uint64(), event.BlockId.Uint64()) - s.Equal(header.Hash(), common.BytesToHash(event.BlockHash[:])) + s.Equal(common.BytesToHash(proofWithHeader.Opts.BlockHash[:]), common.BytesToHash(event.BlockHash[:])) + s.NotEqual(header.Hash(), common.BytesToHash(event.BlockHash[:])) s.Equal(header.ParentHash, common.BytesToHash(event.ParentHash[:])) - s.Equal(encoding.TierGuardianID, event.Tier) + + // Contest the transition. + contestedSink := make(chan *bindings.TaikoL1ClientTransitionContested) + + contestedSub, err := s.p.rpc.TaikoL1.WatchTransitionContested(nil, contestedSink, nil) + s.Nil(err) + defer func() { + contestedSub.Unsubscribe() + close(contestedSink) + }() + + s.Greater(header.Number.Uint64(), uint64(0)) + s.Nil(s.p.onTransitionProved(context.Background(), event)) + + contestedEvent := <-contestedSink + s.Equal(header.Number.Uint64(), contestedEvent.BlockId.Uint64()) + s.Equal(common.BytesToHash(proofWithHeader.Opts.BlockHash[:]), common.BytesToHash(contestedEvent.BlockHash[:])) + s.Equal(header.ParentHash, common.BytesToHash(contestedEvent.ParentHash[:])) } func (s *ProverTestSuite) TestProveExpiredUnassignedBlock() { From fd1a1463eb5cbac950858b124509aaf96e86619f Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 14:48:54 +0800 Subject: [PATCH 52/63] feat(prover): more listeners --- driver/chain_syncer/calldata/syncer_test.go | 2 +- driver/chain_syncer/chain_syncer_test.go | 2 +- driver/driver_test.go | 2 +- driver/state/state.go | 18 ++- proposer/proposer_test.go | 2 +- prover/proof_submitter/proof_contester.go | 7 +- .../proof_submitter/proof_submitter_test.go | 2 +- prover/proof_submitter/transaction/sender.go | 4 + .../transaction/sender_test.go | 2 + prover/prover.go | 106 ++++++++++++++---- prover/prover_test.go | 13 ++- testutils/suite.go | 7 +- 12 files changed, 133 insertions(+), 34 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer_test.go b/driver/chain_syncer/calldata/syncer_test.go index 05718a902..8db3b45fa 100644 --- a/driver/chain_syncer/calldata/syncer_test.go +++ b/driver/chain_syncer/calldata/syncer_test.go @@ -56,7 +56,7 @@ func (s *CalldataSyncerTestSuite) SetupTest() { L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, + WaitReceiptTimeout: 12 * time.Second, ProverEndpoints: s.ProverEndpoints, OptimisticTierFee: common.Big256, SgxTierFee: common.Big256, diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index d31fdb348..a4af01544 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -58,7 +58,7 @@ func (s *ChainSyncerTestSuite) SetupTest() { L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, + WaitReceiptTimeout: 12 * time.Second, ProverEndpoints: s.ProverEndpoints, OptimisticTierFee: common.Big256, SgxTierFee: common.Big256, diff --git a/driver/driver_test.go b/driver/driver_test.go index d3fdbcde2..40df0e74d 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -62,7 +62,7 @@ func (s *DriverTestSuite) SetupTest() { L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, + WaitReceiptTimeout: 12 * time.Second, ProverEndpoints: s.ProverEndpoints, OptimisticTierFee: common.Big256, SgxTierFee: common.Big256, diff --git a/driver/state/state.go b/driver/state/state.go index b76c8f752..e15b69b69 100644 --- a/driver/state/state.go +++ b/driver/state/state.go @@ -167,9 +167,23 @@ func (s *State) startSubscriptions(ctx context.Context) { case e := <-s.blockProposedCh: s.setHeadBlockID(e.BlockId) case e := <-s.transitionProvedCh: - log.Info("✅ Block proven", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) + log.Info( + "✅ Transition proven", + "blockID", e.BlockId, + "parentHash", common.Hash(e.ParentHash), + "hash", common.Hash(e.BlockHash), + "signalRoot", common.Hash(e.SignalRoot), + "prover", e.Prover, + ) case e := <-s.blockVerifiedCh: - log.Info("📈 Block verified", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) + log.Info( + "📈 Block verified", + "blockID", e.BlockId, + "hash", common.Hash(e.BlockHash), + "signalRoot", common.Hash(e.SignalRoot), + "assignedProver", e.AssignedProver, + "prover", e.Prover, + ) case e := <-s.crossChainSynced: // Verify the protocol synced block, check if it exists in // L2 execution engine. diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index f841d0992..5b1552e18 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -44,7 +44,7 @@ func (s *ProposerTestSuite) SetupTest() { ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, ProposeBlockTxReplacementMultiplier: 2, - WaitReceiptTimeout: 10 * time.Second, + WaitReceiptTimeout: 12 * time.Second, ProverEndpoints: s.ProverEndpoints, OptimisticTierFee: common.Big256, SgxTierFee: common.Big256, diff --git a/prover/proof_submitter/proof_contester.go b/prover/proof_submitter/proof_contester.go index 2e976d100..ce93d4be2 100644 --- a/prover/proof_submitter/proof_contester.go +++ b/prover/proof_submitter/proof_contester.go @@ -126,8 +126,11 @@ func (c *ProofContester) SubmitContest( Meta: &blockProposedEvent.Meta, Header: header, Proof: []byte{}, - Opts: &proofProducer.ProofRequestOptions{EventL1Hash: blockProposedEvent.Raw.BlockHash}, - Tier: transitionProvedEvent.Tier, + Opts: &proofProducer.ProofRequestOptions{ + EventL1Hash: blockProposedEvent.Raw.BlockHash, + SignalRoot: evidence.SignalRoot, + }, + Tier: transitionProvedEvent.Tier, }, c.txBuilder.Build(ctx, transitionProvedEvent.BlockId, input), ); err != nil { diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index 3fa6828f1..bbd5e0003 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -83,7 +83,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() { L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, + WaitReceiptTimeout: 12 * time.Second, ProverEndpoints: s.ProverEndpoints, OptimisticTierFee: common.Big256, SgxTierFee: common.Big256, diff --git a/prover/proof_submitter/transaction/sender.go b/prover/proof_submitter/transaction/sender.go index dba02ad83..3ae2fcab3 100644 --- a/prover/proof_submitter/transaction/sender.go +++ b/prover/proof_submitter/transaction/sender.go @@ -110,8 +110,12 @@ func (s *Sender) Send( log.Info( "💰 Your block proof was accepted", "blockID", proofWithHeader.BlockID, + "parentHash", proofWithHeader.Header.ParentHash, + "hash", proofWithHeader.Header.Hash(), + "signalRoot", proofWithHeader.Opts.SignalRoot, "txHash", tx.Hash(), "tier", proofWithHeader.Tier, + "isContest", len(proofWithHeader.Proof) == 0, ) return nil diff --git a/prover/proof_submitter/transaction/sender_test.go b/prover/proof_submitter/transaction/sender_test.go index 1ca00de66..80a07e2aa 100644 --- a/prover/proof_submitter/transaction/sender_test.go +++ b/prover/proof_submitter/transaction/sender_test.go @@ -49,6 +49,7 @@ func (s *TransactionTestSuite) TestSendTxWithBackoff() { &proofProducer.ProofWithHeader{ Meta: meta, BlockID: common.Big1, + Header: &types.Header{}, Opts: &proofProducer.ProofRequestOptions{EventL1Hash: l1Head.Hash()}, }, func(nonce *big.Int) (*types.Transaction, error) { return nil, errors.New("L1_TEST") }, @@ -59,6 +60,7 @@ func (s *TransactionTestSuite) TestSendTxWithBackoff() { &proofProducer.ProofWithHeader{ Meta: meta, BlockID: common.Big1, + Header: &types.Header{}, Opts: &proofProducer.ProofRequestOptions{EventL1Hash: l1Head.Hash()}, }, func(nonce *big.Int) (*types.Transaction, error) { diff --git a/prover/prover.go b/prover/prover.go index 187af6012..47c2dfb6e 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -296,8 +296,9 @@ func (p *Prover) eventLoop() { log.Error("Handle TransitionProved event error", "error", err) } case e := <-p.transitionContestedCh: - // TODO: add a listener. - log.Info("Transaction contested", "event", e) + if err := p.onTransitionContested(p.ctx, e); err != nil { + log.Error("Handle TransitionContested event error", "error", err) + } case e := <-p.proofWindowExpiredCh: if err := p.onProvingWindowExpired(p.ctx, e); err != nil { log.Error("Handle provingWindow expired event error", "error", err) @@ -625,18 +626,69 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc }() } +// onTransitionContested tries to submit a higher tier proof for the contested transition. +func (p *Prover) onTransitionContested(ctx context.Context, e *bindings.TaikoL1ClientTransitionContested) error { + log.Info( + "🗡 Transition contested", + "blockID", e.BlockId, + "parentHash", common.Bytes2Hex(e.ParentHash[:]), + "hash", common.Bytes2Hex(e.BlockHash[:]), + "signalRoot", common.BytesToHash(e.SignalRoot[:]), + "contester", e.Contester, + "bond", e.ContestBond, + ) + + // If this prover is not in contest mode, we simply output a log and return. + if !p.cfg.ContestControversialProofs { + return nil + } + + // Compare the contested transition to the block in local L2 canonical chain. + isValidProof, err := p.isValidProof( + ctx, + e.BlockId, + e.ParentHash, + e.BlockHash, + e.SignalRoot, + ) + if err != nil { + return err + } + if isValidProof { + log.Info( + "Contested transition is valid to local canonical chain, ignore the contest", + "blockID", e.BlockId, + "parentHash", common.Bytes2Hex(e.ParentHash[:]), + "hash", common.Bytes2Hex(e.BlockHash[:]), + "signalRoot", common.BytesToHash(e.SignalRoot[:]), + "contester", e.Contester, + "bond", e.ContestBond, + ) + return nil + } + + l1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: e.BlockId}) + if err != nil { + return err + } + + return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(l1Height+1), e.Tier+1, nil) +} + // onBlockVerified update the latestVerified block in current state, and cancels // the block being proven if it's verified. -func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1ClientBlockVerified) error { - metrics.ProverLatestVerifiedIDGauge.Update(event.BlockId.Int64()) +func (p *Prover) onBlockVerified(ctx context.Context, e *bindings.TaikoL1ClientBlockVerified) error { + metrics.ProverLatestVerifiedIDGauge.Update(e.BlockId.Int64()) - p.latestVerifiedL1Height = event.Raw.BlockNumber + p.latestVerifiedL1Height = e.Raw.BlockNumber log.Info( "New verified block", - "blockID", event.BlockId, - "hash", common.BytesToHash(event.BlockHash[:]), - "prover", event.Prover, + "blockID", e.BlockId, + "hash", common.BytesToHash(e.BlockHash[:]), + "signalRoot", common.BytesToHash(e.SignalRoot[:]), + "assignedProver", e.AssignedProver, + "prover", e.Prover, ) return nil @@ -665,7 +717,10 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 isValidProof, err := p.isValidProof( ctx, - event, + event.BlockId, + event.ParentHash, + event.BlockHash, + event.SignalRoot, ) if err != nil { return err @@ -680,7 +735,7 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 } log.Info( - "Contest a proven block", + "Contest a proven transition", "blockID", event.BlockId, "l1Height", l1Height, "tier", event.Tier, @@ -689,7 +744,7 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 "signalRoot", common.Bytes2Hex(event.SignalRoot[:]), ) - return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), event) + return p.requestProofByBlockID(event.BlockId, new(big.Int).SetUint64(l1Height+1), event.Tier, event) } // Name returns the application name. @@ -774,44 +829,51 @@ func (p *Prover) closeSubscription() { } // isValidProof checks if the given proof is a valid one, comparing to current L2 node canonical chain. -func (p *Prover) isValidProof(ctx context.Context, event *bindings.TaikoL1ClientTransitionProved) (bool, error) { - parent, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId) +func (p *Prover) isValidProof( + ctx context.Context, + blockID *big.Int, + parentHash common.Hash, + blockHash common.Hash, + signalRoot common.Hash, +) (bool, error) { + parent, err := p.rpc.L2ParentByBlockId(ctx, blockID) if err != nil { return false, err } - block, err := p.rpc.L2.BlockByNumber(ctx, event.BlockId) + block, err := p.rpc.L2.BlockByNumber(ctx, blockID) if err != nil { return false, err } l2SignalService, err := p.rpc.TaikoL2.Resolve0( - &bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}, + &bind.CallOpts{Context: ctx, BlockNumber: blockID}, rpc.StringToBytes32("signal_service"), false, ) if err != nil { return false, err } - signalRoot, err := p.rpc.GetStorageRoot( + root, err := p.rpc.GetStorageRoot( ctx, p.rpc.L2GethClient, l2SignalService, - event.BlockId, + blockID, ) if err != nil { return false, err } - return parent.Hash() == event.ParentHash && - block.Hash() == event.BlockHash && - signalRoot == event.SignalRoot, nil + return parent.Hash() == parentHash && + block.Hash() == blockHash && + root == signalRoot, nil } // requestProofByBlockID performs a proving operation for the given block. func (p *Prover) requestProofByBlockID( blockID *big.Int, l1Height *big.Int, + minTier uint16, // If this event is not nil, then the prover will try contesting the transition. transitionProvedEvent *bindings.TaikoL1ClientTransitionProved, ) error { @@ -847,7 +909,7 @@ func (p *Prover) requestProofByBlockID( } // If there is no proof submitter selected, skip proving it. - if proofSubmitter := p.selectSubmitter(event.MinTier); proofSubmitter != nil { + if proofSubmitter := p.selectSubmitter(minTier); proofSubmitter != nil { return proofSubmitter.RequestProof(ctx, event) } @@ -927,7 +989,7 @@ func (p *Prover) onProvingWindowExpired(ctx context.Context, e *bindings.TaikoL1 return nil } - return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber), nil) + return p.requestProofByBlockID(e.BlockId, new(big.Int).SetUint64(e.Raw.BlockNumber), e.MinTier, nil) } // getProvingWindow returns the provingWindow of the given proposed block. diff --git a/prover/prover_test.go b/prover/prover_test.go index 380df8c4f..b6c11624f 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -61,6 +61,7 @@ func (s *ProverTestSuite) SetupTest() { MinSgxTierFee: common.Big1, MinPseZkevmTierFee: common.Big1, HTTPServerPort: uint64(port), + WaitReceiptTimeout: 12 * time.Second, }))) p.srv = testutils.NewTestProverServer( &s.ClientTestSuite, @@ -104,7 +105,7 @@ func (s *ProverTestSuite) SetupTest() { L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, - WaitReceiptTimeout: 10 * time.Second, + WaitReceiptTimeout: 12 * time.Second, ProverEndpoints: []*url.URL{proverServerUrl}, OptimisticTierFee: common.Big256, SgxTierFee: common.Big256, @@ -244,7 +245,6 @@ func (s *ProverTestSuite) TestContestWrongBlocks() { // Contest the transition. contestedSink := make(chan *bindings.TaikoL1ClientTransitionContested) - contestedSub, err := s.p.rpc.TaikoL1.WatchTransitionContested(nil, contestedSink, nil) s.Nil(err) defer func() { @@ -259,6 +259,15 @@ func (s *ProverTestSuite) TestContestWrongBlocks() { s.Equal(header.Number.Uint64(), contestedEvent.BlockId.Uint64()) s.Equal(common.BytesToHash(proofWithHeader.Opts.BlockHash[:]), common.BytesToHash(contestedEvent.BlockHash[:])) s.Equal(header.ParentHash, common.BytesToHash(contestedEvent.ParentHash[:])) + + s.Nil(s.p.onTransitionContested(context.Background(), contestedEvent)) + s.Nil(s.p.selectSubmitter(contestedEvent.Tier+1).SubmitProof(context.Background(), <-s.p.proofGenerationCh)) + provenEvent := <-sink + + s.Equal(header.Number.Uint64(), provenEvent.BlockId.Uint64()) + s.Equal(header.Hash(), common.BytesToHash(provenEvent.BlockHash[:])) + s.Equal(header.ParentHash, common.BytesToHash(provenEvent.ParentHash[:])) + s.Greater(provenEvent.Tier, contestedEvent.Tier) } func (s *ProverTestSuite) TestProveExpiredUnassignedBlock() { diff --git a/testutils/suite.go b/testutils/suite.go index 49caa9857..8312ada83 100644 --- a/testutils/suite.go +++ b/testutils/suite.go @@ -82,7 +82,7 @@ func (s *ClientTestSuite) SetupTest() { s.Nil(err) if tokenBalance.Cmp(common.Big0) == 0 { - // Do not verify zk proofs in tests. + // Do not verify zk && sgx proofs in tests. addressManager, err := bindings.NewAddressManager( common.HexToAddress(os.Getenv("ADDRESS_MANAGER_CONTRACT_ADDRESS")), rpcCli.L1, @@ -103,6 +103,11 @@ func (s *ClientTestSuite) SetupTest() { _, err = rpc.WaitReceipt(context.Background(), rpcCli.L1, tx) s.Nil(err) + tx, err = addressManager.SetAddress(opts, chainID, rpc.StringToBytes32("tier_sgx"), common.Address{}) + s.Nil(err) + _, err = rpc.WaitReceipt(context.Background(), rpcCli.L1, tx) + s.Nil(err) + // Deposit taiko tokens for provers. opts, err = bind.NewKeyedTransactorWithChainID(l1ProverPrivKey, rpcCli.L1ChainID) s.Nil(err) From 5dc59d34c9650807aeda5c39b5b2e2305de393e1 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 15:20:11 +0800 Subject: [PATCH 53/63] feat: update some flags --- cmd/flags/prover.go | 8 ++++---- prover/config.go | 4 ++-- prover/prover.go | 6 +++--- prover/prover_test.go | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 49ed2abc9..bc5a326ef 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -117,9 +117,9 @@ var ( Category: proverCategory, } // Running mode - ContestControversialProofs = &cli.BoolFlag{ - Name: "mode.contest", - Usage: "Whether you want to contest wrong proofs with higher tier proofs", + ContesterMode = &cli.BoolFlag{ + Name: "mode.contester", + Usage: "Whether you want to contest wrong transitions with higher tier proofs", Category: proverCategory, Value: false, } @@ -167,7 +167,7 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ ProveBlockMaxTxGasTipCap, Graffiti, ProveUnassignedBlocks, - ContestControversialProofs, + ContesterMode, ProveBlockTxGasLimit, ProverHTTPServerPort, ProverCapacity, diff --git a/prover/config.go b/prover/config.go index 7cd7aa2cf..57c29b5da 100644 --- a/prover/config.go +++ b/prover/config.go @@ -35,7 +35,7 @@ type Config struct { BackOffMaxRetrys uint64 BackOffRetryInterval time.Duration ProveUnassignedBlocks bool - ContestControversialProofs bool + ContesterMode bool RPCTimeout *time.Duration WaitReceiptTimeout time.Duration ProveBlockGasLimit *uint64 @@ -122,7 +122,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), ProveUnassignedBlocks: c.Bool(flags.ProveUnassignedBlocks.Name), - ContestControversialProofs: c.Bool(flags.ContestControversialProofs.Name), + ContesterMode: c.Bool(flags.ContesterMode.Name), RPCTimeout: timeout, WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProveBlockGasLimit: proveBlockTxGasLimit, diff --git a/prover/prover.go b/prover/prover.go index 47c2dfb6e..869854693 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -638,8 +638,8 @@ func (p *Prover) onTransitionContested(ctx context.Context, e *bindings.TaikoL1C "bond", e.ContestBond, ) - // If this prover is not in contest mode, we simply output a log and return. - if !p.cfg.ContestControversialProofs { + // If this prover is not in contester mode, we simply output a log and return. + if !p.cfg.ContesterMode { return nil } @@ -711,7 +711,7 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 // If this prover is in contest mode, we check the validity of this proof and if it's invalid, // contest it with a higher tier proof. - if !p.cfg.ContestControversialProofs { + if !p.cfg.ContesterMode { return nil } diff --git a/prover/prover_test.go b/prover/prover_test.go index b6c11624f..07bd819a6 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -211,13 +211,13 @@ func (s *ProverTestSuite) TestOnBlockVerified() { } func (s *ProverTestSuite) TestContestWrongBlocks() { - s.p.cfg.ContestControversialProofs = false + s.p.cfg.ContesterMode = false e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) s.Nil(s.p.onTransitionProved(context.Background(), &bindings.TaikoL1ClientTransitionProved{ BlockId: e.BlockId, Tier: e.MinTier, })) - s.p.cfg.ContestControversialProofs = true + s.p.cfg.ContesterMode = true s.p.cfg.GuardianProver = true // Submit a wrong proof at first. From 478a799dc157b168b57716438cac4a0ec0866860 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 15:31:53 +0800 Subject: [PATCH 54/63] chore: update ci --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b1491c56..64cc60533 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main] + branches: [main,contestable-zkrollup] tags: - "v*" From c688fb78c73e10ad4614cf6f51a2d6271d7012c8 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 15:32:03 +0800 Subject: [PATCH 55/63] chore: update ci --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 64cc60533..1b1491c56 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main,contestable-zkrollup] + branches: [main] tags: - "v*" From 01b7d377c1357b53f3934f58e1e81799e6334e63 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 13 Oct 2023 14:36:52 +0800 Subject: [PATCH 56/63] feat: changes based on feedbacks --- cmd/flags/driver.go | 2 +- cmd/flags/proposer.go | 2 +- prover/proof_submitter/proof_contester.go | 2 +- prover/proof_submitter/transaction/builder.go | 6 +++--- prover/proof_submitter/transaction/sender.go | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/flags/driver.go b/cmd/flags/driver.go index 53218736b..3b02a3e04 100644 --- a/cmd/flags/driver.go +++ b/cmd/flags/driver.go @@ -33,7 +33,7 @@ var ( } P2PSyncTimeout = &cli.DurationFlag{ Name: "p2p.syncTimeout", - Usage: "P2P syncing timeout in seconds, if no sync progress is made within this time span, " + + Usage: "P2P syncing timeout, if no sync progress is made within this time span, " + "driver will stop the P2P sync and insert all remaining L2 blocks one by one", Value: 1 * time.Hour, Category: driverCategory, diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index b8f9a335b..a5d529f0c 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -68,7 +68,7 @@ var ( Usage: "Time interval to propose empty blocks", Category: proposerCategory, } - // Proposing metadata realted. + // Proposing metadata related. ExtraData = &cli.StringFlag{ Name: "extraData", Usage: "Block extra data set by the proposer (default = client version)", diff --git a/prover/proof_submitter/proof_contester.go b/prover/proof_submitter/proof_contester.go index ce93d4be2..757a47d53 100644 --- a/prover/proof_submitter/proof_contester.go +++ b/prover/proof_submitter/proof_contester.go @@ -109,7 +109,7 @@ func (c *ProofContester) SubmitContest( return err } - // Genreate an evidence for contest. + // Generate an evidence for contest. evidence, err := c.evidenceBuilder.ForContest(ctx, header, c.l2SignalService, transitionProvedEvent) if err != nil { return err diff --git a/prover/proof_submitter/transaction/builder.go b/prover/proof_submitter/transaction/builder.go index da9a142b7..a9e9e92f2 100644 --- a/prover/proof_submitter/transaction/builder.go +++ b/prover/proof_submitter/transaction/builder.go @@ -13,8 +13,8 @@ import ( "github.com/taikoxyz/taiko-client/pkg/rpc" ) -// TxBuiler will build a transaction with the given nonce. -type TxBuiler func(nonce *big.Int) (*types.Transaction, error) +// TxBuilder will build a transaction with the given nonce. +type TxBuilder func(nonce *big.Int) (*types.Transaction, error) // ProveBlockTxBuilder is responsible for building ProveBlock transactions. type ProveBlockTxBuilder struct { @@ -47,7 +47,7 @@ func NewProveBlockTxBuilder( } // Build creates a new ProveBlock transaction with the given nonce. -func (a *ProveBlockTxBuilder) Build(ctx context.Context, blockID *big.Int, input []byte) TxBuiler { +func (a *ProveBlockTxBuilder) Build(ctx context.Context, blockID *big.Int, input []byte) TxBuilder { return func(nonce *big.Int) (*types.Transaction, error) { a.mutex.Lock() defer a.mutex.Unlock() diff --git a/prover/proof_submitter/transaction/sender.go b/prover/proof_submitter/transaction/sender.go index 3ae2fcab3..55ee7ddec 100644 --- a/prover/proof_submitter/transaction/sender.go +++ b/prover/proof_submitter/transaction/sender.go @@ -55,7 +55,7 @@ func NewSender( func (s *Sender) Send( ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader, - txAssembler TxBuiler, + buildTx TxBuilder, ) error { var ( isUnretryableError bool @@ -77,12 +77,12 @@ func (s *Sender) Send( } // Assemble the taikoL1.proveBlock transaction. - tx, err := txAssembler(nonce) + tx, err := buildTx(nonce) if err != nil { err = encoding.TryParsingCustomError(err) if isSubmitProofTxErrorRetryable(err, proofWithHeader.BlockID) { - log.Info("Retry sending TaikoL1.proveBlock transaction", "blockID", proofWithHeader.BlockID, "reason", err) - if strings.Contains(err.Error(), core.ErrNonceTooLow.Error()) { + log.Warn("Retry sending TaikoL1.proveBlock transaction", "blockID", proofWithHeader.BlockID, "reason", err) + if errors.Is(err, core.ErrNonceTooLow) { nonce = nil } From acc4722513d8df43e7b64b8c896c5e5bdd7d99f5 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 13 Oct 2023 14:49:55 +0800 Subject: [PATCH 57/63] feat: update bindings --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 38 ++--- bindings/gen_taiko_l2.go | 338 +++++++++++++++++++++++++++++++-------- 3 files changed, 284 insertions(+), 94 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 6fda9247f..088873da9 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -2bcf2bf4b43456484ac3974d7360e5007accd741 +b3a77cccd8c68c10955327f28a286a554e4e9683 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index 0a313d77a..9acc36ba1 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -74,11 +74,7 @@ type TaikoDataConfig struct { BlockRingBufferSize uint64 MaxBlocksToVerifyPerProposal uint64 BlockMaxGasLimit uint32 - BlockFeeBaseGas uint32 BlockMaxTxListBytes *big.Int - ProposerRewardPerL1Block *big.Int - ProposerRewardMax *big.Int - ProposerRewardPoolPctg uint8 LivenessBond *big.Int EthDepositRingBufferSize *big.Int EthDepositMinCountPerBlock uint64 @@ -144,7 +140,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardPerL1Block\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"proposerRewardMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"proposerRewardPoolPctg\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConfigValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConfigValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -388,7 +384,7 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlock(blockId uint64) (Taik // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint128,uint128,uint8,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint24,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getConfig") @@ -405,14 +401,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (Taiko // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint128,uint128,uint8,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint24,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint128,uint128,uint8,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint24,uint96,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } @@ -1308,15 +1304,14 @@ type TaikoL1ClientBlockProposed struct { AssignedProver common.Address LivenessBond *big.Int ProverFee *big.Int - Reward *big.Int MinTier uint16 Meta TaikoDataBlockMetadata Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed is a free log retrieval operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. +// FilterBlockProposed is a free log retrieval operation binding the contract event 0xc857f5d042c0ceb165ef70eab0812ba2e6b15a03ce07638b58efc04dbb175ef6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { var blockIdRule []interface{} @@ -1335,9 +1330,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.Filt return &TaikoL1ClientBlockProposedIterator{contract: _TaikoL1Client.contract, event: "BlockProposed", logs: logs, sub: sub}, nil } -// WatchBlockProposed is a free log subscription operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. +// WatchBlockProposed is a free log subscription operation binding the contract event 0xc857f5d042c0ceb165ef70eab0812ba2e6b15a03ce07638b58efc04dbb175ef6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} @@ -1381,9 +1376,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.Watch }), nil } -// ParseBlockProposed is a log parse operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. +// ParseBlockProposed is a log parse operation binding the contract event 0xc857f5d042c0ceb165ef70eab0812ba2e6b15a03ce07638b58efc04dbb175ef6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed(log types.Log) (*TaikoL1ClientBlockProposed, error) { event := new(TaikoL1ClientBlockProposed) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed", log); err != nil { @@ -1466,15 +1461,14 @@ type TaikoL1ClientBlockProposed0 struct { AssignedProver common.Address LivenessBond *big.Int ProverFee *big.Int - Reward *big.Int MinTier uint16 Meta TaikoDataBlockMetadata Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. +// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0xc857f5d042c0ceb165ef70eab0812ba2e6b15a03ce07638b58efc04dbb175ef6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { var blockIdRule []interface{} @@ -1493,9 +1487,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.Fil return &TaikoL1ClientBlockProposed0Iterator{contract: _TaikoL1Client.contract, event: "BlockProposed0", logs: logs, sub: sub}, nil } -// WatchBlockProposed0 is a free log subscription operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. +// WatchBlockProposed0 is a free log subscription operation binding the contract event 0xc857f5d042c0ceb165ef70eab0812ba2e6b15a03ce07638b58efc04dbb175ef6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { var blockIdRule []interface{} @@ -1539,9 +1533,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.Watc }), nil } -// ParseBlockProposed0 is a log parse operation binding the contract event 0x3bc85eed257804b26e2232e767692931a620954ad0ae6ca5c58adb22be553418. +// ParseBlockProposed0 is a log parse operation binding the contract event 0xc857f5d042c0ceb165ef70eab0812ba2e6b15a03ce07638b58efc04dbb175ef6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint256 reward, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint96 livenessBond, uint256 proverFee, uint16 minTier, (bytes32,bytes32,bytes32,bytes32,uint64,uint64,uint64,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed0(log types.Log) (*TaikoL1ClientBlockProposed0, error) { event := new(TaikoL1ClientBlockProposed0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed0", log); err != nil { diff --git a/bindings/gen_taiko_l2.go b/bindings/gen_taiko_l2.go index c1b40a319..59922f8e1 100644 --- a/bindings/gen_taiko_l2.go +++ b/bindings/gen_taiko_l2.go @@ -29,9 +29,18 @@ var ( _ = abi.ConvertType ) +// TaikoL2Config is an auto generated low-level Go binding around an user-defined struct. +type TaikoL2Config struct { + GasTargetPerL1Block uint64 + BasefeeAdjustmentQuotient *big.Int + BlockRewardPerL1Block *big.Int + BlockRewardPoolMax *big.Int + BlockRewardPoolPctg uint8 +} + // TaikoL2ClientMetaData contains all meta data concerning the TaikoL2Client contract. var TaikoL2ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"EIP1559_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_GAS_EXCESS_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"gasExcess\",\"type\":\"uint128\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"syncedL1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"get1559Params\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"adjustmentQuotient\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"syncedL1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"_gasExcess\",\"type\":\"uint128\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"EIP1559_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_GAS_EXCESS_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"gasExcess\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"blockReward\",\"type\":\"uint128\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ANCHOR_GAS_DEDUCT\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accumulatedReward\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"avgGasUsed\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"gasTargetPerL1Block\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"basefeeAdjustmentQuotient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockRewardPerL1Block\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"blockRewardPoolMax\",\"type\":\"uint128\"},{\"internalType\":\"uint8\",\"name\":\"blockRewardPoolPctg\",\"type\":\"uint8\"}],\"internalType\":\"structTaikoL2.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"_gasExcess\",\"type\":\"uint128\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"l1VerifiedBlocks\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"l2Hashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // TaikoL2ClientABI is the input ABI used to generate the binding from. @@ -180,6 +189,37 @@ func (_TaikoL2Client *TaikoL2ClientTransactorRaw) Transact(opts *bind.TransactOp return _TaikoL2Client.Contract.contract.Transact(opts, method, params...) } +// ANCHORGASDEDUCT is a free data retrieval call binding the contract method 0x51bf57b4. +// +// Solidity: function ANCHOR_GAS_DEDUCT() view returns(uint32) +func (_TaikoL2Client *TaikoL2ClientCaller) ANCHORGASDEDUCT(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "ANCHOR_GAS_DEDUCT") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// ANCHORGASDEDUCT is a free data retrieval call binding the contract method 0x51bf57b4. +// +// Solidity: function ANCHOR_GAS_DEDUCT() view returns(uint32) +func (_TaikoL2Client *TaikoL2ClientSession) ANCHORGASDEDUCT() (uint32, error) { + return _TaikoL2Client.Contract.ANCHORGASDEDUCT(&_TaikoL2Client.CallOpts) +} + +// ANCHORGASDEDUCT is a free data retrieval call binding the contract method 0x51bf57b4. +// +// Solidity: function ANCHOR_GAS_DEDUCT() view returns(uint32) +func (_TaikoL2Client *TaikoL2ClientCallerSession) ANCHORGASDEDUCT() (uint32, error) { + return _TaikoL2Client.Contract.ANCHORGASDEDUCT(&_TaikoL2Client.CallOpts) +} + // GOLDENTOUCHADDRESS is a free data retrieval call binding the contract method 0x9ee512f2. // // Solidity: function GOLDEN_TOUCH_ADDRESS() view returns(address) @@ -242,6 +282,37 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) GOLDENTOUCHPRIVATEKEY() (*big. return _TaikoL2Client.Contract.GOLDENTOUCHPRIVATEKEY(&_TaikoL2Client.CallOpts) } +// AccumulatedReward is a free data retrieval call binding the contract method 0x80fad325. +// +// Solidity: function accumulatedReward() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientCaller) AccumulatedReward(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "accumulatedReward") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// AccumulatedReward is a free data retrieval call binding the contract method 0x80fad325. +// +// Solidity: function accumulatedReward() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientSession) AccumulatedReward() (*big.Int, error) { + return _TaikoL2Client.Contract.AccumulatedReward(&_TaikoL2Client.CallOpts) +} + +// AccumulatedReward is a free data retrieval call binding the contract method 0x80fad325. +// +// Solidity: function accumulatedReward() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientCallerSession) AccumulatedReward() (*big.Int, error) { + return _TaikoL2Client.Contract.AccumulatedReward(&_TaikoL2Client.CallOpts) +} + // AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. // // Solidity: function addressManager() view returns(address) @@ -273,88 +344,74 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) AddressManager() (common.Addre return _TaikoL2Client.Contract.AddressManager(&_TaikoL2Client.CallOpts) } -// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. +// AvgGasUsed is a free data retrieval call binding the contract method 0x6d6372c4. // -// Solidity: function gasExcess() view returns(uint128) -func (_TaikoL2Client *TaikoL2ClientCaller) GasExcess(opts *bind.CallOpts) (*big.Int, error) { +// Solidity: function avgGasUsed() view returns(uint32) +func (_TaikoL2Client *TaikoL2ClientCaller) AvgGasUsed(opts *bind.CallOpts) (uint32, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "gasExcess") + err := _TaikoL2Client.contract.Call(opts, &out, "avgGasUsed") if err != nil { - return *new(*big.Int), err + return *new(uint32), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) return out0, err } -// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. +// AvgGasUsed is a free data retrieval call binding the contract method 0x6d6372c4. // -// Solidity: function gasExcess() view returns(uint128) -func (_TaikoL2Client *TaikoL2ClientSession) GasExcess() (*big.Int, error) { - return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) +// Solidity: function avgGasUsed() view returns(uint32) +func (_TaikoL2Client *TaikoL2ClientSession) AvgGasUsed() (uint32, error) { + return _TaikoL2Client.Contract.AvgGasUsed(&_TaikoL2Client.CallOpts) } -// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. +// AvgGasUsed is a free data retrieval call binding the contract method 0x6d6372c4. // -// Solidity: function gasExcess() view returns(uint128) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GasExcess() (*big.Int, error) { - return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) +// Solidity: function avgGasUsed() view returns(uint32) +func (_TaikoL2Client *TaikoL2ClientCallerSession) AvgGasUsed() (uint32, error) { + return _TaikoL2Client.Contract.AvgGasUsed(&_TaikoL2Client.CallOpts) } -// Get1559Params is a free data retrieval call binding the contract method 0x594e47ca. +// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // -// Solidity: function get1559Params() pure returns(uint64 gasTarget, uint256 adjustmentQuotient) -func (_TaikoL2Client *TaikoL2ClientCaller) Get1559Params(opts *bind.CallOpts) (struct { - GasTarget uint64 - AdjustmentQuotient *big.Int -}, error) { +// Solidity: function gasExcess() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientCaller) GasExcess(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "get1559Params") + err := _TaikoL2Client.contract.Call(opts, &out, "gasExcess") - outstruct := new(struct { - GasTarget uint64 - AdjustmentQuotient *big.Int - }) if err != nil { - return *outstruct, err + return *new(*big.Int), err } - outstruct.GasTarget = *abi.ConvertType(out[0], new(uint64)).(*uint64) - outstruct.AdjustmentQuotient = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - return *outstruct, err + return out0, err } -// Get1559Params is a free data retrieval call binding the contract method 0x594e47ca. +// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // -// Solidity: function get1559Params() pure returns(uint64 gasTarget, uint256 adjustmentQuotient) -func (_TaikoL2Client *TaikoL2ClientSession) Get1559Params() (struct { - GasTarget uint64 - AdjustmentQuotient *big.Int -}, error) { - return _TaikoL2Client.Contract.Get1559Params(&_TaikoL2Client.CallOpts) +// Solidity: function gasExcess() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientSession) GasExcess() (*big.Int, error) { + return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) } -// Get1559Params is a free data retrieval call binding the contract method 0x594e47ca. +// GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // -// Solidity: function get1559Params() pure returns(uint64 gasTarget, uint256 adjustmentQuotient) -func (_TaikoL2Client *TaikoL2ClientCallerSession) Get1559Params() (struct { - GasTarget uint64 - AdjustmentQuotient *big.Int -}, error) { - return _TaikoL2Client.Contract.Get1559Params(&_TaikoL2Client.CallOpts) +// Solidity: function gasExcess() view returns(uint128) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GasExcess() (*big.Int, error) { + return _TaikoL2Client.Contract.GasExcess(&_TaikoL2Client.CallOpts) } // GetBasefee is a free data retrieval call binding the contract method 0xa7e022d1. // -// Solidity: function getBasefee(uint64 syncedL1Height, uint32 parentGasUsed) view returns(uint256 basefee) -func (_TaikoL2Client *TaikoL2ClientCaller) GetBasefee(opts *bind.CallOpts, syncedL1Height uint64, parentGasUsed uint32) (*big.Int, error) { +// Solidity: function getBasefee(uint64 l1Height, uint32 parentGasUsed) view returns(uint256 basefee) +func (_TaikoL2Client *TaikoL2ClientCaller) GetBasefee(opts *bind.CallOpts, l1Height uint64, parentGasUsed uint32) (*big.Int, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "getBasefee", syncedL1Height, parentGasUsed) + err := _TaikoL2Client.contract.Call(opts, &out, "getBasefee", l1Height, parentGasUsed) if err != nil { return *new(*big.Int), err @@ -368,16 +425,16 @@ func (_TaikoL2Client *TaikoL2ClientCaller) GetBasefee(opts *bind.CallOpts, synce // GetBasefee is a free data retrieval call binding the contract method 0xa7e022d1. // -// Solidity: function getBasefee(uint64 syncedL1Height, uint32 parentGasUsed) view returns(uint256 basefee) -func (_TaikoL2Client *TaikoL2ClientSession) GetBasefee(syncedL1Height uint64, parentGasUsed uint32) (*big.Int, error) { - return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, syncedL1Height, parentGasUsed) +// Solidity: function getBasefee(uint64 l1Height, uint32 parentGasUsed) view returns(uint256 basefee) +func (_TaikoL2Client *TaikoL2ClientSession) GetBasefee(l1Height uint64, parentGasUsed uint32) (*big.Int, error) { + return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, l1Height, parentGasUsed) } // GetBasefee is a free data retrieval call binding the contract method 0xa7e022d1. // -// Solidity: function getBasefee(uint64 syncedL1Height, uint32 parentGasUsed) view returns(uint256 basefee) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBasefee(syncedL1Height uint64, parentGasUsed uint32) (*big.Int, error) { - return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, syncedL1Height, parentGasUsed) +// Solidity: function getBasefee(uint64 l1Height, uint32 parentGasUsed) view returns(uint256 basefee) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBasefee(l1Height uint64, parentGasUsed uint32) (*big.Int, error) { + return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, l1Height, parentGasUsed) } // GetBlockHash is a free data retrieval call binding the contract method 0x23ac7136. @@ -411,6 +468,37 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBlockHash(blockId uint64) ( return _TaikoL2Client.Contract.GetBlockHash(&_TaikoL2Client.CallOpts, blockId) } +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. +// +// Solidity: function getConfig() pure returns((uint64,uint256,uint256,uint128,uint8) config) +func (_TaikoL2Client *TaikoL2ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoL2Config, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "getConfig") + + if err != nil { + return *new(TaikoL2Config), err + } + + out0 := *abi.ConvertType(out[0], new(TaikoL2Config)).(*TaikoL2Config) + + return out0, err + +} + +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. +// +// Solidity: function getConfig() pure returns((uint64,uint256,uint256,uint128,uint8) config) +func (_TaikoL2Client *TaikoL2ClientSession) GetConfig() (TaikoL2Config, error) { + return _TaikoL2Client.Contract.GetConfig(&_TaikoL2Client.CallOpts) +} + +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. +// +// Solidity: function getConfig() pure returns((uint64,uint256,uint256,uint128,uint8) config) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GetConfig() (TaikoL2Config, error) { + return _TaikoL2Client.Contract.GetConfig(&_TaikoL2Client.CallOpts) +} + // GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // // Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) @@ -473,6 +561,82 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainSignalRoot(blockI return _TaikoL2Client.Contract.GetCrossChainSignalRoot(&_TaikoL2Client.CallOpts, blockId) } +// L1VerifiedBlocks is a free data retrieval call binding the contract method 0xaa13bf20. +// +// Solidity: function l1VerifiedBlocks(uint256 blockId) view returns(bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL2Client *TaikoL2ClientCaller) L1VerifiedBlocks(opts *bind.CallOpts, blockId *big.Int) (struct { + BlockHash [32]byte + SignalRoot [32]byte +}, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "l1VerifiedBlocks", blockId) + + outstruct := new(struct { + BlockHash [32]byte + SignalRoot [32]byte + }) + if err != nil { + return *outstruct, err + } + + outstruct.BlockHash = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.SignalRoot = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +// L1VerifiedBlocks is a free data retrieval call binding the contract method 0xaa13bf20. +// +// Solidity: function l1VerifiedBlocks(uint256 blockId) view returns(bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL2Client *TaikoL2ClientSession) L1VerifiedBlocks(blockId *big.Int) (struct { + BlockHash [32]byte + SignalRoot [32]byte +}, error) { + return _TaikoL2Client.Contract.L1VerifiedBlocks(&_TaikoL2Client.CallOpts, blockId) +} + +// L1VerifiedBlocks is a free data retrieval call binding the contract method 0xaa13bf20. +// +// Solidity: function l1VerifiedBlocks(uint256 blockId) view returns(bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL2Client *TaikoL2ClientCallerSession) L1VerifiedBlocks(blockId *big.Int) (struct { + BlockHash [32]byte + SignalRoot [32]byte +}, error) { + return _TaikoL2Client.Contract.L1VerifiedBlocks(&_TaikoL2Client.CallOpts, blockId) +} + +// L2Hashes is a free data retrieval call binding the contract method 0x8551f41e. +// +// Solidity: function l2Hashes(uint256 blockId) view returns(bytes32 blockHash) +func (_TaikoL2Client *TaikoL2ClientCaller) L2Hashes(opts *bind.CallOpts, blockId *big.Int) ([32]byte, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "l2Hashes", blockId) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// L2Hashes is a free data retrieval call binding the contract method 0x8551f41e. +// +// Solidity: function l2Hashes(uint256 blockId) view returns(bytes32 blockHash) +func (_TaikoL2Client *TaikoL2ClientSession) L2Hashes(blockId *big.Int) ([32]byte, error) { + return _TaikoL2Client.Contract.L2Hashes(&_TaikoL2Client.CallOpts, blockId) +} + +// L2Hashes is a free data retrieval call binding the contract method 0x8551f41e. +// +// Solidity: function l2Hashes(uint256 blockId) view returns(bytes32 blockHash) +func (_TaikoL2Client *TaikoL2ClientCallerSession) L2Hashes(blockId *big.Int) ([32]byte, error) { + return _TaikoL2Client.Contract.L2Hashes(&_TaikoL2Client.CallOpts, blockId) +} + // LatestSyncedL1Height is a free data retrieval call binding the contract method 0xc7b96908. // // Solidity: function latestSyncedL1Height() view returns(uint64) @@ -535,6 +699,37 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) Owner() (common.Address, error return _TaikoL2Client.Contract.Owner(&_TaikoL2Client.CallOpts) } +// ParentProposer is a free data retrieval call binding the contract method 0xfca19902. +// +// Solidity: function parentProposer() view returns(address) +func (_TaikoL2Client *TaikoL2ClientCaller) ParentProposer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "parentProposer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ParentProposer is a free data retrieval call binding the contract method 0xfca19902. +// +// Solidity: function parentProposer() view returns(address) +func (_TaikoL2Client *TaikoL2ClientSession) ParentProposer() (common.Address, error) { + return _TaikoL2Client.Contract.ParentProposer(&_TaikoL2Client.CallOpts) +} + +// ParentProposer is a free data retrieval call binding the contract method 0xfca19902. +// +// Solidity: function parentProposer() view returns(address) +func (_TaikoL2Client *TaikoL2ClientCallerSession) ParentProposer() (common.Address, error) { + return _TaikoL2Client.Contract.ParentProposer(&_TaikoL2Client.CallOpts) +} + // PublicInputHash is a free data retrieval call binding the contract method 0xdac5df78. // // Solidity: function publicInputHash() view returns(bytes32) @@ -680,23 +875,23 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) SignAnchor(digest [32]byte, k // Anchor is a paid mutator transaction binding the contract method 0xda69d3db. // -// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 syncedL1Height, uint32 parentGasUsed) returns() -func (_TaikoL2Client *TaikoL2ClientTransactor) Anchor(opts *bind.TransactOpts, l1Hash [32]byte, l1SignalRoot [32]byte, syncedL1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { - return _TaikoL2Client.contract.Transact(opts, "anchor", l1Hash, l1SignalRoot, syncedL1Height, parentGasUsed) +// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) returns() +func (_TaikoL2Client *TaikoL2ClientTransactor) Anchor(opts *bind.TransactOpts, l1Hash [32]byte, l1SignalRoot [32]byte, l1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { + return _TaikoL2Client.contract.Transact(opts, "anchor", l1Hash, l1SignalRoot, l1Height, parentGasUsed) } // Anchor is a paid mutator transaction binding the contract method 0xda69d3db. // -// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 syncedL1Height, uint32 parentGasUsed) returns() -func (_TaikoL2Client *TaikoL2ClientSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, syncedL1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, syncedL1Height, parentGasUsed) +// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) returns() +func (_TaikoL2Client *TaikoL2ClientSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, l1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, l1Height, parentGasUsed) } // Anchor is a paid mutator transaction binding the contract method 0xda69d3db. // -// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 syncedL1Height, uint32 parentGasUsed) returns() -func (_TaikoL2Client *TaikoL2ClientTransactorSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, syncedL1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { - return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, syncedL1Height, parentGasUsed) +// Solidity: function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) returns() +func (_TaikoL2Client *TaikoL2ClientTransactorSession) Anchor(l1Hash [32]byte, l1SignalRoot [32]byte, l1Height uint64, parentGasUsed uint32) (*types.Transaction, error) { + return _TaikoL2Client.Contract.Anchor(&_TaikoL2Client.TransactOpts, l1Hash, l1SignalRoot, l1Height, parentGasUsed) } // Init is a paid mutator transaction binding the contract method 0xcce03bf3. @@ -996,14 +1191,15 @@ func (it *TaikoL2ClientAnchoredIterator) Close() error { // TaikoL2ClientAnchored represents a Anchored event raised by the TaikoL2Client contract. type TaikoL2ClientAnchored struct { - ParentHash [32]byte - GasExcess *big.Int - Raw types.Log // Blockchain specific contextual infos + ParentHash [32]byte + GasExcess *big.Int + BlockReward *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterAnchored is a free log retrieval operation binding the contract event 0xb01a20e23471fa4d881340e2b742c2f84cb2f7a714b34ba370b815478ae4aae0. +// FilterAnchored is a free log retrieval operation binding the contract event 0xf3a1ab67cc789a3e3961363ffd80ff59c13f394ff689b2fb85531a45dd0aa80d. // -// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess) +// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess, uint128 blockReward) func (_TaikoL2Client *TaikoL2ClientFilterer) FilterAnchored(opts *bind.FilterOpts) (*TaikoL2ClientAnchoredIterator, error) { logs, sub, err := _TaikoL2Client.contract.FilterLogs(opts, "Anchored") @@ -1013,9 +1209,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) FilterAnchored(opts *bind.FilterOpt return &TaikoL2ClientAnchoredIterator{contract: _TaikoL2Client.contract, event: "Anchored", logs: logs, sub: sub}, nil } -// WatchAnchored is a free log subscription operation binding the contract event 0xb01a20e23471fa4d881340e2b742c2f84cb2f7a714b34ba370b815478ae4aae0. +// WatchAnchored is a free log subscription operation binding the contract event 0xf3a1ab67cc789a3e3961363ffd80ff59c13f394ff689b2fb85531a45dd0aa80d. // -// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess) +// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess, uint128 blockReward) func (_TaikoL2Client *TaikoL2ClientFilterer) WatchAnchored(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientAnchored) (event.Subscription, error) { logs, sub, err := _TaikoL2Client.contract.WatchLogs(opts, "Anchored") @@ -1050,9 +1246,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) WatchAnchored(opts *bind.WatchOpts, }), nil } -// ParseAnchored is a log parse operation binding the contract event 0xb01a20e23471fa4d881340e2b742c2f84cb2f7a714b34ba370b815478ae4aae0. +// ParseAnchored is a log parse operation binding the contract event 0xf3a1ab67cc789a3e3961363ffd80ff59c13f394ff689b2fb85531a45dd0aa80d. // -// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess) +// Solidity: event Anchored(bytes32 parentHash, uint128 gasExcess, uint128 blockReward) func (_TaikoL2Client *TaikoL2ClientFilterer) ParseAnchored(log types.Log) (*TaikoL2ClientAnchored, error) { event := new(TaikoL2ClientAnchored) if err := _TaikoL2Client.contract.UnpackLog(event, "Anchored", log); err != nil { From 2157a9cf9907ec8d89cad540782d9fd6b0392799 Mon Sep 17 00:00:00 2001 From: RogerLamTd Date: Fri, 13 Oct 2023 15:15:01 -0700 Subject: [PATCH 58/63] add test --- pkg/rpc/subscription_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/rpc/subscription_test.go b/pkg/rpc/subscription_test.go index 7fae688ac..7ce6ced11 100644 --- a/pkg/rpc/subscription_test.go +++ b/pkg/rpc/subscription_test.go @@ -44,6 +44,13 @@ func TestSubscribeTransitionProved(t *testing.T) { ) } +func TestSucscribeTransitionContested(t *testing.T) { + require.NotNil(t, SubscribeTransitionContested( + newTestClient(t).TaikoL1, + make(chan *bindings.TaikoL1ClientTransitionContested, 1024)), + ) +} + func TestSubscribeChainHead(t *testing.T) { require.NotNil(t, SubscribeChainHead( newTestClient(t).L1, From a5504528a990db6101f31c5211b403ead2857bcb Mon Sep 17 00:00:00 2001 From: David Date: Mon, 16 Oct 2023 10:13:57 +0800 Subject: [PATCH 59/63] Update cmd/flags/common.go Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- cmd/flags/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/flags/common.go b/cmd/flags/common.go index ec974e60d..10920f75d 100644 --- a/cmd/flags/common.go +++ b/cmd/flags/common.go @@ -110,7 +110,7 @@ var ( } WaitReceiptTimeout = &cli.DurationFlag{ Name: "rpc.waitReceiptTimeout", - Usage: "Timeout for wait for receipts for RPC transactions", + Usage: "Timeout for waiting for receipts for RPC transactions", Category: commonCategory, Value: 1 * time.Minute, } From d202aa4aec69e5db10a075fa488570931fbc4602 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 16 Oct 2023 10:14:05 +0800 Subject: [PATCH 60/63] Update driver/state/l1_current.go Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- driver/state/l1_current.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/state/l1_current.go b/driver/state/l1_current.go index d35deef18..d42002bd5 100644 --- a/driver/state/l1_current.go +++ b/driver/state/l1_current.go @@ -75,7 +75,7 @@ func (s *State) ResetL1Current( e *bindings.TaikoL1ClientTransitionProved, end eventIterator.EndTransitionProvedEventIterFunc, ) error { - log.Debug("Filtered BlockProven event", "ID", e.BlockId, "hash", common.Hash(e.BlockHash)) + log.Debug("Filtered TransitionProved event", "ID", e.BlockId, "hash", common.Hash(e.BlockHash)) if e.BlockHash == targetHash { heightOrID.ID = e.BlockId end() From b3cd23b19e9aca527e423d98bb1f170891faef8e Mon Sep 17 00:00:00 2001 From: David Date: Mon, 16 Oct 2023 10:14:17 +0800 Subject: [PATCH 61/63] Update driver/state/state.go Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- driver/state/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/state/state.go b/driver/state/state.go index e15b69b69..62cd5a5a1 100644 --- a/driver/state/state.go +++ b/driver/state/state.go @@ -33,7 +33,7 @@ type State struct { // Subscriptions, will automatically resubscribe on errors l1HeadSub event.Subscription // L1 new heads l2HeadSub event.Subscription // L2 new heads - l2TransitionProvedSub event.Subscription // TaikoL1.BlockProven events + l2TransitionProvedSub event.Subscription // TaikoL1.TransitionProved events l2BlockVerifiedSub event.Subscription // TaikoL1.BlockVerified events l2BlockProposedSub event.Subscription // TaikoL1.BlockProposed events l2HeaderSyncedSub event.Subscription // TaikoL1.HeaderSynced events From e7f30bfa5b8539723007037e9a81c55d4fa596fb Mon Sep 17 00:00:00 2001 From: David Date: Mon, 16 Oct 2023 10:14:22 +0800 Subject: [PATCH 62/63] Update proposer/proposer.go Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- proposer/proposer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposer/proposer.go b/proposer/proposer.go index 33e9417ec..06eb44da8 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -485,7 +485,7 @@ func (p *Proposer) updateProposingTicker() { func (p *Proposer) Name() string { return "proposer" } - +// initTierFees initializes the proving fees for every proof tier configured in the protocol for the proposer. func (p *Proposer) initTierFees() error { for _, tier := range p.tiers { log.Info( From 0801636e979b29110ebe4119b0b09b008e61823a Mon Sep 17 00:00:00 2001 From: David Date: Mon, 16 Oct 2023 10:18:04 +0800 Subject: [PATCH 63/63] feat: changes based on feedbacks --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 2 +- driver/state/l1_current.go | 2 +- proposer/proposer.go | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index 088873da9..a1cb9f8bd 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -b3a77cccd8c68c10955327f28a286a554e4e9683 +7d947b2850ed84ef9fd12cb9856e71e38157c1b8 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index 9acc36ba1..8c9fa977c 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -140,7 +140,7 @@ type TaikoDataTransition struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConfigValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_CONTESTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNED_PROVER_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INSUFFICIENT_FEE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ASSIGNMENT_INVALID_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ADDRESS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ASSIGNED_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TIER_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_ID_ZERO\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TRANSITION_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_INVALID_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TXLIST_TOO_LARGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_TRANSITION_TIER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proverFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"minted\",\"type\":\"bool\"}],\"name\":\"TokenCredited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"fromLocalBalance\",\"type\":\"bool\"}],\"name\":\"TokenDebited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokenWithdrawnByOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionContested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"}],\"name\":\"TransitionProved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"verifiedTransitionId\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"minTier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[7]\",\"name\":\"__reserved\",\"type\":\"bytes32[7]\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerifyPerProposal\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint96\",\"name\":\"livenessBond\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rand\",\"type\":\"uint256\"}],\"name\":\"getMinTier\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"tierId\",\"type\":\"uint16\"}],\"name\":\"getTier\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"verifierName\",\"type\":\"bytes32\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint24\",\"name\":\"cooldownWindow\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"provingWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint8\"}],\"internalType\":\"structITierProvider.Tier\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTierIds\",\"outputs\":[{\"internalType\":\"uint16[]\",\"name\":\"\",\"type\":\"uint16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getTransition\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"validityBond\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"contester\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"contestBond\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"tier\",\"type\":\"uint16\"},{\"internalType\":\"bytes32[4]\",\"name\":\"__reserved\",\"type\":\"bytes32[4]\"}],\"internalType\":\"structTaikoData.Transition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConfigValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"difficulty\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"accumulatedReward\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedHeight\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotC\",\"name\":\"slotC\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocksToVerify\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. diff --git a/driver/state/l1_current.go b/driver/state/l1_current.go index d42002bd5..e40587d84 100644 --- a/driver/state/l1_current.go +++ b/driver/state/l1_current.go @@ -95,7 +95,7 @@ func (s *State) ResetL1Current( } if heightOrID.ID == nil { - return nil, nil, fmt.Errorf("BlockProven event not found, hash: %s", targetHash) + return nil, nil, fmt.Errorf("TransitionProved event not found, hash: %s", targetHash) } } diff --git a/proposer/proposer.go b/proposer/proposer.go index 06eb44da8..1293f886b 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -485,6 +485,7 @@ func (p *Proposer) updateProposingTicker() { func (p *Proposer) Name() string { return "proposer" } + // initTierFees initializes the proving fees for every proof tier configured in the protocol for the proposer. func (p *Proposer) initTierFees() error { for _, tier := range p.tiers {