Skip to content

Commit 75758c9

Browse files
authored
remove DataStore.process_merkle_blob_queries() (#19544)
remove `DataStore.process_merkle_blob_queries()
1 parent 7969c6d commit 75758c9

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

chia/data_layer/data_store.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import shutil
88
import sqlite3
99
from collections import defaultdict
10-
from collections.abc import AsyncIterator, Awaitable, Collection, Mapping
10+
from collections.abc import AsyncIterator, Awaitable, Collection
1111
from contextlib import asynccontextmanager
1212
from dataclasses import dataclass, replace
1313
from hashlib import sha256
@@ -226,28 +226,6 @@ async def insert_into_data_store_from_file(
226226
# Don't store these blob objects into cache, since their data structures are not calculated yet.
227227
await self.insert_root_from_merkle_blob(merkle_blob, store_id, Status.COMMITTED, update_cache=False)
228228

229-
async def process_merkle_blob_queries(
230-
self,
231-
store_id: bytes32,
232-
queries: Mapping[bytes32, list[TreeIndex]],
233-
) -> tuple[dict[bytes32, tuple[bytes32, bytes32]], dict[bytes32, tuple[KeyId, ValueId]]]:
234-
internal_nodes: dict[bytes32, tuple[bytes32, bytes32]] = {}
235-
terminal_nodes: dict[bytes32, tuple[KeyId, ValueId]] = {}
236-
237-
for root_hash_blob, indexes in queries.items():
238-
merkle_blob = await self.get_merkle_blob(store_id=store_id, root_hash=root_hash_blob, read_only=True)
239-
for index in indexes:
240-
nodes = merkle_blob.get_nodes_with_indexes(index=index)
241-
# TODO: consider implementing all or in part in rust for potential speedup
242-
index_to_hash = {index: node.hash for index, node in nodes}
243-
for _, node in nodes:
244-
if isinstance(node, chia_rs.datalayer.LeafNode):
245-
terminal_nodes[node.hash] = (node.key, node.value)
246-
elif isinstance(node, chia_rs.datalayer.InternalNode):
247-
internal_nodes[node.hash] = (index_to_hash[node.left], index_to_hash[node.right])
248-
249-
return internal_nodes, terminal_nodes
250-
251229
async def build_merkle_blob_queries_for_missing_hashes(
252230
self,
253231
missing_hashes: Collection[bytes32],

0 commit comments

Comments
 (0)