From 5dc59d34c9650807aeda5c39b5b2e2305de393e1 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 15:20:11 +0800 Subject: [PATCH] feat: update some flags --- cmd/flags/prover.go | 8 ++++---- prover/config.go | 4 ++-- prover/prover.go | 6 +++--- prover/prover_test.go | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 49ed2abc9..bc5a326ef 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -117,9 +117,9 @@ var ( Category: proverCategory, } // Running mode - ContestControversialProofs = &cli.BoolFlag{ - Name: "mode.contest", - Usage: "Whether you want to contest wrong proofs with higher tier proofs", + ContesterMode = &cli.BoolFlag{ + Name: "mode.contester", + Usage: "Whether you want to contest wrong transitions with higher tier proofs", Category: proverCategory, Value: false, } @@ -167,7 +167,7 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ ProveBlockMaxTxGasTipCap, Graffiti, ProveUnassignedBlocks, - ContestControversialProofs, + ContesterMode, ProveBlockTxGasLimit, ProverHTTPServerPort, ProverCapacity, diff --git a/prover/config.go b/prover/config.go index 7cd7aa2cf..57c29b5da 100644 --- a/prover/config.go +++ b/prover/config.go @@ -35,7 +35,7 @@ type Config struct { BackOffMaxRetrys uint64 BackOffRetryInterval time.Duration ProveUnassignedBlocks bool - ContestControversialProofs bool + ContesterMode bool RPCTimeout *time.Duration WaitReceiptTimeout time.Duration ProveBlockGasLimit *uint64 @@ -122,7 +122,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { BackOffMaxRetrys: c.Uint64(flags.BackOffMaxRetrys.Name), BackOffRetryInterval: c.Duration(flags.BackOffRetryInterval.Name), ProveUnassignedBlocks: c.Bool(flags.ProveUnassignedBlocks.Name), - ContestControversialProofs: c.Bool(flags.ContestControversialProofs.Name), + ContesterMode: c.Bool(flags.ContesterMode.Name), RPCTimeout: timeout, WaitReceiptTimeout: c.Duration(flags.WaitReceiptTimeout.Name), ProveBlockGasLimit: proveBlockTxGasLimit, diff --git a/prover/prover.go b/prover/prover.go index 47c2dfb6e..869854693 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -638,8 +638,8 @@ func (p *Prover) onTransitionContested(ctx context.Context, e *bindings.TaikoL1C "bond", e.ContestBond, ) - // If this prover is not in contest mode, we simply output a log and return. - if !p.cfg.ContestControversialProofs { + // If this prover is not in contester mode, we simply output a log and return. + if !p.cfg.ContesterMode { return nil } @@ -711,7 +711,7 @@ func (p *Prover) onTransitionProved(ctx context.Context, event *bindings.TaikoL1 // If this prover is in contest mode, we check the validity of this proof and if it's invalid, // contest it with a higher tier proof. - if !p.cfg.ContestControversialProofs { + if !p.cfg.ContesterMode { return nil } diff --git a/prover/prover_test.go b/prover/prover_test.go index b6c11624f..07bd819a6 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -211,13 +211,13 @@ func (s *ProverTestSuite) TestOnBlockVerified() { } func (s *ProverTestSuite) TestContestWrongBlocks() { - s.p.cfg.ContestControversialProofs = false + s.p.cfg.ContesterMode = false e := testutils.ProposeAndInsertValidBlock(&s.ClientTestSuite, s.proposer, s.d.ChainSyncer().CalldataSyncer()) s.Nil(s.p.onTransitionProved(context.Background(), &bindings.TaikoL1ClientTransitionProved{ BlockId: e.BlockId, Tier: e.MinTier, })) - s.p.cfg.ContestControversialProofs = true + s.p.cfg.ContesterMode = true s.p.cfg.GuardianProver = true // Submit a wrong proof at first.