Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(taiko-client): remove some unused flags #18678

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/taiko-client/cmd/flags/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
Category: driverCategory,
EnvVars: []string{"P2P_CHECK_POINT_SYNC_URL"},
}
// syncer specific flag
// Chain syncer specific flag
MaxExponent = &cli.Uint64Flag{
Name: "syncer.maxExponent",
Usage: "Maximum exponent of retrieving L1 blocks when there is a mismatch between protocol and L2 EE," +
Expand Down
8 changes: 0 additions & 8 deletions packages/taiko-client/cmd/flags/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ var (
Category: proposerCategory,
EnvVars: []string{"TX_POOL_MAX_TX_LISTS_PER_EPOCH"},
}
ProposeBlockIncludeParentMetaHash = &cli.BoolFlag{
Name: "includeParentMetaHash",
Usage: "Include parent meta hash when proposing block",
Value: false,
Category: proposerCategory,
EnvVars: []string{"INCLUDE_PARENT_META_HASH"},
}
// Transaction related.
BlobAllowed = &cli.BoolFlag{
Name: "l1.blobAllowed",
Expand Down Expand Up @@ -139,7 +132,6 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{
MinProposingInternal,
AllowZeroInterval,
MaxProposedTxListsPerEpoch,
ProposeBlockIncludeParentMetaHash,
BlobAllowed,
RevertProtectionEnabled,
}, TxmgrFlags)
41 changes: 0 additions & 41 deletions packages/taiko-client/cmd/flags/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ var (
Category: proverCategory,
EnvVars: []string{"L1_PROVER_PRIV_KEY"},
}
ProverCapacity = &cli.Uint64Flag{
Name: "prover.capacity",
Usage: "Capacity of prover",
Required: true,
Category: proverCategory,
EnvVars: []string{"PROVER_CAPACITY"},
}
)

