From c6b46fb26830e48b41b87076a38fddfd7d61578f Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:15:12 +0800 Subject: [PATCH] fix: treat JSON errors as CCC error (#940) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: treat JSON errors as CCC error (#922) Co-authored-by: Ă–mer Faruk Irmak --- rollup/pipeline/pipeline.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rollup/pipeline/pipeline.go b/rollup/pipeline/pipeline.go index 6fb9297412..e3d0cbafaa 100644 --- a/rollup/pipeline/pipeline.go +++ b/rollup/pipeline/pipeline.go @@ -396,7 +396,7 @@ func (p *Pipeline) encodeStage(traces <-chan *BlockCandidate) <-chan *BlockCandi trace.RustTrace = circuitcapacitychecker.MakeRustTrace(trace.LastTrace, buffer) if trace.RustTrace == nil { log.Error("making rust trace", "txHash", trace.LastTrace.Transactions[0].TxHash) - return + // ignore the error here, CCC stage will catch it and treat it as a CCC error } } encodeTimer.UpdateSince(encodeStart) @@ -465,7 +465,11 @@ func (p *Pipeline) cccStage(candidates <-chan *BlockCandidate, deadline time.Tim var accRows *types.RowConsumption var err error if candidate != nil && p.ccc != nil { - accRows, err = p.ccc.ApplyTransactionRustTrace(candidate.RustTrace) + if candidate.RustTrace != nil { + accRows, err = p.ccc.ApplyTransactionRustTrace(candidate.RustTrace) + } else { + err = errors.New("no rust trace") + } lastTxn := candidate.Txs[candidate.Txs.Len()-1] cccTimer.UpdateSince(cccStart) if err != nil {