Skip to content

Commit 2708a7e

Browse files
authored
checkpoint: into main from release/2.5.5 @ b1cc0a5 (#19955)
Source hash: b1cc0a5 Remaining commits: 1
2 parents 305d446 + a3a3b01 commit 2708a7e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

chia/_tests/core/mempool/test_singleton_fast_forward.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,4 +663,4 @@ async def test_double_spend_ff_spend_no_latest_unspent() -> None:
663663
status, error = await make_and_send_spend_bundle(sim, sim_client, [singleton_coin_spend], aggsig=sig)
664664
# It fails validation because it doesn't currently have a latest unspent
665665
assert status == MempoolInclusionStatus.FAILED
666-
assert error == Err.DOUBLE_SPEND
666+
assert error == Err.UNKNOWN_UNSPENT

chia/full_node/mempool_manager.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,16 @@ async def validate_spend_bundle(
625625
eligible_for_ff = bool(spend_conds.flags & ELIGIBLE_FOR_FF) and supports_fast_forward(coin_spend)
626626
if eligible_for_ff:
627627
# Make sure the fast forward spend still has a version that is
628-
# still unspent, because if the singleton has been melted, the
629-
# fast forward spend will never become valid.
628+
# still unspent, because if the singleton has been spent in a
629+
# non-FF spend, this fast forward spend will never become valid.
630+
# So treat this as a normal spend, which requires the exact coin
631+
# to exist and be unspent.
632+
# Singletons that were created before the optimization of using
633+
# spent_index will also fail this test, and such spends will
634+
# fall back to be treated as non-FF spends.
630635
lineage_info = await get_unspent_lineage_info_for_puzzle_hash(spend_conds.puzzle_hash)
631636
if lineage_info is None:
632-
return Err.DOUBLE_SPEND, None, []
637+
eligible_for_ff = False
633638

634639
spend_additions = []
635640
for puzzle_hash, amount, _ in spend_conds.create_coin:

0 commit comments

Comments
 (0)