Skip to content

Commit

Permalink
fix: witness loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Feb 4, 2025
1 parent 822782c commit 990cbb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,8 @@ func (a *Aggregator) getAndLockBatchToProve(

// Request the witness from the server, if it is busy just keep looping until it is available
start := time.Now()
witness, err := a.rpcClient.GetWitness(batchNumberToVerify, a.cfg.UseFullWitness)
var witness []byte
witness, err = a.rpcClient.GetWitness(batchNumberToVerify, a.cfg.UseFullWitness)
for err != nil {
if errors.Is(err, rpc.ErrBusy) {
a.logger.Debugf(
Expand All @@ -1226,6 +1227,7 @@ func (a *Aggregator) getAndLockBatchToProve(
a.logger.Errorf("Failed to get witness for batch %d, err: %v", batchNumberToVerify, err)
}
time.Sleep(a.cfg.RetryTime.Duration)
witness, err = a.rpcClient.GetWitness(batchNumberToVerify, a.cfg.UseFullWitness)
}
end := time.Now()
a.logger.Debugf("Time to get witness for batch %d: %v", batchNumberToVerify, end.Sub(start))
Expand Down

0 comments on commit 990cbb3

Please sign in to comment.