From 62a66d98dc20117bb43192789da87e4d47dd4a7f Mon Sep 17 00:00:00 2001 From: Arnau Date: Thu, 31 Oct 2024 12:47:43 -0600 Subject: [PATCH] increase coverage --- l1infotreesync/processor.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/l1infotreesync/processor.go b/l1infotreesync/processor.go index 299ba973..27a4b53f 100644 --- a/l1infotreesync/processor.go +++ b/l1infotreesync/processor.go @@ -352,20 +352,12 @@ func (p *processor) ProcessBlock(ctx context.Context, block sync.Block) error { // failed due to a reorg. Hopefully, this is the case, eventually the reorg will get detected, // and the syncer will get unhalted. Otherwise, this means that the syncer has an inconsistent state // compared to the contracts, and this will need manual intervention. - if root.Hash != event.UpdateL1InfoTreeV2.CurrentL1InfoRoot { + if root.Hash != event.UpdateL1InfoTreeV2.CurrentL1InfoRoot || root.Index+1 != event.UpdateL1InfoTreeV2.LeafCount { errStr := fmt.Sprintf( - "unexpected root when checking UpdateL1InfoTreeV2: %s vs %s. Happened on block %d", - root.Hash, common.Bytes2Hex(event.UpdateL1InfoTreeV2.CurrentL1InfoRoot[:]), block.Num, - ) - log.Error(errStr) - p.haltedReason = errStr - p.halted = true - return sync.ErrInconsistentState - } - if root.Index+1 != event.UpdateL1InfoTreeV2.LeafCount { - errStr := fmt.Sprintf( - "unexpected index when checking UpdateL1InfoTreeV2: %d vs %d. Happened on block %d", - root.Index, event.UpdateL1InfoTreeV2.LeafCount, block.Num, + "failed to check UpdateL1InfoTreeV2. Root: %s vs %s. Index: : %d vs %d. Happened on block %d", + root.Hash, common.Bytes2Hex(event.UpdateL1InfoTreeV2.CurrentL1InfoRoot[:]), + root.Index, event.UpdateL1InfoTreeV2.LeafCount, + block.Num, ) log.Error(errStr) p.haltedReason = errStr