From b63fd86389444adc76ebfd90a7abed6d09cf3867 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 16 Sep 2023 21:39:01 +0800 Subject: [PATCH 01/11] feat: add missed flag params --- cmd/flags/proposer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 3ead92e0f..71040ea75 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -20,12 +20,13 @@ var ( } ProverEndpoints = &cli.StringFlag{ Name: "proverEndpoints", - Usage: "Comma-delineated list of prover endpoints proposer should query when attempting to propose a block", + Required: true, Category: proposerCategory, } BlockProposalFee = &cli.StringFlag{ Name: "blockProposalFee", Usage: "Initial block proposal fee (in wei) paid on block proposing", + Required: true, Category: proposerCategory, } TaikoTokenAddress = &cli.StringFlag{ From 48e17c8181c886fc348f8a8146e77e987aee63fa Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 16 Sep 2023 21:39:44 +0800 Subject: [PATCH 02/11] feat: use placeholder to make help info more readable --- cmd/flags/common.go | 18 +++++++++--------- cmd/flags/driver.go | 6 +++--- cmd/flags/proposer.go | 11 ++++++----- cmd/flags/prover.go | 20 ++++++++++---------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/cmd/flags/common.go b/cmd/flags/common.go index 4f94daeec..4fd8fd374 100644 --- a/cmd/flags/common.go +++ b/cmd/flags/common.go @@ -17,37 +17,37 @@ var ( var ( L1WSEndpoint = &cli.StringFlag{ Name: "l1.ws", - Usage: "Websocket RPC endpoint of a L1 ethereum node", + Usage: "Websocket RPC endpoint `url` of a L1 ethereum node", Required: true, Category: commonCategory, } L2WSEndpoint = &cli.StringFlag{ Name: "l2.ws", - Usage: "Websocket RPC endpoint of a L2 taiko-geth execution engine", + Usage: "Websocket RPC endpoint `url` of a L2 taiko-geth execution engine", Required: true, Category: commonCategory, } L1HTTPEndpoint = &cli.StringFlag{ Name: "l1.http", - Usage: "HTTP RPC endpoint of a L1 ethereum node", + Usage: "HTTP RPC endpoint `url` of a L1 ethereum node", Required: true, Category: commonCategory, } L2HTTPEndpoint = &cli.StringFlag{ Name: "l2.http", - Usage: "HTTP RPC endpoint of a L2 taiko-geth execution engine", + Usage: "HTTP RPC endpoint `url` of a L2 taiko-geth execution engine", Required: true, Category: commonCategory, } TaikoL1Address = &cli.StringFlag{ Name: "taikoL1", - Usage: "TaikoL1 contract address", + Usage: "TaikoL1 contract `address`", Required: true, Category: commonCategory, } TaikoL2Address = &cli.StringFlag{ Name: "taikoL2", - Usage: "TaikoL2 contract address", + Usage: "TaikoL2 contract `address`", Required: true, Category: commonCategory, } @@ -55,7 +55,7 @@ var ( // Logging Verbosity = &cli.IntFlag{ Name: "verbosity", - Usage: "Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail", + Usage: "Logging verbosity `level`: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail", Value: 3, Category: loggingCategory, } @@ -73,13 +73,13 @@ var ( } MetricsAddr = &cli.StringFlag{ Name: "metrics.addr", - Usage: "Metrics reporting server listening address", + Usage: "Metrics reporting server listening `address`", Category: metricsCategory, Value: "0.0.0.0", } MetricsPort = &cli.IntFlag{ Name: "metrics.port", - Usage: "Metrics reporting server listening port", + Usage: "Metrics reporting server listening `port`", Category: metricsCategory, Value: 6060, } diff --git a/cmd/flags/driver.go b/cmd/flags/driver.go index b84d64362..b23c5da41 100644 --- a/cmd/flags/driver.go +++ b/cmd/flags/driver.go @@ -8,13 +8,13 @@ import ( var ( L2AuthEndpoint = &cli.StringFlag{ Name: "l2.auth", - Usage: "Authenticated HTTP RPC endpoint of a L2 taiko-geth execution engine", + Usage: "Authenticated HTTP RPC endpoint `url` of a L2 taiko-geth execution engine", Required: true, Category: driverCategory, } JWTSecret = &cli.StringFlag{ Name: "jwtSecret", - Usage: "Path to a JWT secret to use for authenticated RPC endpoints", + Usage: "JWT secret `file` to use for authenticated RPC endpoints", Required: true, Category: driverCategory, } @@ -38,7 +38,7 @@ var ( } CheckPointSyncUrl = &cli.StringFlag{ Name: "p2p.checkPointSyncUrl", - Usage: "HTTP RPC endpoint of another synced L2 execution engine node", + Usage: "HTTP RPC endpoint `url` of another synced L2 execution engine node", Category: driverCategory, } ) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 71040ea75..96b3f914b 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -8,18 +8,19 @@ import ( var ( L1ProposerPrivKey = &cli.StringFlag{ Name: "l1.proposerPrivKey", - Usage: "Private key of the L1 proposer, who will send TaikoL1.proposeBlock transactions", + Usage: "Private `key` of the L1 proposer, who will send TaikoL1.proposeBlock transactions", Required: true, Category: proposerCategory, } L2SuggestedFeeRecipient = &cli.StringFlag{ Name: "l2.suggestedFeeRecipient", - Usage: "Address of the proposed block's suggested fee recipient", + Usage: "`Address` of the proposed block's suggested fee recipient", Required: true, Category: proposerCategory, } ProverEndpoints = &cli.StringFlag{ Name: "proverEndpoints", + Usage: "Comma-delineated list(`url1,url2`) of prover endpoints proposer should query when attempting to propose a block", Required: true, Category: proposerCategory, } @@ -31,7 +32,7 @@ var ( } TaikoTokenAddress = &cli.StringFlag{ Name: "taikoToken", - Usage: "TaikoToken contract address", + Usage: "TaikoToken contract `address`", Required: true, Category: proposerCategory, } @@ -41,12 +42,12 @@ var ( var ( ProposeInterval = &cli.StringFlag{ Name: "proposeInterval", - Usage: "Time interval to propose L2 pending transactions", + Usage: "Time `interval` to propose L2 pending transactions", Category: proposerCategory, } TxPoolLocals = &cli.StringFlag{ Name: "txpool.locals", - Usage: "Comma separated accounts to treat as locals (priority inclusion)", + Usage: "Comma separated `accounts` to treat as locals (priority inclusion)", Category: proposerCategory, } TxPoolLocalsOnly = &cli.BoolFlag{ diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 4b098bd0f..b824ea18d 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -10,19 +10,19 @@ import ( var ( ZkEvmRpcdEndpoint = &cli.StringFlag{ Name: "zkevmRpcdEndpoint", - Usage: "RPC endpoint of a ZKEVM RPCD service", + Usage: "RPC endpoint `url` of a ZKEVM RPCD service", Required: true, Category: proverCategory, } ZkEvmRpcdParamsPath = &cli.StringFlag{ Name: "zkevmRpcdParamsPath", - Usage: "Path of ZKEVM parameters file to use", + Usage: "Path of ZKEVM parameters `file` to use", Required: true, Category: proverCategory, } L1ProverPrivKey = &cli.StringFlag{ Name: "l1.proverPrivKey", - Usage: "Private key of L1 prover, " + + Usage: "Private `key` of L1 prover, " + "who will send TaikoL1.proveBlock / TaikoL1.proveBlockInvalid transactions", Required: true, Category: proverCategory, @@ -39,12 +39,12 @@ var ( var ( StartingBlockID = &cli.Uint64Flag{ Name: "startingBlockID", - Usage: "If set, prover will start proving blocks from the block with this ID", + Usage: "If set, prover will start proving blocks from the block with this `ID`", Category: proverCategory, } MaxConcurrentProvingJobs = &cli.UintFlag{ Name: "maxConcurrentProvingJobs", - Usage: "Limits the number of concurrent proving blocks jobs", + Usage: "Limits the `number` of concurrent proving blocks jobs", Value: 1, Category: proverCategory, } @@ -57,7 +57,7 @@ var ( } RandomDummyProofDelay = &cli.StringFlag{ Name: "randomDummyProofDelay", - Usage: "Set the random dummy proof delay between the bounds using the format: " + + Usage: "Set the random dummy proof `delay` between the bounds using the format: " + "`lowerBound-upperBound` (e.g. `30m-1h`), testing purposes only", Category: proverCategory, } @@ -68,12 +68,12 @@ var ( } OracleProverPrivateKey = &cli.StringFlag{ Name: "oracleProverPrivateKey", - Usage: "Private key of oracle prover", + Usage: "Private `key` of oracle prover", Category: proverCategory, } OracleProofSubmissionDelay = &cli.Uint64Flag{ Name: "oracleProofSubmissionDelay", - Usage: "Oracle proof submission delay in seconds", + Usage: "Oracle proof submission `delay` in seconds", Value: 0, Category: proverCategory, } @@ -85,7 +85,7 @@ var ( } Graffiti = &cli.StringFlag{ Name: "graffiti", - Usage: "When string is passed, adds additional graffiti info to proof evidence", + Usage: "When `string` is passed, adds additional graffiti info to proof evidence", Category: proverCategory, Value: "", } @@ -108,7 +108,7 @@ var ( } ProverHTTPServerPort = &cli.Uint64Flag{ Name: "prover.httpServerPort", - Usage: "Port to expose for http server", + Usage: "`Port` to expose for http server", Category: proverCategory, Value: 9876, } From 3b0ee69781574ce49e1a96e04ea10a72a6b4c8a7 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 16 Sep 2023 23:17:09 +0800 Subject: [PATCH 03/11] feat: use StringSliceFlag --- cmd/flags/proposer.go | 2 +- proposer/config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 96b3f914b..e9364ba7e 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -18,7 +18,7 @@ var ( Required: true, Category: proposerCategory, } - ProverEndpoints = &cli.StringFlag{ + ProverEndpoints = &cli.StringSliceFlag{ Name: "proverEndpoints", Usage: "Comma-delineated list(`url1,url2`) of prover endpoints proposer should query when attempting to propose a block", Required: true, diff --git a/proposer/config.go b/proposer/config.go index 34428ef7c..94ffd2a80 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -110,7 +110,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } var proverEndpoints []*url.URL - for _, e := range strings.Split(c.String(flags.ProverEndpoints.Name), ",") { + for _, e := range c.StringSlice(flags.ProverEndpoints.Name) { endpoint, err := url.Parse(e) if err != nil { return nil, err From e2ba3b43e4b05a0fd72f086a99b189f0d4a847a4 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 18 Sep 2023 10:17:57 +0800 Subject: [PATCH 04/11] fix: too long --- cmd/flags/proposer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index e9364ba7e..9fdbc6e0d 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -20,7 +20,7 @@ var ( } ProverEndpoints = &cli.StringSliceFlag{ Name: "proverEndpoints", - Usage: "Comma-delineated list(`url1,url2`) of prover endpoints proposer should query when attempting to propose a block", + Usage: "Comma-delineated `URLlist` of prover endpoints proposer should query when attempting to propose a block", Required: true, Category: proposerCategory, } From b792bb2b35b846bb6de55f4cb517be6cf6ad9af5 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 18 Sep 2023 10:46:19 +0800 Subject: [PATCH 05/11] chore: change flag show tips --- cmd/flags/proposer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 9fdbc6e0d..515951ba7 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -20,7 +20,7 @@ var ( } ProverEndpoints = &cli.StringSliceFlag{ Name: "proverEndpoints", - Usage: "Comma-delineated `URLlist` of prover endpoints proposer should query when attempting to propose a block", + Usage: "Comma-delineated `URL` of prover endpoints proposer should query when attempting to propose a block", Required: true, Category: proposerCategory, } From fa7f9610ba7b50965249cd03ac840f5291d4d880 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Sep 2023 12:22:40 +0800 Subject: [PATCH 06/11] feat(proposer): update oracle proof assignment (#393) Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- .../prover_selector/eth_fee_eoa_selector.go | 48 +++++++++++++++---- prover/prover.go | 4 +- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6619e76a1..0342ed769 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,7 +84,7 @@ jobs: - name: Install protocol dependencies working-directory: ${{ env.TAIKO_MONO_DIR }} - run: cd ./packages/protocol && pnpm install --no-frozen-lockfile && ./script/download_solc.sh && forge install + run: cd ./packages/protocol && pnpm install && ./script/download_solc.sh && forge install - name: Build working-directory: ${{ env.CLIENT_DIR }} diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index 279a5333a..e5454e56e 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -83,6 +83,14 @@ func (s *ETHFeeEOASelector) AssignProver( ctx context.Context, meta *encoding.TaikoL1BlockMetadataInput, ) ([]byte, *big.Int, error) { + oracleProverAddress, err := s.rpc.TaikoL1.Resolve0( + &bind.CallOpts{Context: ctx}, + rpc.StringToBytes32("oracle_prover"), + true, + ) + if err != nil { + return nil, nil, err + } // Iterate over each configured endpoint, and see if someone wants to accept this block. // If it is denied, we continue on to the next endpoint. // If we do not find a prover, we can increase the fee up to a point, or give up. @@ -100,19 +108,29 @@ func (s *ETHFeeEOASelector) AssignProver( fee.Add(fee, increase) } for _, endpoint := range s.shuffleProverEndpoints() { - encodedAssignment, proverAddress, err := assignProver(ctx, meta, endpoint, fee, expiry, s.requestTimeout) + encodedAssignment, proverAddress, err := assignProver( + ctx, + meta, + endpoint, + fee, + expiry, + s.requestTimeout, + oracleProverAddress, + ) if err != nil { log.Warn("Failed to assign prover", "endpoint", endpoint, "error", err) continue } - ok, err := s.checkProverBalance(ctx, proverAddress) - if err != nil { - log.Warn("Failed to check prover balance", "endpoint", endpoint, "error", err) - continue - } - if !ok { - continue + if proverAddress != encoding.OracleProverAddress { + ok, err := s.checkProverBalance(ctx, proverAddress) + if err != nil { + log.Warn("Failed to check prover balance", "endpoint", endpoint, "error", err) + continue + } + if !ok { + continue + } } return encodedAssignment, fee, nil @@ -169,6 +187,7 @@ func assignProver( fee *big.Int, expiry uint64, timeout time.Duration, + oracleProverAddress common.Address, ) ([]byte, common.Address, error) { log.Info( "Attempting to assign prover", @@ -228,6 +247,11 @@ func assignProver( // Convert signature to one solidity can recover by adding 27 to 65th byte result.SignedPayload[64] = uint8(uint(result.SignedPayload[64])) + 27 + // If this assignment is to oracle prover, change prover address in assignment to `LibUtils.ORACLE_PROVER` + if oracleProverAddress != (common.Address{}) && result.Prover == oracleProverAddress { + result.Prover = encoding.OracleProverAddress + } + encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ Prover: result.Prover, Expiry: reqBody.Expiry, @@ -237,5 +261,13 @@ func assignProver( return nil, common.Address{}, err } + log.Info( + "Prover assigned", + "address", result.Prover, + "endpoint", endpoint, + "fee", fee.String(), + "expiry", expiry, + ) + return encoded, result.Prover, nil } diff --git a/prover/prover.go b/prover/prover.go index d81309c08..22c1cecf6 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -537,7 +537,9 @@ func (p *Prover) onBlockProposed( proofWindowExpiresAt := block.ProposedAt + uint64(p.protocolConfigs.ProofWindow) proofWindowExpired := uint64(time.Now().Unix()) > proofWindowExpiresAt // zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address - if block.Prover != p.proverAddress && !proofWindowExpired { + if block.Prover != p.proverAddress && + !proofWindowExpired && + !(block.Prover == encoding.OracleProverAddress && p.oracleProverAddress == p.proverAddress) { log.Info( "Proposed block not provable", "blockID", From b8b436794c35878bc57aee67bcfb787299979a2b Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Sep 2023 16:24:45 +0800 Subject: [PATCH 07/11] feat(bindings): update contract bindings (#394) --- bindings/.githead | 2 +- bindings/gen_taiko_l2.go | 222 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 215 insertions(+), 9 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index f714bc2f2..d854d9e9d 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -098a350bac5d2f01f39c975d4c6f4d93efed943a +ee2688156733d49cbf43c5178211db95a7079b26 diff --git a/bindings/gen_taiko_l2.go b/bindings/gen_taiko_l2.go index fde0e9c99..fdf8add4d 100644 --- a/bindings/gen_taiko_l2.go +++ b/bindings/gen_taiko_l2.go @@ -47,7 +47,7 @@ type TaikoL2EIP1559Params struct { // TaikoL2ClientMetaData contains all meta data concerning the TaikoL2Client contract. var TaikoL2ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"chainid\",\"type\":\"uint32\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainid\",\"type\":\"uint64\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gasExcess\",\"type\":\"uint64\"}],\"name\":\"EIP1559ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip1559Config\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"updateEIP1559Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // TaikoL2ClientABI is the input ABI used to generate the binding from. @@ -289,6 +289,56 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) AddressManager() (common.Addre return _TaikoL2Client.Contract.AddressManager(&_TaikoL2Client.CallOpts) } +// Eip1559Config is a free data retrieval call binding the contract method 0x4111610b. +// +// Solidity: function eip1559Config() view returns(uint128 yscale, uint64 xscale, uint32 gasIssuedPerSecond) +func (_TaikoL2Client *TaikoL2ClientCaller) Eip1559Config(opts *bind.CallOpts) (struct { + Yscale *big.Int + Xscale uint64 + GasIssuedPerSecond uint32 +}, error) { + var out []interface{} + err := _TaikoL2Client.contract.Call(opts, &out, "eip1559Config") + + outstruct := new(struct { + Yscale *big.Int + Xscale uint64 + GasIssuedPerSecond uint32 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Yscale = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Xscale = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.GasIssuedPerSecond = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +// Eip1559Config is a free data retrieval call binding the contract method 0x4111610b. +// +// Solidity: function eip1559Config() view returns(uint128 yscale, uint64 xscale, uint32 gasIssuedPerSecond) +func (_TaikoL2Client *TaikoL2ClientSession) Eip1559Config() (struct { + Yscale *big.Int + Xscale uint64 + GasIssuedPerSecond uint32 +}, error) { + return _TaikoL2Client.Contract.Eip1559Config(&_TaikoL2Client.CallOpts) +} + +// Eip1559Config is a free data retrieval call binding the contract method 0x4111610b. +// +// Solidity: function eip1559Config() view returns(uint128 yscale, uint64 xscale, uint32 gasIssuedPerSecond) +func (_TaikoL2Client *TaikoL2ClientCallerSession) Eip1559Config() (struct { + Yscale *big.Int + Xscale uint64 + GasIssuedPerSecond uint32 +}, error) { + return _TaikoL2Client.Contract.Eip1559Config(&_TaikoL2Client.CallOpts) +} + // GasExcess is a free data retrieval call binding the contract method 0xf535bd56. // // Solidity: function gasExcess() view returns(uint64) @@ -816,6 +866,27 @@ func (_TaikoL2Client *TaikoL2ClientTransactorSession) TransferOwnership(newOwner return _TaikoL2Client.Contract.TransferOwnership(&_TaikoL2Client.TransactOpts, newOwner) } +// UpdateEIP1559Config is a paid mutator transaction binding the contract method 0xc1ea62de. +// +// Solidity: function updateEIP1559Config((uint64,uint32,uint64,uint64,uint64) _param1559) returns() +func (_TaikoL2Client *TaikoL2ClientTransactor) UpdateEIP1559Config(opts *bind.TransactOpts, _param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { + return _TaikoL2Client.contract.Transact(opts, "updateEIP1559Config", _param1559) +} + +// UpdateEIP1559Config is a paid mutator transaction binding the contract method 0xc1ea62de. +// +// Solidity: function updateEIP1559Config((uint64,uint32,uint64,uint64,uint64) _param1559) returns() +func (_TaikoL2Client *TaikoL2ClientSession) UpdateEIP1559Config(_param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { + return _TaikoL2Client.Contract.UpdateEIP1559Config(&_TaikoL2Client.TransactOpts, _param1559) +} + +// UpdateEIP1559Config is a paid mutator transaction binding the contract method 0xc1ea62de. +// +// Solidity: function updateEIP1559Config((uint64,uint32,uint64,uint64,uint64) _param1559) returns() +func (_TaikoL2Client *TaikoL2ClientTransactorSession) UpdateEIP1559Config(_param1559 TaikoL2EIP1559Params) (*types.Transaction, error) { + return _TaikoL2Client.Contract.UpdateEIP1559Config(&_TaikoL2Client.TransactOpts, _param1559) +} + // TaikoL2ClientAddressManagerChangedIterator is returned from FilterAddressManagerChanged and is used to iterate over the raw logs and unpacked data for AddressManagerChanged events raised by the TaikoL2Client contract. type TaikoL2ClientAddressManagerChangedIterator struct { Event *TaikoL2ClientAddressManagerChanged // Event containing the contract specifics and raw log @@ -1036,13 +1107,13 @@ type TaikoL2ClientAnchored struct { ParentHash [32]byte Prevrandao *big.Int Coinbase common.Address - Chainid uint32 + Chainid uint64 Raw types.Log // Blockchain specific contextual infos } -// FilterAnchored is a free log retrieval operation binding the contract event 0xf5e89a4a67ffebdbc23df567479d3096c1dba4169c6bbf20ffc6b24d7f6e6e70. +// FilterAnchored is a free log retrieval operation binding the contract event 0xf0fde5abf5476e9fb590d1e786d07c1ceee1d3c80cce3fafe0478e203cf5184e. // -// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint32 chainid) +// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) func (_TaikoL2Client *TaikoL2ClientFilterer) FilterAnchored(opts *bind.FilterOpts) (*TaikoL2ClientAnchoredIterator, error) { logs, sub, err := _TaikoL2Client.contract.FilterLogs(opts, "Anchored") @@ -1052,9 +1123,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) FilterAnchored(opts *bind.FilterOpt return &TaikoL2ClientAnchoredIterator{contract: _TaikoL2Client.contract, event: "Anchored", logs: logs, sub: sub}, nil } -// WatchAnchored is a free log subscription operation binding the contract event 0xf5e89a4a67ffebdbc23df567479d3096c1dba4169c6bbf20ffc6b24d7f6e6e70. +// WatchAnchored is a free log subscription operation binding the contract event 0xf0fde5abf5476e9fb590d1e786d07c1ceee1d3c80cce3fafe0478e203cf5184e. // -// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint32 chainid) +// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) func (_TaikoL2Client *TaikoL2ClientFilterer) WatchAnchored(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientAnchored) (event.Subscription, error) { logs, sub, err := _TaikoL2Client.contract.WatchLogs(opts, "Anchored") @@ -1089,9 +1160,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) WatchAnchored(opts *bind.WatchOpts, }), nil } -// ParseAnchored is a log parse operation binding the contract event 0xf5e89a4a67ffebdbc23df567479d3096c1dba4169c6bbf20ffc6b24d7f6e6e70. +// ParseAnchored is a log parse operation binding the contract event 0xf0fde5abf5476e9fb590d1e786d07c1ceee1d3c80cce3fafe0478e203cf5184e. // -// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint32 chainid) +// Solidity: event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) func (_TaikoL2Client *TaikoL2ClientFilterer) ParseAnchored(log types.Log) (*TaikoL2ClientAnchored, error) { event := new(TaikoL2ClientAnchored) if err := _TaikoL2Client.contract.UnpackLog(event, "Anchored", log); err != nil { @@ -1247,6 +1318,141 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) ParseCrossChainSynced(log types.Log return event, nil } +// TaikoL2ClientEIP1559ConfigUpdatedIterator is returned from FilterEIP1559ConfigUpdated and is used to iterate over the raw logs and unpacked data for EIP1559ConfigUpdated events raised by the TaikoL2Client contract. +type TaikoL2ClientEIP1559ConfigUpdatedIterator struct { + Event *TaikoL2ClientEIP1559ConfigUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoL2ClientEIP1559ConfigUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoL2ClientEIP1559ConfigUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoL2ClientEIP1559ConfigUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoL2ClientEIP1559ConfigUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoL2ClientEIP1559ConfigUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoL2ClientEIP1559ConfigUpdated represents a EIP1559ConfigUpdated event raised by the TaikoL2Client contract. +type TaikoL2ClientEIP1559ConfigUpdated struct { + Config TaikoL2EIP1559Config + GasExcess uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEIP1559ConfigUpdated is a free log retrieval operation binding the contract event 0x60807b646ebaa6bfeb242d7281f23e864f8ba09f3f0d16bfec4060fb4e48e77d. +// +// Solidity: event EIP1559ConfigUpdated((uint128,uint64,uint32) config, uint64 gasExcess) +func (_TaikoL2Client *TaikoL2ClientFilterer) FilterEIP1559ConfigUpdated(opts *bind.FilterOpts) (*TaikoL2ClientEIP1559ConfigUpdatedIterator, error) { + + logs, sub, err := _TaikoL2Client.contract.FilterLogs(opts, "EIP1559ConfigUpdated") + if err != nil { + return nil, err + } + return &TaikoL2ClientEIP1559ConfigUpdatedIterator{contract: _TaikoL2Client.contract, event: "EIP1559ConfigUpdated", logs: logs, sub: sub}, nil +} + +// WatchEIP1559ConfigUpdated is a free log subscription operation binding the contract event 0x60807b646ebaa6bfeb242d7281f23e864f8ba09f3f0d16bfec4060fb4e48e77d. +// +// Solidity: event EIP1559ConfigUpdated((uint128,uint64,uint32) config, uint64 gasExcess) +func (_TaikoL2Client *TaikoL2ClientFilterer) WatchEIP1559ConfigUpdated(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientEIP1559ConfigUpdated) (event.Subscription, error) { + + logs, sub, err := _TaikoL2Client.contract.WatchLogs(opts, "EIP1559ConfigUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoL2ClientEIP1559ConfigUpdated) + if err := _TaikoL2Client.contract.UnpackLog(event, "EIP1559ConfigUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEIP1559ConfigUpdated is a log parse operation binding the contract event 0x60807b646ebaa6bfeb242d7281f23e864f8ba09f3f0d16bfec4060fb4e48e77d. +// +// Solidity: event EIP1559ConfigUpdated((uint128,uint64,uint32) config, uint64 gasExcess) +func (_TaikoL2Client *TaikoL2ClientFilterer) ParseEIP1559ConfigUpdated(log types.Log) (*TaikoL2ClientEIP1559ConfigUpdated, error) { + event := new(TaikoL2ClientEIP1559ConfigUpdated) + if err := _TaikoL2Client.contract.UnpackLog(event, "EIP1559ConfigUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // TaikoL2ClientInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoL2Client contract. type TaikoL2ClientInitializedIterator struct { Event *TaikoL2ClientInitialized // Event containing the contract specifics and raw log From 29c6746319a18f954e7fe4d45e10b4092cb0faee Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 20 Sep 2023 21:08:55 +0800 Subject: [PATCH 08/11] feat: change flag type in test --- proposer/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposer/config_test.go b/proposer/config_test.go index 0555bda14..1a03ea492 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -190,7 +190,7 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.ProposeEmptyBlocksInterval.Name}, &cli.StringFlag{Name: flags.ProposeInterval.Name}, &cli.StringFlag{Name: flags.TxPoolLocals.Name}, - &cli.StringFlag{Name: flags.ProverEndpoints.Name}, + &cli.StringSliceFlag{Name: flags.ProverEndpoints.Name}, &cli.Uint64Flag{Name: flags.BlockProposalFee.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxReplacementMultiplier.Name}, &cli.Uint64Flag{Name: flags.RPCTimeout.Name}, From a5bcccbcce6324d6829ab3c074e67db0f0018273 Mon Sep 17 00:00:00 2001 From: alexshliu <104080237+alexshliu@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:03:42 +0800 Subject: [PATCH 09/11] Update cmd/flags/driver.go Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- cmd/flags/driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/flags/driver.go b/cmd/flags/driver.go index b23c5da41..8d6ab8087 100644 --- a/cmd/flags/driver.go +++ b/cmd/flags/driver.go @@ -14,7 +14,7 @@ var ( } JWTSecret = &cli.StringFlag{ Name: "jwtSecret", - Usage: "JWT secret `file` to use for authenticated RPC endpoints", + Usage: "Path to a JWT secret `file` to use for authenticated RPC endpoints", Required: true, Category: driverCategory, } From 730b0dc5631a1dc6e62a59a3bf4d30a6da70dadf Mon Sep 17 00:00:00 2001 From: alexshliu <104080237+alexshliu@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:04:43 +0800 Subject: [PATCH 10/11] Update cmd/flags/proposer.go Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- cmd/flags/proposer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 515951ba7..3cfa157b2 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -20,7 +20,7 @@ var ( } ProverEndpoints = &cli.StringSliceFlag{ Name: "proverEndpoints", - Usage: "Comma-delineated `URL` of prover endpoints proposer should query when attempting to propose a block", + Usage: "Comma-delineated list of prover endpoint `URLs` proposer should query when attempting to propose a block", Required: true, Category: proposerCategory, } From 9538650868140a14b8e141a26b6a76b0e65fcca2 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 27 Sep 2023 11:19:55 +0800 Subject: [PATCH 11/11] feat: change txpool.locals to StringSliceFlag --- cmd/flags/proposer.go | 2 +- proposer/config.go | 2 +- proposer/config_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index 3cfa157b2..6b306f737 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -45,7 +45,7 @@ var ( Usage: "Time `interval` to propose L2 pending transactions", Category: proposerCategory, } - TxPoolLocals = &cli.StringFlag{ + TxPoolLocals = &cli.StringSliceFlag{ Name: "txpool.locals", Usage: "Comma separated `accounts` to treat as locals (priority inclusion)", Category: proposerCategory, diff --git a/proposer/config.go b/proposer/config.go index 94ffd2a80..3bd5a8b34 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -75,7 +75,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { localAddresses := []common.Address{} if c.IsSet(flags.TxPoolLocals.Name) { - for _, account := range strings.Split(c.String(flags.TxPoolLocals.Name), ",") { + for _, account := range c.StringSlice(flags.TxPoolLocals.Name) { if trimmed := strings.TrimSpace(account); !common.IsHexAddress(trimmed) { return nil, fmt.Errorf("invalid account in --txpool.locals: %s", trimmed) } else { diff --git a/proposer/config_test.go b/proposer/config_test.go index df7707f0f..11aec2350 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -189,7 +189,7 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.L2SuggestedFeeRecipient.Name}, &cli.StringFlag{Name: flags.ProposeEmptyBlocksInterval.Name}, &cli.StringFlag{Name: flags.ProposeInterval.Name}, - &cli.StringFlag{Name: flags.TxPoolLocals.Name}, + &cli.StringSliceFlag{Name: flags.TxPoolLocals.Name}, &cli.StringSliceFlag{Name: flags.ProverEndpoints.Name}, &cli.Uint64Flag{Name: flags.BlockProposalFee.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxReplacementMultiplier.Name},