Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 committed Sep 30, 2024
1 parent 9c2271c commit fd5c6ee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (s *SGXProofProducer) requestBatchProof(
if output.Data.Status == StatusRegistered {
return nil, ErrRetry
}

if len(output.Data.Proof.Proof) == 0 {
return nil, errEmptyProof
}
Expand Down
1 change: 1 addition & 0 deletions packages/taiko-client/prover/proof_submitter/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Submitter interface {
AggregateProofs(ctx context.Context) error
Producer() proofProducer.ProofProducer
Tier() uint16
BufferSize() uint64
}

// Contester is the interface for contesting proofs of the L2 blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,8 @@ func (s *ProofSubmitter) Producer() proofProducer.ProofProducer {
func (s *ProofSubmitter) Tier() uint16 {
return s.proofProducer.Tier()
}

// BufferSize returns the size of the proof buffer.
func (s *ProofSubmitter) BufferSize() uint64 {
return s.proofBuffer.MaxLength
}
16 changes: 11 additions & 5 deletions packages/taiko-client/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,17 @@ func (p *Prover) aggregateOp() error {
wg.Add(1)
go func(s proofSubmitter.Submitter) {
defer wg.Done()
err := s.AggregateProofs(p.ctx)
log.Error("Failed to aggregate proofs",
"error", err,
"tier", s.Tier(),
)
if s.BufferSize() > 1 {
err := s.AggregateProofs(p.ctx)
log.Error("Failed to aggregate proofs",
"error", err,
"tier", s.Tier(),
)
} else {
log.Debug("Skip this aggregateOp since low buffer size",
"tier", s.Tier(),
)
}
}(submitter)
}
return nil
Expand Down

0 comments on commit fd5c6ee

Please sign in to comment.