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

Commit

Permalink
fix(prover): fix some typo (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshliu committed Aug 31, 2023
1 parent af6531b commit 355e68b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions prover/proof_submitter/valid_proof_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (s *ValidProofSubmitter) SubmitProof(
return s.rpc.TaikoL1.ProveBlock(txOpts, blockID.Uint64(), input)
}

var maxRetry = &s.submissionMaxRetry
maxRetry := &s.submissionMaxRetry
if s.isOracleProver {
maxRetry = nil
}
Expand Down Expand Up @@ -296,7 +296,7 @@ func (s *ValidProofSubmitter) SubmitProof(
}

// CancelProof cancels an existing proof generation.
// Right now, it is just a stub that does nothing, because it is not possible to cnacel the proof
// Right now, it is just a stub that does nothing, because it is not possible to cancel the proof
// with the current zkevm software.
func (s *ValidProofSubmitter) CancelProof(ctx context.Context, blockID *big.Int) error {
return s.proofProducer.Cancel(ctx, blockID)
Expand Down
15 changes: 7 additions & 8 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (p *Prover) eventLoop() {
forceProvingTicker := time.NewTicker(15 * time.Second)
defer forceProvingTicker.Stop()

// If there is no new block verification in `proofCooldownPeriod * 2` seconeds, and the current prover is
// If there is no new block verification in `proofCooldownPeriod * 2` seconds, and the current prover is
// a special prover, we will go back to try proving the block whose id is `lastVerifiedBlockId + 1`.
verificationCheckTicker := time.NewTicker(
time.Duration(p.protocolConfigs.ProofRegularCooldown.Uint64()*2) * time.Second,
Expand Down Expand Up @@ -388,7 +388,7 @@ func (p *Prover) onBlockProposed(
return fmt.Errorf("failed to wait L1Origin (eventID %d): %w", event.BlockId, err)
}

// Check whteher the L2 EE's recorded L1 info, to see if the L1 chain has been reorged.
// Check whether the L2 EE's recorded L1 info, to see if the L1 chain has been reorged.
reorged, l1CurrentToReset, lastHandledBlockIDToReset, err := p.rpc.CheckL1ReorgFromL2EE(
ctx,
new(big.Int).Sub(event.BlockId, common.Big1),
Expand Down Expand Up @@ -569,7 +569,7 @@ func (p *Prover) onBlockProposed(
// zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address
if block.Prover != p.proverAddress && !proofWindowExpired {
log.Info(
"Proposed block not proveable",
"Proposed block not provable",
"blockID",
event.BlockId,
"prover",
Expand Down Expand Up @@ -611,7 +611,7 @@ func (p *Prover) onBlockProposed(
}

log.Info(
"Proposed block is proveable",
"Proposed block is provable",
"blockID", event.BlockId,
"prover", block.Prover.Hex(),
"proofWindowExpired", proofWindowExpired,
Expand Down Expand Up @@ -734,7 +734,6 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien
event.ParentHash,
event.BlockHash,
)

if err != nil {
return err
}
Expand Down Expand Up @@ -830,14 +829,14 @@ func (p *Prover) closeSubscription() {
}

// checkChainVerification checks if there is no new block verification in protocol, if so,
// it will let current sepecial prover to go back to try proving the block whose id is `lastVerifiedBlockId + 1`.
// it will let current special prover to go back to try proving the block whose id is `lastVerifiedBlockId + 1`.
func (p *Prover) checkChainVerification(lastLatestVerifiedL1Height uint64) error {
if (!p.cfg.OracleProver) || lastLatestVerifiedL1Height != p.latestVerifiedL1Height {
return nil
}

log.Warn(
"No new block verification in `proofCooldownPeriod * 2` seconeds",
"No new block verification in `proofCooldownPeriod * 2` seconds",
"latestVerifiedL1Height", p.latestVerifiedL1Height,
"proofCooldownPeriod", p.protocolConfigs.ProofRegularCooldown,
)
Expand Down Expand Up @@ -908,7 +907,7 @@ func (p *Prover) checkProofWindowsExpired(ctx context.Context) error {
return nil
}

// checkProofWindowExpired checks a single instance of a block to see if its proof winodw has expired
// checkProofWindowExpired checks a single instance of a block to see if its proof window has expired
// and the proof is now able to be submitted by anyone, not just the blocks assigned prover.
func (p *Prover) checkProofWindowExpired(ctx context.Context, l1Height, blockId uint64) error {
block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, blockId)
Expand Down

0 comments on commit 355e68b

Please sign in to comment.