Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat: update some flags
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Oct 12, 2023
1 parent fd1a146 commit 5dc59d3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cmd/flags/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -167,7 +167,7 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{
ProveBlockMaxTxGasTipCap,
Graffiti,
ProveUnassignedBlocks,
ContestControversialProofs,
ContesterMode,
ProveBlockTxGasLimit,
ProverHTTPServerPort,
ProverCapacity,
Expand Down
4 changes: 2 additions & 2 deletions prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5dc59d3

Please sign in to comment.