From 7f0d2dfd43f7565458a0c662871d8a0662770066 Mon Sep 17 00:00:00 2001 From: Eduard S Date: Thu, 17 Dec 2020 13:50:04 +0100 Subject: [PATCH] Fix panic caused by nil batchInfo.ServerProof --- coordinator/coordinator.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coordinator/coordinator.go b/coordinator/coordinator.go index 9025231..554f489 100644 --- a/coordinator/coordinator.go +++ b/coordinator/coordinator.go @@ -698,9 +698,12 @@ func (p *Pipeline) Start(batchNum common.BatchNum, lastForgeL1TxsNum int64, continue } else if err != nil { log.Errorw("proversPool.Get", "err", err) + continue } - if err := p.sendServerProof(p.ctx, serverProof, batchInfo); err != nil { + batchInfo.ServerProof = serverProof + if err := p.sendServerProof(p.ctx, batchInfo); err != nil { log.Errorw("sendServerProof", "err", err) + batchInfo.ServerProof = nil p.proversPool.Add(serverProof) continue } @@ -762,8 +765,7 @@ func l2TxsIDs(txs []common.PoolL2Tx) []common.TxID { } // sendServerProof sends the circuit inputs to the proof server -func (p *Pipeline) sendServerProof(ctx context.Context, serverProof prover.Client, - batchInfo *BatchInfo) error { +func (p *Pipeline) sendServerProof(ctx context.Context, batchInfo *BatchInfo) error { p.cfg.debugBatchStore(batchInfo) // 7. Call the selected idle server proof with BatchBuilder output,