From e33cbf30a12b385b6fb5ef0feefffa2807e13f2e Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Wed, 1 Mar 2023 12:16:21 -0800 Subject: [PATCH 1/3] bump bindings --- packages/relayer/TaikoL1.json | 551 ++++++++++++++---- packages/relayer/TokenVault.json | 74 ++- .../contracts/iheadersync/IHeaderSync.go | 31 +- packages/relayer/contracts/taikol1/TaikoL1.go | 429 ++++---------- 4 files changed, 634 insertions(+), 451 deletions(-) diff --git a/packages/relayer/TaikoL1.json b/packages/relayer/TaikoL1.json index 5cd2e187e35..ed6499fa3e0 100644 --- a/packages/relayer/TaikoL1.json +++ b/packages/relayer/TaikoL1.json @@ -1,17 +1,292 @@ [ + { + "inputs": [], + "name": "L1_0_FEE_BASE", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ALREADY_CLAIMED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ALREADY_PROVEN", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_CALLDATA", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_DEST", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_GAS_LIMIT", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_RECEIPT_ADDR", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_RECEIPT_DATA", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_RECEIPT_LOGS", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_RECEIPT_PROOF", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_RECEIPT_STATUS", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_RECEIPT_TOPICS", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_SIG_R", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_SIG_S", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_TX_PROOF", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ANCHOR_TYPE", + "type": "error" + }, + { + "inputs": [], + "name": "L1_BLOCK_NOT_CLAIMED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_BLOCK_NUMBER", + "type": "error" + }, + { + "inputs": [], + "name": "L1_BLOCK_NUMBER", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CANNOT_BE_FIRST_PROVER", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CLAIM_AUCTION_DELAY_PASSED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CLAIM_AUCTION_DELAY_PASSED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CLAIM_AUCTION_WINDOW_PASSED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CLAIM_AUCTION_WINDOW_PASSED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_COMMITTED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CONFLICT_PROOF", + "type": "error" + }, + { + "inputs": [], + "name": "L1_CONTRACT_NOT_ALLOWED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_DUP_PROVERS", + "type": "error" + }, + { + "inputs": [], + "name": "L1_EXTRA_DATA", + "type": "error" + }, + { + "inputs": [], + "name": "L1_GAS_LIMIT", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ID", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ID", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ID", + "type": "error" + }, + { + "inputs": [], + "name": "L1_INPUT_SIZE", + "type": "error" + }, + { + "inputs": [], + "name": "L1_INVALID_CLAIM_DEPOSIT", + "type": "error" + }, + { + "inputs": [], + "name": "L1_INVALID_CLAIM_DEPOSIT", + "type": "error" + }, + { + "inputs": [], + "name": "L1_INVALID_PARAM", + "type": "error" + }, + { + "inputs": [], + "name": "L1_METADATA_FIELD", + "type": "error" + }, + { + "inputs": [], + "name": "L1_META_MISMATCH", + "type": "error" + }, + { + "inputs": [], + "name": "L1_NOT_COMMITTED", + "type": "error" + }, + { + "inputs": [], + "name": "L1_NOT_ORACLE_PROVER", + "type": "error" + }, + { + "inputs": [], + "name": "L1_PROOF_LENGTH", + "type": "error" + }, + { + "inputs": [], + "name": "L1_PROVER", + "type": "error" + }, + { + "inputs": [], + "name": "L1_SOLO_PROPOSER", + "type": "error" + }, + { + "inputs": [], + "name": "L1_TOO_EARLY", + "type": "error" + }, + { + "inputs": [], + "name": "L1_TOO_MANY_BLOCKS", + "type": "error" + }, + { + "inputs": [], + "name": "L1_TX_LIST", + "type": "error" + }, + { + "inputs": [], + "name": "L1_ZKP", + "type": "error" + }, + { + "inputs": [], + "name": "RESOLVER_DENIED", + "type": "error" + }, + { + "inputs": [], + "name": "RESOLVER_INVALID_ADDR", + "type": "error" + }, { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, { "indexed": false, - "internalType": "uint64", - "name": "commitSlot", - "type": "uint64" + "internalType": "address", + "name": "claimer", + "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "refundedAt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "refund", + "type": "uint256" + } + ], + "name": "BidRefunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": false, "internalType": "uint64", - "name": "commitHeight", + "name": "commitSlot", "type": "uint64" }, { @@ -123,21 +398,15 @@ }, { "indexed": false, - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" + "internalType": "address", + "name": "prover", + "type": "address" }, { "indexed": false, "internalType": "uint64", "name": "provenAt", "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "prover", - "type": "address" } ], "name": "BlockProven", @@ -165,25 +434,37 @@ { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, { "indexed": false, - "internalType": "bool", - "name": "halted", - "type": "bool" + "internalType": "address", + "name": "claimer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimedAt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deposit", + "type": "uint256" } ], - "name": "Halted", + "name": "ClaimBlockBid", "type": "event" }, { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "height", - "type": "uint256" - }, { "indexed": true, "internalType": "uint256", @@ -245,6 +526,55 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockId", + "type": "uint256" + } + ], + "name": "claimBlock", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockId", + "type": "uint256" + } + ], + "name": "claimForProposedBlock", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "claimedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "claimer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + } + ], + "internalType": "struct TaikoData.Claim", + "name": "claim", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -297,11 +627,6 @@ "name": "blockHashHistory", "type": "uint256" }, - { - "internalType": "uint256", - "name": "zkProofsPerBlock", - "type": "uint256" - }, { "internalType": "uint256", "name": "maxVerificationsPerTx", @@ -312,11 +637,6 @@ "name": "commitConfirmations", "type": "uint256" }, - { - "internalType": "uint256", - "name": "maxProofsPerForkChoice", - "type": "uint256" - }, { "internalType": "uint256", "name": "blockMaxGasLimit", @@ -402,11 +722,6 @@ "name": "bootstrapDiscountHalvingPeriod", "type": "uint64" }, - { - "internalType": "uint64", - "name": "initialUncleDelay", - "type": "uint64" - }, { "internalType": "bool", "name": "enableTokenomics", @@ -423,9 +738,29 @@ "type": "bool" }, { - "internalType": "bool", - "name": "enableOracleProver", - "type": "bool" + "internalType": "uint64", + "name": "baseClaimHoldTimeInSeconds", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "baseClaimDepositInWei", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumClaimBidIncreaseInWei", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "claimAuctionWindowInSeconds", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "claimAuctionDelayInSeconds", + "type": "uint64" } ], "internalType": "struct TaikoData.Config", @@ -458,15 +793,15 @@ "name": "blockHash", "type": "bytes32" }, + { + "internalType": "address", + "name": "prover", + "type": "address" + }, { "internalType": "uint64", "name": "provenAt", "type": "uint64" - }, - { - "internalType": "address[]", - "name": "provers", - "type": "address[]" } ], "internalType": "struct TaikoData.ForkChoice", @@ -501,13 +836,23 @@ "internalType": "uint64", "name": "proposedAt", "type": "uint64" + }, + { + "internalType": "uint256", + "name": "blockId", + "type": "uint256" } ], "name": "getProofReward", "outputs": [ { "internalType": "uint256", - "name": "reward", + "name": "eth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "token", "type": "uint256" } ], @@ -555,6 +900,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getRewardBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getStateVariables", @@ -562,25 +926,20 @@ { "components": [ { - "internalType": "uint64", - "name": "genesisHeight", - "type": "uint64" + "internalType": "uint256", + "name": "feeBase", + "type": "uint256" }, { "internalType": "uint64", - "name": "genesisTimestamp", + "name": "genesisHeight", "type": "uint64" }, { "internalType": "uint64", - "name": "statusBits", + "name": "genesisTimestamp", "type": "uint64" }, - { - "internalType": "uint256", - "name": "feeBase", - "type": "uint256" - }, { "internalType": "uint64", "name": "nextBlockId", @@ -639,38 +998,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockId", - "type": "uint256" - } - ], - "name": "getUncleProofDelay", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "toHalt", - "type": "bool" - } - ], - "name": "halt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -700,14 +1027,28 @@ "internalType": "uint256", "name": "blockId", "type": "uint256" - }, + } + ], + "name": "isClaimForProposedBlockStillValid", + "outputs": [ { - "internalType": "bytes32", - "name": "parentHash", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockId", + "type": "uint256" } ], - "name": "isBlockVerifiable", + "name": "isClaimedBlockProvable", "outputs": [ { "internalType": "bool", @@ -747,19 +1088,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isHalted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "owner", @@ -937,7 +1265,7 @@ }, { "internalType": "uint64", - "name": "statusBits", + "name": "__reservedA2", "type": "uint64" }, { @@ -1014,5 +1342,12 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [], + "name": "withdrawBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/packages/relayer/TokenVault.json b/packages/relayer/TokenVault.json index b0dab10055d..b2e073ee30f 100644 --- a/packages/relayer/TokenVault.json +++ b/packages/relayer/TokenVault.json @@ -1,4 +1,64 @@ [ + { + "inputs": [], + "name": "RESOLVER_DENIED", + "type": "error" + }, + { + "inputs": [], + "name": "RESOLVER_INVALID_ADDR", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_CANONICAL_TOKEN_NOT_FOUND", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_AMOUNT", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_CALL_VALUE", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_OWNER", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_SENDER", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_SRC_CHAIN_ID", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_TO", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_TOKEN", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_INVALID_VALUE", + "type": "error" + }, + { + "inputs": [], + "name": "TOKENVAULT_MESSAGE_NOT_FAILED", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -245,7 +305,7 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "bridgedAddress", "type": "address" } ], @@ -284,12 +344,12 @@ "inputs": [ { "internalType": "uint256", - "name": "", + "name": "chainId", "type": "uint256" }, { "internalType": "address", - "name": "", + "name": "canonicalAddress", "type": "address" } ], @@ -297,7 +357,7 @@ "outputs": [ { "internalType": "address", - "name": "", + "name": "bridgedAddress", "type": "address" } ], @@ -321,7 +381,7 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "tokenAddress", "type": "address" } ], @@ -329,7 +389,7 @@ "outputs": [ { "internalType": "bool", - "name": "", + "name": "isBridged", "type": "bool" } ], @@ -340,7 +400,7 @@ "inputs": [ { "internalType": "bytes32", - "name": "", + "name": "msgHash", "type": "bytes32" } ], diff --git a/packages/relayer/contracts/iheadersync/IHeaderSync.go b/packages/relayer/contracts/iheadersync/IHeaderSync.go index 83ee4782ad3..09d14209cce 100644 --- a/packages/relayer/contracts/iheadersync/IHeaderSync.go +++ b/packages/relayer/contracts/iheadersync/IHeaderSync.go @@ -27,7 +27,7 @@ var ( ) // IHeaderSyncABI is the input ABI used to generate the binding from. -const IHeaderSyncABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" +const IHeaderSyncABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" // IHeaderSync is an auto generated Go binding around an Ethereum contract. type IHeaderSync struct { @@ -302,48 +302,39 @@ func (it *IHeaderSyncHeaderSyncedIterator) Close() error { // IHeaderSyncHeaderSynced represents a HeaderSynced event raised by the IHeaderSync contract. type IHeaderSyncHeaderSynced struct { - Height *big.Int SrcHeight *big.Int SrcHash [32]byte Raw types.Log // Blockchain specific contextual infos } -// FilterHeaderSynced is a free log retrieval operation binding the contract event 0x930c750845026c7bb04c0e3d9111d512b4c86981713c4944a35a10a4a7a854f3. +// FilterHeaderSynced is a free log retrieval operation binding the contract event 0x58313b60ec6c5bfc381e52f0de3ede0faac3cdffea26f7d6bcc3d09b61018691. // -// Solidity: event HeaderSynced(uint256 indexed height, uint256 indexed srcHeight, bytes32 srcHash) -func (_IHeaderSync *IHeaderSyncFilterer) FilterHeaderSynced(opts *bind.FilterOpts, height []*big.Int, srcHeight []*big.Int) (*IHeaderSyncHeaderSyncedIterator, error) { +// Solidity: event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash) +func (_IHeaderSync *IHeaderSyncFilterer) FilterHeaderSynced(opts *bind.FilterOpts, srcHeight []*big.Int) (*IHeaderSyncHeaderSyncedIterator, error) { - var heightRule []interface{} - for _, heightItem := range height { - heightRule = append(heightRule, heightItem) - } var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _IHeaderSync.contract.FilterLogs(opts, "HeaderSynced", heightRule, srcHeightRule) + logs, sub, err := _IHeaderSync.contract.FilterLogs(opts, "HeaderSynced", srcHeightRule) if err != nil { return nil, err } return &IHeaderSyncHeaderSyncedIterator{contract: _IHeaderSync.contract, event: "HeaderSynced", logs: logs, sub: sub}, nil } -// WatchHeaderSynced is a free log subscription operation binding the contract event 0x930c750845026c7bb04c0e3d9111d512b4c86981713c4944a35a10a4a7a854f3. +// WatchHeaderSynced is a free log subscription operation binding the contract event 0x58313b60ec6c5bfc381e52f0de3ede0faac3cdffea26f7d6bcc3d09b61018691. // -// Solidity: event HeaderSynced(uint256 indexed height, uint256 indexed srcHeight, bytes32 srcHash) -func (_IHeaderSync *IHeaderSyncFilterer) WatchHeaderSynced(opts *bind.WatchOpts, sink chan<- *IHeaderSyncHeaderSynced, height []*big.Int, srcHeight []*big.Int) (event.Subscription, error) { +// Solidity: event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash) +func (_IHeaderSync *IHeaderSyncFilterer) WatchHeaderSynced(opts *bind.WatchOpts, sink chan<- *IHeaderSyncHeaderSynced, srcHeight []*big.Int) (event.Subscription, error) { - var heightRule []interface{} - for _, heightItem := range height { - heightRule = append(heightRule, heightItem) - } var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _IHeaderSync.contract.WatchLogs(opts, "HeaderSynced", heightRule, srcHeightRule) + logs, sub, err := _IHeaderSync.contract.WatchLogs(opts, "HeaderSynced", srcHeightRule) if err != nil { return nil, err } @@ -375,9 +366,9 @@ func (_IHeaderSync *IHeaderSyncFilterer) WatchHeaderSynced(opts *bind.WatchOpts, }), nil } -// ParseHeaderSynced is a log parse operation binding the contract event 0x930c750845026c7bb04c0e3d9111d512b4c86981713c4944a35a10a4a7a854f3. +// ParseHeaderSynced is a log parse operation binding the contract event 0x58313b60ec6c5bfc381e52f0de3ede0faac3cdffea26f7d6bcc3d09b61018691. // -// Solidity: event HeaderSynced(uint256 indexed height, uint256 indexed srcHeight, bytes32 srcHash) +// Solidity: event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash) func (_IHeaderSync *IHeaderSyncFilterer) ParseHeaderSynced(log types.Log) (*IHeaderSyncHeaderSynced, error) { event := new(IHeaderSyncHeaderSynced) if err := _IHeaderSync.contract.UnpackLog(event, "HeaderSynced", log); err != nil { diff --git a/packages/relayer/contracts/taikol1/TaikoL1.go b/packages/relayer/contracts/taikol1/TaikoL1.go index a7356009126..fb959711442 100644 --- a/packages/relayer/contracts/taikol1/TaikoL1.go +++ b/packages/relayer/contracts/taikol1/TaikoL1.go @@ -4,6 +4,7 @@ package taikol1 import ( + "errors" "math/big" "strings" @@ -17,6 +18,7 @@ import ( // Reference imports to suppress errors if they are not otherwise used. var ( + _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound @@ -24,14 +26,14 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // LibUtilsStateVariables is an auto generated low-level Go binding around an user-defined struct. type LibUtilsStateVariables struct { + FeeBase *big.Int GenesisHeight uint64 GenesisTimestamp uint64 - StatusBits uint64 - FeeBase *big.Int NextBlockId uint64 LastProposedAt uint64 AvgBlockTime uint64 @@ -60,10 +62,8 @@ type TaikoDataConfig struct { ChainId *big.Int MaxNumBlocks *big.Int BlockHashHistory *big.Int - ZkProofsPerBlock *big.Int MaxVerificationsPerTx *big.Int CommitConfirmations *big.Int - MaxProofsPerForkChoice *big.Int BlockMaxGasLimit *big.Int MaxTransactionsPerBlock *big.Int MaxBytesPerTxList *big.Int @@ -81,18 +81,16 @@ type TaikoDataConfig struct { BlockTimeCap uint64 ProofTimeCap uint64 BootstrapDiscountHalvingPeriod uint64 - InitialUncleDelay uint64 EnableTokenomics bool EnablePublicInputsCheck bool - enableAnchorValidation bool - EnableOracleProver bool + EnableAnchorValidation bool } // TaikoDataForkChoice is an auto generated low-level Go binding around an user-defined struct. type TaikoDataForkChoice struct { BlockHash [32]byte + Prover common.Address ProvenAt uint64 - Provers []common.Address } // TaikoDataProposedBlock is an auto generated low-level Go binding around an user-defined struct. @@ -103,8 +101,14 @@ type TaikoDataProposedBlock struct { ProposedAt uint64 } +// TaikoL1MetaData contains all meta data concerning the TaikoL1 contract. +var TaikoL1MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"L1_0_FEE_BASE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_CALLDATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_DEST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_GAS_LIMIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_RECEIPT_ADDR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_RECEIPT_DATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_RECEIPT_LOGS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_RECEIPT_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_RECEIPT_STATUS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_RECEIPT_TOPICS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_SIG_R\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_SIG_S\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_TX_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ANCHOR_TYPE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_NUMBER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_NUMBER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_CANNOT_BE_FIRST_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_COMMITTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_CONFLICT_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_CONTRACT_NOT_ALLOWED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_DUP_PROVERS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_EXTRA_DATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_GAS_LIMIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INPUT_SIZE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_METADATA_FIELD\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_META_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_COMMITTED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_PROOF_LENGTH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SOLO_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ZKP\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"BlockCommitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"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\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"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\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"commitBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slotSmoothingFactor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableAnchorValidation\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getProposedBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ProposedBlock\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getRewardBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"}],\"internalType\":\"structLibUtils.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_feeBase\",\"type\":\"uint256\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commitSlot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"isCommitValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proposeBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlockInvalid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signWithGoldenTouch\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedA1\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedA2\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__avgGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedC1\",\"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\"},{\"inputs\":[],\"name\":\"withdrawBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + // TaikoL1ABI is the input ABI used to generate the binding from. -const TaikoL1ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"BlockCommitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"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\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"halted\",\"type\":\"bool\"}],\"name\":\"Halted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"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\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"commitBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slotSmoothingFactor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableAnchorValidation\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableOracleProver\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address[]\",\"name\":\"provers\",\"type\":\"address[]\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getProposedBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ProposedBlock\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"}],\"internalType\":\"structLibUtils.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getUncleProofDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toHalt\",\"type\":\"bool\"}],\"name\":\"halt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_feeBase\",\"type\":\"uint256\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"isBlockVerifiable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commitSlot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"isCommitValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isHalted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proposeBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlockInvalid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signWithGoldenTouch\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedA1\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__avgGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedC1\",\"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\"}]" +// Deprecated: Use TaikoL1MetaData.ABI instead. +var TaikoL1ABI = TaikoL1MetaData.ABI // TaikoL1 is an auto generated Go binding around an Ethereum contract. type TaikoL1 struct { @@ -131,7 +135,7 @@ type TaikoL1Filterer struct { // TaikoL1Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type TaikoL1Session struct { - Contract *TaikoL1 // Generic contract binding to set the session for + Contract *TaikoL1 // 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 } @@ -140,14 +144,14 @@ type TaikoL1Session struct { // with pre-set call options. type TaikoL1CallerSession struct { Contract *TaikoL1Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session + CallOpts bind.CallOpts // Call options to use throughout this session } // TaikoL1TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type TaikoL1TransactorSession struct { Contract *TaikoL1Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TaikoL1Raw is an auto generated low-level Go binding around an Ethereum contract. @@ -203,11 +207,11 @@ func NewTaikoL1Filterer(address common.Address, filterer bind.ContractFilterer) // bindTaikoL1 binds a generic wrapper to an already deployed contract. func bindTaikoL1(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(TaikoL1ABI)) + parsed, err := TaikoL1MetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and @@ -312,7 +316,7 @@ func (_TaikoL1 *TaikoL1CallerSession) GetBlockFee() (*big.Int, error) { // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool,bool)) +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool)) func (_TaikoL1 *TaikoL1Caller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1.contract.Call(opts, &out, "getConfig") @@ -329,21 +333,21 @@ func (_TaikoL1 *TaikoL1Caller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool,bool)) +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool)) func (_TaikoL1 *TaikoL1Session) GetConfig() (TaikoDataConfig, error) { return _TaikoL1.Contract.GetConfig(&_TaikoL1.CallOpts) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool,bool)) +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool)) func (_TaikoL1 *TaikoL1CallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1.Contract.GetConfig(&_TaikoL1.CallOpts) } // GetForkChoice is a free data retrieval call binding the contract method 0xe00ea1e1. // -// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,uint64,address[])) +// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,address,uint64)) func (_TaikoL1 *TaikoL1Caller) GetForkChoice(opts *bind.CallOpts, id *big.Int, parentHash [32]byte) (TaikoDataForkChoice, error) { var out []interface{} err := _TaikoL1.contract.Call(opts, &out, "getForkChoice", id, parentHash) @@ -360,14 +364,14 @@ func (_TaikoL1 *TaikoL1Caller) GetForkChoice(opts *bind.CallOpts, id *big.Int, p // GetForkChoice is a free data retrieval call binding the contract method 0xe00ea1e1. // -// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,uint64,address[])) +// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,address,uint64)) func (_TaikoL1 *TaikoL1Session) GetForkChoice(id *big.Int, parentHash [32]byte) (TaikoDataForkChoice, error) { return _TaikoL1.Contract.GetForkChoice(&_TaikoL1.CallOpts, id, parentHash) } // GetForkChoice is a free data retrieval call binding the contract method 0xe00ea1e1. // -// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,uint64,address[])) +// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,address,uint64)) func (_TaikoL1 *TaikoL1CallerSession) GetForkChoice(id *big.Int, parentHash [32]byte) (TaikoDataForkChoice, error) { return _TaikoL1.Contract.GetForkChoice(&_TaikoL1.CallOpts, id, parentHash) } @@ -465,9 +469,40 @@ func (_TaikoL1 *TaikoL1CallerSession) GetProposedBlock(id *big.Int) (TaikoDataPr return _TaikoL1.Contract.GetProposedBlock(&_TaikoL1.CallOpts, id) } +// GetRewardBalance is a free data retrieval call binding the contract method 0xd5a849e9. +// +// Solidity: function getRewardBalance(address addr) view returns(uint256) +func (_TaikoL1 *TaikoL1Caller) GetRewardBalance(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoL1.contract.Call(opts, &out, "getRewardBalance", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetRewardBalance is a free data retrieval call binding the contract method 0xd5a849e9. +// +// Solidity: function getRewardBalance(address addr) view returns(uint256) +func (_TaikoL1 *TaikoL1Session) GetRewardBalance(addr common.Address) (*big.Int, error) { + return _TaikoL1.Contract.GetRewardBalance(&_TaikoL1.CallOpts, addr) +} + +// GetRewardBalance is a free data retrieval call binding the contract method 0xd5a849e9. +// +// Solidity: function getRewardBalance(address addr) view returns(uint256) +func (_TaikoL1 *TaikoL1CallerSession) GetRewardBalance(addr common.Address) (*big.Int, error) { + return _TaikoL1.Contract.GetRewardBalance(&_TaikoL1.CallOpts, addr) +} + // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint256,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1 *TaikoL1Caller) GetStateVariables(opts *bind.CallOpts) (LibUtilsStateVariables, error) { var out []interface{} err := _TaikoL1.contract.Call(opts, &out, "getStateVariables") @@ -484,14 +519,14 @@ func (_TaikoL1 *TaikoL1Caller) GetStateVariables(opts *bind.CallOpts) (LibUtilsS // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint256,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1 *TaikoL1Session) GetStateVariables() (LibUtilsStateVariables, error) { return _TaikoL1.Contract.GetStateVariables(&_TaikoL1.CallOpts) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint256,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1 *TaikoL1CallerSession) GetStateVariables() (LibUtilsStateVariables, error) { return _TaikoL1.Contract.GetStateVariables(&_TaikoL1.CallOpts) } @@ -527,68 +562,6 @@ func (_TaikoL1 *TaikoL1CallerSession) GetSyncedHeader(number *big.Int) ([32]byte return _TaikoL1.Contract.GetSyncedHeader(&_TaikoL1.CallOpts, number) } -// GetUncleProofDelay is a free data retrieval call binding the contract method 0xf728abaf. -// -// Solidity: function getUncleProofDelay(uint256 blockId) view returns(uint64) -func (_TaikoL1 *TaikoL1Caller) GetUncleProofDelay(opts *bind.CallOpts, blockId *big.Int) (uint64, error) { - var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "getUncleProofDelay", blockId) - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// GetUncleProofDelay is a free data retrieval call binding the contract method 0xf728abaf. -// -// Solidity: function getUncleProofDelay(uint256 blockId) view returns(uint64) -func (_TaikoL1 *TaikoL1Session) GetUncleProofDelay(blockId *big.Int) (uint64, error) { - return _TaikoL1.Contract.GetUncleProofDelay(&_TaikoL1.CallOpts, blockId) -} - -// GetUncleProofDelay is a free data retrieval call binding the contract method 0xf728abaf. -// -// Solidity: function getUncleProofDelay(uint256 blockId) view returns(uint64) -func (_TaikoL1 *TaikoL1CallerSession) GetUncleProofDelay(blockId *big.Int) (uint64, error) { - return _TaikoL1.Contract.GetUncleProofDelay(&_TaikoL1.CallOpts, blockId) -} - -// IsBlockVerifiable is a free data retrieval call binding the contract method 0x46a06c27. -// -// Solidity: function isBlockVerifiable(uint256 blockId, bytes32 parentHash) view returns(bool) -func (_TaikoL1 *TaikoL1Caller) IsBlockVerifiable(opts *bind.CallOpts, blockId *big.Int, parentHash [32]byte) (bool, error) { - var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "isBlockVerifiable", blockId, parentHash) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsBlockVerifiable is a free data retrieval call binding the contract method 0x46a06c27. -// -// Solidity: function isBlockVerifiable(uint256 blockId, bytes32 parentHash) view returns(bool) -func (_TaikoL1 *TaikoL1Session) IsBlockVerifiable(blockId *big.Int, parentHash [32]byte) (bool, error) { - return _TaikoL1.Contract.IsBlockVerifiable(&_TaikoL1.CallOpts, blockId, parentHash) -} - -// IsBlockVerifiable is a free data retrieval call binding the contract method 0x46a06c27. -// -// Solidity: function isBlockVerifiable(uint256 blockId, bytes32 parentHash) view returns(bool) -func (_TaikoL1 *TaikoL1CallerSession) IsBlockVerifiable(blockId *big.Int, parentHash [32]byte) (bool, error) { - return _TaikoL1.Contract.IsBlockVerifiable(&_TaikoL1.CallOpts, blockId, parentHash) -} - // IsCommitValid is a free data retrieval call binding the contract method 0x340d9599. // // Solidity: function isCommitValid(uint256 commitSlot, uint256 commitHeight, bytes32 commitHash) view returns(bool) @@ -620,37 +593,6 @@ func (_TaikoL1 *TaikoL1CallerSession) IsCommitValid(commitSlot *big.Int, commitH return _TaikoL1.Contract.IsCommitValid(&_TaikoL1.CallOpts, commitSlot, commitHeight, commitHash) } -// IsHalted is a free data retrieval call binding the contract method 0xc7ff1584. -// -// Solidity: function isHalted() view returns(bool) -func (_TaikoL1 *TaikoL1Caller) IsHalted(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "isHalted") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsHalted is a free data retrieval call binding the contract method 0xc7ff1584. -// -// Solidity: function isHalted() view returns(bool) -func (_TaikoL1 *TaikoL1Session) IsHalted() (bool, error) { - return _TaikoL1.Contract.IsHalted(&_TaikoL1.CallOpts) -} - -// IsHalted is a free data retrieval call binding the contract method 0xc7ff1584. -// -// Solidity: function isHalted() view returns(bool) -func (_TaikoL1 *TaikoL1CallerSession) IsHalted() (bool, error) { - return _TaikoL1.Contract.IsHalted(&_TaikoL1.CallOpts) -} - // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) @@ -796,12 +738,12 @@ func (_TaikoL1 *TaikoL1CallerSession) SignWithGoldenTouch(hash [32]byte, k uint8 // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 statusBits, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 __reservedA2, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) func (_TaikoL1 *TaikoL1Caller) State(opts *bind.CallOpts) (struct { GenesisHeight uint64 GenesisTimestamp uint64 ReservedA1 uint64 - StatusBits uint64 + ReservedA2 uint64 FeeBase *big.Int NextBlockId uint64 LastProposedAt uint64 @@ -819,7 +761,7 @@ func (_TaikoL1 *TaikoL1Caller) State(opts *bind.CallOpts) (struct { GenesisHeight uint64 GenesisTimestamp uint64 ReservedA1 uint64 - StatusBits uint64 + ReservedA2 uint64 FeeBase *big.Int NextBlockId uint64 LastProposedAt uint64 @@ -837,7 +779,7 @@ func (_TaikoL1 *TaikoL1Caller) State(opts *bind.CallOpts) (struct { outstruct.GenesisHeight = *abi.ConvertType(out[0], new(uint64)).(*uint64) outstruct.GenesisTimestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) outstruct.ReservedA1 = *abi.ConvertType(out[2], new(uint64)).(*uint64) - outstruct.StatusBits = *abi.ConvertType(out[3], new(uint64)).(*uint64) + outstruct.ReservedA2 = *abi.ConvertType(out[3], new(uint64)).(*uint64) outstruct.FeeBase = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) outstruct.NextBlockId = *abi.ConvertType(out[5], new(uint64)).(*uint64) outstruct.LastProposedAt = *abi.ConvertType(out[6], new(uint64)).(*uint64) @@ -854,12 +796,12 @@ func (_TaikoL1 *TaikoL1Caller) 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, uint64 __reservedA1, uint64 statusBits, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 __reservedA2, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) func (_TaikoL1 *TaikoL1Session) State() (struct { GenesisHeight uint64 GenesisTimestamp uint64 ReservedA1 uint64 - StatusBits uint64 + ReservedA2 uint64 FeeBase *big.Int NextBlockId uint64 LastProposedAt uint64 @@ -875,12 +817,12 @@ func (_TaikoL1 *TaikoL1Session) State() (struct { // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 statusBits, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 __reservedA2, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) func (_TaikoL1 *TaikoL1CallerSession) State() (struct { GenesisHeight uint64 GenesisTimestamp uint64 ReservedA1 uint64 - StatusBits uint64 + ReservedA2 uint64 FeeBase *big.Int NextBlockId uint64 LastProposedAt uint64 @@ -915,27 +857,6 @@ func (_TaikoL1 *TaikoL1TransactorSession) CommitBlock(commitSlot uint64, commitH return _TaikoL1.Contract.CommitBlock(&_TaikoL1.TransactOpts, commitSlot, commitHash) } -// Halt is a paid mutator transaction binding the contract method 0x96a38d22. -// -// Solidity: function halt(bool toHalt) returns() -func (_TaikoL1 *TaikoL1Transactor) Halt(opts *bind.TransactOpts, toHalt bool) (*types.Transaction, error) { - return _TaikoL1.contract.Transact(opts, "halt", toHalt) -} - -// Halt is a paid mutator transaction binding the contract method 0x96a38d22. -// -// Solidity: function halt(bool toHalt) returns() -func (_TaikoL1 *TaikoL1Session) Halt(toHalt bool) (*types.Transaction, error) { - return _TaikoL1.Contract.Halt(&_TaikoL1.TransactOpts, toHalt) -} - -// Halt is a paid mutator transaction binding the contract method 0x96a38d22. -// -// Solidity: function halt(bool toHalt) returns() -func (_TaikoL1 *TaikoL1TransactorSession) Halt(toHalt bool) (*types.Transaction, error) { - return _TaikoL1.Contract.Halt(&_TaikoL1.TransactOpts, toHalt) -} - // Init is a paid mutator transaction binding the contract method 0x9c5e9f06. // // Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint256 _feeBase) returns() @@ -1083,6 +1004,27 @@ func (_TaikoL1 *TaikoL1TransactorSession) VerifyBlocks(maxBlocks *big.Int) (*typ return _TaikoL1.Contract.VerifyBlocks(&_TaikoL1.TransactOpts, maxBlocks) } +// WithdrawBalance is a paid mutator transaction binding the contract method 0x5fd8c710. +// +// Solidity: function withdrawBalance() returns() +func (_TaikoL1 *TaikoL1Transactor) WithdrawBalance(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoL1.contract.Transact(opts, "withdrawBalance") +} + +// WithdrawBalance is a paid mutator transaction binding the contract method 0x5fd8c710. +// +// Solidity: function withdrawBalance() returns() +func (_TaikoL1 *TaikoL1Session) WithdrawBalance() (*types.Transaction, error) { + return _TaikoL1.Contract.WithdrawBalance(&_TaikoL1.TransactOpts) +} + +// WithdrawBalance is a paid mutator transaction binding the contract method 0x5fd8c710. +// +// Solidity: function withdrawBalance() returns() +func (_TaikoL1 *TaikoL1TransactorSession) WithdrawBalance() (*types.Transaction, error) { + return _TaikoL1.Contract.WithdrawBalance(&_TaikoL1.TransactOpts) +} + // TaikoL1BlockCommittedIterator is returned from FilterBlockCommitted and is used to iterate over the raw logs and unpacked data for BlockCommitted events raised by the TaikoL1 contract. type TaikoL1BlockCommittedIterator struct { Event *TaikoL1BlockCommitted // Event containing the contract specifics and raw log @@ -1152,15 +1094,14 @@ func (it *TaikoL1BlockCommittedIterator) Close() error { // TaikoL1BlockCommitted represents a BlockCommitted event raised by the TaikoL1 contract. type TaikoL1BlockCommitted struct { - CommitSlot uint64 - CommitHeight uint64 - CommitHash [32]byte - Raw types.Log // Blockchain specific contextual infos + CommitSlot uint64 + CommitHash [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockCommitted is a free log retrieval operation binding the contract event 0xd925166ecbc7d0fa7893e375c60319a9fbb17d83674eb3a8d3d57fd89ce3e7fc. +// FilterBlockCommitted is a free log retrieval operation binding the contract event 0x51264991e22d808f3bcbb1cbffa82b752eae327c24055259a5c455c0aa5b7136. // -// Solidity: event BlockCommitted(uint64 commitSlot, uint64 commitHeight, bytes32 commitHash) +// Solidity: event BlockCommitted(uint64 commitSlot, bytes32 commitHash) func (_TaikoL1 *TaikoL1Filterer) FilterBlockCommitted(opts *bind.FilterOpts) (*TaikoL1BlockCommittedIterator, error) { logs, sub, err := _TaikoL1.contract.FilterLogs(opts, "BlockCommitted") @@ -1170,9 +1111,9 @@ func (_TaikoL1 *TaikoL1Filterer) FilterBlockCommitted(opts *bind.FilterOpts) (*T return &TaikoL1BlockCommittedIterator{contract: _TaikoL1.contract, event: "BlockCommitted", logs: logs, sub: sub}, nil } -// WatchBlockCommitted is a free log subscription operation binding the contract event 0xd925166ecbc7d0fa7893e375c60319a9fbb17d83674eb3a8d3d57fd89ce3e7fc. +// WatchBlockCommitted is a free log subscription operation binding the contract event 0x51264991e22d808f3bcbb1cbffa82b752eae327c24055259a5c455c0aa5b7136. // -// Solidity: event BlockCommitted(uint64 commitSlot, uint64 commitHeight, bytes32 commitHash) +// Solidity: event BlockCommitted(uint64 commitSlot, bytes32 commitHash) func (_TaikoL1 *TaikoL1Filterer) WatchBlockCommitted(opts *bind.WatchOpts, sink chan<- *TaikoL1BlockCommitted) (event.Subscription, error) { logs, sub, err := _TaikoL1.contract.WatchLogs(opts, "BlockCommitted") @@ -1207,9 +1148,9 @@ func (_TaikoL1 *TaikoL1Filterer) WatchBlockCommitted(opts *bind.WatchOpts, sink }), nil } -// ParseBlockCommitted is a log parse operation binding the contract event 0xd925166ecbc7d0fa7893e375c60319a9fbb17d83674eb3a8d3d57fd89ce3e7fc. +// ParseBlockCommitted is a log parse operation binding the contract event 0x51264991e22d808f3bcbb1cbffa82b752eae327c24055259a5c455c0aa5b7136. // -// Solidity: event BlockCommitted(uint64 commitSlot, uint64 commitHeight, bytes32 commitHash) +// Solidity: event BlockCommitted(uint64 commitSlot, bytes32 commitHash) func (_TaikoL1 *TaikoL1Filterer) ParseBlockCommitted(log types.Log) (*TaikoL1BlockCommitted, error) { event := new(TaikoL1BlockCommitted) if err := _TaikoL1.contract.UnpackLog(event, "BlockCommitted", log); err != nil { @@ -1436,15 +1377,14 @@ type TaikoL1BlockProven struct { Id *big.Int ParentHash [32]byte BlockHash [32]byte - Timestamp uint64 - ProvenAt uint64 Prover common.Address + ProvenAt uint64 Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProven is a free log retrieval operation binding the contract event 0xf66e10e397da1b4c87429bd76e1d3b85fd417c38c5d43c8ea3e2ec45935bada0. +// FilterBlockProven is a free log retrieval operation binding the contract event 0x45848a3b2a67571e5876283456675aa3e05880e4f5a73447bd86cef5a181db38. // -// Solidity: event BlockProven(uint256 indexed id, bytes32 parentHash, bytes32 blockHash, uint64 timestamp, uint64 provenAt, address prover) +// Solidity: event BlockProven(uint256 indexed id, bytes32 parentHash, bytes32 blockHash, address prover, uint64 provenAt) func (_TaikoL1 *TaikoL1Filterer) FilterBlockProven(opts *bind.FilterOpts, id []*big.Int) (*TaikoL1BlockProvenIterator, error) { var idRule []interface{} @@ -1459,9 +1399,9 @@ func (_TaikoL1 *TaikoL1Filterer) FilterBlockProven(opts *bind.FilterOpts, id []* return &TaikoL1BlockProvenIterator{contract: _TaikoL1.contract, event: "BlockProven", logs: logs, sub: sub}, nil } -// WatchBlockProven is a free log subscription operation binding the contract event 0xf66e10e397da1b4c87429bd76e1d3b85fd417c38c5d43c8ea3e2ec45935bada0. +// WatchBlockProven is a free log subscription operation binding the contract event 0x45848a3b2a67571e5876283456675aa3e05880e4f5a73447bd86cef5a181db38. // -// Solidity: event BlockProven(uint256 indexed id, bytes32 parentHash, bytes32 blockHash, uint64 timestamp, uint64 provenAt, address prover) +// Solidity: event BlockProven(uint256 indexed id, bytes32 parentHash, bytes32 blockHash, address prover, uint64 provenAt) func (_TaikoL1 *TaikoL1Filterer) WatchBlockProven(opts *bind.WatchOpts, sink chan<- *TaikoL1BlockProven, id []*big.Int) (event.Subscription, error) { var idRule []interface{} @@ -1501,9 +1441,9 @@ func (_TaikoL1 *TaikoL1Filterer) WatchBlockProven(opts *bind.WatchOpts, sink cha }), nil } -// ParseBlockProven is a log parse operation binding the contract event 0xf66e10e397da1b4c87429bd76e1d3b85fd417c38c5d43c8ea3e2ec45935bada0. +// ParseBlockProven is a log parse operation binding the contract event 0x45848a3b2a67571e5876283456675aa3e05880e4f5a73447bd86cef5a181db38. // -// Solidity: event BlockProven(uint256 indexed id, bytes32 parentHash, bytes32 blockHash, uint64 timestamp, uint64 provenAt, address prover) +// Solidity: event BlockProven(uint256 indexed id, bytes32 parentHash, bytes32 blockHash, address prover, uint64 provenAt) func (_TaikoL1 *TaikoL1Filterer) ParseBlockProven(log types.Log) (*TaikoL1BlockProven, error) { event := new(TaikoL1BlockProven) if err := _TaikoL1.contract.UnpackLog(event, "BlockProven", log); err != nil { @@ -1658,140 +1598,6 @@ func (_TaikoL1 *TaikoL1Filterer) ParseBlockVerified(log types.Log) (*TaikoL1Bloc return event, nil } -// TaikoL1HaltedIterator is returned from FilterHalted and is used to iterate over the raw logs and unpacked data for Halted events raised by the TaikoL1 contract. -type TaikoL1HaltedIterator struct { - Event *TaikoL1Halted // 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 *TaikoL1HaltedIterator) 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(TaikoL1Halted) - 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(TaikoL1Halted) - 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 *TaikoL1HaltedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1HaltedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1Halted represents a Halted event raised by the TaikoL1 contract. -type TaikoL1Halted struct { - Halted bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHalted is a free log retrieval operation binding the contract event 0x92333b0b676476985757350034668cb9ee247674ac7a7479de10cd761381f733. -// -// Solidity: event Halted(bool halted) -func (_TaikoL1 *TaikoL1Filterer) FilterHalted(opts *bind.FilterOpts) (*TaikoL1HaltedIterator, error) { - - logs, sub, err := _TaikoL1.contract.FilterLogs(opts, "Halted") - if err != nil { - return nil, err - } - return &TaikoL1HaltedIterator{contract: _TaikoL1.contract, event: "Halted", logs: logs, sub: sub}, nil -} - -// WatchHalted is a free log subscription operation binding the contract event 0x92333b0b676476985757350034668cb9ee247674ac7a7479de10cd761381f733. -// -// Solidity: event Halted(bool halted) -func (_TaikoL1 *TaikoL1Filterer) WatchHalted(opts *bind.WatchOpts, sink chan<- *TaikoL1Halted) (event.Subscription, error) { - - logs, sub, err := _TaikoL1.contract.WatchLogs(opts, "Halted") - 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(TaikoL1Halted) - if err := _TaikoL1.contract.UnpackLog(event, "Halted", 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 -} - -// ParseHalted is a log parse operation binding the contract event 0x92333b0b676476985757350034668cb9ee247674ac7a7479de10cd761381f733. -// -// Solidity: event Halted(bool halted) -func (_TaikoL1 *TaikoL1Filterer) ParseHalted(log types.Log) (*TaikoL1Halted, error) { - event := new(TaikoL1Halted) - if err := _TaikoL1.contract.UnpackLog(event, "Halted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - // TaikoL1HeaderSyncedIterator is returned from FilterHeaderSynced and is used to iterate over the raw logs and unpacked data for HeaderSynced events raised by the TaikoL1 contract. type TaikoL1HeaderSyncedIterator struct { Event *TaikoL1HeaderSynced // Event containing the contract specifics and raw log @@ -1861,48 +1667,39 @@ func (it *TaikoL1HeaderSyncedIterator) Close() error { // TaikoL1HeaderSynced represents a HeaderSynced event raised by the TaikoL1 contract. type TaikoL1HeaderSynced struct { - Height *big.Int SrcHeight *big.Int SrcHash [32]byte Raw types.Log // Blockchain specific contextual infos } -// FilterHeaderSynced is a free log retrieval operation binding the contract event 0x930c750845026c7bb04c0e3d9111d512b4c86981713c4944a35a10a4a7a854f3. +// FilterHeaderSynced is a free log retrieval operation binding the contract event 0x58313b60ec6c5bfc381e52f0de3ede0faac3cdffea26f7d6bcc3d09b61018691. // -// Solidity: event HeaderSynced(uint256 indexed height, uint256 indexed srcHeight, bytes32 srcHash) -func (_TaikoL1 *TaikoL1Filterer) FilterHeaderSynced(opts *bind.FilterOpts, height []*big.Int, srcHeight []*big.Int) (*TaikoL1HeaderSyncedIterator, error) { +// Solidity: event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash) +func (_TaikoL1 *TaikoL1Filterer) FilterHeaderSynced(opts *bind.FilterOpts, srcHeight []*big.Int) (*TaikoL1HeaderSyncedIterator, error) { - var heightRule []interface{} - for _, heightItem := range height { - heightRule = append(heightRule, heightItem) - } var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _TaikoL1.contract.FilterLogs(opts, "HeaderSynced", heightRule, srcHeightRule) + logs, sub, err := _TaikoL1.contract.FilterLogs(opts, "HeaderSynced", srcHeightRule) if err != nil { return nil, err } return &TaikoL1HeaderSyncedIterator{contract: _TaikoL1.contract, event: "HeaderSynced", logs: logs, sub: sub}, nil } -// WatchHeaderSynced is a free log subscription operation binding the contract event 0x930c750845026c7bb04c0e3d9111d512b4c86981713c4944a35a10a4a7a854f3. +// WatchHeaderSynced is a free log subscription operation binding the contract event 0x58313b60ec6c5bfc381e52f0de3ede0faac3cdffea26f7d6bcc3d09b61018691. // -// Solidity: event HeaderSynced(uint256 indexed height, uint256 indexed srcHeight, bytes32 srcHash) -func (_TaikoL1 *TaikoL1Filterer) WatchHeaderSynced(opts *bind.WatchOpts, sink chan<- *TaikoL1HeaderSynced, height []*big.Int, srcHeight []*big.Int) (event.Subscription, error) { +// Solidity: event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash) +func (_TaikoL1 *TaikoL1Filterer) WatchHeaderSynced(opts *bind.WatchOpts, sink chan<- *TaikoL1HeaderSynced, srcHeight []*big.Int) (event.Subscription, error) { - var heightRule []interface{} - for _, heightItem := range height { - heightRule = append(heightRule, heightItem) - } var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { srcHeightRule = append(srcHeightRule, srcHeightItem) } - logs, sub, err := _TaikoL1.contract.WatchLogs(opts, "HeaderSynced", heightRule, srcHeightRule) + logs, sub, err := _TaikoL1.contract.WatchLogs(opts, "HeaderSynced", srcHeightRule) if err != nil { return nil, err } @@ -1934,9 +1731,9 @@ func (_TaikoL1 *TaikoL1Filterer) WatchHeaderSynced(opts *bind.WatchOpts, sink ch }), nil } -// ParseHeaderSynced is a log parse operation binding the contract event 0x930c750845026c7bb04c0e3d9111d512b4c86981713c4944a35a10a4a7a854f3. +// ParseHeaderSynced is a log parse operation binding the contract event 0x58313b60ec6c5bfc381e52f0de3ede0faac3cdffea26f7d6bcc3d09b61018691. // -// Solidity: event HeaderSynced(uint256 indexed height, uint256 indexed srcHeight, bytes32 srcHash) +// Solidity: event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash) func (_TaikoL1 *TaikoL1Filterer) ParseHeaderSynced(log types.Log) (*TaikoL1HeaderSynced, error) { event := new(TaikoL1HeaderSynced) if err := _TaikoL1.contract.UnpackLog(event, "HeaderSynced", log); err != nil { From 0b196a62427c2c1299d895bcb8a33571ad65f083 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Wed, 1 Mar 2023 12:58:19 -0800 Subject: [PATCH 2/3] hardcode gas right now, rpc seems to nto allow estimating gas? --- packages/relayer/message/process_message.go | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/relayer/message/process_message.go b/packages/relayer/message/process_message.go index 6f83cc669d1..4d53f2bd144 100644 --- a/packages/relayer/message/process_message.go +++ b/packages/relayer/message/process_message.go @@ -128,18 +128,18 @@ func (p *Processor) sendProcessMessageCall( return nil, errors.New("p.getLatestNonce") } - profitable, gas, err := p.isProfitable(ctx, event.Message, proof) - if err != nil { - return nil, errors.Wrap(err, "p.isProfitable") - } - - if bool(p.profitableOnly) && !profitable { - return nil, relayer.ErrUnprofitable - } - - if gas != 0 { - auth.GasLimit = gas - } + // profitable, gas, err := p.isProfitable(ctx, event.Message, proof) + // if err != nil { + // return nil, errors.Wrap(err, "p.isProfitable") + // } + + // if bool(p.profitableOnly) && !profitable { + // return nil, relayer.ErrUnprofitable + // } + + // if gas != 0 { + auth.GasLimit = 2500000 + // } // process the message on the destination bridge. tx, err := p.destBridge.ProcessMessage(auth, event.Message, proof) From 699c95fcf0e4d4d661197f365a4016aca12991e2 Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Wed, 1 Mar 2023 14:34:49 -0800 Subject: [PATCH 3/3] feat(relayer): relayer events for prometheus metrics (#13240) --- go.mod | 6 ++-- go.sum | 6 ++++ .../relayer/indexer/filter_then_subscribe.go | 1 + .../indexer/handle_no_events_in_batch.go | 2 ++ packages/relayer/indexer/subscribe.go | 2 ++ packages/relayer/message/process_message.go | 8 +++++ packages/relayer/prometheus.go | 29 +++++++++++++++++++ 7 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 packages/relayer/prometheus.go diff --git a/go.mod b/go.mod index db6e595c604..925f38a1ef1 100644 --- a/go.mod +++ b/go.mod @@ -73,8 +73,8 @@ require ( github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect github.com/opencontainers/runc v1.1.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.12.2 // indirect - github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rjeczalik/notify v0.9.1 // indirect @@ -92,7 +92,7 @@ require ( golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/grpc v1.48.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5c9e193dcc1..b33ba94eca9 100644 --- a/go.sum +++ b/go.sum @@ -777,12 +777,16 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1366,6 +1370,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/packages/relayer/indexer/filter_then_subscribe.go b/packages/relayer/indexer/filter_then_subscribe.go index 9fb5dbc05f4..0d949fb087b 100644 --- a/packages/relayer/indexer/filter_then_subscribe.go +++ b/packages/relayer/indexer/filter_then_subscribe.go @@ -88,6 +88,7 @@ func (svc *Service) FilterThenSubscribe( group.Go(func() error { err := svc.handleEvent(groupCtx, chainID, event) if err != nil { + relayer.ErrorEvents.Inc() // log error but always return nil to keep other goroutines active log.Error(err.Error()) } diff --git a/packages/relayer/indexer/handle_no_events_in_batch.go b/packages/relayer/indexer/handle_no_events_in_batch.go index 6ee402922b0..bac69757830 100644 --- a/packages/relayer/indexer/handle_no_events_in_batch.go +++ b/packages/relayer/indexer/handle_no_events_in_batch.go @@ -32,6 +32,8 @@ func (svc *Service) handleNoEventsInBatch( return errors.Wrap(err, "svc.blockRepo.Save") } + relayer.BlocksProcessed.Inc() + svc.processingBlockHeight = uint64(blockNumber) return nil diff --git a/packages/relayer/indexer/subscribe.go b/packages/relayer/indexer/subscribe.go index 02ea554e6fc..50cab3ad180 100644 --- a/packages/relayer/indexer/subscribe.go +++ b/packages/relayer/indexer/subscribe.go @@ -56,6 +56,8 @@ func (svc *Service) subscribe(ctx context.Context, chainID *big.Int) error { if err != nil { log.Errorf("svc.subscribe, svc.blockRepo.Save: %v", err) } + + relayer.BlocksProcessed.Inc() } }() } diff --git a/packages/relayer/message/process_message.go b/packages/relayer/message/process_message.go index 4d53f2bd144..c32f2b7be29 100644 --- a/packages/relayer/message/process_message.go +++ b/packages/relayer/message/process_message.go @@ -84,6 +84,8 @@ func (p *Processor) ProcessMessage( return errors.Wrap(err, "p.sendProcessMessageCall") } + relayer.EventsProcessed.Inc() + log.Infof("waiting for tx hash %v", hex.EncodeToString(tx.Hash().Bytes())) _, err = relayer.WaitReceipt(ctx, p.destEthClient, tx.Hash()) @@ -100,6 +102,12 @@ func (p *Processor) ProcessMessage( log.Infof("updating message status to: %v", relayer.EventStatus(messageStatus).String()) + if messageStatus == uint8(relayer.EventStatusRetriable) { + relayer.RetriableEvents.Inc() + } else if messageStatus == uint8(relayer.EventStatusDone) { + relayer.DoneEvents.Inc() + } + // update message status if err := p.eventRepo.UpdateStatus(ctx, e.ID, relayer.EventStatus(messageStatus)); err != nil { return errors.Wrap(err, "s.eventRepo.UpdateStatus") diff --git a/packages/relayer/prometheus.go b/packages/relayer/prometheus.go new file mode 100644 index 00000000000..8d3dfefb11f --- /dev/null +++ b/packages/relayer/prometheus.go @@ -0,0 +1,29 @@ +package relayer + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var ( + EventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ + Name: "events_processed_ops_total", + Help: "The total number of processed events", + }) + BlocksProcessed = promauto.NewCounter(prometheus.CounterOpts{ + Name: "blocks_processed_ops_total", + Help: "The total number of processed blocks", + }) + RetriableEvents = promauto.NewCounter(prometheus.CounterOpts{ + Name: "events_processed_retriable_status_ops_total", + Help: "The total number of processed events that ended up in Retriable status", + }) + DoneEvents = promauto.NewCounter(prometheus.CounterOpts{ + Name: "events_processed_done_status_ops_total", + Help: "The total number of processed events that ended up in Done status", + }) + ErrorEvents = promauto.NewCounter(prometheus.CounterOpts{ + Name: "events_processed_error_ops_total", + Help: "The total number of processed events that failed due to an error", + }) +)