From ba90549d82bb0a4671a2c2f52b17e44480cc3874 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Thu, 4 May 2023 19:34:36 -0700 Subject: [PATCH 01/21] ref --- .github/workflows/test.yml | 1 - integration_test/entrypoint.sh | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bffce707..4e1ab2480 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,6 @@ jobs: with: repository: taikoxyz/taiko-mono path: ${{ env.TAIKO_MONO_DIR }} - ref: get_oracle_prover - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index 8f10b1681..ec951f993 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -32,6 +32,7 @@ L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.signal_service trap "docker compose -f $TESTNET_CONFIG down -v" EXIT INT KILL ERR RUN_TESTS=${RUN_TESTS:-false} +PACKAGE=${PACKAGE:-...} echo "TAIKO_L1_CONTRACT_ADDRESS: $TAIKO_L1_CONTRACT_ADDRESS" echo "L1_SIGNAL_SERVICE_CONTRACT_ADDRESS: $L1_SIGNAL_SERVICE_CONTRACT_ADDRESS" @@ -50,7 +51,7 @@ if [ "$RUN_TESTS" == "true" ]; then L2_SUGGESTED_FEE_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ L1_PROVER_PRIVATE_KEY=59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d \ JWT_SECRET=$DIR/nodes/jwt.hex \ - go test -v -p=1 ./... -coverprofile=coverage.out -covermode=atomic -timeout=300s + go test -v -p=1 ./$PACKAGE -coverprofile=coverage.out -covermode=atomic -timeout=300s else echo "💻 Local dev net started" docker compose -f $TESTNET_CONFIG logs -f l2_execution_engine From 88c206216fcb7907ecfcaa7268337e28cc79a772 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 09:53:02 -0700 Subject: [PATCH 02/21] system prover --- .github/workflows/test.yml | 1 + cmd/flags/prover.go | 12 ++ prover/config.go | 27 ++- prover/config_test.go | 165 +++++++++++++++++- ..._producer.go => special_proof_producer.go} | 47 +++-- ...test.go => special_proof_producer_test.go} | 2 +- prover/proof_submitter/util.go | 4 +- prover/proof_submitter/util_test.go | 1 + prover/prover.go | 36 +++- 9 files changed, 267 insertions(+), 28 deletions(-) rename prover/proof_producer/{oracle_proof_producer.go => special_proof_producer.go} (68%) rename prover/proof_producer/{oracle_proof_producer_test.go => special_proof_producer_test.go} (96%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e1ab2480..26a9ac598 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,7 @@ jobs: with: repository: taikoxyz/taiko-mono path: ${{ env.TAIKO_MONO_DIR }} + ref: separate_oracle_proof_and_artificially_valid_oracle_proof - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 7cd18a2af..e89402723 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -58,11 +58,21 @@ var ( Usage: "Set whether prover should use oracle prover or not", Category: proverCategory, } + SystemProver = &cli.BoolFlag{ + Name: "systemProver", + Usage: "Set whether prover should use system prover or not", + Category: proverCategory, + } OracleProverPrivateKey = &cli.StringFlag{ Name: "oracleProverPrivateKey", Usage: "Private key of oracle prover", Category: proverCategory, } + SystemProverPrivateKey = &cli.StringFlag{ + Name: "systemProverPrivateKey", + Usage: "Private key of system prover", + Category: proverCategory, + } Graffiti = &cli.StringFlag{ Name: "graffiti", Usage: "When string is passed, adds additional graffiti info to proof evidence", @@ -84,6 +94,8 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ Dummy, RandomDummyProofDelay, OracleProver, + SystemProver, OracleProverPrivateKey, + SystemProverPrivateKey, Graffiti, }) diff --git a/prover/config.go b/prover/config.go index 5bd34e857..3e922ea54 100644 --- a/prover/config.go +++ b/prover/config.go @@ -28,7 +28,9 @@ type Config struct { MaxConcurrentProvingJobs uint Dummy bool OracleProver bool + SystemProver bool OracleProverPrivateKey *ecdsa.PrivateKey + SystemProverPrivateKey *ecdsa.PrivateKey Graffiti string RandomDummyProofDelayLowerBound *time.Duration RandomDummyProofDelayUpperBound *time.Duration @@ -43,8 +45,15 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, fmt.Errorf("invalid L1 prover private key: %w", err) } + oracleProverSet := c.IsSet(flags.OracleProver.Name) + systemProverSet := c.IsSet(flags.SystemProver.Name) + + if oracleProverSet && systemProverSet { + return nil, fmt.Errorf("cannot set both oracleProver and systemProver") + } + var oracleProverPrivKey *ecdsa.PrivateKey - if c.IsSet(flags.OracleProver.Name) { + if oracleProverSet { if !c.IsSet(flags.OracleProverPrivateKey.Name) { return nil, fmt.Errorf("oracleProver flag set without oracleProverPrivateKey set") } @@ -57,6 +66,20 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } } + var systemProverPrivKey *ecdsa.PrivateKey + if systemProverSet { + if !c.IsSet(flags.SystemProverPrivateKey.Name) { + return nil, fmt.Errorf("systemProver flag set without systemProverPrivateKey set") + } + + systemProverPrivKeyStr := c.String(flags.OracleProverPrivateKey.Name) + + systemProverPrivKey, err = crypto.ToECDSA(common.Hex2Bytes(systemProverPrivKeyStr)) + if err != nil { + return nil, fmt.Errorf("invalid system private key: %w", err) + } + } + var ( randomDummyProofDelayLowerBound *time.Duration randomDummyProofDelayUpperBound *time.Duration @@ -106,6 +129,8 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { Dummy: c.Bool(flags.Dummy.Name), OracleProver: c.Bool(flags.OracleProver.Name), OracleProverPrivateKey: oracleProverPrivKey, + SystemProver: c.Bool(flags.SystemProver.Name), + SystemProverPrivateKey: systemProverPrivKey, Graffiti: c.String(flags.Graffiti.Name), RandomDummyProofDelayLowerBound: randomDummyProofDelayLowerBound, RandomDummyProofDelayUpperBound: randomDummyProofDelayUpperBound, diff --git a/prover/config_test.go b/prover/config_test.go index b0eb34271..ff77390a5 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -10,7 +10,7 @@ import ( "github.com/urfave/cli/v2" ) -func (s *ProverTestSuite) TestNewConfigFromCliContext() { +func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") l2WsEndpoint := os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") @@ -31,6 +31,8 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext() { &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, &cli.BoolFlag{Name: flags.OracleProver.Name}, &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, + &cli.BoolFlag{Name: flags.SystemProver.Name}, + &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, } app.Action = func(ctx *cli.Context) error { @@ -77,6 +79,75 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext() { })) } +func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProver() { + l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") + l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") + l2WsEndpoint := os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") + l2HttpEndpoint := os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") + taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") + + app := cli.NewApp() + app.Flags = []cli.Flag{ + &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.TaikoL1Address.Name}, + &cli.StringFlag{Name: flags.TaikoL2Address.Name}, + &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, + &cli.BoolFlag{Name: flags.Dummy.Name}, + &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, + &cli.BoolFlag{Name: flags.SystemProver.Name}, + &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, + &cli.BoolFlag{Name: flags.SystemProver.Name}, + &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, + &cli.StringFlag{Name: flags.Graffiti.Name}, + } + app.Action = func(ctx *cli.Context) error { + c, err := NewConfigFromCliContext(ctx) + s.Nil(err) + s.Equal(l1WsEndpoint, c.L1WsEndpoint) + s.Equal(l1HttpEndpoint, c.L1HttpEndpoint) + s.Equal(l2WsEndpoint, c.L2WsEndpoint) + s.Equal(l2HttpEndpoint, c.L2HttpEndpoint) + s.Equal(taikoL1, c.TaikoL1Address.String()) + s.Equal(taikoL2, c.TaikoL2Address.String()) + s.Equal( + crypto.PubkeyToAddress(s.p.cfg.L1ProverPrivKey.PublicKey), + crypto.PubkeyToAddress(c.L1ProverPrivKey.PublicKey), + ) + s.Equal(30*time.Minute, *c.RandomDummyProofDelayLowerBound) + s.Equal(time.Hour, *c.RandomDummyProofDelayUpperBound) + s.True(c.Dummy) + s.True(c.OracleProver) + s.Equal( + crypto.PubkeyToAddress(s.p.cfg.SystemProverPrivateKey.PublicKey), + crypto.PubkeyToAddress(c.SystemProverPrivateKey.PublicKey), + ) + s.Equal("", c.Graffiti) + s.Nil(new(Prover).InitFromCli(context.Background(), ctx)) + + return err + } + + s.Nil(app.Run([]string{ + "TestNewConfigFromCliContext", + "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, + "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, + "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, + "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, + "-" + flags.TaikoL1Address.Name, taikoL1, + "-" + flags.TaikoL2Address.Name, taikoL2, + "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.Dummy.Name, + "-" + flags.RandomDummyProofDelay.Name, "30m-1h", + "-" + flags.SystemProver.Name, + "-" + flags.SystemProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.Graffiti.Name, "", + })) +} + func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") @@ -121,3 +192,95 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { "-" + flags.Graffiti.Name, "", }), "oracleProver flag set without oracleProverPrivateKey set") } + +func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverError() { + l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") + l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") + l2WsEndpoint := os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") + l2HttpEndpoint := os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") + taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") + + app := cli.NewApp() + app.Flags = []cli.Flag{ + &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.TaikoL1Address.Name}, + &cli.StringFlag{Name: flags.TaikoL2Address.Name}, + &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, + &cli.BoolFlag{Name: flags.Dummy.Name}, + &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, + &cli.BoolFlag{Name: flags.SystemProver.Name}, + &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, + &cli.StringFlag{Name: flags.Graffiti.Name}, + } + app.Action = func(ctx *cli.Context) error { + _, err := NewConfigFromCliContext(ctx) + s.NotNil(err) + return err + } + + s.ErrorContains(app.Run([]string{ + "TestNewConfigFromCliContext", + "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, + "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, + "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, + "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, + "-" + flags.TaikoL1Address.Name, taikoL1, + "-" + flags.TaikoL2Address.Name, taikoL2, + "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.Dummy.Name, + "-" + flags.RandomDummyProofDelay.Name, "30m-1h", + "-" + flags.SystemProver.Name, + "-" + flags.Graffiti.Name, "", + }), "systemProver flag set without systemProverPrivateKey set") +} + +func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverEAndOracleProverBothSet() { + l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") + l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") + l2WsEndpoint := os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") + l2HttpEndpoint := os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") + taikoL1 := os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") + + app := cli.NewApp() + app.Flags = []cli.Flag{ + &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.TaikoL1Address.Name}, + &cli.StringFlag{Name: flags.TaikoL2Address.Name}, + &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, + &cli.BoolFlag{Name: flags.Dummy.Name}, + &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, + &cli.BoolFlag{Name: flags.OracleProver.Name}, + &cli.BoolFlag{Name: flags.SystemProver.Name}, + &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, + &cli.StringFlag{Name: flags.Graffiti.Name}, + } + app.Action = func(ctx *cli.Context) error { + _, err := NewConfigFromCliContext(ctx) + s.NotNil(err) + return err + } + + s.ErrorContains(app.Run([]string{ + "TestNewConfigFromCliContext", + "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, + "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, + "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, + "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, + "-" + flags.TaikoL1Address.Name, taikoL1, + "-" + flags.TaikoL2Address.Name, taikoL2, + "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.Dummy.Name, + "-" + flags.RandomDummyProofDelay.Name, "30m-1h", + "-" + flags.OracleProver.Name, + "-" + flags.SystemProver.Name, + "-" + flags.Graffiti.Name, "", + }), "cannot set both oracleProver and systemProvert") +} diff --git a/prover/proof_producer/oracle_proof_producer.go b/prover/proof_producer/special_proof_producer.go similarity index 68% rename from prover/proof_producer/oracle_proof_producer.go rename to prover/proof_producer/special_proof_producer.go index c1642df02..09e8403b0 100644 --- a/prover/proof_producer/oracle_proof_producer.go +++ b/prover/proof_producer/special_proof_producer.go @@ -19,30 +19,33 @@ import ( ) var ( - errProtocolAddressMismatch = errors.New("oracle prover private key does not match protocol setting") + errProtocolAddressMismatch = errors.New("special prover private key does not match protocol setting") ) -// OracleProducer is responsible for generating a fake "zkproof" consisting +// SpecialProofProducer is responsible for generating a fake "zkproof" consisting // of a signature of the evidence. -type OracleProducer struct { +type SpecialProofProducer struct { rpc *rpc.Client proverPrivKey *ecdsa.PrivateKey anchorTxValidator *anchorTxValidator.AnchorTxValidator proofTimeTarget time.Duration graffiti [32]byte + isSystemProver bool } -// NewOracleProducer creates a new NewOracleProducer instance. -func NewOracleProducer( +// NewSpecialProofProducer creates a new NewSpecialProofProducer instance, which can be either +// an oracle proof producer, or a system proofproducer. +func NewSpecialProofProducer( rpc *rpc.Client, proverPrivKey *ecdsa.PrivateKey, taikoL2Address common.Address, proofTimeTarget time.Duration, - protocolOracleProverAddress common.Address, + protocolSpecialProverAddress common.Address, graffiti string, -) (*OracleProducer, error) { + isSystemProver bool, +) (*SpecialProofProducer, error) { proverAddress := crypto.PubkeyToAddress(proverPrivKey.PublicKey) - if proverAddress != protocolOracleProverAddress { + if proverAddress != protocolSpecialProverAddress { return nil, errProtocolAddressMismatch } @@ -54,11 +57,11 @@ func NewOracleProducer( var graffitiBytes [32]byte copy(graffitiBytes[:], []byte(graffiti)) - return &OracleProducer{rpc, proverPrivKey, anchorValidator, proofTimeTarget, graffitiBytes}, nil + return &SpecialProofProducer{rpc, proverPrivKey, anchorValidator, proofTimeTarget, graffitiBytes, isSystemProver}, nil } // RequestProof implements the ProofProducer interface. -func (p *OracleProducer) RequestProof( +func (p *SpecialProofProducer) RequestProof( ctx context.Context, opts *ProofRequestOptions, blockID *big.Int, @@ -99,6 +102,16 @@ func (p *OracleProducer) RequestProof( return err } + // the only difference from a client perspective when generating a special proof, + // either an oracle proof or a system proof, is the prover address which should be set to 1 + // if system prover, and 0 if oracle prover, and the protocol will use that to decide + // whether a proof can be overwritten or not. + var prover common.Address + if p.isSystemProver { + prover = common.HexToAddress("0x0000000000000000000000000000000000000001") + } else { + prover = common.HexToAddress("0x0000000000000000000000000000000000000000") + } // signature should be done with proof set to nil, verifierID set to 0, // and prover set to 0 address. evidence := &encoding.TaikoL1Evidence{ @@ -107,14 +120,14 @@ func (p *OracleProducer) RequestProof( BlockHash: block.Hash(), SignalRoot: signalRoot, Graffiti: p.graffiti, - Prover: common.HexToAddress("0x0000000000000000000000000000000000000000"), + Prover: prover, ParentGasUsed: uint32(parent.GasUsed()), GasUsed: uint32(block.GasUsed()), VerifierId: 0, Proof: []byte{}, } - proof, err := hashAndSignForOracleProof(evidence, p.proverPrivKey) + proof, err := hashAndSignForSpecialProof(evidence, p.proverPrivKey) if err != nil { return fmt.Errorf("failed to sign evidence: %w", err) } @@ -142,9 +155,9 @@ func (p *OracleProducer) RequestProof( return nil } -// HashSignAndSetEvidenceForOracleProof hashes and signs the TaikoL1Evidence according to the -// protocol spec to generate an "oracle proof" via the signature and v value. -func hashAndSignForOracleProof( +// HashSignAndSetEvidenceForSpecialProof hashes and signs the TaikoL1Evidence according to the +// protocol spec to generate a special proof via the signature and v value. +func hashAndSignForSpecialProof( evidence *encoding.TaikoL1Evidence, privateKey *ecdsa.PrivateKey, ) ([]byte, error) { @@ -167,7 +180,7 @@ func hashAndSignForOracleProof( } // Cancel cancels an existing proof generation. -// Since Oracle proofs are not "real" proofs, there is nothing to cancel. -func (d *OracleProducer) Cancel(ctx context.Context, blockID *big.Int) error { +// Since oracle and system proofs are not "real" proofs, there is nothing to cancel. +func (d *SpecialProofProducer) Cancel(ctx context.Context, blockID *big.Int) error { return nil } diff --git a/prover/proof_producer/oracle_proof_producer_test.go b/prover/proof_producer/special_proof_producer_test.go similarity index 96% rename from prover/proof_producer/oracle_proof_producer_test.go rename to prover/proof_producer/special_proof_producer_test.go index 6086ee4c0..244d17aec 100644 --- a/prover/proof_producer/oracle_proof_producer_test.go +++ b/prover/proof_producer/special_proof_producer_test.go @@ -50,7 +50,7 @@ func TestHashAndSignOracleProof(t *testing.T) { hash := crypto.Keccak256Hash(input) - sig, err := hashAndSignForOracleProof(evidence, privateKey) + sig, err := hashAndSignForSpecialProof(evidence, privateKey) require.Nil(t, err) sig[64] = sig[64] - 27 diff --git a/prover/proof_submitter/util.go b/prover/proof_submitter/util.go index 307a821e2..311e73c82 100644 --- a/prover/proof_submitter/util.go +++ b/prover/proof_submitter/util.go @@ -24,7 +24,9 @@ var ( // isSubmitProofTxErrorRetryable checks whether the error returned by a proof submission transaction // is retryable. func isSubmitProofTxErrorRetryable(err error, blockID *big.Int) bool { - if strings.HasPrefix(err.Error(), "L1_NOT_ORACLE_PROVER") || !strings.HasPrefix(err.Error(), "L1_") { + if strings.HasPrefix(err.Error(), "L1_NOT_ORACLE_PROVER") || + strings.HasPrefix(err.Error(), "L1_NOT_SYSTEM_PROVER") || + !strings.HasPrefix(err.Error(), "L1_") { return true } diff --git a/prover/proof_submitter/util_test.go b/prover/proof_submitter/util_test.go index 602af89c3..47f651aa4 100644 --- a/prover/proof_submitter/util_test.go +++ b/prover/proof_submitter/util_test.go @@ -12,6 +12,7 @@ import ( func (s *ProofSubmitterTestSuite) TestIsSubmitProofTxErrorRetryable() { s.True(isSubmitProofTxErrorRetryable(errors.New(testAddr.String()), common.Big0)) s.True(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_ORACLE_PROVER"), common.Big0)) + s.True(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_SYSTEM_PROVER"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_DUP_PROVERS"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_"+testAddr.String()), common.Big0)) } diff --git a/prover/prover.go b/prover/prover.go index 7336661f6..92e1c2e71 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -32,6 +32,7 @@ type Prover struct { cfg *Config proverAddress common.Address oracleProverAddress common.Address + systemProverAddress common.Address // Clients rpc *rpc.Client @@ -134,26 +135,47 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.proposeConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) p.submitProofConcurrencyGuard = make(chan struct{}, cfg.MaxConcurrentProvingJobs) - oracleName := [32]byte{} - copy(oracleName[:], "oracle_prover") + oracleProverName := [32]byte{} + copy(oracleProverName[:], "oracle_prover") - oracleProverAddress, err := p.rpc.TaikoL1.Resolve(nil, p.rpc.L1ChainID, oracleName, true) + oracleProverAddress, err := p.rpc.TaikoL1.Resolve(nil, p.rpc.L1ChainID, oracleProverName, true) if err != nil { return err } p.oracleProverAddress = oracleProverAddress + systemProverName := [32]byte{} + copy(systemProverName[:], "oracle_prover") + + systemProverAddress, err := p.rpc.TaikoL1.Resolve(nil, p.rpc.L1ChainID, systemProverName, true) + if err != nil { + return err + } + + p.systemProverAddress = systemProverAddress + var producer proofProducer.ProofProducer - if cfg.OracleProver { - if producer, err = proofProducer.NewOracleProducer( + isSystemProver := cfg.SystemProver + isOracleProver := cfg.OracleProver + + if isSystemProver || isOracleProver { + var specialProverAddress common.Address + if isSystemProver { + specialProverAddress = systemProverAddress + } else { + specialProverAddress = oracleProverAddress + } + + if producer, err = proofProducer.NewSpecialProofProducer( p.rpc, p.cfg.OracleProverPrivateKey, p.cfg.TaikoL2Address, time.Duration(p.protocolConfigs.ProofTimeTarget)*time.Second, - oracleProverAddress, + specialProverAddress, p.cfg.Graffiti, + isSystemProver, ); err != nil { return err } @@ -385,7 +407,7 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientBlockProven) error { metrics.ProverReceivedProvenBlockGauge.Update(event.Id.Int64()) // if oracle prover, dont cancel proof. - if event.Prover == p.oracleProverAddress { + if event.Prover == p.oracleProverAddress || event.Prover == p.systemProverAddress { return nil } From a16e16a500e90748155335cc1eb71b0dbcdaa7e3 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 09:57:31 -0700 Subject: [PATCH 03/21] isSystem on validproofsubmitter --- prover/proof_producer/zkevm_cmd_producer.go | 16 ++++++------ prover/proof_producer/zkevm_rpcd_producer.go | 26 +++++++++---------- .../proof_submitter/valid_proof_submitter.go | 17 ++++++++---- .../valid_proof_submitter_test.go | 1 + prover/prover.go | 1 + 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/prover/proof_producer/zkevm_cmd_producer.go b/prover/proof_producer/zkevm_cmd_producer.go index 596135304..a639a934a 100644 --- a/prover/proof_producer/zkevm_cmd_producer.go +++ b/prover/proof_producer/zkevm_cmd_producer.go @@ -34,7 +34,7 @@ func NewZkevmCmdProducer( } // RequestProof implements the ProofProducer interface. -func (d *ZkevmCmdProducer) RequestProof( +func (p *ZkevmCmdProducer) RequestProof( ctx context.Context, opts *ProofRequestOptions, blockID *big.Int, @@ -48,7 +48,7 @@ func (d *ZkevmCmdProducer) RequestProof( "beneficiary", meta.Beneficiary, "height", header.Number, "hash", header.Hash(), - "cmd", d.CmdPath, + "cmd", p.CmdPath, ) var ( @@ -56,7 +56,7 @@ func (d *ZkevmCmdProducer) RequestProof( err error ) if err := backoff.Retry(func() error { - if proof, err = d.ExecProverCmd(opts.Height); err != nil { + if proof, err = p.ExecProverCmd(opts.Height); err != nil { log.Error("Execute prover cmd error", "error", err) return err } @@ -82,9 +82,9 @@ type ProverCmdOutput struct { Proof []byte `json:"proof"` } -func (d *ZkevmCmdProducer) ExecProverCmd(height *big.Int) ([]byte, error) { +func (p *ZkevmCmdProducer) ExecProverCmd(height *big.Int) ([]byte, error) { start := time.Now() - cmd := exec.Command(d.CmdPath, d.L2Endpoint, height.String()) + cmd := exec.Command(p.CmdPath, p.L2Endpoint, height.String()) var stdout, stderr bytes.Buffer @@ -124,10 +124,10 @@ func (d *ZkevmCmdProducer) ExecProverCmd(height *big.Int) ([]byte, error) { return nil, err } - return d.outputToCalldata(&proverCmdOutput), nil + return p.outputToCalldata(&proverCmdOutput), nil } -func (d *ZkevmCmdProducer) outputToCalldata(output *ProverCmdOutput) []byte { +func (p *ZkevmCmdProducer) outputToCalldata(output *ProverCmdOutput) []byte { calldata := []byte{} bufLen := len(output.Instances)*32 + len(output.Proof) @@ -158,7 +158,7 @@ func (d *ZkevmCmdProducer) outputToCalldata(output *ProverCmdOutput) []byte { // Cancel cancels an existing proof generation. // Right now, it is just a stub that does nothing, because it is not possible to cnacel the proof // with the current zkevm software. -func (d *ZkevmCmdProducer) Cancel(ctx context.Context, blockID *big.Int) error { +func (p *ZkevmCmdProducer) Cancel(ctx context.Context, blockID *big.Int) error { log.Info("Cancel proof generation for block ", "blockId", blockID) return nil } diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index f0916b1a9..30fdeb291 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -89,7 +89,7 @@ func NewZkevmRpcdProducer( } // RequestProof implements the ProofProducer interface. -func (d *ZkevmRpcdProducer) RequestProof( +func (p *ZkevmRpcdProducer) RequestProof( ctx context.Context, opts *ProofRequestOptions, blockID *big.Int, @@ -110,10 +110,10 @@ func (d *ZkevmRpcdProducer) RequestProof( degree uint64 err error ) - if d.CustomProofHook != nil { - proof, degree, err = d.CustomProofHook() + if p.CustomProofHook != nil { + proof, degree, err = p.CustomProofHook() } else { - proof, degree, err = d.callProverDaemon(ctx, opts) + proof, degree, err = p.callProverDaemon(ctx, opts) } if err != nil { return err @@ -131,7 +131,7 @@ func (d *ZkevmRpcdProducer) RequestProof( } // callProverDaemon keeps polling the proverd service to get the requested proof. -func (d *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofRequestOptions) ([]byte, uint64, error) { +func (p *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofRequestOptions) ([]byte, uint64, error) { var ( proof []byte degree uint64 @@ -141,9 +141,9 @@ func (d *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofReq if ctx.Err() != nil { return nil } - output, err := d.requestProof(opts) + output, err := p.requestProof(opts) if err != nil { - log.Error("Failed to request proof", "height", opts.Height, "err", err, "endpoint", d.RpcdEndpoint) + log.Error("Failed to request proof", "height", opts.Height, "err", err, "endpoint", p.RpcdEndpoint) return err } @@ -163,7 +163,7 @@ func (d *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofReq } // requestProof sends a RPC request to proverd to try to get the requested proof. -func (d *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput, error) { +func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput, error) { reqBody := RequestProofBody{ JsonRPC: "2.0", ID: common.Big1, @@ -171,10 +171,10 @@ func (d *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput Params: []*RequestProofBodyParam{{ Circuit: "pi", Block: opts.Height, - L1RPC: d.L1Endpoint, - L2RPC: d.L2Endpoint, + L1RPC: p.L1Endpoint, + L2RPC: p.L2Endpoint, Retry: true, - Param: d.Param, + Param: p.Param, VerifyProof: true, Mock: false, Aggregate: false, @@ -188,7 +188,7 @@ func (d *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput return nil, err } - res, err := http.Post(d.RpcdEndpoint, "application/json", bytes.NewBuffer(jsonValue)) + res, err := http.Post(p.RpcdEndpoint, "application/json", bytes.NewBuffer(jsonValue)) if err != nil { return nil, err } @@ -214,7 +214,7 @@ func (d *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput // Cancel cancels an existing proof generation. // Right now, it is just a stub that does nothing, because it is not possible to cnacel the proof // with the current zkevm software. -func (d *ZkevmRpcdProducer) Cancel(ctx context.Context, blockID *big.Int) error { +func (p *ZkevmRpcdProducer) Cancel(ctx context.Context, blockID *big.Int) error { log.Info("Cancel proof generation for block ", "blockId", blockID) return nil } diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index 912bcd518..ecc0e4d79 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -32,7 +32,8 @@ type ValidProofSubmitter struct { proverPrivKey *ecdsa.PrivateKey proverAddress common.Address mutex *sync.Mutex - isOracle bool + isOracleProver bool + isSystemProver bool graffiti [32]byte } @@ -44,7 +45,8 @@ func NewValidProofSubmitter( taikoL2Address common.Address, proverPrivKey *ecdsa.PrivateKey, mutex *sync.Mutex, - isOracle bool, + isOracleProver bool, + isSystemProver bool, graffiti string, ) (*ValidProofSubmitter, error) { anchorValidator, err := anchorTxValidator.New(taikoL2Address, rpc.L2ChainID, rpc) @@ -63,7 +65,8 @@ func NewValidProofSubmitter( proverPrivKey: proverPrivKey, proverAddress: crypto.PubkeyToAddress(proverPrivKey.PublicKey), mutex: mutex, - isOracle: isOracle, + isOracleProver: isOracleProver, + isSystemProver: isSystemProver, graffiti: graffitiBytes, }, nil } @@ -179,8 +182,12 @@ func (s *ValidProofSubmitter) SubmitProof( var circuitsIdx uint16 var prover common.Address - if s.isOracle { - prover = common.HexToAddress("0x0000000000000000000000000000000000000000") + if s.isOracleProver || s.isSystemProver { + if s.isOracleProver { + prover = common.HexToAddress("0x0000000000000000000000000000000000000000") + } else { + prover = common.HexToAddress("0x0000000000000000000000000000000000000001") + } circuitsIdx = uint16(int(zkProof[64])) evidence.Proof = zkProof[0:64] } else { diff --git a/prover/proof_submitter/valid_proof_submitter_test.go b/prover/proof_submitter/valid_proof_submitter_test.go index 2396abf1c..6e8c53bbc 100644 --- a/prover/proof_submitter/valid_proof_submitter_test.go +++ b/prover/proof_submitter/valid_proof_submitter_test.go @@ -46,6 +46,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() { l1ProverPrivKey, &sync.Mutex{}, false, + false, "test", ) s.Nil(err) diff --git a/prover/prover.go b/prover/prover.go index 92e1c2e71..1e0dbdcb1 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -205,6 +205,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.cfg.L1ProverPrivKey, p.submitProofTxMutex, p.cfg.OracleProver, + p.cfg.SystemProver, p.cfg.Graffiti, ); err != nil { return err From f9d96614bb0a644858e43ec49ca5cab04c36f460 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 10:01:00 -0700 Subject: [PATCH 04/21] NOT_SPECIAL_PROVER error --- prover/proof_submitter/util.go | 3 +-- prover/proof_submitter/util_test.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/prover/proof_submitter/util.go b/prover/proof_submitter/util.go index 311e73c82..9da25c100 100644 --- a/prover/proof_submitter/util.go +++ b/prover/proof_submitter/util.go @@ -24,8 +24,7 @@ var ( // isSubmitProofTxErrorRetryable checks whether the error returned by a proof submission transaction // is retryable. func isSubmitProofTxErrorRetryable(err error, blockID *big.Int) bool { - if strings.HasPrefix(err.Error(), "L1_NOT_ORACLE_PROVER") || - strings.HasPrefix(err.Error(), "L1_NOT_SYSTEM_PROVER") || + if strings.HasPrefix(err.Error(), "L1_NOT_SPECIAL_PROVER") || !strings.HasPrefix(err.Error(), "L1_") { return true } diff --git a/prover/proof_submitter/util_test.go b/prover/proof_submitter/util_test.go index 47f651aa4..bb2ddf10f 100644 --- a/prover/proof_submitter/util_test.go +++ b/prover/proof_submitter/util_test.go @@ -11,8 +11,7 @@ import ( func (s *ProofSubmitterTestSuite) TestIsSubmitProofTxErrorRetryable() { s.True(isSubmitProofTxErrorRetryable(errors.New(testAddr.String()), common.Big0)) - s.True(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_ORACLE_PROVER"), common.Big0)) - s.True(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_SYSTEM_PROVER"), common.Big0)) + s.True(isSubmitProofTxErrorRetryable(errors.New("L1_NOT_SPECIAL_PROVER"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_DUP_PROVERS"), common.Big0)) s.False(isSubmitProofTxErrorRetryable(errors.New("L1_"+testAddr.String()), common.Big0)) } From ddbbb76aeaeb961f03013cc05ba2283b3ec0dc9e Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 10:01:44 -0700 Subject: [PATCH 05/21] typo --- prover/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/config_test.go b/prover/config_test.go index ff77390a5..04fed3126 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -238,7 +238,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverError() { }), "systemProver flag set without systemProverPrivateKey set") } -func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverEAndOracleProverBothSet() { +func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverAndOracleProverBothSetError() { l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") l2WsEndpoint := os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") From 74d7335a55ad0b1dfd1e99dd2b92b3610b3483e6 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 10:06:48 -0700 Subject: [PATCH 06/21] systemprover key typo --- prover/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/config.go b/prover/config.go index 3e922ea54..cb64b377d 100644 --- a/prover/config.go +++ b/prover/config.go @@ -72,7 +72,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, fmt.Errorf("systemProver flag set without systemProverPrivateKey set") } - systemProverPrivKeyStr := c.String(flags.OracleProverPrivateKey.Name) + systemProverPrivKeyStr := c.String(flags.SystemProverPrivateKey.Name) systemProverPrivKey, err = crypto.ToECDSA(common.Hex2Bytes(systemProverPrivKeyStr)) if err != nil { From 1345c3b1b8ea11f3f328800f8433cb9b41b185e6 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 12:19:00 -0700 Subject: [PATCH 07/21] gen bindings --- bindings/.githead | 2 +- bindings/gen_taiko_l1.go | 84 +++++++++++++++++++--------------------- bindings/gen_taiko_l2.go | 2 +- 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/bindings/.githead b/bindings/.githead index f4217b3d6..e60c037bd 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -ec477de46f543339e71d4aa8453b62f44c32b32f +998955b669620232e1154624df1866af9d12ab85 diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index bf55abbfd..21943ba44 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -49,26 +49,27 @@ type TaikoDataBlockMetadata struct { // TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. type TaikoDataConfig struct { - ChainId *big.Int - MaxNumProposedBlocks *big.Int - RingBufferSize *big.Int - MaxVerificationsPerTx *big.Int - BlockMaxGasLimit *big.Int - MaxTransactionsPerBlock *big.Int - MaxBytesPerTxList *big.Int - MinTxGasLimit *big.Int - TxListCacheExpiry *big.Int - ProofCooldownPeriod *big.Int - RealProofSkipSize *big.Int - EthDepositGas *big.Int - EthDepositMaxFee *big.Int - MinEthDepositsPerBlock uint64 - MaxEthDepositsPerBlock uint64 - MaxEthDepositAmount *big.Int - MinEthDepositAmount *big.Int - ProofTimeTarget uint64 - AdjustmentQuotient uint8 - RelaySignalRoot bool + ChainId *big.Int + MaxNumProposedBlocks *big.Int + RingBufferSize *big.Int + MaxVerificationsPerTx *big.Int + BlockMaxGasLimit *big.Int + MaxTransactionsPerBlock *big.Int + MaxBytesPerTxList *big.Int + MinTxGasLimit *big.Int + TxListCacheExpiry *big.Int + ProofCooldownPeriod *big.Int + SystemProofCooldownPeriod *big.Int + RealProofSkipSize *big.Int + EthDepositGas *big.Int + EthDepositMaxFee *big.Int + MinEthDepositsPerBlock uint64 + MaxEthDepositsPerBlock uint64 + MaxEthDepositAmount *big.Int + MinEthDepositAmount *big.Int + ProofTimeTarget uint64 + AdjustmentQuotient uint8 + RelaySignalRoot bool } // TaikoDataEthDeposit is an auto generated low-level Go binding around an user-defined struct. @@ -103,7 +104,7 @@ type TaikoDataStateVariables struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ORACLE_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ORACLE_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"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\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"depositsRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"cacheTxListInfo\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"treasure\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getBlock\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"_metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_proposedAt\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumProposedBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ringBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"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\":\"txListCacheExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofCooldownPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"realProofSkipSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"minEthDepositsPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxEthDepositsPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxEthDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"minEthDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"adjustmentQuotient\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasUsed\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accBlockFees\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeIssued\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"getVerifierName\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_initBlockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"_initProofTimeIssued\",\"type\":\"uint64\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"depositsRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"cacheTxListInfo\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"treasure\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"staticRefs\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved71\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved72\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accBlockFees\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeIssued\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved91\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF_OVERWRITE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF_OVERWRITE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_SPECIAL_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_SPECIAL_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ORACLE_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ORACLE_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_DISABLED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_PROHIBITED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SYSTEM_PROVER_PROHIBITED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"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\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"depositsRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"cacheTxListInfo\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"treasure\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getBlock\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"_metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_proposedAt\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumProposedBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ringBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"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\":\"txListCacheExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofCooldownPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"systemProofCooldownPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"realProofSkipSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"minEthDepositsPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxEthDepositsPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxEthDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"minEthDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"adjustmentQuotient\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasUsed\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accBlockFees\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeIssued\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"getVerifierName\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_initBlockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"_initProofTimeIssued\",\"type\":\"uint64\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"depositsRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"cacheTxListInfo\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"treasure\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved71\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved72\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"accBlockFees\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeIssued\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved91\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -366,7 +367,7 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlockFee() (uint64, 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,uint64,uint64,uint96,uint96,uint64,uint8,bool)) +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,uint64,uint8,bool)) func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getConfig") @@ -383,14 +384,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (Taiko // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,uint64,uint8,bool)) +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,uint64,uint8,bool)) func (_TaikoL1Client *TaikoL1ClientSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,uint64,uint8,bool)) +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint96,uint96,uint64,uint8,bool)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } @@ -707,9 +708,8 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) Resolve0(name [32]byte, allowZ // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(bytes32 staticRefs, uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved71, uint64 __reserved72, uint64 accProposedAt, uint64 accBlockFees, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 proofTimeIssued, uint64 lastVerifiedBlockId, uint64 __reserved91) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved71, uint64 __reserved72, uint64 accProposedAt, uint64 accBlockFees, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 proofTimeIssued, uint64 lastVerifiedBlockId, uint64 __reserved91) func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { - StaticRefs [32]byte GenesisHeight uint64 GenesisTimestamp uint64 Reserved71 uint64 @@ -727,7 +727,6 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { err := _TaikoL1Client.contract.Call(opts, &out, "state") outstruct := new(struct { - StaticRefs [32]byte GenesisHeight uint64 GenesisTimestamp uint64 Reserved71 uint64 @@ -745,19 +744,18 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { return *outstruct, err } - outstruct.StaticRefs = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - outstruct.GenesisHeight = *abi.ConvertType(out[1], new(uint64)).(*uint64) - outstruct.GenesisTimestamp = *abi.ConvertType(out[2], new(uint64)).(*uint64) - outstruct.Reserved71 = *abi.ConvertType(out[3], new(uint64)).(*uint64) - outstruct.Reserved72 = *abi.ConvertType(out[4], new(uint64)).(*uint64) - outstruct.AccProposedAt = *abi.ConvertType(out[5], new(uint64)).(*uint64) - outstruct.AccBlockFees = *abi.ConvertType(out[6], new(uint64)).(*uint64) - outstruct.NumBlocks = *abi.ConvertType(out[7], new(uint64)).(*uint64) - outstruct.NextEthDepositToProcess = *abi.ConvertType(out[8], new(uint64)).(*uint64) - outstruct.BlockFee = *abi.ConvertType(out[9], new(uint64)).(*uint64) - outstruct.ProofTimeIssued = *abi.ConvertType(out[10], new(uint64)).(*uint64) - outstruct.LastVerifiedBlockId = *abi.ConvertType(out[11], new(uint64)).(*uint64) - outstruct.Reserved91 = *abi.ConvertType(out[12], new(uint64)).(*uint64) + outstruct.GenesisHeight = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.GenesisTimestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.Reserved71 = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.Reserved72 = *abi.ConvertType(out[3], new(uint64)).(*uint64) + outstruct.AccProposedAt = *abi.ConvertType(out[4], new(uint64)).(*uint64) + outstruct.AccBlockFees = *abi.ConvertType(out[5], new(uint64)).(*uint64) + outstruct.NumBlocks = *abi.ConvertType(out[6], new(uint64)).(*uint64) + outstruct.NextEthDepositToProcess = *abi.ConvertType(out[7], new(uint64)).(*uint64) + outstruct.BlockFee = *abi.ConvertType(out[8], new(uint64)).(*uint64) + outstruct.ProofTimeIssued = *abi.ConvertType(out[9], new(uint64)).(*uint64) + outstruct.LastVerifiedBlockId = *abi.ConvertType(out[10], new(uint64)).(*uint64) + outstruct.Reserved91 = *abi.ConvertType(out[11], new(uint64)).(*uint64) return *outstruct, err @@ -765,9 +763,8 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(bytes32 staticRefs, uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved71, uint64 __reserved72, uint64 accProposedAt, uint64 accBlockFees, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 proofTimeIssued, uint64 lastVerifiedBlockId, uint64 __reserved91) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved71, uint64 __reserved72, uint64 accProposedAt, uint64 accBlockFees, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 proofTimeIssued, uint64 lastVerifiedBlockId, uint64 __reserved91) func (_TaikoL1Client *TaikoL1ClientSession) State() (struct { - StaticRefs [32]byte GenesisHeight uint64 GenesisTimestamp uint64 Reserved71 uint64 @@ -786,9 +783,8 @@ func (_TaikoL1Client *TaikoL1ClientSession) State() (struct { // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(bytes32 staticRefs, uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved71, uint64 __reserved72, uint64 accProposedAt, uint64 accBlockFees, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 proofTimeIssued, uint64 lastVerifiedBlockId, uint64 __reserved91) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved71, uint64 __reserved72, uint64 accProposedAt, uint64 accBlockFees, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 blockFee, uint64 proofTimeIssued, uint64 lastVerifiedBlockId, uint64 __reserved91) func (_TaikoL1Client *TaikoL1ClientCallerSession) State() (struct { - StaticRefs [32]byte GenesisHeight uint64 GenesisTimestamp uint64 Reserved71 uint64 diff --git a/bindings/gen_taiko_l2.go b/bindings/gen_taiko_l2.go index ae92cea9a..3983f46e9 100644 --- a/bindings/gen_taiko_l2.go +++ b/bindings/gen_taiko_l2.go @@ -40,7 +40,7 @@ type TaikoL2EIP1559Params struct { // TaikoL2ClientMetaData contains all meta data concerning the TaikoL2Client contract. var TaikoL2ClientMetaData = &bind.MetaData{ - ABI: "[{\"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\":\"M1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"M1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"M1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"M1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gaslimit\",\"type\":\"uint64\"},{\"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\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":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\":\"__reserved1\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"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\":\"uint64\",\"name\":\"parentGasUsed\",\"type\":\"uint64\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasIssuedPerSecond\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"timeSinceParent\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"parentGasUsed\",\"type\":\"uint64\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint64\"},{\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"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\":[],\"name\":\"xscale\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"yscale\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"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\":\"M1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"M1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"M1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"M1559_UNEXPECTED_CHANGE\",\"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\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gaslimit\",\"type\":\"uint64\"},{\"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\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":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\":\"__reserved1\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"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\":\"uint64\",\"name\":\"parentGasUsed\",\"type\":\"uint64\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasIssuedPerSecond\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"timeSinceParent\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"parentGasUsed\",\"type\":\"uint64\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint64\"},{\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"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\":[],\"name\":\"xscale\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"yscale\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // TaikoL2ClientABI is the input ABI used to generate the binding from. From 9fd3b11bd82ae0f68204e0a7e86a1c46b6d701d8 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 13:12:08 -0700 Subject: [PATCH 08/21] change env vars to use proxies --- integration_test/entrypoint.sh | 2 +- integration_test/nodes/init.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index ec951f993..fd6982069 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -44,7 +44,7 @@ if [ "$RUN_TESTS" == "true" ]; then L2_EXECUTION_ENGINE_WS_ENDPOINT=ws://localhost:28546 \ L2_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:28551 \ TAIKO_L1_ADDRESS=$TAIKO_L1_CONTRACT_ADDRESS \ - TAIKO_L2_ADDRESS=0x0000777700000000000000000000000000000001 \ + TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$L1_SIGNAL_SERVICE_CONTRACT_ADDRESS \ L1_CONTRACT_OWNER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ L1_PROPOSER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index b80ce0f2d..f635f0544 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -40,8 +40,8 @@ cd $TAIKO_MONO_DIR/packages/protocol && SOLO_PROPOSER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ OWNER=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \ TREASURE=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \ - TAIKO_L2_ADDRESS=0x0000777700000000000000000000000000000001 \ - L2_SIGNAL_SERVICE=0x0000777700000000000000000000000000000007 \ + TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ + L2_SIGNAL_SERVICE=0x1000777700000000000000000000000000000007 \ SHARED_SIGNAL_SERVICE=0x0000000000000000000000000000000000000000 \ TAIKO_TOKEN_PREMINT_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ TAIKO_TOKEN_PREMINT_AMOUNT=18446744073709551614 \ From b3022b291910a15646f47221f22b64251c364180 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 13:14:50 -0700 Subject: [PATCH 09/21] doubled flag --- prover/config_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/prover/config_test.go b/prover/config_test.go index 04fed3126..3e110c39e 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -100,8 +100,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProver() { &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, &cli.BoolFlag{Name: flags.SystemProver.Name}, &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, - &cli.BoolFlag{Name: flags.SystemProver.Name}, - &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, } app.Action = func(ctx *cli.Context) error { From 4779492bb47018fa58db9cac651def290dad6f0a Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 13:36:26 -0700 Subject: [PATCH 10/21] lint --- integration_test/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index fd6982069..d59660861 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -23,7 +23,7 @@ COMPILE_PROTOCOL=${COMPILE_PROTOCOL:-false} TESTNET_CONFIG=$TESTNET_CONFIG \ COMPILE_PROTOCOL=$COMPILE_PROTOCOL \ TAIKO_MONO_DIR=$TAIKO_MONO_DIR \ - $DIR/nodes/init.sh +$DIR/nodes/init.sh DEPLOYMENT_JSON=$(cat $TAIKO_MONO_DIR/packages/protocol/deployments/deploy_l1.json) TAIKO_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko' | sed 's/\"//g') From 0d3732a04691afdd5bad62403c2e083b4464e985 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 10 May 2023 11:43:22 +0800 Subject: [PATCH 11/21] chore: update workflow --- .github/workflows/test.yml | 1 - bindings/.githead | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26a9ac598..4e1ab2480 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,6 @@ jobs: with: repository: taikoxyz/taiko-mono path: ${{ env.TAIKO_MONO_DIR }} - ref: separate_oracle_proof_and_artificially_valid_oracle_proof - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/bindings/.githead b/bindings/.githead index e60c037bd..33e7ee8a3 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -998955b669620232e1154624df1866af9d12ab85 +e8ba7168231f9a8bbef1378fa93448b11c4267ac From f57e789917d37641e2bcadd92c0334f99c31cae5 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 21:55:31 -0700 Subject: [PATCH 12/21] add system prover to deploy --- integration_test/nodes/init.sh | 1 + .../block_batch_iterator_test.go | 31 +++++++++++++++++++ .../event_iterator/block_proposed_iterator.go | 3 ++ 3 files changed, 35 insertions(+) diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index f635f0544..911a5a0da 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -36,6 +36,7 @@ L2_GENESIS_HASH=$( # Deploy Taiko protocol. cd $TAIKO_MONO_DIR/packages/protocol && PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ + SYSTEM_PROVER=0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 \ ORACLE_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ SOLO_PROPOSER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ OWNER=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \ diff --git a/pkg/chain_iterator/block_batch_iterator_test.go b/pkg/chain_iterator/block_batch_iterator_test.go index fd809936d..5ddc83d6c 100644 --- a/pkg/chain_iterator/block_batch_iterator_test.go +++ b/pkg/chain_iterator/block_batch_iterator_test.go @@ -113,6 +113,37 @@ func (s *BlockBatchIteratorTestSuite) TestIterEndFunc() { s.Equal(lastEnd.Uint64(), maxBlocksReadPerEpoch) } +func (s *BlockBatchIteratorTestSuite) TestIter_Reorg() { + var maxBlocksReadPerEpoch uint64 = 2 + + headHeight, err := s.RpcClient.L1.BlockNumber(context.Background()) + s.Nil(err) + s.Greater(headHeight, uint64(0)) + + lastEnd := common.Big0 + + iter, err := NewBlockBatchIterator(context.Background(), &BlockBatchIteratorConfig{ + Client: s.RpcClient.L1, + MaxBlocksReadPerEpoch: &maxBlocksReadPerEpoch, + StartHeight: common.Big0, + EndHeight: new(big.Int).SetUint64(headHeight), + OnBlocks: func( + ctx context.Context, + start, end *types.Header, + updateCurrentFunc UpdateCurrentFunc, + endIterFunc EndIterFunc, + ) error { + s.Equal(lastEnd.Uint64(), start.Number.Uint64()) + lastEnd = end.Number + return nil + }, + }) + + s.Nil(err) + s.Nil(iter.Iter()) + s.Equal(headHeight, lastEnd.Uint64()) +} + func TestBlockBatchIteratorTestSuite(t *testing.T) { suite.Run(t, new(BlockBatchIteratorTestSuite)) } diff --git a/pkg/chain_iterator/event_iterator/block_proposed_iterator.go b/pkg/chain_iterator/event_iterator/block_proposed_iterator.go index 6928f09a3..34f987fc8 100644 --- a/pkg/chain_iterator/event_iterator/block_proposed_iterator.go +++ b/pkg/chain_iterator/event_iterator/block_proposed_iterator.go @@ -125,6 +125,9 @@ func assembleBlockProposedIteratorCallback( continue } + // check if we have already seen this blockID, if it has, + // it means layer1 has reorged, and we should rewind chain + if err := callback(ctx, event, eventIter.end); err != nil { return err } From 70d1642b4d1bfd7995ba45bd17e19383a8fdd6b5 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 21:59:04 -0700 Subject: [PATCH 13/21] . --- .../block_batch_iterator_test.go | 31 ------------------- .../event_iterator/block_proposed_iterator.go | 3 -- 2 files changed, 34 deletions(-) diff --git a/pkg/chain_iterator/block_batch_iterator_test.go b/pkg/chain_iterator/block_batch_iterator_test.go index 5ddc83d6c..fd809936d 100644 --- a/pkg/chain_iterator/block_batch_iterator_test.go +++ b/pkg/chain_iterator/block_batch_iterator_test.go @@ -113,37 +113,6 @@ func (s *BlockBatchIteratorTestSuite) TestIterEndFunc() { s.Equal(lastEnd.Uint64(), maxBlocksReadPerEpoch) } -func (s *BlockBatchIteratorTestSuite) TestIter_Reorg() { - var maxBlocksReadPerEpoch uint64 = 2 - - headHeight, err := s.RpcClient.L1.BlockNumber(context.Background()) - s.Nil(err) - s.Greater(headHeight, uint64(0)) - - lastEnd := common.Big0 - - iter, err := NewBlockBatchIterator(context.Background(), &BlockBatchIteratorConfig{ - Client: s.RpcClient.L1, - MaxBlocksReadPerEpoch: &maxBlocksReadPerEpoch, - StartHeight: common.Big0, - EndHeight: new(big.Int).SetUint64(headHeight), - OnBlocks: func( - ctx context.Context, - start, end *types.Header, - updateCurrentFunc UpdateCurrentFunc, - endIterFunc EndIterFunc, - ) error { - s.Equal(lastEnd.Uint64(), start.Number.Uint64()) - lastEnd = end.Number - return nil - }, - }) - - s.Nil(err) - s.Nil(iter.Iter()) - s.Equal(headHeight, lastEnd.Uint64()) -} - func TestBlockBatchIteratorTestSuite(t *testing.T) { suite.Run(t, new(BlockBatchIteratorTestSuite)) } diff --git a/pkg/chain_iterator/event_iterator/block_proposed_iterator.go b/pkg/chain_iterator/event_iterator/block_proposed_iterator.go index 34f987fc8..6928f09a3 100644 --- a/pkg/chain_iterator/event_iterator/block_proposed_iterator.go +++ b/pkg/chain_iterator/event_iterator/block_proposed_iterator.go @@ -125,9 +125,6 @@ func assembleBlockProposedIteratorCallback( continue } - // check if we have already seen this blockID, if it has, - // it means layer1 has reorged, and we should rewind chain - if err := callback(ctx, event, eventIter.end); err != nil { return err } From bb0fbcfb23e6bbc058ad85675459722140ee05ff Mon Sep 17 00:00:00 2001 From: David Date: Wed, 10 May 2023 13:02:49 +0800 Subject: [PATCH 14/21] test: fix deployment errors --- integration_test/nodes/init.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index 911a5a0da..968a60304 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -52,4 +52,5 @@ cd $TAIKO_MONO_DIR/packages/protocol && --fork-url http://localhost:18545 \ --broadcast \ --ffi \ - -vvvv + -vvvv \ + --block-gas-limit 100000000 From 3311557d1d714c89b1afdda118d9608c7489f02f Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 22:08:43 -0700 Subject: [PATCH 15/21] systemprover test --- prover/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/config_test.go b/prover/config_test.go index 3e110c39e..7d905b805 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -118,7 +118,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProver() { s.Equal(30*time.Minute, *c.RandomDummyProofDelayLowerBound) s.Equal(time.Hour, *c.RandomDummyProofDelayUpperBound) s.True(c.Dummy) - s.True(c.OracleProver) + s.True(c.SystemProver) s.Equal( crypto.PubkeyToAddress(s.p.cfg.SystemProverPrivateKey.PublicKey), crypto.PubkeyToAddress(c.SystemProverPrivateKey.PublicKey), From e6a06cdca2b4892c2d2173fe65c9dfd9d1702f43 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 22:21:00 -0700 Subject: [PATCH 16/21] flags for config test --- prover/config_test.go | 95 ++++++++++--------------------------------- 1 file changed, 22 insertions(+), 73 deletions(-) diff --git a/prover/config_test.go b/prover/config_test.go index 7d905b805..749ba2d2b 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -10,6 +10,23 @@ import ( "github.com/urfave/cli/v2" ) +var testFlags = []cli.Flag{ + &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, + &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, + &cli.StringFlag{Name: flags.TaikoL1Address.Name}, + &cli.StringFlag{Name: flags.TaikoL2Address.Name}, + &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, + &cli.BoolFlag{Name: flags.Dummy.Name}, + &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, + &cli.BoolFlag{Name: flags.OracleProver.Name}, + &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, + &cli.BoolFlag{Name: flags.SystemProver.Name}, + &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, + &cli.StringFlag{Name: flags.Graffiti.Name}, +} + func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { l1WsEndpoint := os.Getenv("L1_NODE_WS_ENDPOINT") l1HttpEndpoint := os.Getenv("L1_NODE_HTTP_ENDPOINT") @@ -19,22 +36,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") app := cli.NewApp() - app.Flags = []cli.Flag{ - &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.TaikoL1Address.Name}, - &cli.StringFlag{Name: flags.TaikoL2Address.Name}, - &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, - &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, - &cli.BoolFlag{Name: flags.OracleProver.Name}, - &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, - &cli.BoolFlag{Name: flags.SystemProver.Name}, - &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, - &cli.StringFlag{Name: flags.Graffiti.Name}, - } + app.Flags = testFlags app.Action = func(ctx *cli.Context) error { c, err := NewConfigFromCliContext(ctx) s.Nil(err) @@ -88,20 +90,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProver() { taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") app := cli.NewApp() - app.Flags = []cli.Flag{ - &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.TaikoL1Address.Name}, - &cli.StringFlag{Name: flags.TaikoL2Address.Name}, - &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, - &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, - &cli.BoolFlag{Name: flags.SystemProver.Name}, - &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, - &cli.StringFlag{Name: flags.Graffiti.Name}, - } + app.Flags = testFlags app.Action = func(ctx *cli.Context) error { c, err := NewConfigFromCliContext(ctx) s.Nil(err) @@ -155,20 +144,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") app := cli.NewApp() - app.Flags = []cli.Flag{ - &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.TaikoL1Address.Name}, - &cli.StringFlag{Name: flags.TaikoL2Address.Name}, - &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, - &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, - &cli.BoolFlag{Name: flags.OracleProver.Name}, - &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, - &cli.StringFlag{Name: flags.Graffiti.Name}, - } + app.Flags = testFlags app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) s.NotNil(err) @@ -200,20 +176,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverError() { taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") app := cli.NewApp() - app.Flags = []cli.Flag{ - &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.TaikoL1Address.Name}, - &cli.StringFlag{Name: flags.TaikoL2Address.Name}, - &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, - &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, - &cli.BoolFlag{Name: flags.SystemProver.Name}, - &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, - &cli.StringFlag{Name: flags.Graffiti.Name}, - } + app.Flags = testFlags app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) s.NotNil(err) @@ -245,21 +208,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverAndOracleProve taikoL2 := os.Getenv("TAIKO_L2_ADDRESS") app := cli.NewApp() - app.Flags = []cli.Flag{ - &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, - &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.TaikoL1Address.Name}, - &cli.StringFlag{Name: flags.TaikoL2Address.Name}, - &cli.StringFlag{Name: flags.L1ProverPrivKey.Name}, - &cli.BoolFlag{Name: flags.Dummy.Name}, - &cli.StringFlag{Name: flags.RandomDummyProofDelay.Name}, - &cli.BoolFlag{Name: flags.OracleProver.Name}, - &cli.BoolFlag{Name: flags.SystemProver.Name}, - &cli.StringFlag{Name: flags.SystemProverPrivateKey.Name}, - &cli.StringFlag{Name: flags.Graffiti.Name}, - } + app.Flags = testFlags app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) s.NotNil(err) From 03134262f0edc63d6a83b2c58750dfb50dacabc9 Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Tue, 9 May 2023 22:25:05 -0700 Subject: [PATCH 17/21] Update prover/prover.go Co-authored-by: David --- prover/prover.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/prover.go b/prover/prover.go index 1e0dbdcb1..8f2b77834 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -146,7 +146,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.oracleProverAddress = oracleProverAddress systemProverName := [32]byte{} - copy(systemProverName[:], "oracle_prover") + copy(systemProverName[:], "system_prover") systemProverAddress, err := p.rpc.TaikoL1.Resolve(nil, p.rpc.L1ChainID, systemProverName, true) if err != nil { From bc51485650b039c2549ef9391bed0be2c8ecf7e2 Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Tue, 9 May 2023 22:25:12 -0700 Subject: [PATCH 18/21] Update prover/config_test.go Co-authored-by: David --- prover/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/config_test.go b/prover/config_test.go index 749ba2d2b..760ab2d47 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -229,5 +229,5 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_SystemProverAndOracleProve "-" + flags.OracleProver.Name, "-" + flags.SystemProver.Name, "-" + flags.Graffiti.Name, "", - }), "cannot set both oracleProver and systemProvert") + }), "cannot set both oracleProver and systemProver") } From 8c38effef7b22a38ad500501efbb287a0554b2d9 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 22:33:29 -0700 Subject: [PATCH 19/21] setuptest w/ systemproverprivatekey --- prover/prover_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/prover/prover_test.go b/prover/prover_test.go index d4f03ae1e..35527f259 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -44,6 +44,7 @@ func (s *ProverTestSuite) SetupTest() { TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), L1ProverPrivKey: l1ProverPrivKey, OracleProverPrivateKey: l1ProverPrivKey, + SystemProverPrivateKey: l1ProverPrivKey, Dummy: true, MaxConcurrentProvingJobs: 1, }))) From a306307579011d81703256efdd5e797deb289e5d Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 22:42:08 -0700 Subject: [PATCH 20/21] pk --- prover/prover.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prover/prover.go b/prover/prover.go index 8f2b77834..cad230914 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -2,6 +2,7 @@ package prover import ( "context" + "crypto/ecdsa" "fmt" "math/big" "strings" @@ -162,15 +163,18 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { if isSystemProver || isOracleProver { var specialProverAddress common.Address + var privateKey *ecdsa.PrivateKey if isSystemProver { specialProverAddress = systemProverAddress + privateKey = p.cfg.SystemProverPrivateKey } else { specialProverAddress = oracleProverAddress + privateKey = p.cfg.OracleProverPrivateKey } if producer, err = proofProducer.NewSpecialProofProducer( p.rpc, - p.cfg.OracleProverPrivateKey, + privateKey, p.cfg.TaikoL2Address, time.Duration(p.protocolConfigs.ProofTimeTarget)*time.Second, specialProverAddress, From 999da6d0ac7aa8a66aaabb93ca0ec45ea9432eb1 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 9 May 2023 22:50:15 -0700 Subject: [PATCH 21/21] set system prover equal to oracle prover --- integration_test/nodes/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index 968a60304..7d98a4155 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -36,7 +36,7 @@ L2_GENESIS_HASH=$( # Deploy Taiko protocol. cd $TAIKO_MONO_DIR/packages/protocol && PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - SYSTEM_PROVER=0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 \ + SYSTEM_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ ORACLE_PROVER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ SOLO_PROPOSER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ OWNER=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \