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

Commit

Permalink
feat(prover): remove the uncessary special proof delay
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed May 15, 2023
1 parent 98c17f0 commit 6079921
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
27 changes: 7 additions & 20 deletions prover/proof_producer/special_proof_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (p *SpecialProofProducer) RequestProof(
resultCh chan *ProofWithHeader,
) error {
log.Info(
"Request oracle proof",
"Request special proof",
"blockID", blockID,
"beneficiary", meta.Beneficiary,
"height", header.Number,
Expand Down Expand Up @@ -140,27 +140,14 @@ func (p *SpecialProofProducer) RequestProof(
return fmt.Errorf("failed to sign evidence: %w", err)
}

var (
delay time.Duration = 0
now = time.Now()
blockTime = time.Unix(int64(block.Time()), 0)
)
if !p.isSystemProver && now.Before(blockTime.Add(p.proofTimeTarget)) {
delay = blockTime.Add(p.proofTimeTarget).Sub(now)
resultCh <- &ProofWithHeader{
BlockID: blockID,
Header: header,
Meta: meta,
ZkProof: proof,
Opts: opts,
}

log.Info("Proof submission delay", "delay", delay, "isSystemProver", p.isSystemProver)

time.AfterFunc(delay, func() {
resultCh <- &ProofWithHeader{
BlockID: blockID,
Header: header,
Meta: meta,
ZkProof: proof,
Opts: opts,
}
})

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli
// and the proof is not the oracle proof address.
func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1ClientBlockProven) error {
metrics.ProverReceivedProvenBlockGauge.Update(event.Id.Int64())
// if oracle prover, dont cancel proof.
// if this proof is submitted by an oracle prover or a system prover, dont cancel proof.
if event.Prover == p.oracleProverAddress ||
event.Prover == p.systemProverAddress ||
event.Prover == common.HexToAddress("0x0000000000000000000000000000000000000000") ||
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package version

// Version info.
var (
Version = "0.8.0"
Version = "0.9.0"
Meta = "dev"
)

Expand Down

0 comments on commit 6079921

Please sign in to comment.