chia-blockchain 2.5.5rc3__py3-none-any.whl → 2.5.5rc4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3161,3 +3161,53 @@ def test_check_removals(case: CheckRemovalsCase) -> None:
3161
3161
  assert err == expected_err
3162
3162
  assert len(conflicts) == len(expected_conflicts)
3163
3163
  assert set(conflicts) == set(expected_conflicts)
3164
+
3165
+
3166
+ @pytest.mark.anyio
3167
+ async def test_new_peak_deferred_ff_items() -> None:
3168
+ """
3169
+ Covers the case where we update lineage info for multiple fast forward
3170
+ singletons at new peak.
3171
+ """
3172
+ singleton_spend1 = make_singleton_spend(bytes32([1] * 32))
3173
+ singleton1_id = singleton_spend1.coin.name()
3174
+ singleton_spend2 = make_singleton_spend(bytes32([2] * 32))
3175
+ singleton2_id = singleton_spend2.coin.name()
3176
+ coins = TestCoins(
3177
+ [singleton_spend1.coin, singleton_spend2.coin, TEST_COIN, TEST_COIN2],
3178
+ {
3179
+ singleton_spend1.coin.puzzle_hash: singleton_spend1.coin,
3180
+ singleton_spend2.coin.puzzle_hash: singleton_spend2.coin,
3181
+ },
3182
+ )
3183
+ mempool_manager = await setup_mempool(coins)
3184
+ # Let's submit the two singletons transactions to the mempool
3185
+ sb_names = []
3186
+ for singleton_spend, regular_coin in [(singleton_spend1, TEST_COIN), (singleton_spend2, TEST_COIN2)]:
3187
+ sb = SpendBundle([singleton_spend, mk_coin_spend(regular_coin)], G2Element())
3188
+ sb_name = sb.name()
3189
+ await mempool_manager.add_spend_bundle(
3190
+ sb,
3191
+ make_test_conds(spend_ids=[(singleton_spend.coin, ELIGIBLE_FOR_FF), (regular_coin, 0)], cost=1337),
3192
+ sb_name,
3193
+ uint32(1),
3194
+ )
3195
+ assert mempool_manager.get_mempool_item(sb_name) is not None
3196
+ sb_names.append(sb_name)
3197
+ # Let's advance the mempool by spending these singletons into new lineages
3198
+ singleton1_new_latest = Coin(singleton1_id, singleton_spend1.coin.puzzle_hash, singleton_spend1.coin.amount)
3199
+ coins.update_lineage(singleton_spend1.coin.puzzle_hash, singleton1_new_latest)
3200
+ singleton2_new_latest = Coin(singleton2_id, singleton_spend2.coin.puzzle_hash, singleton_spend2.coin.amount)
3201
+ coins.update_lineage(singleton_spend2.coin.puzzle_hash, singleton2_new_latest)
3202
+ await advance_mempool(mempool_manager, [singleton1_id, singleton2_id], use_optimization=True)
3203
+ # Both items should get updated with their related latest lineages
3204
+ mi1 = mempool_manager.get_mempool_item(sb_names[0])
3205
+ assert mi1 is not None
3206
+ latest_singleton_lineage1 = mi1.bundle_coin_spends[singleton1_id].latest_singleton_lineage
3207
+ assert latest_singleton_lineage1 is not None
3208
+ assert latest_singleton_lineage1.coin_id == singleton1_new_latest.name()
3209
+ mi2 = mempool_manager.get_mempool_item(sb_names[1])
3210
+ assert mi2 is not None
3211
+ latest_singleton_lineage2 = mi2.bundle_coin_spends[singleton2_id].latest_singleton_lineage
3212
+ assert latest_singleton_lineage2 is not None
3213
+ assert latest_singleton_lineage2.coin_id == singleton2_new_latest.name()
@@ -843,7 +843,7 @@ class MempoolManager:
843
843
  # rebasing a fast forward spend is more expensive than to just
844
844
  # evict the item. So, any FF spend we may need to rebase, defer
845
845
  # them until after we've gone through all spends
846
- deferred_ff_items: set[tuple[bytes32, bytes32]] = set()
846
+ deferred_ff_items: set[tuple[bytes32, MempoolItem]] = set()
847
847
 
848
848
  for spend in spent_coins:
849
849
  items = self.mempool.get_items_by_coin_id(spend)
@@ -866,7 +866,7 @@ class MempoolManager:
866
866
  spendbundle_ids_to_remove.add(item_name)
867
867
  continue
868
868
 
869
- deferred_ff_items.add((spend, item_name))
869
+ deferred_ff_items.add((spend, item))
870
870
 
871
871
  # fast forward spends are indexed under the latest singleton coin ID
872
872
  # if it's spent, we need to update the index in the mempool. This
@@ -874,7 +874,8 @@ class MempoolManager:
874
874
  # new_coin_id, current_coin_id, mempool item name
875
875
  spends_to_update: list[tuple[bytes32, bytes32, bytes32]] = []
876
876
 
877
- for spend, item_name in deferred_ff_items:
877
+ for spend, item in deferred_ff_items:
878
+ item_name = item.spend_bundle_name
878
879
  if item_name in spendbundle_ids_to_remove:
879
880
  continue
880
881
  # there may be multiple matching spends in the mempool
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: chia-blockchain
3
- Version: 2.5.5rc3
3
+ Version: 2.5.5rc4
4
4
  Summary: Chia blockchain full node, farmer, timelord, and wallet.
5
5
  License: Apache-2.0
6
6
  Keywords: chia,blockchain,node
