Skip to content

Commit 4ae4485

Browse files
authored
Include removals in declare_proof_of_space (#19364)
1 parent 91b57a2 commit 4ae4485

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

chia/_tests/core/mempool/test_mempool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,7 @@ async def local_get_unspent_lineage_info(ph: bytes32) -> Optional[UnspentLineage
29592959

29602960
result = await mempool.create_block_generator(local_get_unspent_lineage_info, DEFAULT_CONSTANTS, uint32(10))
29612961
assert result is not None
2962-
generator, _, _ = result
2962+
generator, _, _, _ = result
29632963

29642964
assert called == 3
29652965
assert generator.program == SerializedProgram.from_bytes(bytes.fromhex("ff01ff8080"))
@@ -3249,7 +3249,7 @@ async def get_unspent_lineage_info_for_puzzle_hash(_: bytes32) -> Optional[Unspe
32493249

32503250
block = await mempool.create_block_generator(get_unspent_lineage_info_for_puzzle_hash, test_constants, uint32(0))
32513251
assert block is not None
3252-
generator, signature, additions = block
3252+
generator, signature, additions, _ = block
32533253

32543254
assert set(additions) == expected_additions
32553255

chia/full_node/full_node_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ async def declare_proof_of_space(
865865
try:
866866
block = await self.full_node.mempool_manager.create_block_generator(curr_l_tb.header_hash)
867867
if block is not None:
868-
block_generator, aggregate_signature, additions = block
868+
block_generator, aggregate_signature, additions, removals = block
869869
except Exception as e:
870870
self.log.error(f"Traceback: {traceback.format_exc()}")
871871
self.full_node.log.error(f"Error making spend bundle {e} peak: {peak}")

chia/full_node/mempool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ async def create_block_generator(
493493
constants: ConsensusConstants,
494494
height: uint32,
495495
item_inclusion_filter: Optional[Callable[[bytes32], bool]] = None,
496-
) -> Optional[tuple[BlockGenerator, G2Element, list[Coin]]]:
496+
) -> Optional[tuple[BlockGenerator, G2Element, list[Coin], list[Coin]]]:
497497
"""
498498
height is needed in case we fast-forward a transaction and we need to
499499
re-run its puzzle.
@@ -525,6 +525,7 @@ async def create_block_generator(
525525
BlockGenerator(SerializedProgram.from_bytes(block_program), []),
526526
spend_bundle.aggregated_signature,
527527
additions,
528+
removals,
528529
)
529530

530531
async def create_bundle_from_mempool_items(

chia/full_node/mempool_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ async def create_block_generator(
247247
self,
248248
last_tb_header_hash: bytes32,
249249
item_inclusion_filter: Optional[Callable[[bytes32], bool]] = None,
250-
) -> Optional[tuple[BlockGenerator, G2Element, list[Coin]]]:
250+
) -> Optional[tuple[BlockGenerator, G2Element, list[Coin], list[Coin]]]:
251251
"""
252-
Returns a block generator program, the aggregate signature and all additions, for a new block
252+
Returns a block generator program, the aggregate signature and all additions and removals, for a new block
253253
"""
254254
if self.peak is None or self.peak.header_hash != last_tb_header_hash:
255255
return None

0 commit comments

Comments
 (0)