Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit e8e9b65

Browse files
committed
Revive the speed of batching the full trie persist
1 parent 1bb4097 commit e8e9b65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eth/db/chain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ def get(self, key: bytes) -> bytes:
377377
return self.db[key]
378378

379379
def persist_trie_data_dict(self, trie_data_dict: Dict[Hash32, bytes]) -> None:
380-
self._persist_trie_data_dict(self.db, trie_data_dict)
380+
with self.db.atomic_batch() as db:
381+
self._persist_trie_data_dict(db, trie_data_dict)
381382

382383
@classmethod
383384
def _persist_trie_data_dict(cls, db: DatabaseAPI, trie_data_dict: Dict[Hash32, bytes]) -> None:

0 commit comments

Comments
 (0)