From daad1859738383b9b77d634d6736ad112d667ec6 Mon Sep 17 00:00:00 2001 From: bhartnett Date: Thu, 7 Aug 2025 08:48:54 +0800 Subject: [PATCH 1/4] Delete all cached values. --- execution_chain/db/aristo/aristo_tx_frame.nim | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/execution_chain/db/aristo/aristo_tx_frame.nim b/execution_chain/db/aristo/aristo_tx_frame.nim index b445829ced..502dfbeebd 100644 --- a/execution_chain/db/aristo/aristo_tx_frame.nim +++ b/execution_chain/db/aristo/aristo_tx_frame.nim @@ -214,29 +214,29 @@ with --debug-eager-state-root.""" # Copy cached values from the snapshot for accPath, v in txFrame.snapshot.acc: - if v[0] == nil: - db.accLeaves.del(accPath) - else: - discard db.accLeaves.update(accPath, v[0]) + # if v[0] == nil: + db.accLeaves.del(accPath) + # else: + # discard db.accLeaves.update(accPath, v[0]) for mixPath, v in txFrame.snapshot.sto: - if v[0] == nil: - db.stoLeaves.del(mixPath) - else: - discard db.stoLeaves.update(mixPath, v[0]) + # if v[0] == nil: + db.stoLeaves.del(mixPath) + # else: + # discard db.stoLeaves.update(mixPath, v[0]) # Copy cached values from the txFrame for accPath, vtx in txFrame.accLeaves: - if vtx == nil: - db.accLeaves.del(accPath) - else: - discard db.accLeaves.update(accPath, vtx) + # if vtx == nil: + db.accLeaves.del(accPath) + # else: + # discard db.accLeaves.update(accPath, vtx) for mixPath, vtx in txFrame.stoLeaves: - if vtx == nil: - db.stoLeaves.del(mixPath) - else: - discard db.stoLeaves.update(mixPath, vtx) + # if vtx == nil: + db.stoLeaves.del(mixPath) + # else: + # discard db.stoLeaves.update(mixPath, vtx) txFrame.snapshot.vtx.clear() txFrame.snapshot.acc.clear() From 5d01fd8917810d77a61f4d6aced884eed5e79355 Mon Sep 17 00:00:00 2001 From: bhartnett Date: Thu, 7 Aug 2025 10:31:38 +0800 Subject: [PATCH 2/4] Clean up. --- execution_chain/db/aristo/aristo_tx_frame.nim | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/execution_chain/db/aristo/aristo_tx_frame.nim b/execution_chain/db/aristo/aristo_tx_frame.nim index 502dfbeebd..2608738ef5 100644 --- a/execution_chain/db/aristo/aristo_tx_frame.nim +++ b/execution_chain/db/aristo/aristo_tx_frame.nim @@ -210,33 +210,18 @@ with --debug-eager-state-root.""" # really run after things have been written (to maintain sync betweeen # in-memory and on-disk state) - # Copy back updated payloads into the shared database LRU caches. + # Updated values in the txFrame caches are now stale so remove them from the + # shared database LRU caches. - # Copy cached values from the snapshot for accPath, v in txFrame.snapshot.acc: - # if v[0] == nil: db.accLeaves.del(accPath) - # else: - # discard db.accLeaves.update(accPath, v[0]) - for mixPath, v in txFrame.snapshot.sto: - # if v[0] == nil: db.stoLeaves.del(mixPath) - # else: - # discard db.stoLeaves.update(mixPath, v[0]) - # Copy cached values from the txFrame for accPath, vtx in txFrame.accLeaves: - # if vtx == nil: db.accLeaves.del(accPath) - # else: - # discard db.accLeaves.update(accPath, vtx) - for mixPath, vtx in txFrame.stoLeaves: - # if vtx == nil: db.stoLeaves.del(mixPath) - # else: - # discard db.stoLeaves.update(mixPath, vtx) txFrame.snapshot.vtx.clear() txFrame.snapshot.acc.clear() From 81317a1757618292127bd74156e3fcfb5e8e9032 Mon Sep 17 00:00:00 2001 From: bhartnett Date: Thu, 28 Aug 2025 11:22:37 +0800 Subject: [PATCH 3/4] Use LRUCache refresh instead of delete. --- execution_chain/db/aristo/aristo_tx_frame.nim | 8 ++++---- vendor/nim-minilru | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/execution_chain/db/aristo/aristo_tx_frame.nim b/execution_chain/db/aristo/aristo_tx_frame.nim index 2608738ef5..b8e8e73f1a 100644 --- a/execution_chain/db/aristo/aristo_tx_frame.nim +++ b/execution_chain/db/aristo/aristo_tx_frame.nim @@ -214,14 +214,14 @@ with --debug-eager-state-root.""" # shared database LRU caches. for accPath, v in txFrame.snapshot.acc: - db.accLeaves.del(accPath) + discard db.accLeaves.refresh(accPath, v[0]) for mixPath, v in txFrame.snapshot.sto: - db.stoLeaves.del(mixPath) + discard db.stoLeaves.refresh(mixPath, v[0]) for accPath, vtx in txFrame.accLeaves: - db.accLeaves.del(accPath) + discard db.accLeaves.refresh(accPath, vtx) for mixPath, vtx in txFrame.stoLeaves: - db.stoLeaves.del(mixPath) + discard db.stoLeaves.refresh(mixPath, vtx) txFrame.snapshot.vtx.clear() txFrame.snapshot.acc.clear() diff --git a/vendor/nim-minilru b/vendor/nim-minilru index 0c4b2bce95..b6a279c0cb 160000 --- a/vendor/nim-minilru +++ b/vendor/nim-minilru @@ -1 +1 @@ -Subproject commit 0c4b2bce959591f0a862e9b541ba43c6d0cf3476 +Subproject commit b6a279c0cb197a6c8520e79340c7ce6f7dd41686 From faceb444276923f4fe19774916ad2ee3a930fa05 Mon Sep 17 00:00:00 2001 From: bhartnett Date: Fri, 29 Aug 2025 10:00:37 +0800 Subject: [PATCH 4/4] Update nim-minilru to master branch. --- vendor/nim-minilru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/nim-minilru b/vendor/nim-minilru index b6a279c0cb..aba86fcf59 160000 --- a/vendor/nim-minilru +++ b/vendor/nim-minilru @@ -1 +1 @@ -Subproject commit b6a279c0cb197a6c8520e79340c7ce6f7dd41686 +Subproject commit aba86fcf59597f5d43875751d478732100456d1f