Skip to content

Commit

Permalink
fix(taiko-client): remove useless config in prover (#17335)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 authored May 25, 2024
1 parent 0c3c0e1 commit 3c37890
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
6 changes: 0 additions & 6 deletions packages/taiko-client/prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
type Config struct {
L1WsEndpoint string
L1HttpEndpoint string
L1BeaconEndpoint string
L2WsEndpoint string
L2HttpEndpoint string
TaikoL1Address common.Address
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)),
Expand Down
26 changes: 11 additions & 15 deletions packages/taiko-client/prover/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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())
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit 3c37890

Please sign in to comment.