Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
fchirica committed Jan 30, 2025
1 parent 942ad22 commit d07eefc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions chia/_tests/core/data_layer/test_data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,7 @@ async def test_data_server_files(
counter = 0
num_repeats = 2

# Repeat twice to guarantee there will be hashes from the old file format
for _ in range(num_repeats):
for batch in range(num_batches):
changelist: list[dict[str, Any]] = []
Expand Down
1 change: 1 addition & 0 deletions chia/data_layer/data_layer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def key_hash(key: bytes) -> bytes32:
return bytes32(sha256(b"\1" + key).digest())


# TODO: allow Optional[bytes32] for `node_hash` and resolve the filenames here
def get_full_tree_filename(store_id: bytes32, node_hash: bytes32, generation: int, group_by_store: bool = False) -> str:
if group_by_store:
return f"{store_id}/{node_hash}-full-{generation}-v1.0.dat"
Expand Down
1 change: 1 addition & 0 deletions chia/data_layer/data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ async def insert_into_data_store_from_file(
if node_hash not in internal_nodes and node_hash not in terminal_nodes:
missing_hashes.append(node_hash)

# TODO: consider adding transactions aroud this code
root = await self.get_tree_root(store_id=store_id)
latest_blob = await self.get_merkle_blob(root.node_hash, read_only=True)
known_hashes: dict[bytes32, TreeIndex] = {}
Expand Down

0 comments on commit d07eefc

Please sign in to comment.