// Optional flags used by prover.
Expand Down Expand Up @@ -74,20 +67,6 @@ var (
Value: false,
EnvVars: []string{"PROVER_PROVE_UNASSIGNED_BLOCKS"},
}
MinEthBalance = &cli.Float64Flag{
Name: "prover.minEthBalance",
Usage: "Minimum ETH balance (in Ether) a prover wants to keep",
Category: proverCategory,
Value: 0,
EnvVars: []string{"PROVER_MIN_ETH_BALANCE"},
}
MinTaikoTokenBalance = &cli.Float64Flag{
Name: "prover.minTaikoTokenBalance",
Usage: "Minimum Taiko token balance without decimal a prover wants to keep",
Category: proverCategory,
Value: 0,
EnvVars: []string{"PROVER_MIN_TAIKO_TOKEN_BALANCE"},
}
// Running mode
ContesterMode = &cli.BoolFlag{
Name: "mode.contester",
Expand Down Expand Up @@ -119,22 +98,7 @@ var (
Category: proverCategory,
EnvVars: []string{"PROVER_DUMMY"},
}
// Max slippage allowed
MaxAcceptableBlockSlippage = &cli.Uint64Flag{
Name: "prover.blockSlippage",
Usage: "Maximum accepted slippage difference for blockID for accepting proving a block",
Value: 1024,
Category: proverCategory,
EnvVars: []string{"PROVER_BLOCK_SLIPPAGE"},
}
// Max amount of L1 blocks that can pass before block is invalid
MaxProposedIn = &cli.Uint64Flag{
Name: "prover.maxProposedIn",
Usage: "Maximum amount of L1 blocks that can pass before block can not be proposed. 0 means no limit.",
Value: 0,
Category: proverCategory,
EnvVars: []string{"PROVER_MAX_PROPOSED_IN"},
}
Allowance = &cli.Float64Flag{
Name: "prover.allowance",
Usage: "Amount without decimal to approve TaikoL1 contract for TaikoToken usage",
Expand Down Expand Up @@ -229,8 +193,6 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{
RaikoHostEndpoint,
RaikoJWTPath,
L1ProverPrivKey,
MinEthBalance,
MinTaikoTokenBalance,
StartingBlockID,
Dummy,
GuardianProverMinority,
Expand All @@ -241,11 +203,8 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{
ProveUnassignedBlocks,
ContesterMode,
ProverHTTPServerPort,
ProverCapacity,
MaxExpiry,
MaxProposedIn,
TaikoTokenAddress,
MaxAcceptableBlockSlippage,
Allowance,
L1NodeVersion,
L2NodeVersion,
Expand Down
2 changes: 0 additions & 2 deletions packages/taiko-client/proposer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type Config struct {
AllowZeroInterval uint64
MaxProposedTxListsPerEpoch uint64
ProposeBlockTxGasLimit uint64
IncludeParentMetaHash bool
BlobAllowed bool
RevertProtectionEnabled bool
TxmgrConfigs *txmgr.CLIConfig
Expand Down Expand Up @@ -104,7 +103,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
MaxProposedTxListsPerEpoch: maxProposedTxListsPerEpoch,
AllowZeroInterval: c.Uint64(flags.AllowZeroInterval.Name),
ProposeBlockTxGasLimit: c.Uint64(flags.TxGasLimit.Name),
IncludeParentMetaHash: c.Bool(flags.ProposeBlockIncludeParentMetaHash.Name),
BlobAllowed: c.Bool(flags.BlobAllowed.Name),
RevertProtectionEnabled: c.Bool(flags.RevertProtectionEnabled.Name),
TxmgrConfigs: pkgFlags.InitTxmgrConfigsFromCli(
Expand Down
3 changes: 0 additions & 3 deletions packages/taiko-client/proposer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() {
s.Equal(1, len(c.LocalAddresses))
s.Equal(goldenTouchAddress, c.LocalAddresses[0])
s.Equal(5*time.Second, c.Timeout)
s.Equal(true, c.IncludeParentMetaHash)

s.Nil(new(Proposer).InitFromCli(context.Background(), cliCtx))
return nil
Expand All @@ -62,7 +61,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() {
"--" + flags.TxPoolLocals.Name, goldenTouchAddress.Hex(),
"--" + flags.RPCTimeout.Name, rpcTimeout,
"--" + flags.TxGasLimit.Name, "100000",
"--" + flags.ProposeBlockIncludeParentMetaHash.Name, "true",
}))
}

Expand Down Expand Up @@ -117,7 +115,6 @@ func (s *ProposerTestSuite) SetupApp() *cli.App {
&cli.DurationFlag{Name: flags.ProposeInterval.Name},
&cli.StringFlag{Name: flags.TxPoolLocals.Name},
&cli.DurationFlag{Name: flags.RPCTimeout.Name},
&cli.BoolFlag{Name: flags.ProposeBlockIncludeParentMetaHash.Name},
}
app.Flags = append(app.Flags, flags.TxmgrFlags...)
app.Action = func(ctx *cli.Context) error {
Expand Down
19 changes: 0 additions & 19 deletions packages/taiko-client/prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ type Config struct {
RPCTimeout time.Duration
ProveBlockGasLimit uint64
HTTPServerPort uint64
Capacity uint64
MinEthBalance *big.Int
MinTaikoTokenBalance *big.Int
MaxExpiry time.Duration
MaxProposedIn uint64
MaxBlockSlippage uint64
Allowance *big.Int
GuardianProverHealthCheckServerEndpoint *url.URL
RaikoHostEndpoint string
Expand Down Expand Up @@ -117,16 +113,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
}
}

minEthBalance, err := utils.EtherToWei(c.Float64(flags.MinEthBalance.Name))
if err != nil {
return nil, err
}

minTaikoTokenBalance, err := utils.EtherToWei(c.Float64(flags.MinTaikoTokenBalance.Name))
if err != nil {
return nil, err
}

if !c.IsSet(flags.GuardianProverMajority.Name) && !c.IsSet(flags.RaikoHostEndpoint.Name) {
return nil, errors.New("empty raiko host endpoint")
}
Expand Down Expand Up @@ -165,13 +151,8 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
EnableLivenessBondProof: c.Bool(flags.EnableLivenessBondProof.Name),
RPCTimeout: c.Duration(flags.RPCTimeout.Name),
ProveBlockGasLimit: c.Uint64(flags.TxGasLimit.Name),
Capacity: c.Uint64(flags.ProverCapacity.Name),
HTTPServerPort: c.Uint64(flags.ProverHTTPServerPort.Name),
MinEthBalance: minEthBalance,
MinTaikoTokenBalance: minTaikoTokenBalance,
MaxExpiry: c.Duration(flags.MaxExpiry.Name),
MaxBlockSlippage: c.Uint64(flags.MaxAcceptableBlockSlippage.Name),
MaxProposedIn: c.Uint64(flags.MaxProposedIn.Name),
Allowance: allowance,
L1NodeVersion: c.String(flags.L1NodeVersion.Name),
L2NodeVersion: c.String(flags.L2NodeVersion.Name),
Expand Down
6 changes: 0 additions & 6 deletions packages/taiko-client/prover/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() {
s.True(c.ProveUnassignedBlocks)
s.True(c.ContesterMode)
s.Equal(rpcTimeout, c.RPCTimeout)
s.Equal(uint64(8), c.Capacity)
s.Equal(c.L1NodeVersion, l1NodeVersion)
s.Equal(c.L2NodeVersion, l2NodeVersion)
s.Nil(new(Prover).InitFromCli(context.Background(), ctx))
s.True(c.ProveUnassignedBlocks)
s.Equal(uint64(100), c.MaxProposedIn)
allowanceWithDecimal, err := utils.EtherToWei(allowance)
s.Nil(err)
s.Equal(allowanceWithDecimal.Uint64(), c.Allowance.Uint64())
Expand All @@ -69,12 +67,10 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() {
"--" + flags.RPCTimeout.Name, "5s",
"--" + flags.TxGasLimit.Name, "100000",
"--" + flags.Dummy.Name,
"--" + flags.ProverCapacity.Name, "8",
"--" + flags.GuardianProverMajority.Name, os.Getenv("GUARDIAN_PROVER_CONTRACT"),
"--" + flags.GuardianProverMinority.Name, os.Getenv("GUARDIAN_PROVER_MINORITY"),
"--" + flags.Graffiti.Name, "",
"--" + flags.ProveUnassignedBlocks.Name,
"--" + flags.MaxProposedIn.Name, "100",
"--" + flags.Allowance.Name, fmt.Sprint(allowance),
"--" + flags.L1NodeVersion.Name, l1NodeVersion,
"--" + flags.L2NodeVersion.Name, l2NodeVersion,
Expand Down Expand Up @@ -107,8 +103,6 @@ func (s *ProverTestSuite) SetupApp() *cli.App {
&cli.StringFlag{Name: flags.Graffiti.Name},
&cli.BoolFlag{Name: flags.ProveUnassignedBlocks.Name},
&cli.DurationFlag{Name: flags.RPCTimeout.Name},
&cli.Uint64Flag{Name: flags.ProverCapacity.Name},
&cli.Uint64Flag{Name: flags.MaxProposedIn.Name},
&cli.StringFlag{Name: flags.Allowance.Name},
&cli.StringFlag{Name: flags.ContesterMode.Name},
&cli.StringFlag{Name: flags.L1NodeVersion.Name},
Expand Down
4 changes: 2 additions & 2 deletions packages/taiko-client/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ func InitFromConfig(
p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize)
p.batchProofGenerationCh = make(chan *proofProducer.BatchProofs, chBufferSize)
p.assignmentExpiredCh = make(chan metadata.TaikoBlockMetaData, chBufferSize)
p.proofSubmissionCh = make(chan *proofProducer.ProofRequestBody, p.cfg.Capacity)
p.proofContestCh = make(chan *proofProducer.ContestRequestBody, p.cfg.Capacity)
p.proofSubmissionCh = make(chan *proofProducer.ProofRequestBody, chBufferSize)
p.proofContestCh = make(chan *proofProducer.ContestRequestBody, chBufferSize)
p.proveNotify = make(chan struct{}, 1)
p.aggregationNotify = make(chan uint16, 1)

Expand Down
3 changes: 0 additions & 3 deletions packages/taiko-client/prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ func (s *ProverTestSuite) TestAggregateProofsAlreadyProved() {
L1ProverPrivKey: l1ProverPrivKey,
Dummy: true,
ProveUnassignedBlocks: true,
Capacity: 1024,
Allowance: new(big.Int).Exp(big.NewInt(1_000_000_100), new(big.Int).SetUint64(uint64(decimal)), nil),
RPCTimeout: 3 * time.Second,
BackOffRetryInterval: 3 * time.Second,
Expand Down Expand Up @@ -525,7 +524,6 @@ func (s *ProverTestSuite) TestAggregateProofs() {
L1ProverPrivKey: l1ProverPrivKey,
Dummy: true,
ProveUnassignedBlocks: true,
Capacity: 1024,
Allowance: new(big.Int).Exp(big.NewInt(1_000_000_100), new(big.Int).SetUint64(uint64(decimal)), nil),
RPCTimeout: 3 * time.Second,
BackOffRetryInterval: 3 * time.Second,
Expand Down Expand Up @@ -602,7 +600,6 @@ func (s *ProverTestSuite) initProver(
L1ProverPrivKey: key,
Dummy: true,
ProveUnassignedBlocks: true,
Capacity: 1024,
Allowance: new(big.Int).Exp(big.NewInt(1_000_000_100), new(big.Int).SetUint64(uint64(decimal)), nil),
RPCTimeout: 3 * time.Second,
BackOffRetryInterval: 3 * time.Second,
Expand Down
Loading