From 486c7ee0f962e8b598ed6bd07696d4a58929ff04 Mon Sep 17 00:00:00 2001 From: colin <102356659+colinlyguo@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:55:18 +0800 Subject: [PATCH] refactor(rollup-relayer): tweak finalize batch logs (#1009) Co-authored-by: colinlyguo --- common/version/version.go | 2 +- rollup/internal/controller/relayer/l2_relayer.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/version/version.go b/common/version/version.go index e0b887e9e5..7e18ebb7e3 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.3.39" +var tag = "v4.3.40" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index b03812b3ac..ca10f6ba89 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -485,7 +485,7 @@ func (r *Layer2Relayer) ProcessCommittedBatches() { } func (r *Layer2Relayer) finalizeBatch(batch *orm.Batch, withProof bool) error { - // Check batch status before send `finalizeBatchWithProof` tx. + // Check batch status before send `finalizeBatch` tx. if r.cfg.ChainMonitor.Enabled { var batchStatus bool batchStatus, err := r.getBatchStatusByIndex(batch.Index) @@ -564,14 +564,16 @@ func (r *Layer2Relayer) finalizeBatch(batch *orm.Batch, withProof bool) error { // the client does not see the 1st tx's updates at this point. // TODO: add more fine-grained error handling log.Error( - "finalizeBatchWithProof in layer1 failed", + "finalizeBatch in layer1 failed", + "with proof", withProof, "index", batch.Index, "hash", batch.Hash, "RollupContractAddress", r.cfg.RollupContractAddress, "err", err, ) log.Debug( - "finalizeBatchWithProof in layer1 failed", + "finalizeBatch in layer1 failed", + "with proof", withProof, "index", batch.Index, "hash", batch.Hash, "RollupContractAddress", r.cfg.RollupContractAddress, @@ -581,7 +583,7 @@ func (r *Layer2Relayer) finalizeBatch(batch *orm.Batch, withProof bool) error { } return err } - log.Info("finalizeBatch in layer1", "index", batch.Index, "batch hash", batch.Hash, "tx hash", batch.Hash, "with proof", withProof) + log.Info("finalizeBatch in layer1", "with proof", withProof, "index", batch.Index, "batch hash", batch.Hash, "tx hash", batch.Hash) // record and sync with db, @todo handle db error if err := r.batchOrm.UpdateFinalizeTxHashAndRollupStatus(r.ctx, batch.Hash, finalizeTxHash.String(), types.RollupFinalizing); err != nil {