From 3c37890cadb15bcc28d0de22b139a7c681e4d08d Mon Sep 17 00:00:00 2001 From: Gavin Yu Date: Sat, 25 May 2024 16:48:08 +0800 Subject: [PATCH] fix(taiko-client): remove useless config in prover (#17335) --- packages/taiko-client/prover/config.go | 6 ----- packages/taiko-client/prover/config_test.go | 26 +++++++++------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/packages/taiko-client/prover/config.go b/packages/taiko-client/prover/config.go index 182a15089c..3e8a4662fd 100644 --- a/packages/taiko-client/prover/config.go +++ b/packages/taiko-client/prover/config.go @@ -23,7 +23,6 @@ import ( type Config struct { L1WsEndpoint string L1HttpEndpoint string - L1BeaconEndpoint string L2WsEndpoint string L2HttpEndpoint string TaikoL1Address common.Address @@ -75,10 +74,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, fmt.Errorf("invalid L1 prover private key: %w", err) } - if !c.IsSet(flags.L1BeaconEndpoint.Name) { - return nil, errors.New("empty L1 beacon endpoint") - } - var startingBlockID *big.Int if c.IsSet(flags.StartingBlockID.Name) { startingBlockID = new(big.Int).SetUint64(c.Uint64(flags.StartingBlockID.Name)) @@ -160,7 +155,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return &Config{ L1WsEndpoint: c.String(flags.L1WSEndpoint.Name), L1HttpEndpoint: c.String(flags.L1HTTPEndpoint.Name), - L1BeaconEndpoint: c.String(flags.L1BeaconEndpoint.Name), L2WsEndpoint: c.String(flags.L2WSEndpoint.Name), L2HttpEndpoint: c.String(flags.L2HTTPEndpoint.Name), TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)), diff --git a/packages/taiko-client/prover/config_test.go b/packages/taiko-client/prover/config_test.go index f9e284dd06..8a04955028 100644 --- a/packages/taiko-client/prover/config_test.go +++ b/packages/taiko-client/prover/config_test.go @@ -14,18 +14,17 @@ import ( ) var ( - l1WsEndpoint = os.Getenv("L1_NODE_WS_ENDPOINT") - l1HttpEndpoint = os.Getenv("L1_NODE_HTTP_ENDPOINT") - l1BeaconEndpoint = os.Getenv("L1_NODE_HTTP_ENDPOINT") - l2WsEndpoint = os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") - l2HttpEndpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") - l1NodeVersion = "1.0.0" - l2NodeVersion = "0.1.0" - taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") - allowance = 10.0 - rpcTimeout = 5 * time.Second - minTierFee = 1024.0 + 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") + l1NodeVersion = "1.0.0" + l2NodeVersion = "0.1.0" + taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") + allowance = 10.0 + rpcTimeout = 5 * time.Second + minTierFee = 1024.0 ) func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { @@ -35,7 +34,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { s.Nil(err) s.Equal(l1WsEndpoint, c.L1WsEndpoint) s.Equal(l1HttpEndpoint, c.L1HttpEndpoint) - s.Equal(l1BeaconEndpoint, c.L1BeaconEndpoint) s.Equal(l2WsEndpoint, c.L2WsEndpoint) s.Equal(l2HttpEndpoint, c.L2HttpEndpoint) s.Equal(taikoL1, c.TaikoL1Address.String()) @@ -71,7 +69,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { "TestNewConfigFromCliContextGuardianProver", "--" + flags.L1WSEndpoint.Name, l1WsEndpoint, "--" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, - "--" + flags.L1BeaconEndpoint.Name, l1BeaconEndpoint, "--" + flags.L2WSEndpoint.Name, l2WsEndpoint, "--" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, "--" + flags.TaikoL1Address.Name, taikoL1, @@ -111,7 +108,6 @@ func (s *ProverTestSuite) SetupApp() *cli.App { app.Flags = []cli.Flag{ &cli.StringFlag{Name: flags.L1WSEndpoint.Name}, &cli.StringFlag{Name: flags.L1HTTPEndpoint.Name}, - &cli.StringFlag{Name: flags.L1BeaconEndpoint.Name}, &cli.StringFlag{Name: flags.L2WSEndpoint.Name}, &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, &cli.StringFlag{Name: flags.TaikoL1Address.Name},