From 355e68bc53bf01684198076fdd0c8a3ddb4bbed3 Mon Sep 17 00:00:00 2001 From: alexshliu <104080237+alexshliu@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:06:59 +0800 Subject: [PATCH] fix(prover): fix some typo (#374) --- prover/proof_submitter/valid_proof_submitter.go | 4 ++-- prover/prover.go | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index 0bca978d7..5fe072224 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -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 } @@ -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) diff --git a/prover/prover.go b/prover/prover.go index e54a8dce2..9965eb597 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -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, @@ -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), @@ -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", @@ -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, @@ -734,7 +734,6 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien event.ParentHash, event.BlockHash, ) - if err != nil { return err } @@ -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, ) @@ -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)