From 5f44be1bcdc50cce3e1530501b89565273363308 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Wed, 12 Jun 2024 21:13:53 +0200 Subject: [PATCH] Remove rehashing in storage ledger init (#2340) This looks like a debug leftover, but it causes a state root recomputation which is slow --- nimbus/db/ledger/distinct_ledgers.nim | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nimbus/db/ledger/distinct_ledgers.nim b/nimbus/db/ledger/distinct_ledgers.nim index 4df35c6b2..b0a744859 100644 --- a/nimbus/db/ledger/distinct_ledgers.nim +++ b/nimbus/db/ledger/distinct_ledgers.nim @@ -174,7 +174,6 @@ proc init*( T: type StorageLedger; al: AccountLedger; account: CoreDbAccount; - reHashOk = true; ): T = ## Storage trie constructor. ## @@ -183,11 +182,6 @@ proc init*( let db = al.distinctBase.parent stt = account.storage - if not stt.isNil and reHashOk: - let rc = al.distinctBase.getColumn.state() - if rc.isErr: - raiseAssert "re-hash oops, error=" & $$rc.error - let ctx = db.ctx trie = if stt.isNil: ctx.newColumn(account.address) else: stt mpt = block: