diff --git a/migration/migration.go b/migration/migration.go index e6f5a0f4e0..1b829eac6f 100644 --- a/migration/migration.go +++ b/migration/migration.go @@ -450,7 +450,7 @@ func processBlocks(txn db.Transaction, processBlock func(uint64, *sync.Mutex) er } blockNumbers := make(chan uint64, 1024) //nolint:mnd go func() { - for bNumber := range chainHeight { + for bNumber := range chainHeight + 1 { blockNumbers <- bNumber } close(blockNumbers) @@ -467,15 +467,6 @@ func processBlocks(txn db.Transaction, processBlock func(uint64, *sync.Mutex) er }) } return workerPool.Wait() - // This causes the transaction to be discarded - // err = workerPool.Wait() - // if err != nil { - // return err - // } - // txnLock.Lock() - // err = txn.Commit() - // txnLock.Unlock() - // return err } // calculateBlockCommitments calculates the txn and event commitments for each block and stores them separately diff --git a/migration/migration_pkg_test.go b/migration/migration_pkg_test.go index e9c2926351..cd26d59db6 100644 --- a/migration/migration_pkg_test.go +++ b/migration/migration_pkg_test.go @@ -210,7 +210,7 @@ func TestL1HandlerTxns(t *testing.T) { // Ensure the key has been deleted _, err := chain.L1HandlerTxnHash(&msgHash) - require.Error(t, err) + require.ErrorIs(t, err, db.ErrKeyNotFound) // Recalculate and store the L1 message hashes require.NoError(t, testdb.Update(func(txn db.Transaction) error {