@@ -125,7 +125,7 @@ chia/_tests/core/mempool/test_mempool.py,sha256=3U4SzpN9JAfaC2OJDR0rSusz9Jj1SDl2
125
125
  chia/_tests/core/mempool/test_mempool_fee_estimator.py,sha256=HDUVrV6tNq1w2v7Rq-FGXFrCspnHVoSQfPOKRmwojmw,3711
126
126
  chia/_tests/core/mempool/test_mempool_fee_protocol.py,sha256=XUTKqs82IOiiZMGPTPSRhB4Zp8clbus5GlOoUtPtL6A,2165
127
127
  chia/_tests/core/mempool/test_mempool_item_queries.py,sha256=k8tM3axB-fdZwN2NqCAcir-4yslSM8AJIQ0QvEJK9V8,6959
128
- chia/_tests/core/mempool/test_mempool_manager.py,sha256=vQr4LJCzQas-k7n10F0pKX1VA8OD1uT1k6UFkySXwbU,141627
128
+ chia/_tests/core/mempool/test_mempool_manager.py,sha256=Qeo6rJChjKvAzq-HUteRQ05InDDmtBp2mwR-e8tfS_0,144246
129
129
  chia/_tests/core/mempool/test_mempool_performance.py,sha256=a5bLSJ_Q_EVYnUHn96I5RC7VZl7niizBK47yVnzvWn4,2935
130
130
  chia/_tests/core/mempool/test_singleton_fast_forward.py,sha256=Fk85FJRgEHwrc_n2k8jTzsunlWdNdLCYh8MqpG-egt8,35060
131
131
  chia/_tests/core/node_height.py,sha256=yfkEmmYCsAb3cIe1ZhtE9J2SFB9lG_49SgjxsITdrZk,917
@@ -544,7 +544,7 @@ chia/full_node/hint_management.py,sha256=8dVKguFPm-h32GEnMWxX2qyITo4WVO1YBKaPFKC
544
544
  chia/full_node/hint_store.py,sha256=0m6y0_f0rhGIKqfAmhFSGEeyM3LCN-dv-bR1OfIr4Uo,3666
545
545
  chia/full_node/mempool.py,sha256=x8Uo5xy1jcxXQgYaPUU2JkRsu9edndYs0hye3fFoZbk,33795
546
546
  chia/full_node/mempool_check_conditions.py,sha256=19_uUO8SCVrkJHEUDw0i0NVWwJyXc7BaAQQdVJSVqIE,3583
547
- chia/full_node/mempool_manager.py,sha256=MyLJ_wOS-5ICCHQRdh3EofmeIZbYC-sEzFuABDF6dB8,50020
547
+ chia/full_node/mempool_manager.py,sha256=tUw-N3r67BQFIekx2wSgXmMoN7Gcn5IfI0BqphsCpAg,50065
548
548
  chia/full_node/pending_tx_cache.py,sha256=jEL004L7r1n7ppeSdLVe6nsVNfYw0jU86DHmRYe1rH4,3657
549
549
  chia/full_node/subscriptions.py,sha256=-3Mjv08_Z1iBUoXgGoHZvYPyTfkVHyWXhHJH2DWwx9A,8659
550
550
  chia/full_node/sync_store.py,sha256=pyjhiUVe_5CXJd8r-lk0-VpFbkX2RtO5N-370W47Rko,5206
@@ -891,8 +891,8 @@ chia/wallet/wallet_user_store.py,sha256=rXiQpk5g8t1X0Chx0bValcQsHonjB1oQ_F_K16bp
891
891
  chia/wallet/wallet_weight_proof_handler.py,sha256=IcQg_w8EPjpS9xwmEE8GvPcneLePOtu74wWUu1l5uuM,4875
892
892
  chia/wallet/wsm_apis.py,sha256=6LmxbHXC-tqNbRyoiGgz-f19PF1nEfMbfm3BTnsNQ6s,3914
893
893
  mozilla-ca/cacert.pem,sha256=qz7jZRl3pBeKcCsLgopO57K7uRJyNbCrdA4uFZdL9ds,222971
894
- chia_blockchain-2.5.5rc3.dist-info/LICENSE,sha256=0tuU-jTzeRDJJaxF2YCEpBwbywgpbrVSXq1i6fJq63U,11347
895
- chia_blockchain-2.5.5rc3.dist-info/METADATA,sha256=jPO2fn-pvvZ1oWncBQZ8bCpscbiPec74CeEIXsMrOW4,10687
896
- chia_blockchain-2.5.5rc3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
897
- chia_blockchain-2.5.5rc3.dist-info/entry_points.txt,sha256=GL2-UvicPVdKz72IP4shnmV3XImfoD5pMzoURfoAYk4,742
898
- chia_blockchain-2.5.5rc3.dist-info/RECORD,,
894
+ chia_blockchain-2.5.5rc4.dist-info/LICENSE,sha256=0tuU-jTzeRDJJaxF2YCEpBwbywgpbrVSXq1i6fJq63U,11347
895
+ chia_blockchain-2.5.5rc4.dist-info/METADATA,sha256=7zD_mYhVB8UIXks054o9_hqJdERGFNBqF-LLGapzBoE,10687
896
+ chia_blockchain-2.5.5rc4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
897
+ chia_blockchain-2.5.5rc4.dist-info/entry_points.txt,sha256=GL2-UvicPVdKz72IP4shnmV3XImfoD5pMzoURfoAYk4,742
898
+ chia_blockchain-2.5.5rc4.dist-info/RECORD,,