Skip to content

Commit

Permalink
better CCC error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Sep 2, 2024
1 parent 057b2c1 commit 4736632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ func (w *worker) skip(txHash common.Hash) {

// onBlockFailingCCC is called when block produced by worker fails CCC
func (w *worker) onBlockFailingCCC(failingBlock *types.Block, err error) {
log.Warn("block failed CCC", "hash", failingBlock.Hash(), "number", failingBlock.NumberU64())
log.Warn("block failed CCC", "hash", failingBlock.Hash().Hex(), "number", failingBlock.NumberU64(), "err", err)
// w.asyncChecker.Check() might block until this callback returns and if the write to reorgCh
// below blocks, we have a deadlock. Make sure this callback can never block.
go func() {
Expand Down
4 changes: 3 additions & 1 deletion rollup/ccc/async_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ type ErrorWithTxnIdx struct {
TxIdx uint
err error
ShouldSkip bool
AccRc *types.RowConsumption
}

func (e *ErrorWithTxnIdx) Error() string {
return fmt.Sprintf("txn at index %d failed with %s", e.TxIdx, e.err)
return fmt.Sprintf("txn at index %d failed with %s (rc = %s)", e.TxIdx, e.err, fmt.Sprint(e.AccRc))
}

func (e *ErrorWithTxnIdx) Unwrap() error {
Expand Down Expand Up @@ -188,6 +189,7 @@ func (c *AsyncChecker) checkerTask(block *types.Block, ccc *Checker, forkCtx con
// if the txn is the first in block or the additional resource utilization caused
// by this txn alone is enough to overflow the circuit, skip
ShouldSkip: txIdx == 0 || curRc.Difference(*accRc).IsOverflown(),
AccRc: curRc,
}
return failingCallback
}
Expand Down

0 comments on commit 4736632

Please sign in to comment.