diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e1ab2480..42b5be71e 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: alpha-4 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/bindings/.githead b/bindings/.githead index 5eb06b18e..386337e81 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -9d7bc39c282c6ceb0e62146aa6271d5ceaee7633 +8e398f40bd8693af5966c3ac7bf21cb3516d4b2d diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index fc561d5f6..ac8590fe7 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -9,8 +9,7 @@ import ( ) var ( - OracleProverAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") - SystemProverAddress = common.HexToAddress("0x0000000000000000000000000000000000000001") + OracleProverAddress = common.HexToAddress("0x0000000000000000000000000000000000000001") ) type BlockHeader struct { diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index 3fd544dee..0596918ca 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -48,24 +48,29 @@ type TaikoDataBlockMetadata struct { // TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. type TaikoDataConfig struct { ChainId *big.Int - MaxNumProposedBlocks *big.Int - RingBufferSize *big.Int - MaxVerificationsPerTx *big.Int - BlockMaxGasLimit uint64 - MaxTransactionsPerBlock uint64 - MaxBytesPerTxList uint64 - TxListCacheExpiry *big.Int - ProofCooldownPeriod *big.Int - SystemProofCooldownPeriod *big.Int - RealProofSkipSize *big.Int - EthDepositGas *big.Int - EthDepositMaxFee *big.Int + RelaySignalRoot bool + BlockMaxProposals *big.Int + BlockRingBufferSize *big.Int + BlockMaxVerificationsPerTx *big.Int + BlockMaxGasLimit uint32 + BlockFeeBaseGas uint32 + BlockMaxTransactions uint64 + BlockMaxTxListBytes uint64 + BlockTxListExpiry *big.Int + ProofRegularCooldown *big.Int + ProofOracleCooldown *big.Int + ProofMinWindow uint16 + ProofMaxWindow uint16 EthDepositRingBufferSize *big.Int EthDepositMinCountPerBlock uint64 EthDepositMaxCountPerBlock uint64 - EthDepositMaxAmount *big.Int EthDepositMinAmount *big.Int - RelaySignalRoot bool + EthDepositMaxAmount *big.Int + EthDepositGas *big.Int + EthDepositMaxFee *big.Int + RewardPerGasRange uint32 + RewardOpenMultipler uint8 + RewardOpenMaxCount *big.Int } // TaikoDataEthDeposit is an auto generated low-level Go binding around an user-defined struct. @@ -80,14 +85,14 @@ type TaikoDataForkChoice struct { Key [32]byte BlockHash [32]byte SignalRoot [32]byte - ProvenAt uint64 Prover common.Address + ProvenAt uint64 GasUsed uint32 } // TaikoDataStateVariables is an auto generated low-level Go binding around an user-defined struct. type TaikoDataStateVariables struct { - BlockFee uint64 + FeePerGas uint32 GenesisHeight uint64 GenesisTimestamp uint64 NumBlocks uint64 @@ -98,7 +103,7 @@ type TaikoDataStateVariables struct { // 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\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"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_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF_OVERWRITE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF_OVERWRITE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_SPECIAL_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_SPECIAL_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ORACLE_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ORACLE_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_PROHIBITED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_PROHIBITED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"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\":\"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\":false,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"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\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"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\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"reward\",\"type\":\"uint64\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"reward\",\"type\":\"uint64\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"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\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"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\":\"uint64\",\"name\":\"proofTimeTarget\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"proofTimeIssued\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"adjustmentQuotient\",\"type\":\"uint16\"}],\"name\":\"ProofParamsChanged\",\"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\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getBlock\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"_metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_proposedAt\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumProposedBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ringBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"txListCacheExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofCooldownPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"systemProofCooldownPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"realProofSkipSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasUsed\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"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\":\"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\"},{\"internalType\":\"uint64\",\"name\":\"_initBlockFee\",\"type\":\"uint64\"}],\"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\":\"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\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"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\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"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\":\"\",\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"__reserved70\",\"type\":\"uint16\"},{\"internalType\":\"uint48\",\"name\":\"__reserved71\",\"type\":\"uint48\"},{\"internalType\":\"uint64\",\"name\":\"__reserved72\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved80\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved90\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved91\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BATCH_NOT_AUCTIONABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BID\",\"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_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF_OVERWRITE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF_OVERWRITE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_BETTER_BID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_SPECIAL_PROVER\",\"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_TOO_MANY_OPEN_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_OPEN_BLOCKS\",\"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_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"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\":false,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"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\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"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\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"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\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"reward\",\"type\":\"uint64\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"reward\",\"type\":\"uint64\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"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\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"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\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getBlock\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"_metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"_nextForkChoiceId\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"_verifiedForkChoiceId\",\"type\":\"uint24\"},{\"internalType\":\"bool\",\"name\":\"_proverReleased\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_feePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_rewardPerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_proofWindow\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxProposals\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxTransactions\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"blockTxListExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofRegularCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofOracleCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"proofMinWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"proofMaxWindow\",\"type\":\"uint16\"},{\"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\":\"uint32\",\"name\":\"rewardPerGasRange\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"rewardOpenMultipler\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"rewardOpenMaxCount\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getForkChoice\",\"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\":\"uint32\",\"name\":\"gasUsed\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"feePerGas\",\"type\":\"uint32\"},{\"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\":\"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\"},{\"internalType\":\"uint32\",\"name\":\"_initFeePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_initAvgProofDelay\",\"type\":\"uint16\"}],\"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\":\"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\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"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\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"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\":\"\",\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved70\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved71\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numOpenBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"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\":\"uint64\",\"name\":\"__reserved90\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"feePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"avgProofDelay\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"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. @@ -311,27 +316,51 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) CanDepositEthToL2(amount *big. // GetBlock is a free data retrieval call binding the contract method 0x04c07569. // -// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, address _proposer, uint64 _proposedAt) +// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, uint32 _gasLimit, uint24 _nextForkChoiceId, uint24 _verifiedForkChoiceId, bool _proverReleased, address _proposer, uint32 _feePerGas, uint64 _proposedAt, address _assignedProver, uint32 _rewardPerGas, uint64 _proofWindow) func (_TaikoL1Client *TaikoL1ClientCaller) GetBlock(opts *bind.CallOpts, blockId *big.Int) (struct { - MetaHash [32]byte - Proposer common.Address - ProposedAt uint64 + MetaHash [32]byte + GasLimit uint32 + NextForkChoiceId *big.Int + VerifiedForkChoiceId *big.Int + ProverReleased bool + Proposer common.Address + FeePerGas uint32 + ProposedAt uint64 + AssignedProver common.Address + RewardPerGas uint32 + ProofWindow uint64 }, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getBlock", blockId) outstruct := new(struct { - MetaHash [32]byte - Proposer common.Address - ProposedAt uint64 + MetaHash [32]byte + GasLimit uint32 + NextForkChoiceId *big.Int + VerifiedForkChoiceId *big.Int + ProverReleased bool + Proposer common.Address + FeePerGas uint32 + ProposedAt uint64 + AssignedProver common.Address + RewardPerGas uint32 + ProofWindow uint64 }) if err != nil { return *outstruct, err } outstruct.MetaHash = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - outstruct.Proposer = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - outstruct.ProposedAt = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.GasLimit = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.NextForkChoiceId = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.VerifiedForkChoiceId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.ProverReleased = *abi.ConvertType(out[4], new(bool)).(*bool) + outstruct.Proposer = *abi.ConvertType(out[5], new(common.Address)).(*common.Address) + outstruct.FeePerGas = *abi.ConvertType(out[6], new(uint32)).(*uint32) + outstruct.ProposedAt = *abi.ConvertType(out[7], new(uint64)).(*uint64) + outstruct.AssignedProver = *abi.ConvertType(out[8], new(common.Address)).(*common.Address) + outstruct.RewardPerGas = *abi.ConvertType(out[9], new(uint32)).(*uint32) + outstruct.ProofWindow = *abi.ConvertType(out[10], new(uint64)).(*uint64) return *outstruct, err @@ -339,32 +368,48 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetBlock(opts *bind.CallOpts, blockId // GetBlock is a free data retrieval call binding the contract method 0x04c07569. // -// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, address _proposer, uint64 _proposedAt) +// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, uint32 _gasLimit, uint24 _nextForkChoiceId, uint24 _verifiedForkChoiceId, bool _proverReleased, address _proposer, uint32 _feePerGas, uint64 _proposedAt, address _assignedProver, uint32 _rewardPerGas, uint64 _proofWindow) func (_TaikoL1Client *TaikoL1ClientSession) GetBlock(blockId *big.Int) (struct { - MetaHash [32]byte - Proposer common.Address - ProposedAt uint64 + MetaHash [32]byte + GasLimit uint32 + NextForkChoiceId *big.Int + VerifiedForkChoiceId *big.Int + ProverReleased bool + Proposer common.Address + FeePerGas uint32 + ProposedAt uint64 + AssignedProver common.Address + RewardPerGas uint32 + ProofWindow uint64 }, error) { return _TaikoL1Client.Contract.GetBlock(&_TaikoL1Client.CallOpts, blockId) } // GetBlock is a free data retrieval call binding the contract method 0x04c07569. // -// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, address _proposer, uint64 _proposedAt) +// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, uint32 _gasLimit, uint24 _nextForkChoiceId, uint24 _verifiedForkChoiceId, bool _proverReleased, address _proposer, uint32 _feePerGas, uint64 _proposedAt, address _assignedProver, uint32 _rewardPerGas, uint64 _proofWindow) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlock(blockId *big.Int) (struct { - MetaHash [32]byte - Proposer common.Address - ProposedAt uint64 + MetaHash [32]byte + GasLimit uint32 + NextForkChoiceId *big.Int + VerifiedForkChoiceId *big.Int + ProverReleased bool + Proposer common.Address + FeePerGas uint32 + ProposedAt uint64 + AssignedProver common.Address + RewardPerGas uint32 + ProofWindow uint64 }, error) { return _TaikoL1Client.Contract.GetBlock(&_TaikoL1Client.CallOpts, blockId) } -// GetBlockFee is a free data retrieval call binding the contract method 0x7baf0bc7. +// GetBlockFee is a free data retrieval call binding the contract method 0xffb2784f. // -// Solidity: function getBlockFee() view returns(uint64) -func (_TaikoL1Client *TaikoL1ClientCaller) GetBlockFee(opts *bind.CallOpts) (uint64, error) { +// Solidity: function getBlockFee(uint32 gasLimit) view returns(uint64) +func (_TaikoL1Client *TaikoL1ClientCaller) GetBlockFee(opts *bind.CallOpts, gasLimit uint32) (uint64, error) { var out []interface{} - err := _TaikoL1Client.contract.Call(opts, &out, "getBlockFee") + err := _TaikoL1Client.contract.Call(opts, &out, "getBlockFee", gasLimit) if err != nil { return *new(uint64), err @@ -376,23 +421,23 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetBlockFee(opts *bind.CallOpts) (uin } -// GetBlockFee is a free data retrieval call binding the contract method 0x7baf0bc7. +// GetBlockFee is a free data retrieval call binding the contract method 0xffb2784f. // -// Solidity: function getBlockFee() view returns(uint64) -func (_TaikoL1Client *TaikoL1ClientSession) GetBlockFee() (uint64, error) { - return _TaikoL1Client.Contract.GetBlockFee(&_TaikoL1Client.CallOpts) +// Solidity: function getBlockFee(uint32 gasLimit) view returns(uint64) +func (_TaikoL1Client *TaikoL1ClientSession) GetBlockFee(gasLimit uint32) (uint64, error) { + return _TaikoL1Client.Contract.GetBlockFee(&_TaikoL1Client.CallOpts, gasLimit) } -// GetBlockFee is a free data retrieval call binding the contract method 0x7baf0bc7. +// GetBlockFee is a free data retrieval call binding the contract method 0xffb2784f. // -// Solidity: function getBlockFee() view returns(uint64) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlockFee() (uint64, error) { - return _TaikoL1Client.Contract.GetBlockFee(&_TaikoL1Client.CallOpts) +// Solidity: function getBlockFee(uint32 gasLimit) view returns(uint64) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlockFee(gasLimit uint32) (uint64, error) { + return _TaikoL1Client.Contract.GetBlockFee(&_TaikoL1Client.CallOpts, gasLimit) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,bool)) +// Solidity: function getConfig() pure returns((uint256,bool,uint256,uint256,uint256,uint32,uint32,uint64,uint64,uint256,uint256,uint256,uint16,uint16,uint256,uint64,uint64,uint96,uint96,uint256,uint256,uint32,uint8,uint256)) func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getConfig") @@ -409,14 +454,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,uint256,uint256,uint256,uint64,uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,bool)) +// Solidity: function getConfig() pure returns((uint256,bool,uint256,uint256,uint256,uint32,uint32,uint64,uint64,uint256,uint256,uint256,uint16,uint16,uint256,uint64,uint64,uint96,uint96,uint256,uint256,uint32,uint8,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,uint256,uint256,uint256,uint64,uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,bool)) +// Solidity: function getConfig() pure returns((uint256,bool,uint256,uint256,uint256,uint32,uint32,uint64,uint64,uint256,uint256,uint256,uint16,uint16,uint256,uint64,uint64,uint96,uint96,uint256,uint256,uint32,uint8,uint256)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } @@ -485,7 +530,7 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetCrossChainSignalRoot(blockI // GetForkChoice is a free data retrieval call binding the contract method 0x7163e0ed. // -// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,uint64,address,uint32)) +// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,address,uint64,uint32)) func (_TaikoL1Client *TaikoL1ClientCaller) GetForkChoice(opts *bind.CallOpts, blockId *big.Int, parentHash [32]byte, parentGasUsed uint32) (TaikoDataForkChoice, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getForkChoice", blockId, parentHash, parentGasUsed) @@ -502,21 +547,21 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetForkChoice(opts *bind.CallOpts, bl // GetForkChoice is a free data retrieval call binding the contract method 0x7163e0ed. // -// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,uint64,address,uint32)) +// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,address,uint64,uint32)) func (_TaikoL1Client *TaikoL1ClientSession) GetForkChoice(blockId *big.Int, parentHash [32]byte, parentGasUsed uint32) (TaikoDataForkChoice, error) { return _TaikoL1Client.Contract.GetForkChoice(&_TaikoL1Client.CallOpts, blockId, parentHash, parentGasUsed) } // GetForkChoice is a free data retrieval call binding the contract method 0x7163e0ed. // -// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,uint64,address,uint32)) +// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,address,uint64,uint32)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetForkChoice(blockId *big.Int, parentHash [32]byte, parentGasUsed uint32) (TaikoDataForkChoice, error) { return _TaikoL1Client.Contract.GetForkChoice(&_TaikoL1Client.CallOpts, blockId, parentHash, parentGasUsed) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint32,uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1Client *TaikoL1ClientCaller) GetStateVariables(opts *bind.CallOpts) (TaikoDataStateVariables, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getStateVariables") @@ -533,14 +578,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetStateVariables(opts *bind.CallOpts // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint32,uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1Client *TaikoL1ClientSession) GetStateVariables() (TaikoDataStateVariables, error) { return _TaikoL1Client.Contract.GetStateVariables(&_TaikoL1Client.CallOpts) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint32,uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetStateVariables() (TaikoDataStateVariables, error) { return _TaikoL1Client.Contract.GetStateVariables(&_TaikoL1Client.CallOpts) } @@ -702,21 +747,21 @@ 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 genesisHeight, uint64 genesisTimestamp, uint16 __reserved70, uint48 __reserved71, uint64 __reserved72, uint64 __reserved80, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 __reserved90, uint64 lastVerifiedBlockId, uint64 __reserved91) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved70, uint64 __reserved71, uint64 numOpenBlocks, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 lastVerifiedAt, uint64 lastVerifiedBlockId, uint64 __reserved90, uint32 feePerGas, uint16 avgProofDelay) func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { GenesisHeight uint64 GenesisTimestamp uint64 - Reserved70 uint16 - Reserved71 *big.Int - Reserved72 uint64 - Reserved80 uint64 + Reserved70 uint64 + Reserved71 uint64 + NumOpenBlocks uint64 NumEthDeposits uint64 NumBlocks uint64 NextEthDepositToProcess uint64 - BlockFee uint64 - Reserved90 uint64 + LastVerifiedAt uint64 LastVerifiedBlockId uint64 - Reserved91 uint64 + Reserved90 uint64 + FeePerGas uint32 + AvgProofDelay uint16 }, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "state") @@ -724,17 +769,17 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { outstruct := new(struct { GenesisHeight uint64 GenesisTimestamp uint64 - Reserved70 uint16 - Reserved71 *big.Int - Reserved72 uint64 - Reserved80 uint64 + Reserved70 uint64 + Reserved71 uint64 + NumOpenBlocks uint64 NumEthDeposits uint64 NumBlocks uint64 NextEthDepositToProcess uint64 - BlockFee uint64 - Reserved90 uint64 + LastVerifiedAt uint64 LastVerifiedBlockId uint64 - Reserved91 uint64 + Reserved90 uint64 + FeePerGas uint32 + AvgProofDelay uint16 }) if err != nil { return *outstruct, err @@ -742,17 +787,17 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { outstruct.GenesisHeight = *abi.ConvertType(out[0], new(uint64)).(*uint64) outstruct.GenesisTimestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) - outstruct.Reserved70 = *abi.ConvertType(out[2], new(uint16)).(*uint16) - outstruct.Reserved71 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - outstruct.Reserved72 = *abi.ConvertType(out[4], new(uint64)).(*uint64) - outstruct.Reserved80 = *abi.ConvertType(out[5], new(uint64)).(*uint64) - outstruct.NumEthDeposits = *abi.ConvertType(out[6], new(uint64)).(*uint64) - outstruct.NumBlocks = *abi.ConvertType(out[7], new(uint64)).(*uint64) - outstruct.NextEthDepositToProcess = *abi.ConvertType(out[8], new(uint64)).(*uint64) - outstruct.BlockFee = *abi.ConvertType(out[9], new(uint64)).(*uint64) + outstruct.Reserved70 = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.Reserved71 = *abi.ConvertType(out[3], new(uint64)).(*uint64) + outstruct.NumOpenBlocks = *abi.ConvertType(out[4], new(uint64)).(*uint64) + outstruct.NumEthDeposits = *abi.ConvertType(out[5], new(uint64)).(*uint64) + outstruct.NumBlocks = *abi.ConvertType(out[6], new(uint64)).(*uint64) + outstruct.NextEthDepositToProcess = *abi.ConvertType(out[7], new(uint64)).(*uint64) + outstruct.LastVerifiedAt = *abi.ConvertType(out[8], new(uint64)).(*uint64) + outstruct.LastVerifiedBlockId = *abi.ConvertType(out[9], new(uint64)).(*uint64) outstruct.Reserved90 = *abi.ConvertType(out[10], new(uint64)).(*uint64) - outstruct.LastVerifiedBlockId = *abi.ConvertType(out[11], new(uint64)).(*uint64) - outstruct.Reserved91 = *abi.ConvertType(out[12], new(uint64)).(*uint64) + outstruct.FeePerGas = *abi.ConvertType(out[11], new(uint32)).(*uint32) + outstruct.AvgProofDelay = *abi.ConvertType(out[12], new(uint16)).(*uint16) return *outstruct, err @@ -760,42 +805,42 @@ 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 genesisHeight, uint64 genesisTimestamp, uint16 __reserved70, uint48 __reserved71, uint64 __reserved72, uint64 __reserved80, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 __reserved90, uint64 lastVerifiedBlockId, uint64 __reserved91) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved70, uint64 __reserved71, uint64 numOpenBlocks, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 lastVerifiedAt, uint64 lastVerifiedBlockId, uint64 __reserved90, uint32 feePerGas, uint16 avgProofDelay) func (_TaikoL1Client *TaikoL1ClientSession) State() (struct { GenesisHeight uint64 GenesisTimestamp uint64 - Reserved70 uint16 - Reserved71 *big.Int - Reserved72 uint64 - Reserved80 uint64 + Reserved70 uint64 + Reserved71 uint64 + NumOpenBlocks uint64 NumEthDeposits uint64 NumBlocks uint64 NextEthDepositToProcess uint64 - BlockFee uint64 - Reserved90 uint64 + LastVerifiedAt uint64 LastVerifiedBlockId uint64 - Reserved91 uint64 + Reserved90 uint64 + FeePerGas uint32 + AvgProofDelay uint16 }, 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 genesisHeight, uint64 genesisTimestamp, uint16 __reserved70, uint48 __reserved71, uint64 __reserved72, uint64 __reserved80, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 __reserved90, uint64 lastVerifiedBlockId, uint64 __reserved91) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved70, uint64 __reserved71, uint64 numOpenBlocks, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 lastVerifiedAt, uint64 lastVerifiedBlockId, uint64 __reserved90, uint32 feePerGas, uint16 avgProofDelay) func (_TaikoL1Client *TaikoL1ClientCallerSession) State() (struct { GenesisHeight uint64 GenesisTimestamp uint64 - Reserved70 uint16 - Reserved71 *big.Int - Reserved72 uint64 - Reserved80 uint64 + Reserved70 uint64 + Reserved71 uint64 + NumOpenBlocks uint64 NumEthDeposits uint64 NumBlocks uint64 NextEthDepositToProcess uint64 - BlockFee uint64 - Reserved90 uint64 + LastVerifiedAt uint64 LastVerifiedBlockId uint64 - Reserved91 uint64 + Reserved90 uint64 + FeePerGas uint32 + AvgProofDelay uint16 }, error) { return _TaikoL1Client.Contract.State(&_TaikoL1Client.CallOpts) } @@ -821,25 +866,46 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) DepositEtherToL2(recipient return _TaikoL1Client.Contract.DepositEtherToL2(&_TaikoL1Client.TransactOpts, recipient) } -// Init is a paid mutator transaction binding the contract method 0xf859492f. +// DepositTaikoToken is a paid mutator transaction binding the contract method 0x98f39aba. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint64 _initBlockFee) returns() -func (_TaikoL1Client *TaikoL1ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _genesisBlockHash [32]byte, _initBlockFee uint64) (*types.Transaction, error) { - return _TaikoL1Client.contract.Transact(opts, "init", _addressManager, _genesisBlockHash, _initBlockFee) +// Solidity: function depositTaikoToken(uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) DepositTaikoToken(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "depositTaikoToken", amount) } -// Init is a paid mutator transaction binding the contract method 0xf859492f. +// DepositTaikoToken is a paid mutator transaction binding the contract method 0x98f39aba. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint64 _initBlockFee) returns() -func (_TaikoL1Client *TaikoL1ClientSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _initBlockFee uint64) (*types.Transaction, error) { - return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash, _initBlockFee) +// Solidity: function depositTaikoToken(uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientSession) DepositTaikoToken(amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.Contract.DepositTaikoToken(&_TaikoL1Client.TransactOpts, amount) } -// Init is a paid mutator transaction binding the contract method 0xf859492f. +// DepositTaikoToken is a paid mutator transaction binding the contract method 0x98f39aba. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint64 _initBlockFee) returns() -func (_TaikoL1Client *TaikoL1ClientTransactorSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _initBlockFee uint64) (*types.Transaction, error) { - return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash, _initBlockFee) +// Solidity: function depositTaikoToken(uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) DepositTaikoToken(amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.Contract.DepositTaikoToken(&_TaikoL1Client.TransactOpts, amount) +} + +// Init is a paid mutator transaction binding the contract method 0xa72111dc. +// +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint32 _initFeePerGas, uint16 _initAvgProofDelay) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _genesisBlockHash [32]byte, _initFeePerGas uint32, _initAvgProofDelay uint16) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "init", _addressManager, _genesisBlockHash, _initFeePerGas, _initAvgProofDelay) +} + +// Init is a paid mutator transaction binding the contract method 0xa72111dc. +// +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint32 _initFeePerGas, uint16 _initAvgProofDelay) returns() +func (_TaikoL1Client *TaikoL1ClientSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _initFeePerGas uint32, _initAvgProofDelay uint16) (*types.Transaction, error) { + return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash, _initFeePerGas, _initAvgProofDelay) +} + +// Init is a paid mutator transaction binding the contract method 0xa72111dc. +// +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint32 _initFeePerGas, uint16 _initAvgProofDelay) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _initFeePerGas uint32, _initAvgProofDelay uint16) (*types.Transaction, error) { + return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash, _initFeePerGas, _initAvgProofDelay) } // ProposeBlock is a paid mutator transaction binding the contract method 0xef16e845. @@ -968,6 +1034,27 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) VerifyBlocks(maxBlocks *bi return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocks) } +// WithdrawTaikoToken is a paid mutator transaction binding the contract method 0x5043f059. +// +// Solidity: function withdrawTaikoToken(uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) WithdrawTaikoToken(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "withdrawTaikoToken", amount) +} + +// WithdrawTaikoToken is a paid mutator transaction binding the contract method 0x5043f059. +// +// Solidity: function withdrawTaikoToken(uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientSession) WithdrawTaikoToken(amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.Contract.WithdrawTaikoToken(&_TaikoL1Client.TransactOpts, amount) +} + +// WithdrawTaikoToken is a paid mutator transaction binding the contract method 0x5043f059. +// +// Solidity: function withdrawTaikoToken(uint256 amount) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) WithdrawTaikoToken(amount *big.Int) (*types.Transaction, error) { + return _TaikoL1Client.Contract.WithdrawTaikoToken(&_TaikoL1Client.TransactOpts, amount) +} + // Receive is a paid mutator transaction binding the contract receive function. // // Solidity: receive() payable returns() @@ -2851,140 +2938,3 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) ParseOwnershipTransferred(log types event.Raw = log return event, nil } - -// TaikoL1ClientProofParamsChangedIterator is returned from FilterProofParamsChanged and is used to iterate over the raw logs and unpacked data for ProofParamsChanged events raised by the TaikoL1Client contract. -type TaikoL1ClientProofParamsChangedIterator struct { - Event *TaikoL1ClientProofParamsChanged // 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 *TaikoL1ClientProofParamsChangedIterator) 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(TaikoL1ClientProofParamsChanged) - 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(TaikoL1ClientProofParamsChanged) - 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 *TaikoL1ClientProofParamsChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ClientProofParamsChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ClientProofParamsChanged represents a ProofParamsChanged event raised by the TaikoL1Client contract. -type TaikoL1ClientProofParamsChanged struct { - ProofTimeTarget uint64 - ProofTimeIssued uint64 - BlockFee uint64 - AdjustmentQuotient uint16 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterProofParamsChanged is a free log retrieval operation binding the contract event 0x565e5aa69c99d81e441dd3bb8535d888585683743f3c6a3bf49e5e1b227bd8f9. -// -// Solidity: event ProofParamsChanged(uint64 proofTimeTarget, uint64 proofTimeIssued, uint64 blockFee, uint16 adjustmentQuotient) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterProofParamsChanged(opts *bind.FilterOpts) (*TaikoL1ClientProofParamsChangedIterator, error) { - - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "ProofParamsChanged") - if err != nil { - return nil, err - } - return &TaikoL1ClientProofParamsChangedIterator{contract: _TaikoL1Client.contract, event: "ProofParamsChanged", logs: logs, sub: sub}, nil -} - -// WatchProofParamsChanged is a free log subscription operation binding the contract event 0x565e5aa69c99d81e441dd3bb8535d888585683743f3c6a3bf49e5e1b227bd8f9. -// -// Solidity: event ProofParamsChanged(uint64 proofTimeTarget, uint64 proofTimeIssued, uint64 blockFee, uint16 adjustmentQuotient) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchProofParamsChanged(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientProofParamsChanged) (event.Subscription, error) { - - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "ProofParamsChanged") - 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(TaikoL1ClientProofParamsChanged) - if err := _TaikoL1Client.contract.UnpackLog(event, "ProofParamsChanged", 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 -} - -// ParseProofParamsChanged is a log parse operation binding the contract event 0x565e5aa69c99d81e441dd3bb8535d888585683743f3c6a3bf49e5e1b227bd8f9. -// -// Solidity: event ProofParamsChanged(uint64 proofTimeTarget, uint64 proofTimeIssued, uint64 blockFee, uint16 adjustmentQuotient) -func (_TaikoL1Client *TaikoL1ClientFilterer) ParseProofParamsChanged(log types.Log) (*TaikoL1ClientProofParamsChanged, error) { - event := new(TaikoL1ClientProofParamsChanged) - if err := _TaikoL1Client.contract.UnpackLog(event, "ProofParamsChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/bindings/gen_taiko_prover_pool_l1.go b/bindings/gen_taiko_prover_pool_l1.go new file mode 100644 index 000000000..8d9579910 --- /dev/null +++ b/bindings/gen_taiko_prover_pool_l1.go @@ -0,0 +1,1982 @@ +// 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 +) + +// ProverPoolProver is an auto generated low-level Go binding around an user-defined struct. +type ProverPoolProver struct { + StakedAmount uint64 + RewardPerGas uint16 + CurrentCapacity uint16 + Weight uint64 +} + +// ProverPoolStaker is an auto generated low-level Go binding around an user-defined struct. +type ProverPoolStaker struct { + ExitRequestedAt uint64 + ExitAmount uint64 + MaxCapacity uint16 + ProverId uint8 +} + +// TaikoL1ProverPoolMetaData contains all meta data concerning the TaikoL1ProverPool contract. +var TaikoL1ProverPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NO_MATURE_EXIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PROVER_NOT_GOOD_ENOUGH\",\"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\"},{\"inputs\":[],\"name\":\"UNAUTHORIZED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"Exited\",\"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\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"Slashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"rewardPerGas\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"currentCapacity\",\"type\":\"uint16\"}],\"name\":\"Staked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"EXIT_PERIOD\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CAPACITY_LOWER_BOUND\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_PROVERS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_SLASH_AMOUNT\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_STAKE_PER_CAPACITY\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SLASH_POINTS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"assignProver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"exit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapacity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvers\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"stakedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"rewardPerGas\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"currentCapacity\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structProverPool.Prover[]\",\"name\":\"_provers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"_stakers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getStaker\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"exitRequestedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"exitAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"maxCapacity\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"proverId\",\"type\":\"uint8\"}],\"internalType\":\"structProverPool.Staker\",\"name\":\"staker\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"stakedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"rewardPerGas\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"currentCapacity\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structProverPool.Prover\",\"name\":\"prover\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"idToProver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"provers\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"stakedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"rewardPerGas\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"currentCapacity\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"releaseProver\",\"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\":\"\",\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"slashProver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"rewardPerGas\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"maxCapacity\",\"type\":\"uint16\"}],\"name\":\"stake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakers\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"exitRequestedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"exitAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"maxCapacity\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"proverId\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// TaikoL1ProverPoolABI is the input ABI used to generate the binding from. +// Deprecated: Use TaikoL1ProverPoolMetaData.ABI instead. +var TaikoL1ProverPoolABI = TaikoL1ProverPoolMetaData.ABI + +// TaikoL1ProverPool is an auto generated Go binding around an Ethereum contract. +type TaikoL1ProverPool struct { + TaikoL1ProverPoolCaller // Read-only binding to the contract + TaikoL1ProverPoolTransactor // Write-only binding to the contract + TaikoL1ProverPoolFilterer // Log filterer for contract events +} + +// TaikoL1ProverPoolCaller is an auto generated read-only Go binding around an Ethereum contract. +type TaikoL1ProverPoolCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoL1ProverPoolTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TaikoL1ProverPoolTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoL1ProverPoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TaikoL1ProverPoolFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoL1ProverPoolSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TaikoL1ProverPoolSession struct { + Contract *TaikoL1ProverPool // 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 +} + +// TaikoL1ProverPoolCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TaikoL1ProverPoolCallerSession struct { + Contract *TaikoL1ProverPoolCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TaikoL1ProverPoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TaikoL1ProverPoolTransactorSession struct { + Contract *TaikoL1ProverPoolTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TaikoL1ProverPoolRaw is an auto generated low-level Go binding around an Ethereum contract. +type TaikoL1ProverPoolRaw struct { + Contract *TaikoL1ProverPool // Generic contract binding to access the raw methods on +} + +// TaikoL1ProverPoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TaikoL1ProverPoolCallerRaw struct { + Contract *TaikoL1ProverPoolCaller // Generic read-only contract binding to access the raw methods on +} + +// TaikoL1ProverPoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TaikoL1ProverPoolTransactorRaw struct { + Contract *TaikoL1ProverPoolTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTaikoL1ProverPool creates a new instance of TaikoL1ProverPool, bound to a specific deployed contract. +func NewTaikoL1ProverPool(address common.Address, backend bind.ContractBackend) (*TaikoL1ProverPool, error) { + contract, err := bindTaikoL1ProverPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TaikoL1ProverPool{TaikoL1ProverPoolCaller: TaikoL1ProverPoolCaller{contract: contract}, TaikoL1ProverPoolTransactor: TaikoL1ProverPoolTransactor{contract: contract}, TaikoL1ProverPoolFilterer: TaikoL1ProverPoolFilterer{contract: contract}}, nil +} + +// NewTaikoL1ProverPoolCaller creates a new read-only instance of TaikoL1ProverPool, bound to a specific deployed contract. +func NewTaikoL1ProverPoolCaller(address common.Address, caller bind.ContractCaller) (*TaikoL1ProverPoolCaller, error) { + contract, err := bindTaikoL1ProverPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolCaller{contract: contract}, nil +} + +// NewTaikoL1ProverPoolTransactor creates a new write-only instance of TaikoL1ProverPool, bound to a specific deployed contract. +func NewTaikoL1ProverPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*TaikoL1ProverPoolTransactor, error) { + contract, err := bindTaikoL1ProverPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolTransactor{contract: contract}, nil +} + +// NewTaikoL1ProverPoolFilterer creates a new log filterer instance of TaikoL1ProverPool, bound to a specific deployed contract. +func NewTaikoL1ProverPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*TaikoL1ProverPoolFilterer, error) { + contract, err := bindTaikoL1ProverPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolFilterer{contract: contract}, nil +} + +// bindTaikoL1ProverPool binds a generic wrapper to an already deployed contract. +func bindTaikoL1ProverPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TaikoL1ProverPoolMetaData.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 (_TaikoL1ProverPool *TaikoL1ProverPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TaikoL1ProverPool.Contract.TaikoL1ProverPoolCaller.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 (_TaikoL1ProverPool *TaikoL1ProverPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.TaikoL1ProverPoolTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TaikoL1ProverPool *TaikoL1ProverPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.TaikoL1ProverPoolTransactor.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 (_TaikoL1ProverPool *TaikoL1ProverPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TaikoL1ProverPool.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 (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.contract.Transact(opts, method, params...) +} + +// EXITPERIOD is a free data retrieval call binding the contract method 0xc04b5f65. +// +// Solidity: function EXIT_PERIOD() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) EXITPERIOD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "EXIT_PERIOD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// EXITPERIOD is a free data retrieval call binding the contract method 0xc04b5f65. +// +// Solidity: function EXIT_PERIOD() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) EXITPERIOD() (uint64, error) { + return _TaikoL1ProverPool.Contract.EXITPERIOD(&_TaikoL1ProverPool.CallOpts) +} + +// EXITPERIOD is a free data retrieval call binding the contract method 0xc04b5f65. +// +// Solidity: function EXIT_PERIOD() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) EXITPERIOD() (uint64, error) { + return _TaikoL1ProverPool.Contract.EXITPERIOD(&_TaikoL1ProverPool.CallOpts) +} + +// MAXCAPACITYLOWERBOUND is a free data retrieval call binding the contract method 0x35acc933. +// +// Solidity: function MAX_CAPACITY_LOWER_BOUND() view returns(uint32) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MAXCAPACITYLOWERBOUND(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "MAX_CAPACITY_LOWER_BOUND") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// MAXCAPACITYLOWERBOUND is a free data retrieval call binding the contract method 0x35acc933. +// +// Solidity: function MAX_CAPACITY_LOWER_BOUND() view returns(uint32) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MAXCAPACITYLOWERBOUND() (uint32, error) { + return _TaikoL1ProverPool.Contract.MAXCAPACITYLOWERBOUND(&_TaikoL1ProverPool.CallOpts) +} + +// MAXCAPACITYLOWERBOUND is a free data retrieval call binding the contract method 0x35acc933. +// +// Solidity: function MAX_CAPACITY_LOWER_BOUND() view returns(uint32) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MAXCAPACITYLOWERBOUND() (uint32, error) { + return _TaikoL1ProverPool.Contract.MAXCAPACITYLOWERBOUND(&_TaikoL1ProverPool.CallOpts) +} + +// MAXNUMPROVERS is a free data retrieval call binding the contract method 0x62c0fd98. +// +// Solidity: function MAX_NUM_PROVERS() view returns(uint256) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MAXNUMPROVERS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "MAX_NUM_PROVERS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXNUMPROVERS is a free data retrieval call binding the contract method 0x62c0fd98. +// +// Solidity: function MAX_NUM_PROVERS() view returns(uint256) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MAXNUMPROVERS() (*big.Int, error) { + return _TaikoL1ProverPool.Contract.MAXNUMPROVERS(&_TaikoL1ProverPool.CallOpts) +} + +// MAXNUMPROVERS is a free data retrieval call binding the contract method 0x62c0fd98. +// +// Solidity: function MAX_NUM_PROVERS() view returns(uint256) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MAXNUMPROVERS() (*big.Int, error) { + return _TaikoL1ProverPool.Contract.MAXNUMPROVERS(&_TaikoL1ProverPool.CallOpts) +} + +// MINSLASHAMOUNT is a free data retrieval call binding the contract method 0x1972bc0d. +// +// Solidity: function MIN_SLASH_AMOUNT() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MINSLASHAMOUNT(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "MIN_SLASH_AMOUNT") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINSLASHAMOUNT is a free data retrieval call binding the contract method 0x1972bc0d. +// +// Solidity: function MIN_SLASH_AMOUNT() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MINSLASHAMOUNT() (uint64, error) { + return _TaikoL1ProverPool.Contract.MINSLASHAMOUNT(&_TaikoL1ProverPool.CallOpts) +} + +// MINSLASHAMOUNT is a free data retrieval call binding the contract method 0x1972bc0d. +// +// Solidity: function MIN_SLASH_AMOUNT() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MINSLASHAMOUNT() (uint64, error) { + return _TaikoL1ProverPool.Contract.MINSLASHAMOUNT(&_TaikoL1ProverPool.CallOpts) +} + +// MINSTAKEPERCAPACITY is a free data retrieval call binding the contract method 0x7d62c057. +// +// Solidity: function MIN_STAKE_PER_CAPACITY() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MINSTAKEPERCAPACITY(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "MIN_STAKE_PER_CAPACITY") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINSTAKEPERCAPACITY is a free data retrieval call binding the contract method 0x7d62c057. +// +// Solidity: function MIN_STAKE_PER_CAPACITY() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MINSTAKEPERCAPACITY() (uint64, error) { + return _TaikoL1ProverPool.Contract.MINSTAKEPERCAPACITY(&_TaikoL1ProverPool.CallOpts) +} + +// MINSTAKEPERCAPACITY is a free data retrieval call binding the contract method 0x7d62c057. +// +// Solidity: function MIN_STAKE_PER_CAPACITY() view returns(uint64) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MINSTAKEPERCAPACITY() (uint64, error) { + return _TaikoL1ProverPool.Contract.MINSTAKEPERCAPACITY(&_TaikoL1ProverPool.CallOpts) +} + +// SLASHPOINTS is a free data retrieval call binding the contract method 0xdd9fb65c. +// +// Solidity: function SLASH_POINTS() view returns(uint32) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) SLASHPOINTS(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "SLASH_POINTS") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// SLASHPOINTS is a free data retrieval call binding the contract method 0xdd9fb65c. +// +// Solidity: function SLASH_POINTS() view returns(uint32) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SLASHPOINTS() (uint32, error) { + return _TaikoL1ProverPool.Contract.SLASHPOINTS(&_TaikoL1ProverPool.CallOpts) +} + +// SLASHPOINTS is a free data retrieval call binding the contract method 0xdd9fb65c. +// +// Solidity: function SLASH_POINTS() view returns(uint32) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) SLASHPOINTS() (uint32, error) { + return _TaikoL1ProverPool.Contract.SLASHPOINTS(&_TaikoL1ProverPool.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) AddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "addressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) AddressManager() (common.Address, error) { + return _TaikoL1ProverPool.Contract.AddressManager(&_TaikoL1ProverPool.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) AddressManager() (common.Address, error) { + return _TaikoL1ProverPool.Contract.AddressManager(&_TaikoL1ProverPool.CallOpts) +} + +// GetCapacity is a free data retrieval call binding the contract method 0xc40000d4. +// +// Solidity: function getCapacity() view returns(uint256 capacity) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetCapacity(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "getCapacity") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetCapacity is a free data retrieval call binding the contract method 0xc40000d4. +// +// Solidity: function getCapacity() view returns(uint256 capacity) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetCapacity() (*big.Int, error) { + return _TaikoL1ProverPool.Contract.GetCapacity(&_TaikoL1ProverPool.CallOpts) +} + +// GetCapacity is a free data retrieval call binding the contract method 0xc40000d4. +// +// Solidity: function getCapacity() view returns(uint256 capacity) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetCapacity() (*big.Int, error) { + return _TaikoL1ProverPool.Contract.GetCapacity(&_TaikoL1ProverPool.CallOpts) +} + +// GetProvers is a free data retrieval call binding the contract method 0xc0bfd036. +// +// Solidity: function getProvers() view returns((uint64,uint16,uint16,uint64)[] _provers, address[] _stakers) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetProvers(opts *bind.CallOpts) (struct { + Provers []ProverPoolProver + Stakers []common.Address +}, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "getProvers") + + outstruct := new(struct { + Provers []ProverPoolProver + Stakers []common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.Provers = *abi.ConvertType(out[0], new([]ProverPoolProver)).(*[]ProverPoolProver) + outstruct.Stakers = *abi.ConvertType(out[1], new([]common.Address)).(*[]common.Address) + + return *outstruct, err + +} + +// GetProvers is a free data retrieval call binding the contract method 0xc0bfd036. +// +// Solidity: function getProvers() view returns((uint64,uint16,uint16,uint64)[] _provers, address[] _stakers) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetProvers() (struct { + Provers []ProverPoolProver + Stakers []common.Address +}, error) { + return _TaikoL1ProverPool.Contract.GetProvers(&_TaikoL1ProverPool.CallOpts) +} + +// GetProvers is a free data retrieval call binding the contract method 0xc0bfd036. +// +// Solidity: function getProvers() view returns((uint64,uint16,uint16,uint64)[] _provers, address[] _stakers) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetProvers() (struct { + Provers []ProverPoolProver + Stakers []common.Address +}, error) { + return _TaikoL1ProverPool.Contract.GetProvers(&_TaikoL1ProverPool.CallOpts) +} + +// GetStaker is a free data retrieval call binding the contract method 0xa23c44b1. +// +// Solidity: function getStaker(address addr) view returns((uint64,uint64,uint16,uint8) staker, (uint64,uint16,uint16,uint64) prover) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetStaker(opts *bind.CallOpts, addr common.Address) (struct { + Staker ProverPoolStaker + Prover ProverPoolProver +}, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "getStaker", addr) + + outstruct := new(struct { + Staker ProverPoolStaker + Prover ProverPoolProver + }) + if err != nil { + return *outstruct, err + } + + outstruct.Staker = *abi.ConvertType(out[0], new(ProverPoolStaker)).(*ProverPoolStaker) + outstruct.Prover = *abi.ConvertType(out[1], new(ProverPoolProver)).(*ProverPoolProver) + + return *outstruct, err + +} + +// GetStaker is a free data retrieval call binding the contract method 0xa23c44b1. +// +// Solidity: function getStaker(address addr) view returns((uint64,uint64,uint16,uint8) staker, (uint64,uint16,uint16,uint64) prover) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetStaker(addr common.Address) (struct { + Staker ProverPoolStaker + Prover ProverPoolProver +}, error) { + return _TaikoL1ProverPool.Contract.GetStaker(&_TaikoL1ProverPool.CallOpts, addr) +} + +// GetStaker is a free data retrieval call binding the contract method 0xa23c44b1. +// +// Solidity: function getStaker(address addr) view returns((uint64,uint64,uint16,uint8) staker, (uint64,uint16,uint16,uint64) prover) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetStaker(addr common.Address) (struct { + Staker ProverPoolStaker + Prover ProverPoolProver +}, error) { + return _TaikoL1ProverPool.Contract.GetStaker(&_TaikoL1ProverPool.CallOpts, addr) +} + +// IdToProver is a free data retrieval call binding the contract method 0x2f88a7fe. +// +// Solidity: function idToProver(uint256 id) view returns(address prover) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) IdToProver(opts *bind.CallOpts, id *big.Int) (common.Address, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "idToProver", id) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// IdToProver is a free data retrieval call binding the contract method 0x2f88a7fe. +// +// Solidity: function idToProver(uint256 id) view returns(address prover) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) IdToProver(id *big.Int) (common.Address, error) { + return _TaikoL1ProverPool.Contract.IdToProver(&_TaikoL1ProverPool.CallOpts, id) +} + +// IdToProver is a free data retrieval call binding the contract method 0x2f88a7fe. +// +// Solidity: function idToProver(uint256 id) view returns(address prover) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) IdToProver(id *big.Int) (common.Address, error) { + return _TaikoL1ProverPool.Contract.IdToProver(&_TaikoL1ProverPool.CallOpts, id) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoL1ProverPool.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 (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Owner() (common.Address, error) { + return _TaikoL1ProverPool.Contract.Owner(&_TaikoL1ProverPool.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Owner() (common.Address, error) { + return _TaikoL1ProverPool.Contract.Owner(&_TaikoL1ProverPool.CallOpts) +} + +// Provers is a free data retrieval call binding the contract method 0xfd1190ea. +// +// Solidity: function provers(uint256 ) view returns(uint64 stakedAmount, uint16 rewardPerGas, uint16 currentCapacity, uint64 weight) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Provers(opts *bind.CallOpts, arg0 *big.Int) (struct { + StakedAmount uint64 + RewardPerGas uint16 + CurrentCapacity uint16 + Weight uint64 +}, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "provers", arg0) + + outstruct := new(struct { + StakedAmount uint64 + RewardPerGas uint16 + CurrentCapacity uint16 + Weight uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.StakedAmount = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.RewardPerGas = *abi.ConvertType(out[1], new(uint16)).(*uint16) + outstruct.CurrentCapacity = *abi.ConvertType(out[2], new(uint16)).(*uint16) + outstruct.Weight = *abi.ConvertType(out[3], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// Provers is a free data retrieval call binding the contract method 0xfd1190ea. +// +// Solidity: function provers(uint256 ) view returns(uint64 stakedAmount, uint16 rewardPerGas, uint16 currentCapacity, uint64 weight) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Provers(arg0 *big.Int) (struct { + StakedAmount uint64 + RewardPerGas uint16 + CurrentCapacity uint16 + Weight uint64 +}, error) { + return _TaikoL1ProverPool.Contract.Provers(&_TaikoL1ProverPool.CallOpts, arg0) +} + +// Provers is a free data retrieval call binding the contract method 0xfd1190ea. +// +// Solidity: function provers(uint256 ) view returns(uint64 stakedAmount, uint16 rewardPerGas, uint16 currentCapacity, uint64 weight) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Provers(arg0 *big.Int) (struct { + StakedAmount uint64 + RewardPerGas uint16 + CurrentCapacity uint16 + Weight uint64 +}, error) { + return _TaikoL1ProverPool.Contract.Provers(&_TaikoL1ProverPool.CallOpts, arg0) +} + +// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. +// +// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Resolve(opts *bind.CallOpts, chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "resolve", chainId, name, allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. +// +// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Resolve(chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1ProverPool.Contract.Resolve(&_TaikoL1ProverPool.CallOpts, chainId, name, allowZeroAddress) +} + +// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. +// +// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Resolve(chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1ProverPool.Contract.Resolve(&_TaikoL1ProverPool.CallOpts, chainId, name, allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Resolve0(opts *bind.CallOpts, name [32]byte, allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "resolve0", name, allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Resolve0(name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1ProverPool.Contract.Resolve0(&_TaikoL1ProverPool.CallOpts, name, allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Resolve0(name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1ProverPool.Contract.Resolve0(&_TaikoL1ProverPool.CallOpts, name, allowZeroAddress) +} + +// Stakers is a free data retrieval call binding the contract method 0x9168ae72. +// +// Solidity: function stakers(address staker) view returns(uint64 exitRequestedAt, uint64 exitAmount, uint16 maxCapacity, uint8 proverId) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Stakers(opts *bind.CallOpts, staker common.Address) (struct { + ExitRequestedAt uint64 + ExitAmount uint64 + MaxCapacity uint16 + ProverId uint8 +}, error) { + var out []interface{} + err := _TaikoL1ProverPool.contract.Call(opts, &out, "stakers", staker) + + outstruct := new(struct { + ExitRequestedAt uint64 + ExitAmount uint64 + MaxCapacity uint16 + ProverId uint8 + }) + if err != nil { + return *outstruct, err + } + + outstruct.ExitRequestedAt = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.ExitAmount = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.MaxCapacity = *abi.ConvertType(out[2], new(uint16)).(*uint16) + outstruct.ProverId = *abi.ConvertType(out[3], new(uint8)).(*uint8) + + return *outstruct, err + +} + +// Stakers is a free data retrieval call binding the contract method 0x9168ae72. +// +// Solidity: function stakers(address staker) view returns(uint64 exitRequestedAt, uint64 exitAmount, uint16 maxCapacity, uint8 proverId) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Stakers(staker common.Address) (struct { + ExitRequestedAt uint64 + ExitAmount uint64 + MaxCapacity uint16 + ProverId uint8 +}, error) { + return _TaikoL1ProverPool.Contract.Stakers(&_TaikoL1ProverPool.CallOpts, staker) +} + +// Stakers is a free data retrieval call binding the contract method 0x9168ae72. +// +// Solidity: function stakers(address staker) view returns(uint64 exitRequestedAt, uint64 exitAmount, uint16 maxCapacity, uint8 proverId) +func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Stakers(staker common.Address) (struct { + ExitRequestedAt uint64 + ExitAmount uint64 + MaxCapacity uint16 + ProverId uint8 +}, error) { + return _TaikoL1ProverPool.Contract.Stakers(&_TaikoL1ProverPool.CallOpts, staker) +} + +// AssignProver is a paid mutator transaction binding the contract method 0xbd849fe9. +// +// Solidity: function assignProver(uint64 blockId, uint32 ) returns(address prover, uint32 rewardPerGas) +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) AssignProver(opts *bind.TransactOpts, blockId uint64, arg1 uint32) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "assignProver", blockId, arg1) +} + +// AssignProver is a paid mutator transaction binding the contract method 0xbd849fe9. +// +// Solidity: function assignProver(uint64 blockId, uint32 ) returns(address prover, uint32 rewardPerGas) +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) AssignProver(blockId uint64, arg1 uint32) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.AssignProver(&_TaikoL1ProverPool.TransactOpts, blockId, arg1) +} + +// AssignProver is a paid mutator transaction binding the contract method 0xbd849fe9. +// +// Solidity: function assignProver(uint64 blockId, uint32 ) returns(address prover, uint32 rewardPerGas) +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) AssignProver(blockId uint64, arg1 uint32) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.AssignProver(&_TaikoL1ProverPool.TransactOpts, blockId, arg1) +} + +// Exit is a paid mutator transaction binding the contract method 0xe9fad8ee. +// +// Solidity: function exit() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Exit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "exit") +} + +// Exit is a paid mutator transaction binding the contract method 0xe9fad8ee. +// +// Solidity: function exit() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Exit() (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Exit(&_TaikoL1ProverPool.TransactOpts) +} + +// Exit is a paid mutator transaction binding the contract method 0xe9fad8ee. +// +// Solidity: function exit() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Exit() (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Exit(&_TaikoL1ProverPool.TransactOpts) +} + +// Init is a paid mutator transaction binding the contract method 0x19ab453c. +// +// Solidity: function init(address _addressManager) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "init", _addressManager) +} + +// Init is a paid mutator transaction binding the contract method 0x19ab453c. +// +// Solidity: function init(address _addressManager) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Init(_addressManager common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Init(&_TaikoL1ProverPool.TransactOpts, _addressManager) +} + +// Init is a paid mutator transaction binding the contract method 0x19ab453c. +// +// Solidity: function init(address _addressManager) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Init(_addressManager common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Init(&_TaikoL1ProverPool.TransactOpts, _addressManager) +} + +// ReleaseProver is a paid mutator transaction binding the contract method 0xcba0414f. +// +// Solidity: function releaseProver(address addr) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) ReleaseProver(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "releaseProver", addr) +} + +// ReleaseProver is a paid mutator transaction binding the contract method 0xcba0414f. +// +// Solidity: function releaseProver(address addr) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) ReleaseProver(addr common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.ReleaseProver(&_TaikoL1ProverPool.TransactOpts, addr) +} + +// ReleaseProver is a paid mutator transaction binding the contract method 0xcba0414f. +// +// Solidity: function releaseProver(address addr) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) ReleaseProver(addr common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.ReleaseProver(&_TaikoL1ProverPool.TransactOpts, addr) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) RenounceOwnership() (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.RenounceOwnership(&_TaikoL1ProverPool.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.RenounceOwnership(&_TaikoL1ProverPool.TransactOpts) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address newAddressManager) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) SetAddressManager(opts *bind.TransactOpts, newAddressManager common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "setAddressManager", newAddressManager) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address newAddressManager) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SetAddressManager(newAddressManager common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.SetAddressManager(&_TaikoL1ProverPool.TransactOpts, newAddressManager) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address newAddressManager) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) SetAddressManager(newAddressManager common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.SetAddressManager(&_TaikoL1ProverPool.TransactOpts, newAddressManager) +} + +// SlashProver is a paid mutator transaction binding the contract method 0xcd362a5b. +// +// Solidity: function slashProver(address addr) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) SlashProver(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "slashProver", addr) +} + +// SlashProver is a paid mutator transaction binding the contract method 0xcd362a5b. +// +// Solidity: function slashProver(address addr) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SlashProver(addr common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.SlashProver(&_TaikoL1ProverPool.TransactOpts, addr) +} + +// SlashProver is a paid mutator transaction binding the contract method 0xcd362a5b. +// +// Solidity: function slashProver(address addr) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) SlashProver(addr common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.SlashProver(&_TaikoL1ProverPool.TransactOpts, addr) +} + +// Stake is a paid mutator transaction binding the contract method 0x75244643. +// +// Solidity: function stake(uint64 amount, uint16 rewardPerGas, uint16 maxCapacity) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Stake(opts *bind.TransactOpts, amount uint64, rewardPerGas uint16, maxCapacity uint16) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "stake", amount, rewardPerGas, maxCapacity) +} + +// Stake is a paid mutator transaction binding the contract method 0x75244643. +// +// Solidity: function stake(uint64 amount, uint16 rewardPerGas, uint16 maxCapacity) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Stake(amount uint64, rewardPerGas uint16, maxCapacity uint16) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Stake(&_TaikoL1ProverPool.TransactOpts, amount, rewardPerGas, maxCapacity) +} + +// Stake is a paid mutator transaction binding the contract method 0x75244643. +// +// Solidity: function stake(uint64 amount, uint16 rewardPerGas, uint16 maxCapacity) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Stake(amount uint64, rewardPerGas uint16, maxCapacity uint16) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Stake(&_TaikoL1ProverPool.TransactOpts, amount, rewardPerGas, maxCapacity) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.TransferOwnership(&_TaikoL1ProverPool.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.TransferOwnership(&_TaikoL1ProverPool.TransactOpts, newOwner) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoL1ProverPool.contract.Transact(opts, "withdraw") +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Withdraw() (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Withdraw(&_TaikoL1ProverPool.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Withdraw() (*types.Transaction, error) { + return _TaikoL1ProverPool.Contract.Withdraw(&_TaikoL1ProverPool.TransactOpts) +} + +// TaikoL1ProverPoolAddressManagerChangedIterator is returned from FilterAddressManagerChanged and is used to iterate over the raw logs and unpacked data for AddressManagerChanged events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolAddressManagerChangedIterator struct { + Event *TaikoL1ProverPoolAddressManagerChanged // 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 *TaikoL1ProverPoolAddressManagerChangedIterator) 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(TaikoL1ProverPoolAddressManagerChanged) + 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(TaikoL1ProverPoolAddressManagerChanged) + 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 *TaikoL1ProverPoolAddressManagerChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolAddressManagerChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolAddressManagerChanged represents a AddressManagerChanged event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolAddressManagerChanged struct { + AddressManager common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddressManagerChanged is a free log retrieval operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. +// +// Solidity: event AddressManagerChanged(address addressManager) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterAddressManagerChanged(opts *bind.FilterOpts) (*TaikoL1ProverPoolAddressManagerChangedIterator, error) { + + logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "AddressManagerChanged") + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolAddressManagerChangedIterator{contract: _TaikoL1ProverPool.contract, event: "AddressManagerChanged", logs: logs, sub: sub}, nil +} + +// WatchAddressManagerChanged is a free log subscription operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. +// +// Solidity: event AddressManagerChanged(address addressManager) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchAddressManagerChanged(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolAddressManagerChanged) (event.Subscription, error) { + + logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "AddressManagerChanged") + 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(TaikoL1ProverPoolAddressManagerChanged) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "AddressManagerChanged", 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 +} + +// ParseAddressManagerChanged is a log parse operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. +// +// Solidity: event AddressManagerChanged(address addressManager) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseAddressManagerChanged(log types.Log) (*TaikoL1ProverPoolAddressManagerChanged, error) { + event := new(TaikoL1ProverPoolAddressManagerChanged) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "AddressManagerChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ProverPoolExitedIterator is returned from FilterExited and is used to iterate over the raw logs and unpacked data for Exited events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolExitedIterator struct { + Event *TaikoL1ProverPoolExited // 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 *TaikoL1ProverPoolExitedIterator) 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(TaikoL1ProverPoolExited) + 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(TaikoL1ProverPoolExited) + 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 *TaikoL1ProverPoolExitedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolExitedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolExited represents a Exited event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolExited struct { + Addr common.Address + Amount uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExited is a free log retrieval operation binding the contract event 0x7b870040d0137f84191e3e446a10f48b5ac5d26ec96be3f795fcfc4c954410fe. +// +// Solidity: event Exited(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterExited(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolExitedIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Exited", addrRule) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolExitedIterator{contract: _TaikoL1ProverPool.contract, event: "Exited", logs: logs, sub: sub}, nil +} + +// WatchExited is a free log subscription operation binding the contract event 0x7b870040d0137f84191e3e446a10f48b5ac5d26ec96be3f795fcfc4c954410fe. +// +// Solidity: event Exited(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchExited(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolExited, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Exited", addrRule) + 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(TaikoL1ProverPoolExited) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Exited", 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 +} + +// ParseExited is a log parse operation binding the contract event 0x7b870040d0137f84191e3e446a10f48b5ac5d26ec96be3f795fcfc4c954410fe. +// +// Solidity: event Exited(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseExited(log types.Log) (*TaikoL1ProverPoolExited, error) { + event := new(TaikoL1ProverPoolExited) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Exited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ProverPoolInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolInitializedIterator struct { + Event *TaikoL1ProverPoolInitialized // 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 *TaikoL1ProverPoolInitializedIterator) 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(TaikoL1ProverPoolInitialized) + 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(TaikoL1ProverPoolInitialized) + 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 *TaikoL1ProverPoolInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolInitialized represents a Initialized event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolInitialized 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 (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterInitialized(opts *bind.FilterOpts) (*TaikoL1ProverPoolInitializedIterator, error) { + + logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolInitializedIterator{contract: _TaikoL1ProverPool.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 (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolInitialized) (event.Subscription, error) { + + logs, sub, err := _TaikoL1ProverPool.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(TaikoL1ProverPoolInitialized) + if err := _TaikoL1ProverPool.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 (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseInitialized(log types.Log) (*TaikoL1ProverPoolInitialized, error) { + event := new(TaikoL1ProverPoolInitialized) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ProverPoolOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolOwnershipTransferredIterator struct { + Event *TaikoL1ProverPoolOwnershipTransferred // 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 *TaikoL1ProverPoolOwnershipTransferredIterator) 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(TaikoL1ProverPoolOwnershipTransferred) + 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(TaikoL1ProverPoolOwnershipTransferred) + 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 *TaikoL1ProverPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolOwnershipTransferred represents a OwnershipTransferred event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolOwnershipTransferred 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 (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoL1ProverPoolOwnershipTransferredIterator, 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 := _TaikoL1ProverPool.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolOwnershipTransferredIterator{contract: _TaikoL1ProverPool.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 (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolOwnershipTransferred, 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 := _TaikoL1ProverPool.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(TaikoL1ProverPoolOwnershipTransferred) + if err := _TaikoL1ProverPool.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 (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseOwnershipTransferred(log types.Log) (*TaikoL1ProverPoolOwnershipTransferred, error) { + event := new(TaikoL1ProverPoolOwnershipTransferred) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ProverPoolSlashedIterator is returned from FilterSlashed and is used to iterate over the raw logs and unpacked data for Slashed events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolSlashedIterator struct { + Event *TaikoL1ProverPoolSlashed // 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 *TaikoL1ProverPoolSlashedIterator) 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(TaikoL1ProverPoolSlashed) + 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(TaikoL1ProverPoolSlashed) + 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 *TaikoL1ProverPoolSlashedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolSlashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolSlashed represents a Slashed event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolSlashed struct { + Addr common.Address + Amount uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSlashed is a free log retrieval operation binding the contract event 0xdd80bbe216163c1792fa59b50e56f1a7ac79674c4815b65da0ef875a39655e08. +// +// Solidity: event Slashed(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterSlashed(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolSlashedIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Slashed", addrRule) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolSlashedIterator{contract: _TaikoL1ProverPool.contract, event: "Slashed", logs: logs, sub: sub}, nil +} + +// WatchSlashed is a free log subscription operation binding the contract event 0xdd80bbe216163c1792fa59b50e56f1a7ac79674c4815b65da0ef875a39655e08. +// +// Solidity: event Slashed(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchSlashed(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolSlashed, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Slashed", addrRule) + 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(TaikoL1ProverPoolSlashed) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Slashed", 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 +} + +// ParseSlashed is a log parse operation binding the contract event 0xdd80bbe216163c1792fa59b50e56f1a7ac79674c4815b65da0ef875a39655e08. +// +// Solidity: event Slashed(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseSlashed(log types.Log) (*TaikoL1ProverPoolSlashed, error) { + event := new(TaikoL1ProverPoolSlashed) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Slashed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ProverPoolStakedIterator is returned from FilterStaked and is used to iterate over the raw logs and unpacked data for Staked events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolStakedIterator struct { + Event *TaikoL1ProverPoolStaked // 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 *TaikoL1ProverPoolStakedIterator) 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(TaikoL1ProverPoolStaked) + 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(TaikoL1ProverPoolStaked) + 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 *TaikoL1ProverPoolStakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolStakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolStaked represents a Staked event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolStaked struct { + Addr common.Address + Amount uint64 + RewardPerGas uint16 + CurrentCapacity uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStaked is a free log retrieval operation binding the contract event 0xb071f01ce43c8c0960b11143f30bedc46b345006ee5631abbdfd2a5cb6562774. +// +// Solidity: event Staked(address indexed addr, uint64 amount, uint16 rewardPerGas, uint16 currentCapacity) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterStaked(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolStakedIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Staked", addrRule) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolStakedIterator{contract: _TaikoL1ProverPool.contract, event: "Staked", logs: logs, sub: sub}, nil +} + +// WatchStaked is a free log subscription operation binding the contract event 0xb071f01ce43c8c0960b11143f30bedc46b345006ee5631abbdfd2a5cb6562774. +// +// Solidity: event Staked(address indexed addr, uint64 amount, uint16 rewardPerGas, uint16 currentCapacity) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchStaked(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolStaked, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Staked", addrRule) + 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(TaikoL1ProverPoolStaked) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Staked", 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 +} + +// ParseStaked is a log parse operation binding the contract event 0xb071f01ce43c8c0960b11143f30bedc46b345006ee5631abbdfd2a5cb6562774. +// +// Solidity: event Staked(address indexed addr, uint64 amount, uint16 rewardPerGas, uint16 currentCapacity) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseStaked(log types.Log) (*TaikoL1ProverPoolStaked, error) { + event := new(TaikoL1ProverPoolStaked) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Staked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoL1ProverPoolWithdrawnIterator is returned from FilterWithdrawn and is used to iterate over the raw logs and unpacked data for Withdrawn events raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolWithdrawnIterator struct { + Event *TaikoL1ProverPoolWithdrawn // 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 *TaikoL1ProverPoolWithdrawnIterator) 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(TaikoL1ProverPoolWithdrawn) + 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(TaikoL1ProverPoolWithdrawn) + 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 *TaikoL1ProverPoolWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL1ProverPoolWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL1ProverPoolWithdrawn represents a Withdrawn event raised by the TaikoL1ProverPool contract. +type TaikoL1ProverPoolWithdrawn struct { + Addr common.Address + Amount uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawn is a free log retrieval operation binding the contract event 0xbae95d59332d6e1e8f1ae78e7bebdaeef072d57b731c8790a636667e3a0a87ee. +// +// Solidity: event Withdrawn(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterWithdrawn(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolWithdrawnIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Withdrawn", addrRule) + if err != nil { + return nil, err + } + return &TaikoL1ProverPoolWithdrawnIterator{contract: _TaikoL1ProverPool.contract, event: "Withdrawn", logs: logs, sub: sub}, nil +} + +// WatchWithdrawn is a free log subscription operation binding the contract event 0xbae95d59332d6e1e8f1ae78e7bebdaeef072d57b731c8790a636667e3a0a87ee. +// +// Solidity: event Withdrawn(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolWithdrawn, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Withdrawn", addrRule) + 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(TaikoL1ProverPoolWithdrawn) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Withdrawn", 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 +} + +// ParseWithdrawn is a log parse operation binding the contract event 0xbae95d59332d6e1e8f1ae78e7bebdaeef072d57b731c8790a636667e3a0a87ee. +// +// Solidity: event Withdrawn(address indexed addr, uint64 amount) +func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseWithdrawn(log types.Log) (*TaikoL1ProverPoolWithdrawn, error) { + event := new(TaikoL1ProverPoolWithdrawn) + if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Withdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 832f8c794..14438c963 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -58,32 +58,28 @@ var ( Usage: "Set whether prover should use oracle prover or not", Category: proverCategory, } - SystemProver = &cli.BoolFlag{ - Name: "systemProver", - Usage: "Set whether prover should use system prover or not", - Category: proverCategory, - } OracleProverPrivateKey = &cli.StringFlag{ Name: "oracleProverPrivateKey", Usage: "Private key of oracle prover", Category: proverCategory, } - SystemProverPrivateKey = &cli.StringFlag{ - Name: "systemProverPrivateKey", - Usage: "Private key of system prover", - Category: proverCategory, - } Graffiti = &cli.StringFlag{ Name: "graffiti", Usage: "When string is passed, adds additional graffiti info to proof evidence", Category: proverCategory, Value: "", } - ExpectedReward = &cli.Uint64Flag{ - Name: "expectedReward", - Usage: "The expected prover reward for each block", - Category: proverCategory, - Value: 100_000_000, + TaikoProverPoolL1Address = &cli.StringFlag{ + Name: "taikoProverPoolL1", + Usage: "TaikoProverPoolL1 contract address", + Required: true, + Category: commonCategory, + } + CheckProofWindowExpiredInterval = &cli.Uint64Flag{ + Name: "prover.checkProofWindowExpiredInterval", + Usage: "Interval in seconds to check for expired proof windows from other provers", + Category: commonCategory, + Value: 15, } ) @@ -100,9 +96,8 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ Dummy, RandomDummyProofDelay, OracleProver, - SystemProver, OracleProverPrivateKey, - SystemProverPrivateKey, Graffiti, - ExpectedReward, + TaikoProverPoolL1Address, + CheckProofWindowExpiredInterval, }) diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index adf7e4e57..ab08ff448 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -64,9 +64,9 @@ func NewSyncer( progressTracker: progressTracker, anchorConstructor: constructor, txListValidator: txListValidator.NewTxListValidator( - configs.BlockMaxGasLimit, - configs.MaxTransactionsPerBlock, - configs.MaxBytesPerTxList, + uint64(configs.BlockMaxGasLimit), + configs.BlockMaxTransactions, + configs.BlockMaxTxListBytes, rpc.L2ChainID, ), }, nil @@ -176,7 +176,6 @@ func (s *Syncer) onBlockProposed( "L1Height", event.Raw.BlockNumber, "L1Hash", event.Raw.BlockHash, "BlockID", event.Id, - "BlockFee", event.BlockFee, "Removed", event.Raw.Removed, ) diff --git a/driver/driver.go b/driver/driver.go index 6c13ef870..efd2ad8f3 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -197,7 +197,7 @@ func (d *Driver) reportProtocolStatus() { return err } - maxNumBlocks = configs.MaxNumProposedBlocks.Uint64() + maxNumBlocks = configs.BlockMaxProposals.Uint64() return nil }, backoff.NewConstantBackOff(d.backOffRetryInterval), diff --git a/driver/state/state.go b/driver/state/state.go index ce6654483..daf327f19 100644 --- a/driver/state/state.go +++ b/driver/state/state.go @@ -168,7 +168,7 @@ func (s *State) startSubscriptions(ctx context.Context) { case e := <-s.blockProposedCh: s.setHeadBlockID(e.Id) case e := <-s.blockProvenCh: - if e.Prover != encoding.SystemProverAddress && e.Prover != encoding.OracleProverAddress { + if e.Prover != encoding.OracleProverAddress { log.Info("✅ Block proven", "blockID", e.Id, "hash", common.Hash(e.BlockHash), "prover", e.Prover) } case e := <-s.blockVerifiedCh: diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index 87b842c4e..65c02abc0 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -27,6 +27,8 @@ $DIR/nodes/init.sh DEPLOYMENT_JSON=$(cat $TAIKO_MONO_DIR/packages/protocol/deployments/deploy_l1.json) TAIKO_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko' | sed 's/\"//g') +TAIKO_PROVER_POOL_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.prover_pool' | sed 's/\"//g') +TAIKO_TOKEN_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko_token' | sed 's/\"//g') L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.signal_service' | sed 's/\"//g') trap "docker compose -f $TESTNET_CONFIG down -v" EXIT INT KILL ERR @@ -44,6 +46,8 @@ if [ "$RUN_TESTS" == "true" ]; then L2_EXECUTION_ENGINE_WS_ENDPOINT=ws://localhost:28546 \ L2_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:28551 \ TAIKO_L1_ADDRESS=$TAIKO_L1_CONTRACT_ADDRESS \ + TAIKO_PROVER_POOL_L1_ADDRESS=$TAIKO_PROVER_POOL_L1_CONTRACT_ADDRESS \ + TAIKO_TOKEN_L1_ADDRESS=$TAIKO_TOKEN_L1_CONTRACT_ADDRESS \ TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$L1_SIGNAL_SERVICE_CONTRACT_ADDRESS \ L1_CONTRACT_OWNER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index 61a577c35..c9f903b4c 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -36,20 +36,17 @@ L2_GENESIS_HASH=$( # Deploy Taiko protocol. cd $TAIKO_MONO_DIR/packages/protocol && PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - SYSTEM_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ ORACLE_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ SOLO_PROPOSER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ OWNER=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \ TREASURY=0xdf09A0afD09a63fb04ab3573922437e1e637dE8b \ - INITIAL_PROOF_TIME_TARGET=101 \ TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ L2_SIGNAL_SERVICE=0x1000777700000000000000000000000000000007 \ SHARED_SIGNAL_SERVICE=0x0000000000000000000000000000000000000000 \ - TAIKO_TOKEN_PREMINT_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ - TAIKO_TOKEN_PREMINT_AMOUNT=18446744073709551614 \ + TAIKO_TOKEN_PREMINT_RECIPIENTS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266,0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ + TAIKO_TOKEN_PREMINT_AMOUNTS=9223372036854775807,9223372036854775807 \ L2_GENESIS_HASH=$L2_GENESIS_HASH \ L2_CHAIN_ID=167001 \ - ADJUSTMENT_QUOTIENT=32000 \ forge script script/DeployOnL1.s.sol:DeployOnL1 \ --fork-url http://localhost:18545 \ --broadcast \ diff --git a/pkg/rpc/client.go b/pkg/rpc/client.go index 09930f2cc..9dc32747f 100644 --- a/pkg/rpc/client.go +++ b/pkg/rpc/client.go @@ -27,8 +27,9 @@ type Client struct { // Geth Engine API clients L2Engine *EngineClient // Protocol contracts clients - TaikoL1 *bindings.TaikoL1Client - TaikoL2 *bindings.TaikoL2Client + TaikoL1 *bindings.TaikoL1Client + TaikoL2 *bindings.TaikoL2Client + TaikoProverPoolL1 *bindings.TaikoL1ProverPool // Chain IDs L1ChainID *big.Int L2ChainID *big.Int @@ -38,14 +39,15 @@ type Client struct { // RPC client. If not providing L2EngineEndpoint or JwtSecret, then the L2Engine client // won't be initialized. type ClientConfig struct { - L1Endpoint string - L2Endpoint string - L2CheckPoint string - TaikoL1Address common.Address - TaikoL2Address common.Address - L2EngineEndpoint string - JwtSecret string - RetryInterval time.Duration + L1Endpoint string + L2Endpoint string + L2CheckPoint string + TaikoL1Address common.Address + TaikoProverPoolL1Address common.Address + TaikoL2Address common.Address + L2EngineEndpoint string + JwtSecret string + RetryInterval time.Duration } // NewClient initializes all RPC clients used by Taiko client softwares. @@ -60,6 +62,14 @@ func NewClient(ctx context.Context, cfg *ClientConfig) (*Client, error) { return nil, err } + var taikoProverPoolL1 *bindings.TaikoL1ProverPool + if cfg.TaikoProverPoolL1Address.Hex() != "" { + taikoProverPoolL1, err = bindings.NewTaikoL1ProverPool(cfg.TaikoProverPoolL1Address, l1RPC) + if err != nil { + return nil, err + } + } + l2RPC, err := DialClientWithBackoff(ctx, cfg.L2Endpoint, cfg.RetryInterval) if err != nil { return nil, err @@ -112,18 +122,19 @@ func NewClient(ctx context.Context, cfg *ClientConfig) (*Client, error) { } client := &Client{ - L1: l1RPC, - L2: l2RPC, - L2CheckPoint: l2CheckPoint, - L1RawRPC: l1RawRPC, - L2RawRPC: l2RawRPC, - L1GethClient: gethclient.New(l1RawRPC), - L2GethClient: gethclient.New(l2RawRPC), - L2Engine: l2AuthRPC, - TaikoL1: taikoL1, - TaikoL2: taikoL2, - L1ChainID: l1ChainID, - L2ChainID: l2ChainID, + L1: l1RPC, + L2: l2RPC, + L2CheckPoint: l2CheckPoint, + L1RawRPC: l1RawRPC, + L2RawRPC: l2RawRPC, + L1GethClient: gethclient.New(l1RawRPC), + L2GethClient: gethclient.New(l2RawRPC), + L2Engine: l2AuthRPC, + TaikoL1: taikoL1, + TaikoL2: taikoL2, + TaikoProverPoolL1: taikoProverPoolL1, + L1ChainID: l1ChainID, + L2ChainID: l2ChainID, } if err := client.ensureGenesisMatched(ctx); err != nil { diff --git a/pkg/rpc/client_test.go b/pkg/rpc/client_test.go index 97dc3977e..7fc0b9971 100644 --- a/pkg/rpc/client_test.go +++ b/pkg/rpc/client_test.go @@ -12,13 +12,14 @@ import ( func newTestClient(t *testing.T) *Client { client, err := NewClient(context.Background(), &ClientConfig{ - 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")), - L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), - JwtSecret: os.Getenv("JWT_SECRET"), - RetryInterval: backoff.DefaultMaxInterval, + 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")), + TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), + L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), + JwtSecret: os.Getenv("JWT_SECRET"), + RetryInterval: backoff.DefaultMaxInterval, }) require.Nil(t, err) diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index 075195295..eb309f45b 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -213,7 +213,7 @@ func (c *Client) WaitL1Origin(ctx context.Context, blockID *big.Int) (*rawdb.L1O func (c *Client) GetPoolContent( ctx context.Context, maxTransactionsPerBlock uint64, - blockMaxGasLimit uint64, + blockMaxGasLimit uint32, maxBytesPerTxList uint64, locals []common.Address, ) ([]types.Transactions, error) { diff --git a/pkg/rpc/subscription.go b/pkg/rpc/subscription.go index 0da211631..a898f38d2 100644 --- a/pkg/rpc/subscription.go +++ b/pkg/rpc/subscription.go @@ -100,6 +100,24 @@ func SubscribeBlockProven( }) } +// SubscribeSlashed subscribes the prover pool's Slashed events. +func SubscribeSlashed( + taikoProverPool *bindings.TaikoL1ProverPool, + ch chan *bindings.TaikoL1ProverPoolSlashed, +) event.Subscription { + return SubscribeEvent("Slashed", func(ctx context.Context) (event.Subscription, error) { + sub, err := taikoProverPool.WatchSlashed(nil, ch, nil) + if err != nil { + log.Error("Create taikoProverPool.WatchSlashed subscription error", "error", err) + return nil, err + } + + defer sub.Unsubscribe() + + return waitSubErr(ctx, sub) + }) +} + // SubscribeChainHead subscribes the new chain heads. func SubscribeChainHead( client *ethclient.Client, diff --git a/pkg/rpc/subscription_test.go b/pkg/rpc/subscription_test.go index b19483f94..21f7bfe06 100644 --- a/pkg/rpc/subscription_test.go +++ b/pkg/rpc/subscription_test.go @@ -44,6 +44,13 @@ func TestSubscribeBlockProven(t *testing.T) { ) } +func TestSubscribeSlashed(t *testing.T) { + require.NotNil(t, SubscribeSlashed( + newTestClient(t).TaikoProverPoolL1, + make(chan *bindings.TaikoL1ProverPoolSlashed, 1024)), + ) +} + func TestSubscribeChainHead(t *testing.T) { require.NotNil(t, SubscribeChainHead( newTestClient(t).L1, diff --git a/pkg/rpc/utils.go b/pkg/rpc/utils.go index cc08738bf..1fce23d22 100644 --- a/pkg/rpc/utils.go +++ b/pkg/rpc/utils.go @@ -69,81 +69,13 @@ func WaitReceipt(ctx context.Context, client *ethclient.Client, tx *types.Transa } } -// NeedNewSystemProof checks whether the L2 block still needs a new system proof. -func NeedNewSystemProof(ctx context.Context, cli *Client, id *big.Int, realProofSkipSize *big.Int) (bool, error) { - if realProofSkipSize == nil || realProofSkipSize.Uint64() <= 1 { - return false, nil - } - if id.Uint64()%realProofSkipSize.Uint64() == 0 { - log.Info( - "Skipping system block proof", - "blockID", id.Uint64(), - "skipSize", realProofSkipSize.Uint64(), - ) - - return false, nil - } - - var parent *types.Header - if id.Cmp(common.Big1) == 0 { - header, err := cli.L2.HeaderByNumber(ctx, common.Big0) - if err != nil { - return false, err - } - - parent = header - } else { - parentL1Origin, err := cli.WaitL1Origin(ctx, new(big.Int).Sub(id, common.Big1)) - if err != nil { - return false, err - } - - if parent, err = cli.L2.HeaderByHash(ctx, parentL1Origin.L2BlockHash); err != nil { - return false, err - } - } - - fc, err := cli.TaikoL1.GetForkChoice(nil, id, parent.Hash(), uint32(parent.GasUsed)) - if err != nil { - if !strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_FORK_CHOICE_NOT_FOUND") { - return false, encoding.TryParsingCustomError(err) - } - - return true, nil - } - - if fc.Prover == encoding.SystemProverAddress { - log.Info( - "📬 Block's system proof has already been submitted by another system prover", - "blockID", id, - "prover", fc.Prover, - "provenAt", fc.ProvenAt, - ) - - return false, nil - } - - return true, nil -} - // NeedNewProof checks whether the L2 block still needs a new proof. func NeedNewProof( ctx context.Context, cli *Client, id *big.Int, proverAddress common.Address, - realProofSkipSize *big.Int, ) (bool, error) { - if realProofSkipSize != nil && id.Uint64()%realProofSkipSize.Uint64() != 0 { - log.Info( - "Skipping valid block proof", - "blockID", id.Uint64(), - "skipSize", realProofSkipSize.Uint64(), - ) - - return false, nil - } - var parent *types.Header if id.Cmp(common.Big1) == 0 { header, err := cli.L2.HeaderByNumber(ctx, common.Big0) @@ -172,7 +104,7 @@ func NeedNewProof( return true, nil } - if fc.Prover == encoding.OracleProverAddress || fc.Prover == encoding.SystemProverAddress { + if fc.Prover == encoding.OracleProverAddress { return true, nil } diff --git a/proposer/proposer.go b/proposer/proposer.go index cdc23302b..89f47ab2b 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -105,7 +105,7 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { p.protocolConfigs = &protocolConfigs if cfg.MinBlockGasLimit != 0 { - if cfg.MinBlockGasLimit > p.protocolConfigs.BlockMaxGasLimit { + if uint32(cfg.MinBlockGasLimit) > p.protocolConfigs.BlockMaxGasLimit { return fmt.Errorf( "minimal block gas limit too large, set: %d, limit: %d", cfg.MinBlockGasLimit, @@ -194,9 +194,9 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { txLists, err := p.rpc.GetPoolContent( ctx, - p.protocolConfigs.MaxTransactionsPerBlock, + p.protocolConfigs.BlockMaxTransactions, p.protocolConfigs.BlockMaxGasLimit, - p.protocolConfigs.MaxBytesPerTxList, + p.protocolConfigs.BlockMaxTxListBytes, p.locals, ) if err != nil { @@ -394,7 +394,7 @@ func getTxOpts( // CheckTaikoTokenBalance checks if the current proposer has enough balance to pay // the current block fee. func (p *Proposer) CheckTaikoTokenBalance() error { - fee, err := p.rpc.TaikoL1.GetBlockFee(nil) + fee, err := p.rpc.TaikoL1.GetBlockFee(nil, p.protocolConfigs.BlockMaxGasLimit) if err != nil { return fmt.Errorf("failed to get block fee: %w", err) } diff --git a/prover/config.go b/prover/config.go index 39961150c..f163c16a7 100644 --- a/prover/config.go +++ b/prover/config.go @@ -15,28 +15,27 @@ import ( // Config contains the configurations to initialize a Taiko prover. type Config struct { - L1WsEndpoint string - L1HttpEndpoint string - L2WsEndpoint string - L2HttpEndpoint string - TaikoL1Address common.Address - TaikoL2Address common.Address - L1ProverPrivKey *ecdsa.PrivateKey - ZKEvmRpcdEndpoint string - ZkEvmRpcdParamsPath string - StartingBlockID *big.Int - MaxConcurrentProvingJobs uint - Dummy bool - OracleProver bool - SystemProver bool - OracleProverPrivateKey *ecdsa.PrivateKey - SystemProverPrivateKey *ecdsa.PrivateKey - Graffiti string - RandomDummyProofDelayLowerBound *time.Duration - RandomDummyProofDelayUpperBound *time.Duration - ExpectedReward uint64 - BackOffMaxRetrys uint64 - BackOffRetryInterval time.Duration + L1WsEndpoint string + L1HttpEndpoint string + L2WsEndpoint string + L2HttpEndpoint string + TaikoL1Address common.Address + TaikoProverPoolL1Address common.Address + TaikoL2Address common.Address + L1ProverPrivKey *ecdsa.PrivateKey + ZKEvmRpcdEndpoint string + ZkEvmRpcdParamsPath string + StartingBlockID *big.Int + MaxConcurrentProvingJobs uint + Dummy bool + OracleProver bool + OracleProverPrivateKey *ecdsa.PrivateKey + Graffiti string + RandomDummyProofDelayLowerBound *time.Duration + RandomDummyProofDelayUpperBound *time.Duration + BackOffMaxRetrys uint64 + BackOffRetryInterval time.Duration + CheckProofWindowExpiredIntervalInSeconds time.Duration } // NewConfigFromCliContext creates a new config instance from command line flags. @@ -49,11 +48,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } oracleProverSet := c.IsSet(flags.OracleProver.Name) - systemProverSet := c.IsSet(flags.SystemProver.Name) - - if oracleProverSet && systemProverSet { - return nil, fmt.Errorf("cannot set both oracleProver and systemProver") - } var oracleProverPrivKey *ecdsa.PrivateKey if oracleProverSet { @@ -69,20 +63,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } } - var systemProverPrivKey *ecdsa.PrivateKey - if systemProverSet { - if !c.IsSet(flags.SystemProverPrivateKey.Name) { - return nil, fmt.Errorf("systemProver flag set without systemProverPrivateKey set") - } - - systemProverPrivKeyStr := c.String(flags.SystemProverPrivateKey.Name) - - systemProverPrivKey, err = crypto.ToECDSA(common.Hex2Bytes(systemProverPrivKeyStr)) - if err != nil { - return nil, fmt.Errorf("invalid system private key: %w", err) - } - } - var ( randomDummyProofDelayLowerBound *time.Duration randomDummyProofDelayUpperBound *time.Duration @@ -124,6 +104,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { L2HttpEndpoint: c.String(flags.L2HTTPEndpoint.Name), TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)), TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)), + TaikoProverPoolL1Address: common.HexToAddress(c.String(flags.TaikoProverPoolL1Address.Name)), L1ProverPrivKey: l1ProverPrivKey, ZKEvmRpcdEndpoint: c.String(flags.ZkEvmRpcdEndpoint.Name), ZkEvmRpcdParamsPath: c.String(flags.ZkEvmRpcdParamsPath.Name), @@ -132,13 +113,13 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { Dummy: c.Bool(flags.Dummy.Name), OracleProver: c.Bool(flags.OracleProver.Name), OracleProverPrivateKey: oracleProverPrivKey, - SystemProver: c.Bool(flags.SystemProver.Name), - SystemProverPrivateKey: systemProverPrivKey, Graffiti: c.String(flags.Graffiti.Name), RandomDummyProofDelayLowerBound: randomDummyProofDelayLowerBound, RandomDummyProofDelayUpperBound: randomDummyProofDelayUpperBound, - ExpectedReward: c.Uint64(flags.ExpectedReward.Name), BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), BackOffRetryInterval: time.Duration(c.Uint64(flags.BackOffRetryInterval.Name)) * time.Second, + CheckProofWindowExpiredIntervalInSeconds: time.Duration( + c.Uint64(flags.CheckProofWindowExpiredInterval.Name), + ) * time.Second, }, nil } diff --git a/prover/config_test.go b/prover/config_test.go index 760ab2d47..7718bad71 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -22,9 +22,9 @@ var testFlags = []cli.Flag{ &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, &cli.BoolFlag{Name: flags.OracleProver.Name}, &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, - &cli.BoolFlag{Name: flags.SystemProver.Name}, - &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, + &cli.StringFlag{Name: flags.TaikoProverPoolL1Address.Name}, + &cli.Uint64Flag{Name: flags.CheckProofWindowExpiredInterval.Name}, } func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { @@ -34,6 +34,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { l2HttpEndpoint := os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") + taikoProverPoolL1 := os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS") app := cli.NewApp() app.Flags = testFlags @@ -46,6 +47,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { s.Equal(l2HttpEndpoint, c.L2HttpEndpoint) s.Equal(taikoL1, c.TaikoL1Address.String()) s.Equal(taikoL2, c.TaikoL2Address.String()) + s.Equal(taikoProverPoolL1, c.TaikoProverPoolL1Address.String()) s.Equal( crypto.PubkeyToAddress(s.p.cfg.L1ProverPrivKey.PublicKey), crypto.PubkeyToAddress(c.L1ProverPrivKey.PublicKey), @@ -59,6 +61,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { crypto.PubkeyToAddress(c.OracleProverPrivateKey.PublicKey), ) s.Equal("", c.Graffiti) + s.Equal(30*time.Second, c.CheckProofWindowExpiredIntervalInSeconds) s.Nil(new(Prover).InitFromCli(context.Background(), ctx)) return err @@ -72,66 +75,14 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, "-" + flags.TaikoL1Address.Name, taikoL1, "-" + flags.TaikoL2Address.Name, taikoL2, + "-" + flags.TaikoProverPoolL1Address.Name, taikoProverPoolL1, "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.Dummy.Name, "-" + flags.RandomDummyProofDelay.Name, "30m-1h", "-" + flags.OracleProver.Name, "-" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.Graffiti.Name, "", - })) -} - -func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProver() { - 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") - taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") - - app := cli.NewApp() - app.Flags = testFlags - app.Action = func(ctx *cli.Context) error { - c, err := NewConfigFromCliContext(ctx) - s.Nil(err) - s.Equal(l1WsEndpoint, c.L1WsEndpoint) - s.Equal(l1HttpEndpoint, c.L1HttpEndpoint) - s.Equal(l2WsEndpoint, c.L2WsEndpoint) - s.Equal(l2HttpEndpoint, c.L2HttpEndpoint) - s.Equal(taikoL1, c.TaikoL1Address.String()) - s.Equal(taikoL2, c.TaikoL2Address.String()) - s.Equal( - 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.SystemProver) - s.Equal( - crypto.PubkeyToAddress(s.p.cfg.SystemProverPrivateKey.PublicKey), - crypto.PubkeyToAddress(c.SystemProverPrivateKey.PublicKey), - ) - s.Equal("", c.Graffiti) - s.Nil(new(Prover).InitFromCli(context.Background(), ctx)) - - return err - } - - s.Nil(app.Run([]string{ - "TestNewConfigFromCliContext", - "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, - "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, - "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, - "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, - "-" + flags.TaikoL1Address.Name, taikoL1, - "-" + flags.TaikoL2Address.Name, taikoL2, - "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "-" + flags.Dummy.Name, - "-" + flags.RandomDummyProofDelay.Name, "30m-1h", - "-" + flags.SystemProver.Name, - "-" + flags.SystemProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "-" + flags.Graffiti.Name, "", + "-" + flags.CheckProofWindowExpiredInterval.Name, "30", })) } @@ -142,6 +93,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { l2HttpEndpoint := os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") + taikoProverPoolL1 := os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS") app := cli.NewApp() app.Flags = testFlags @@ -159,6 +111,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, "-" + flags.TaikoL1Address.Name, taikoL1, "-" + flags.TaikoL2Address.Name, taikoL2, + "-" + flags.TaikoProverPoolL1Address.Name, taikoProverPoolL1, "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.Dummy.Name, "-" + flags.RandomDummyProofDelay.Name, "30m-1h", @@ -166,68 +119,3 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { "-" + flags.Graffiti.Name, "", }), "oracleProver flag set without oracleProverPrivateKey set") } - -func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverError() { - 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") - taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") - - app := cli.NewApp() - app.Flags = testFlags - app.Action = func(ctx *cli.Context) error { - _, err := NewConfigFromCliContext(ctx) - s.NotNil(err) - return err - } - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContext", - "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, - "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, - "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, - "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, - "-" + flags.TaikoL1Address.Name, taikoL1, - "-" + flags.TaikoL2Address.Name, taikoL2, - "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), - "-" + flags.Dummy.Name, - "-" + flags.RandomDummyProofDelay.Name, "30m-1h", - "-" + flags.SystemProver.Name, - "-" + flags.Graffiti.Name, "", - }), "systemProver flag set without systemProverPrivateKey set") -} - -func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverAndOracleProverBothSetError() { - 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") - taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") - - app := cli.NewApp() - app.Flags = testFlags - app.Action = func(ctx *cli.Context) error { - _, err := NewConfigFromCliContext(ctx) - s.NotNil(err) - return err - } - - s.ErrorContains(app.Run([]string{ - "TestNewConfigFromCliContext", - "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, - "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, - "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, - "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, - "-" + flags.TaikoL1Address.Name, taikoL1, - "-" + 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.SystemProver.Name, - "-" + flags.Graffiti.Name, "", - }), "cannot set both oracleProver and systemProver") -} diff --git a/prover/proof_producer/special_proof_producer.go b/prover/proof_producer/special_proof_producer.go index 4603d43cb..a55d5f189 100644 --- a/prover/proof_producer/special_proof_producer.go +++ b/prover/proof_producer/special_proof_producer.go @@ -28,7 +28,6 @@ type SpecialProofProducer struct { proverPrivKey *ecdsa.PrivateKey anchorTxValidator *anchorTxValidator.AnchorTxValidator graffiti [32]byte - isSystemProver bool } // NewSpecialProofProducer creates a new NewSpecialProofProducer instance, which can be either @@ -39,7 +38,6 @@ func NewSpecialProofProducer( taikoL2Address common.Address, protocolSpecialProverAddress common.Address, graffiti string, - isSystemProver bool, ) (*SpecialProofProducer, error) { proverAddress := crypto.PubkeyToAddress(proverPrivKey.PublicKey) if proverAddress != protocolSpecialProverAddress { @@ -56,7 +54,6 @@ func NewSpecialProofProducer( proverPrivKey, anchorValidator, rpc.StringToBytes32(graffiti), - isSystemProver, }, nil } @@ -106,16 +103,6 @@ func (p *SpecialProofProducer) RequestProof( return err } - // the only difference from a client perspective when generating a special proof, - // either an oracle proof or a system proof, is the prover address which should be set to 1 - // if system prover, and 0 if oracle prover, and the protocol will use that to decide - // whether a proof can be overwritten or not. - var prover common.Address - if p.isSystemProver { - prover = encoding.SystemProverAddress - } else { - prover = encoding.OracleProverAddress - } // signature should be done with proof set to nil, verifierID set to 0, // and prover set to 0 address. evidence := &encoding.TaikoL1Evidence{ @@ -124,7 +111,7 @@ func (p *SpecialProofProducer) RequestProof( BlockHash: block.Hash(), SignalRoot: signalRoot, Graffiti: p.graffiti, - Prover: prover, + Prover: encoding.OracleProverAddress, ParentGasUsed: uint32(parent.GasUsed()), GasUsed: uint32(block.GasUsed()), VerifierId: 0, diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index c5ff39e9b..ecb695250 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -230,9 +230,9 @@ func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput Graffiti: opts.Graffiti, GasUsed: opts.GasUsed, ParentGasUsed: opts.ParentGasUsed, - BlockMaxGasLimit: p.ProtocolConfig.BlockMaxGasLimit, - MaxTransactionsPerBlock: p.ProtocolConfig.MaxTransactionsPerBlock, - MaxBytesPerTxList: p.ProtocolConfig.MaxBytesPerTxList, + BlockMaxGasLimit: uint64(p.ProtocolConfig.BlockMaxGasLimit), + MaxTransactionsPerBlock: p.ProtocolConfig.BlockMaxTransactions, + MaxBytesPerTxList: p.ProtocolConfig.BlockMaxTxListBytes, }, }}, } diff --git a/prover/proof_submitter/util.go b/prover/proof_submitter/util.go index 12af3a65a..c5f21a191 100644 --- a/prover/proof_submitter/util.go +++ b/prover/proof_submitter/util.go @@ -67,7 +67,6 @@ func sendTxWithBackoff( cli *rpc.Client, blockID *big.Int, proposedAt uint64, - expectedReward uint64, meta *bindings.TaikoDataBlockMetadata, sendTxFunc func() (*types.Transaction, error), retryInterval time.Duration, diff --git a/prover/proof_submitter/util_test.go b/prover/proof_submitter/util_test.go index 4c1c20258..e57f0039c 100644 --- a/prover/proof_submitter/util_test.go +++ b/prover/proof_submitter/util_test.go @@ -37,7 +37,6 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { s.RpcClient, common.Big1, 0, - 0, meta, func() (*types.Transaction, error) { return nil, errors.New("L1_TEST") }, 12*time.Second, @@ -48,7 +47,6 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { s.RpcClient, common.Big1, 0, - 0, meta, func() (*types.Transaction, error) { height, err := s.RpcClient.L1.BlockNumber(context.Background()) diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index 70f612550..eb7b699a2 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -37,9 +37,7 @@ type ValidProofSubmitter struct { l2SignalService common.Address mutex *sync.Mutex isOracleProver bool - isSystemProver bool graffiti [32]byte - expectedReward uint64 retryInterval time.Duration } @@ -52,9 +50,7 @@ func NewValidProofSubmitter( proverPrivKey *ecdsa.PrivateKey, mutex *sync.Mutex, isOracleProver bool, - isSystemProver bool, graffiti string, - expectedReward uint64, retryInterval time.Duration, ) (*ValidProofSubmitter, error) { anchorValidator, err := anchorTxValidator.New(taikoL2Address, rpcClient.L2ChainID, rpcClient) @@ -72,11 +68,6 @@ func NewValidProofSubmitter( return nil, err } - // OracleProver and SystemProver do not care about the expected proof reward. - if isOracleProver || isSystemProver { - expectedReward = 0 - } - return &ValidProofSubmitter{ rpc: rpcClient, proofProducer: proofProducer, @@ -89,9 +80,7 @@ func NewValidProofSubmitter( taikoL2Address: taikoL2Address, mutex: mutex, isOracleProver: isOracleProver, - isSystemProver: isSystemProver, graffiti: rpc.StringToBytes32(graffiti), - expectedReward: expectedReward, retryInterval: retryInterval, }, nil } @@ -221,12 +210,9 @@ func (s *ValidProofSubmitter) SubmitProof( var circuitsIdx uint16 var prover common.Address - if s.isOracleProver || s.isSystemProver { - if s.isSystemProver { - prover = encoding.SystemProverAddress - } else { - prover = encoding.OracleProverAddress - } + if s.isOracleProver { + prover = encoding.OracleProverAddress + circuitsIdx = uint16(int(zkProof[64])) evidence.Proof = zkProof[0:64] } else { @@ -263,7 +249,6 @@ func (s *ValidProofSubmitter) SubmitProof( s.rpc, blockID, block.Header().Time, - s.expectedReward, proofWithHeader.Meta, sendTx, s.retryInterval, diff --git a/prover/proof_submitter/valid_proof_submitter_test.go b/prover/proof_submitter/valid_proof_submitter_test.go index d200dad85..e8f6c2234 100644 --- a/prover/proof_submitter/valid_proof_submitter_test.go +++ b/prover/proof_submitter/valid_proof_submitter_test.go @@ -47,9 +47,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() { l1ProverPrivKey, &sync.Mutex{}, false, - false, "test", - 0, 12*time.Second, ) s.Nil(err) diff --git a/prover/prover.go b/prover/prover.go index 0108ff81d..fe9f03c59 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -26,6 +26,10 @@ import ( "github.com/urfave/cli/v2" ) +var ( + zeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") +) + type cancelFunc func() // Prover keep trying to prove new proposed blocks valid/invalid. @@ -34,7 +38,6 @@ type Prover struct { cfg *Config proverAddress common.Address oracleProverAddress common.Address - systemProverAddress common.Address // Clients rpc *rpc.Client @@ -59,7 +62,9 @@ type Prover struct { blockProvenSub event.Subscription blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified blockVerifiedSub event.Subscription - proveNotify chan struct{} + proverSlashedCh chan *bindings.TaikoL1ProverPoolSlashed + proverSlashedSub event.Subscription + proveNotify chan *big.Int // Proof related proofGenerationCh chan *proofProducer.ProofWithHeader @@ -69,8 +74,13 @@ type Prover struct { submitProofConcurrencyGuard chan struct{} submitProofTxMutex *sync.Mutex - currentBlocksBeingProven map[uint64]cancelFunc - currentBlocksBeingProvenMutex *sync.Mutex + currentBlocksBeingProven map[uint64]cancelFunc + currentBlocksBeingProvenMutex *sync.Mutex + currentBlocksWaitingForProofWindow []uint64 + currentBlocksWaitingForProofWindowMutex *sync.Mutex + + // interval settings + checkProofWindowExpiredIntervalInSeconds time.Duration ctx context.Context wg sync.WaitGroup @@ -92,14 +102,17 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.ctx = ctx p.currentBlocksBeingProven = make(map[uint64]cancelFunc) p.currentBlocksBeingProvenMutex = &sync.Mutex{} + p.currentBlocksWaitingForProofWindow = make([]uint64, 0) + p.currentBlocksWaitingForProofWindowMutex = &sync.Mutex{} // Clients if p.rpc, err = rpc.NewClient(p.ctx, &rpc.ClientConfig{ - L1Endpoint: cfg.L1WsEndpoint, - L2Endpoint: cfg.L2WsEndpoint, - TaikoL1Address: cfg.TaikoL1Address, - TaikoL2Address: cfg.TaikoL2Address, - RetryInterval: cfg.BackOffRetryInterval, + L1Endpoint: cfg.L1WsEndpoint, + L2Endpoint: cfg.L2WsEndpoint, + TaikoL1Address: cfg.TaikoL1Address, + TaikoL2Address: cfg.TaikoL2Address, + TaikoProverPoolL1Address: cfg.TaikoProverPoolL1Address, + RetryInterval: cfg.BackOffRetryInterval, }); err != nil { return err } @@ -115,19 +128,20 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.submitProofTxMutex = &sync.Mutex{} p.txListValidator = txListValidator.NewTxListValidator( - p.protocolConfigs.BlockMaxGasLimit, - p.protocolConfigs.MaxTransactionsPerBlock, - p.protocolConfigs.MaxBytesPerTxList, + uint64(p.protocolConfigs.BlockMaxGasLimit), + p.protocolConfigs.BlockMaxTransactions, + p.protocolConfigs.BlockMaxTxListBytes, p.rpc.L2ChainID, ) p.proverAddress = crypto.PubkeyToAddress(p.cfg.L1ProverPrivKey.PublicKey) - chBufferSize := p.protocolConfigs.MaxNumProposedBlocks.Uint64() + chBufferSize := p.protocolConfigs.BlockMaxProposals.Uint64() p.blockProposedCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.blockVerifiedCh = make(chan *bindings.TaikoL1ClientBlockVerified, chBufferSize) p.blockProvenCh = make(chan *bindings.TaikoL1ClientBlockProven, chBufferSize) p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) - p.proveNotify = make(chan struct{}, 1) + p.proverSlashedCh = make(chan *bindings.TaikoL1ProverPoolSlashed, chBufferSize) + p.proveNotify = make(chan *big.Int, 1) if err := p.initL1Current(cfg.StartingBlockID); err != nil { return fmt.Errorf("initialize L1 current cursor error: %w", err) } @@ -136,6 +150,8 @@ 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.checkProofWindowExpiredIntervalInSeconds = p.cfg.CheckProofWindowExpiredIntervalInSeconds + oracleProverAddress, err := p.rpc.TaikoL1.Resolve(nil, p.rpc.L1ChainID, rpc.StringToBytes32("oracle_prover"), true) if err != nil { return err @@ -143,28 +159,16 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.oracleProverAddress = oracleProverAddress - systemProverAddress, err := p.rpc.TaikoL1.Resolve(nil, p.rpc.L1ChainID, rpc.StringToBytes32("system_prover"), true) - if err != nil { - return err - } - - p.systemProverAddress = systemProverAddress - var producer proofProducer.ProofProducer - isSystemProver := cfg.SystemProver isOracleProver := cfg.OracleProver - if isSystemProver || isOracleProver { + if isOracleProver { var specialProverAddress common.Address var privateKey *ecdsa.PrivateKey - if isSystemProver { - specialProverAddress = systemProverAddress - privateKey = p.cfg.SystemProverPrivateKey - } else { - specialProverAddress = oracleProverAddress - privateKey = p.cfg.OracleProverPrivateKey - } + + specialProverAddress = oracleProverAddress + privateKey = p.cfg.OracleProverPrivateKey if producer, err = proofProducer.NewSpecialProofProducer( p.rpc, @@ -172,7 +176,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.cfg.TaikoL2Address, specialProverAddress, p.cfg.Graffiti, - isSystemProver, ); err != nil { return err } @@ -203,9 +206,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.cfg.L1ProverPrivKey, p.submitProofTxMutex, p.cfg.OracleProver, - p.cfg.SystemProver, p.cfg.Graffiti, - p.cfg.ExpectedReward, p.cfg.BackOffRetryInterval, ); err != nil { return err @@ -233,7 +234,7 @@ func (p *Prover) eventLoop() { // if we are already proving. reqProving := func() { select { - case p.proveNotify <- struct{}{}: + case p.proveNotify <- nil: default: } } @@ -249,10 +250,13 @@ func (p *Prover) eventLoop() { // If there is no new block verification in `proofCooldownPeriod * 2` seconeds, 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.ProofCooldownPeriod.Uint64()*2) * time.Second, + time.Duration(p.protocolConfigs.ProofRegularCooldown.Uint64()*2) * time.Second, ) defer verificationCheckTicker.Stop() + checkProofWindowExpiredTicker := time.NewTicker(p.checkProofWindowExpiredIntervalInSeconds) + defer checkProofWindowExpiredTicker.Stop() + // Call reqProving() right away to catch up with the latest state. reqProving() @@ -267,10 +271,14 @@ func (p *Prover) eventLoop() { ); err != nil { log.Error("Check chain verification error", "error", err) } + case <-checkProofWindowExpiredTicker.C: + if err := p.checkProofWindowsExpired(p.ctx); err != nil { + log.Error("error checking proof window expired", "error", err) + } case proofWithHeader := <-p.proofGenerationCh: p.submitProofOp(p.ctx, proofWithHeader) - case <-p.proveNotify: - if err := p.proveOp(); err != nil { + case blockId := <-p.proveNotify: + if err := p.proveOp(blockId); err != nil { log.Error("Prove new blocks error", "error", err) } case <-p.blockProposedCh: @@ -283,6 +291,10 @@ func (p *Prover) eventLoop() { if err := p.onBlockProven(p.ctx, e); err != nil { log.Error("Handle BlockProven event error", "error", err) } + case e := <-p.proverSlashedCh: + if e.Addr.Hex() == p.proverAddress.Hex() { + log.Info("Prover slashed", "address", e.Addr.Hex(), "amount", e.Amount) + } case <-forceProvingTicker.C: reqProving() } @@ -297,8 +309,12 @@ func (p *Prover) Close() { // proveOp performs a proving operation, find current unproven blocks, then // request generating proofs for them. -func (p *Prover) proveOp() error { +func (p *Prover) proveOp(startHeight *big.Int) error { firstTry := true + + if startHeight == nil { + startHeight = new(big.Int).SetUint64(p.l1Current) + } for firstTry || p.reorgDetectedFlag { p.reorgDetectedFlag = false firstTry = false @@ -306,7 +322,7 @@ func (p *Prover) proveOp() error { iter, err := eventIterator.NewBlockProposedIterator(p.ctx, &eventIterator.BlockProposedIteratorConfig{ Client: p.rpc.L1, TaikoL1: p.rpc.TaikoL1, - StartHeight: new(big.Int).SetUint64(p.l1Current), + StartHeight: startHeight, OnBlockProposedEvent: p.onBlockProposed, }) if err != nil { @@ -390,7 +406,6 @@ func (p *Prover) onBlockProposed( "L1Height", event.Raw.BlockNumber, "L1Hash", event.Raw.BlockHash, "BlockID", event.Id, - "BlockFee", event.BlockFee, "Removed", event.Raw.Removed, ) metrics.ProverReceivedProposedBlockGauge.Update(event.Id.Int64()) @@ -410,13 +425,12 @@ func (p *Prover) onBlockProposed( } // Check whether the block's proof is still needed. - if !p.cfg.OracleProver && !p.cfg.SystemProver { + if !p.cfg.OracleProver { needNewProof, err := rpc.NeedNewProof( p.ctx, p.rpc, event.Id, p.proverAddress, - p.protocolConfigs.RealProofSkipSize, ) if err != nil { return fmt.Errorf("failed to check whether the L2 block needs a new proof: %w", err) @@ -427,23 +441,32 @@ func (p *Prover) onBlockProposed( } } - if p.cfg.SystemProver { - needNewSystemProof, err := rpc.NeedNewSystemProof(ctx, p.rpc, event.Id, p.protocolConfigs.RealProofSkipSize) - if err != nil { - return fmt.Errorf("failed to check whether the L2 block needs a new system proof: %w", err) - } - - if !needNewSystemProof { - 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) } + block, err := p.rpc.TaikoL1.GetBlock(nil, event.Id) + if err != nil { + return err + } + + proofWindowExpired := uint64(time.Now().Unix()) > block.ProposedAt+block.ProofWindow + // zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address + if block.AssignedProver != p.proverAddress && block.AssignedProver != zeroAddress && !proofWindowExpired { + log.Info("proposed block not proveable", "blockID", event.Id, "prover", block.AssignedProver.Hex()) + + if !proofWindowExpired { + // if we cant prove it + p.currentBlocksWaitingForProofWindowMutex.Lock() + p.currentBlocksWaitingForProofWindow = append(p.currentBlocksWaitingForProofWindow, event.Meta.Id) + p.currentBlocksBeingProvenMutex.Unlock() + } + + return nil + } + ctx, cancelCtx := context.WithCancel(ctx) p.currentBlocksBeingProvenMutex.Lock() p.currentBlocksBeingProven[event.Id.Uint64()] = cancelFunc(func() { @@ -510,18 +533,10 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1ClientBlockVerified) error { metrics.ProverLatestVerifiedIDGauge.Update(event.Id.Int64()) - isNormalProof := p.protocolConfigs.RealProofSkipSize == nil || - (p.protocolConfigs.RealProofSkipSize != nil && event.Id.Uint64()%p.protocolConfigs.RealProofSkipSize.Uint64() == 0) if event.Reward > math.MaxInt64 { metrics.ProverAllProofRewardGauge.Update(math.MaxInt64) - if isNormalProof { - metrics.ProverNormalProofRewardGauge.Update(math.MaxInt64) - } } else { metrics.ProverAllProofRewardGauge.Update(int64(event.Reward)) - if isNormalProof { - metrics.ProverNormalProofRewardGauge.Update(int64(event.Reward)) - } } p.latestVerifiedL1Height = event.Raw.BlockNumber @@ -545,8 +560,6 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien metrics.ProverReceivedProvenBlockGauge.Update(event.Id.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 == p.systemProverAddress || - event.Prover == encoding.SystemProverAddress || event.Prover == encoding.OracleProverAddress { return nil } @@ -620,6 +633,7 @@ 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.proverSlashedSub = rpc.SubscribeSlashed(p.rpc.TaikoProverPoolL1, p.proverSlashedCh) } // closeSubscription closes all subscriptions. @@ -631,14 +645,14 @@ func (p *Prover) closeSubscription() { // checkChainVerification checks if there is no new block verification in protocol, if so, // it will let current sepecial prover to go back to try proving the block whose id is `lastVerifiedBlockId + 1`. func (p *Prover) checkChainVerification(lastLatestVerifiedL1Height uint64) error { - if (!p.cfg.SystemProver && !p.cfg.OracleProver) || lastLatestVerifiedL1Height != p.latestVerifiedL1Height { + if (!p.cfg.OracleProver) || lastLatestVerifiedL1Height != p.latestVerifiedL1Height { return nil } log.Warn( "No new block verification in `proofCooldownPeriod * 2` seconeds", "latestVerifiedL1Height", p.latestVerifiedL1Height, - "proofCooldownPeriod", p.protocolConfigs.ProofCooldownPeriod, + "proofCooldownPeriod", p.protocolConfigs.ProofRegularCooldown, ) stateVar, err := p.rpc.TaikoL1.GetStateVariables(nil) @@ -685,3 +699,59 @@ func (p *Prover) cancelProof(ctx context.Context, blockID uint64) { delete(p.currentBlocksBeingProven, blockID) } } + +// 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 { + for i, blockId := range p.currentBlocksWaitingForProofWindow { + if err := p.checkProofWindowExpired(ctx, i, blockId); err != nil { + return err + } + } + + return nil +} + +// checkProofWindowExpired checks a single instance of a block to see if its proof winodw 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, i int, blockId uint64) error { + p.currentBlocksWaitingForProofWindowMutex.Lock() + defer p.currentBlocksWaitingForProofWindowMutex.Unlock() + + block, err := p.rpc.TaikoL1.GetBlock(nil, big.NewInt(int64(blockId))) + if err != nil { + return err + } + + if time.Now().Unix() > int64(block.ProposedAt)+int64(block.ProofWindow) { + // 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, big.NewInt(int64(blockId))) + if err != nil { + return err + } + + forkChoice, err := p.rpc.TaikoL1.GetForkChoice(nil, big.NewInt(int64(blockId)), parent.Hash(), uint32(parent.GasUsed)) + if err != nil { + return err + } + + if forkChoice.Prover == zeroAddress { + // we can generate the proof + p.proveNotify <- big.NewInt(int64(blockId)) + } else { + // we should remove this block from being watched, a proof has already come in that agrees with + // our expected fork choice. + // cancel will remove this from the map. + p.currentBlocksWaitingForProofWindow = append( + p.currentBlocksWaitingForProofWindow[:i], + p.currentBlocksWaitingForProofWindow[i+1:]..., + ) + } + } + + // otherwise, keep it in the map and check again next iteration + return nil +} diff --git a/prover/prover_test.go b/prover/prover_test.go index ffc50dee8..ef28ff3df 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -36,17 +36,18 @@ 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, - OracleProverPrivateKey: l1ProverPrivKey, - SystemProverPrivateKey: l1ProverPrivKey, - Dummy: true, - MaxConcurrentProvingJobs: 1, + 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")), + TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), + L1ProverPrivKey: l1ProverPrivKey, + OracleProverPrivateKey: l1ProverPrivKey, + Dummy: true, + MaxConcurrentProvingJobs: 1, + CheckProofWindowExpiredIntervalInSeconds: 5 * time.Second, }))) s.p = p s.cancel = cancel @@ -110,6 +111,7 @@ func (s *ProverTestSuite) TestOnBlockProposed() { s.d.ChainSyncer().CalldataSyncer(), ) { s.Nil(s.p.onBlockProposed(context.Background(), e, func() {})) + s.Nil(s.p.validProofSubmitter.SubmitProof(context.Background(), <-s.p.proofGenerationCh)) } } @@ -148,7 +150,6 @@ func (s *ProverTestSuite) TestStartSubscription() { func (s *ProverTestSuite) TestCheckChainVerification() { s.Nil(s.p.checkChainVerification(0)) s.p.latestVerifiedL1Height = 1024 - s.p.cfg.SystemProver = true s.Nil(s.p.checkChainVerification(1024)) } diff --git a/scripts/gen_bindings.sh b/scripts/gen_bindings.sh index ffc424798..94528ea34 100755 --- a/scripts/gen_bindings.sh +++ b/scripts/gen_bindings.sh @@ -35,6 +35,10 @@ cat ${TAIKO_MONO_DIR}/packages/protocol/out/TaikoL2.sol/TaikoL2.json | jq .abi | ${ABIGEN_BIN} --abi - --type TaikoL2Client --pkg bindings --out $DIR/../bindings/gen_taiko_l2.go +cat ${TAIKO_MONO_DIR}/packages/protocol/out/ProverPool.sol/ProverPool.json | + jq .abi | + ${ABIGEN_BIN} --abi - --type TaikoL1ProverPool --pkg bindings --out $DIR/../bindings/gen_taiko_prover_pool_l1.go + git -C ${TAIKO_MONO_DIR} log --format="%H" -n 1 >./bindings/.githead echo "🍻 Go contract bindings generated!" diff --git a/testutils/helper.go b/testutils/helper.go index 1afc6004a..1eeb17b31 100644 --- a/testutils/helper.go +++ b/testutils/helper.go @@ -166,7 +166,7 @@ func ProposeAndInsertValidBlock( return event } -func DepositEtherToL2(s *ClientTestSuite, depositerPrivKey *ecdsa.PrivateKey) { +func DepositEtherToL2(s *ClientTestSuite, depositerPrivKey *ecdsa.PrivateKey, recipient common.Address) { config, err := s.RpcClient.TaikoL1.GetConfig(nil) s.Nil(err) @@ -174,8 +174,8 @@ func DepositEtherToL2(s *ClientTestSuite, depositerPrivKey *ecdsa.PrivateKey) { s.Nil(err) opts.Value = config.EthDepositMinAmount - for i := 0; i < int(config.EthDepositMinAmount.Uint64()); i++ { - _, err = s.RpcClient.TaikoL1.DepositEtherToL2(opts, crypto.PubkeyToAddress(depositerPrivKey.PublicKey)) + for i := 0; i < int(config.EthDepositMinCountPerBlock); i++ { + _, err = s.RpcClient.TaikoL1.DepositEtherToL2(opts, recipient) s.Nil(err) } } diff --git a/testutils/suite.go b/testutils/suite.go index b7db5560c..a24582383 100644 --- a/testutils/suite.go +++ b/testutils/suite.go @@ -3,9 +3,12 @@ package testutils import ( "context" "crypto/ecdsa" + "math" + "math/big" "os" "github.com/cenkalti/backoff/v4" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" @@ -51,17 +54,59 @@ func (s *ClientTestSuite) SetupTest() { s.NotEmpty(jwtSecret) rpcCli, err := rpc.NewClient(context.Background(), &rpc.ClientConfig{ - 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")), - L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), - JwtSecret: string(jwtSecret), - RetryInterval: backoff.DefaultMaxInterval, + 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")), + TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), + L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), + JwtSecret: string(jwtSecret), + RetryInterval: backoff.DefaultMaxInterval, }) s.Nil(err) s.RpcClient = rpcCli + // set allowance + l1ProposerPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROPOSER_PRIVATE_KEY"))) + s.Nil(err) + + proposerOpts, err := bind.NewKeyedTransactorWithChainID(l1ProposerPrivKey, rpcCli.L1ChainID) + s.Nil(err) + + // register prover as a staker/eligible prover + + l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) + s.Nil(err) + + proverOpts, err := bind.NewKeyedTransactorWithChainID(l1ProverPrivKey, rpcCli.L1ChainID) + s.Nil(err) + + proverInfo, err := s.RpcClient.TaikoProverPoolL1.GetStaker(nil, crypto.PubkeyToAddress(l1ProverPrivKey.PublicKey)) + s.Nil(err) + + if proverInfo.Staker.ProverId == 0 { + _, err = s.RpcClient.TaikoL1.DepositTaikoToken(proposerOpts, new(big.Int).SetUint64(uint64(math.Pow(2, 32)))) + s.Nil(err) + + minStakePerCapacity, err := s.RpcClient.TaikoProverPoolL1.MINSTAKEPERCAPACITY(nil) + s.Nil(err) + + capacity, err := s.RpcClient.TaikoProverPoolL1.MAXCAPACITYLOWERBOUND(nil) + s.Nil(err) + + amt := new(big.Int).Mul(big.NewInt(int64(minStakePerCapacity)), big.NewInt(int64(capacity))) + + rewardPerGas := 1 + s.Nil(err) + _, err = s.RpcClient.TaikoProverPoolL1.Stake( + proverOpts, + amt.Uint64(), + uint16(rewardPerGas), + uint16(capacity), + ) + s.Nil(err) + } + s.Nil(rpcCli.L1RawRPC.CallContext(context.Background(), &s.testnetL1SnapshotID, "evm_snapshot")) s.NotEmpty(s.testnetL1SnapshotID) }