Compare commits

..

1 Commits

Author SHA1 Message Date
Péter Garamvölgyi
2c89343e03 handle failed proof in ProcessCommittedBatches 2023-08-06 22:39:20 +08:00

View File

@@ -374,15 +374,6 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
// send transaction
txID := batch.Hash + "-commit"
log.Info(
"Sending commitBatch",
"batch.Index", batch.Index,
"batch.Hash", batch.Hash,
"RollupContractAddress", r.cfg.RollupContractAddress,
"calldata", common.Bytes2Hex(calldata),
"parentBatch.BatchHeader", common.Bytes2Hex(parentBatch.BatchHeader),
"batch.BatchHeader", common.Bytes2Hex(batch.BatchHeader),
)
txHash, err := r.rollupSender.SendTransaction(txID, &r.cfg.RollupContractAddress, big.NewInt(0), calldata, 0)
if err != nil {
if !errors.Is(err, sender.ErrNoAvailableAccount) && !errors.Is(err, sender.ErrFullPending) {
@@ -424,8 +415,8 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
hash := batch.Hash
status := types.ProvingStatus(batch.ProvingStatus)
switch status {
case types.ProvingTaskUnassigned, types.ProvingTaskAssigned:
// The proof for this block is not ready yet.
case types.ProvingTaskUnassigned, types.ProvingTaskAssigned, types.ProvingTaskFailed:
// We do not handle pending or failed proving tasks in this function.
return
case types.ProvingTaskProved:
// It's an intermediate state. The prover manager received the proof but has not verified
@@ -505,25 +496,6 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
success = true
r.processingFinalization.Store(txID, hash)
case types.ProvingTaskFailed:
// We were unable to prove this batch. There are two possibilities:
// (a) Prover bug. In this case, we should fix and redeploy the prover.
// In the meantime, we continue to commit batches to L1 as well as
// proposing and proving chunks and batches.
// (b) Unprovable batch, e.g. proof overflow. In this case we need to
// stop the ledger, fix the limit, revert all the violating blocks,
// chunks and batches and all subsequent ones, and resume, i.e. this
// case requires manual resolution.
log.Error(
"batch proving failed",
"Index", batch.Index,
"Hash", batch.Hash,
"ProverAssignedAt", batch.ProverAssignedAt,
"ProvedAt", batch.ProvedAt,
"ProofTimeSec", batch.ProofTimeSec,
)
return
default:
log.Error("encounter unreachable case in ProcessCommittedBatches", "proving status", status)
}