fix: treat JSON errors as CCC error (#940)

fix: treat JSON errors as CCC error (#922)

Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
This commit is contained in:
HAOYUatHZ 2024-07-29 19:15:12 +08:00 committed by GitHub
parent ac044caa1b
commit c6b46fb268
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {
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 {