@@ -240,6 +240,7 @@ fn mempool_walk_over_fork() {
240
240
& mut chainstate,
241
241
& block. 0 ,
242
242
& block. 1 ,
243
+ true ,
243
244
txid,
244
245
tx_bytes,
245
246
tx_fee,
@@ -275,7 +276,6 @@ fn mempool_walk_over_fork() {
275
276
. iterate_candidates :: < _ , ChainstateError , _ > (
276
277
clarity_conn,
277
278
& mut tx_events,
278
- 2 ,
279
279
mempool_settings. clone ( ) ,
280
280
|_, available_tx, _| {
281
281
count_txs += 1 ;
@@ -314,7 +314,6 @@ fn mempool_walk_over_fork() {
314
314
. iterate_candidates :: < _ , ChainstateError , _ > (
315
315
clarity_conn,
316
316
& mut tx_events,
317
- 2 ,
318
317
mempool_settings. clone ( ) ,
319
318
|_, available_tx, _| {
320
319
count_txs += 1 ;
@@ -352,7 +351,6 @@ fn mempool_walk_over_fork() {
352
351
. iterate_candidates :: < _ , ChainstateError , _ > (
353
352
clarity_conn,
354
353
& mut tx_events,
355
- 3 ,
356
354
mempool_settings. clone ( ) ,
357
355
|_, available_tx, _| {
358
356
count_txs += 1 ;
@@ -395,7 +393,6 @@ fn mempool_walk_over_fork() {
395
393
. iterate_candidates :: < _ , ChainstateError , _ > (
396
394
clarity_conn,
397
395
& mut tx_events,
398
- 2 ,
399
396
mempool_settings. clone ( ) ,
400
397
|_, available_tx, _| {
401
398
count_txs += 1 ;
@@ -436,7 +433,6 @@ fn mempool_walk_over_fork() {
436
433
. iterate_candidates :: < _ , ChainstateError , _ > (
437
434
clarity_conn,
438
435
& mut tx_events,
439
- 3 ,
440
436
mempool_settings. clone ( ) ,
441
437
|_, available_tx, _| {
442
438
count_txs += 1 ;
@@ -498,6 +494,7 @@ fn mempool_walk_over_fork() {
498
494
& mut chainstate,
499
495
& block. 0 ,
500
496
& block. 1 ,
497
+ true ,
501
498
txid,
502
499
tx_bytes,
503
500
tx_fee,
@@ -551,6 +548,7 @@ fn mempool_walk_over_fork() {
551
548
& mut chainstate,
552
549
& block. 0 ,
553
550
& block. 1 ,
551
+ true ,
554
552
txid,
555
553
tx_bytes,
556
554
tx_fee,
@@ -630,6 +628,7 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
630
628
& mut chainstate,
631
629
& b_1. 0 ,
632
630
& b_1. 1 ,
631
+ true ,
633
632
txid,
634
633
tx_bytes,
635
634
tx_fee,
@@ -672,7 +671,6 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
672
671
. iterate_candidates :: < _ , ChainstateError , _ > (
673
672
clarity_conn,
674
673
& mut tx_events,
675
- 2 ,
676
674
mempool_settings. clone ( ) ,
677
675
|_, available_tx, _| {
678
676
count_txs += 1 ;
@@ -710,7 +708,6 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
710
708
. iterate_candidates :: < _ , ChainstateError , _ > (
711
709
clarity_conn,
712
710
& mut tx_events,
713
- 2 ,
714
711
mempool_settings. clone ( ) ,
715
712
|_, available_tx, _| {
716
713
count_txs += 1 ;
@@ -748,7 +745,6 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
748
745
. iterate_candidates :: < _ , ChainstateError , _ > (
749
746
clarity_conn,
750
747
& mut tx_events,
751
- 2 ,
752
748
mempool_settings. clone ( ) ,
753
749
|_, available_tx, _| {
754
750
count_txs += 1 ;
@@ -826,6 +822,7 @@ fn test_iterate_candidates_skipped_transaction() {
826
822
& mut chainstate,
827
823
& b_1. 0 ,
828
824
& b_1. 1 ,
825
+ true ,
829
826
txid,
830
827
tx_bytes,
831
828
tx_fee,
@@ -850,7 +847,6 @@ fn test_iterate_candidates_skipped_transaction() {
850
847
. iterate_candidates :: < _ , ChainstateError , _ > (
851
848
clarity_conn,
852
849
& mut tx_events,
853
- 2 ,
854
850
mempool_settings. clone ( ) ,
855
851
|_, available_tx, _| {
856
852
count_txs += 1 ;
@@ -939,6 +935,7 @@ fn test_iterate_candidates_processing_error_transaction() {
939
935
& mut chainstate,
940
936
& b_1. 0 ,
941
937
& b_1. 1 ,
938
+ true ,
942
939
txid,
943
940
tx_bytes,
944
941
tx_fee,
@@ -963,7 +960,6 @@ fn test_iterate_candidates_processing_error_transaction() {
963
960
. iterate_candidates :: < _ , ChainstateError , _ > (
964
961
clarity_conn,
965
962
& mut tx_events,
966
- 2 ,
967
963
mempool_settings. clone ( ) ,
968
964
|_, available_tx, _| {
969
965
count_txs += 1 ;
@@ -1054,6 +1050,7 @@ fn test_iterate_candidates_problematic_transaction() {
1054
1050
& mut chainstate,
1055
1051
& b_1. 0 ,
1056
1052
& b_1. 1 ,
1053
+ true ,
1057
1054
txid,
1058
1055
tx_bytes,
1059
1056
tx_fee,
@@ -1078,7 +1075,6 @@ fn test_iterate_candidates_problematic_transaction() {
1078
1075
. iterate_candidates :: < _ , ChainstateError , _ > (
1079
1076
clarity_conn,
1080
1077
& mut tx_events,
1081
- 2 ,
1082
1078
mempool_settings. clone ( ) ,
1083
1079
|_, available_tx, _| {
1084
1080
count_txs += 1 ;
@@ -1183,6 +1179,7 @@ fn test_iterate_candidates_concurrent_write_lock() {
1183
1179
& mut chainstate,
1184
1180
& b_1. 0 ,
1185
1181
& b_1. 1 ,
1182
+ true ,
1186
1183
txid,
1187
1184
tx_bytes,
1188
1185
tx_fee,
@@ -1239,7 +1236,6 @@ fn test_iterate_candidates_concurrent_write_lock() {
1239
1236
. iterate_candidates :: < _ , ChainstateError , _ > (
1240
1237
clarity_conn,
1241
1238
& mut tx_events,
1242
- 2 ,
1243
1239
mempool_settings. clone ( ) ,
1244
1240
|_, available_tx, _| {
1245
1241
count_txs += 1 ;
@@ -1342,6 +1338,7 @@ fn mempool_do_not_replace_tx() {
1342
1338
& mut chainstate,
1343
1339
& b_1. 0 ,
1344
1340
& b_1. 1 ,
1341
+ true ,
1345
1342
txid,
1346
1343
tx_bytes,
1347
1344
tx_fee,
@@ -1370,6 +1367,7 @@ fn mempool_do_not_replace_tx() {
1370
1367
& mut chainstate,
1371
1368
& b_2. 0 ,
1372
1369
& b_2. 1 ,
1370
+ true ,
1373
1371
txid,
1374
1372
tx_bytes,
1375
1373
tx_fee,
@@ -1446,6 +1444,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
1446
1444
& mut chainstate,
1447
1445
& ConsensusHash ( [ 0x1 ; 20 ] ) ,
1448
1446
& BlockHeaderHash ( [ 0x2 ; 32 ] ) ,
1447
+ false , // don't resolve the above chain tip since it doesn't exist
1449
1448
txid,
1450
1449
tx_bytes,
1451
1450
tx_fee,
@@ -1471,12 +1470,15 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
1471
1470
assert_eq ! ( tx_info. metadata. origin_nonce, origin_nonce) ;
1472
1471
assert_eq ! ( tx_info. metadata. sponsor_address, sponsor_address) ;
1473
1472
assert_eq ! ( tx_info. metadata. sponsor_nonce, sponsor_nonce) ;
1474
- assert_eq ! ( tx_info. metadata. consensus_hash, ConsensusHash ( [ 0x1 ; 20 ] ) ) ;
1475
1473
assert_eq ! (
1476
- tx_info. metadata. block_header_hash,
1474
+ tx_info. metadata. tenure_consensus_hash,
1475
+ ConsensusHash ( [ 0x1 ; 20 ] )
1476
+ ) ;
1477
+ assert_eq ! (
1478
+ tx_info. metadata. tenure_block_header_hash,
1477
1479
BlockHeaderHash ( [ 0x2 ; 32 ] )
1478
1480
) ;
1479
- assert_eq ! ( tx_info. metadata. block_height , height) ;
1481
+ assert_eq ! ( tx_info. metadata. coinbase_height , height) ;
1480
1482
1481
1483
// test replace-by-fee with a higher fee
1482
1484
let old_txid = txid;
@@ -1503,6 +1505,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
1503
1505
& mut chainstate,
1504
1506
& ConsensusHash ( [ 0x1 ; 20 ] ) ,
1505
1507
& BlockHeaderHash ( [ 0x2 ; 32 ] ) ,
1508
+ false , // don't resolve the above chain tip since it doesn't exist
1506
1509
txid,
1507
1510
tx_bytes,
1508
1511
tx_fee,
@@ -1539,12 +1542,15 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
1539
1542
assert_eq ! ( tx_info. metadata. origin_nonce, origin_nonce) ;
1540
1543
assert_eq ! ( tx_info. metadata. sponsor_address, sponsor_address) ;
1541
1544
assert_eq ! ( tx_info. metadata. sponsor_nonce, sponsor_nonce) ;
1542
- assert_eq ! ( tx_info. metadata. consensus_hash, ConsensusHash ( [ 0x1 ; 20 ] ) ) ;
1543
1545
assert_eq ! (
1544
- tx_info. metadata. block_header_hash,
1546
+ tx_info. metadata. tenure_consensus_hash,
1547
+ ConsensusHash ( [ 0x1 ; 20 ] )
1548
+ ) ;
1549
+ assert_eq ! (
1550
+ tx_info. metadata. tenure_block_header_hash,
1545
1551
BlockHeaderHash ( [ 0x2 ; 32 ] )
1546
1552
) ;
1547
- assert_eq ! ( tx_info. metadata. block_height , height) ;
1553
+ assert_eq ! ( tx_info. metadata. coinbase_height , height) ;
1548
1554
1549
1555
// test replace-by-fee with a lower fee
1550
1556
let old_txid = txid;
@@ -1563,6 +1569,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
1563
1569
& mut chainstate,
1564
1570
& ConsensusHash ( [ 0x1 ; 20 ] ) ,
1565
1571
& BlockHeaderHash ( [ 0x2 ; 32 ] ) ,
1572
+ false , // don't resolve the above chain tip since it doesn't exist
1566
1573
txid,
1567
1574
tx_bytes,
1568
1575
tx_fee,
@@ -1622,7 +1629,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
1622
1629
let mut mempool_tx = mempool. tx_begin ( ) . unwrap ( ) ;
1623
1630
match behavior {
1624
1631
MempoolCollectionBehavior :: ByStacksHeight => {
1625
- MemPoolDB :: garbage_collect_by_height ( & mut mempool_tx, 101 , None )
1632
+ MemPoolDB :: garbage_collect_by_coinbase_height ( & mut mempool_tx, 101 , None )
1626
1633
}
1627
1634
MempoolCollectionBehavior :: ByReceiveTime => {
1628
1635
let test_max_age = Duration :: from_secs ( 1 ) ;
@@ -1712,6 +1719,7 @@ fn mempool_db_test_rbf() {
1712
1719
& mut chainstate,
1713
1720
& ConsensusHash ( [ 0x1 ; 20 ] ) ,
1714
1721
& BlockHeaderHash ( [ 0x2 ; 32 ] ) ,
1722
+ false , // don't resolve the above chain tip since it doesn't exist
1715
1723
txid,
1716
1724
tx_bytes,
1717
1725
tx_fee,
@@ -1761,6 +1769,7 @@ fn mempool_db_test_rbf() {
1761
1769
& mut chainstate,
1762
1770
& ConsensusHash ( [ 0x1 ; 20 ] ) ,
1763
1771
& BlockHeaderHash ( [ 0x2 ; 32 ] ) ,
1772
+ false , // don't resolve the above chain tip since it doesn't exist
1764
1773
txid,
1765
1774
tx_bytes,
1766
1775
tx_fee,
@@ -1843,6 +1852,7 @@ fn test_add_txs_bloom_filter() {
1843
1852
& mut chainstate,
1844
1853
& ConsensusHash ( [ 0x1 + ( block_height as u8 ) ; 20 ] ) ,
1845
1854
& BlockHeaderHash ( [ 0x2 + ( block_height as u8 ) ; 32 ] ) ,
1855
+ false , // don't resolve the above chain tip since it doesn't exist
1846
1856
txid,
1847
1857
tx_bytes,
1848
1858
tx_fee,
@@ -1953,6 +1963,7 @@ fn test_txtags() {
1953
1963
& mut chainstate,
1954
1964
& ConsensusHash ( [ 0x1 + ( block_height as u8 ) ; 20 ] ) ,
1955
1965
& BlockHeaderHash ( [ 0x2 + ( block_height as u8 ) ; 32 ] ) ,
1966
+ false , // don't resolve the above chain tip since it doesn't exist
1956
1967
txid,
1957
1968
tx_bytes,
1958
1969
tx_fee,
@@ -2046,6 +2057,7 @@ fn test_make_mempool_sync_data() {
2046
2057
& mut chainstate,
2047
2058
& ConsensusHash ( [ 0x1 + ( block_height as u8 ) ; 20 ] ) ,
2048
2059
& BlockHeaderHash ( [ 0x2 + ( block_height as u8 ) ; 32 ] ) ,
2060
+ false , // don't resolve the above chain tip since it doesn't exist
2049
2061
txid. clone ( ) ,
2050
2062
tx_bytes,
2051
2063
tx_fee,
@@ -2084,7 +2096,7 @@ fn test_make_mempool_sync_data() {
2084
2096
let recent_txids = mempool. get_bloom_txids ( ) . unwrap ( ) ;
2085
2097
assert ! ( recent_txids. len( ) <= MAX_BLOOM_COUNTER_TXS as usize ) ;
2086
2098
2087
- let max_height = MemPoolDB :: get_max_height ( mempool. conn ( ) )
2099
+ let max_height = MemPoolDB :: get_max_coinbase_height ( mempool. conn ( ) )
2088
2100
. unwrap ( )
2089
2101
. unwrap_or ( 0 ) ;
2090
2102
eprintln ! (
@@ -2223,6 +2235,7 @@ fn test_find_next_missing_transactions() {
2223
2235
& mut chainstate,
2224
2236
& ConsensusHash ( [ 0x1 + ( block_height as u8 ) ; 20 ] ) ,
2225
2237
& BlockHeaderHash ( [ 0x2 + ( block_height as u8 ) ; 32 ] ) ,
2238
+ false , // don't resolve the above chain tip since it doesn't exist
2226
2239
txid. clone ( ) ,
2227
2240
tx_bytes,
2228
2241
tx_fee,
@@ -2492,6 +2505,7 @@ fn test_drop_and_blacklist_txs_by_time() {
2492
2505
& mut chainstate,
2493
2506
& ConsensusHash ( [ 0x1 + ( block_height as u8 ) ; 20 ] ) ,
2494
2507
& BlockHeaderHash ( [ 0x2 + ( block_height as u8 ) ; 32 ] ) ,
2508
+ false , // don't resolve the above chain tip since it doesn't exist
2495
2509
txid. clone ( ) ,
2496
2510
tx_bytes,
2497
2511
tx_fee,
@@ -2611,6 +2625,7 @@ fn test_drop_and_blacklist_txs_by_size() {
2611
2625
& mut chainstate,
2612
2626
& ConsensusHash ( [ 0x1 + ( block_height as u8 ) ; 20 ] ) ,
2613
2627
& BlockHeaderHash ( [ 0x2 + ( block_height as u8 ) ; 32 ] ) ,
2628
+ false , // don't resolve the above chain tip since it doesn't exist
2614
2629
txid. clone ( ) ,
2615
2630
tx_bytes,
2616
2631
tx_fee,
@@ -2728,6 +2743,7 @@ fn test_filter_txs_by_type() {
2728
2743
& mut chainstate,
2729
2744
& b_2. 0 ,
2730
2745
& b_2. 1 ,
2746
+ true ,
2731
2747
txid. clone ( ) ,
2732
2748
tx_bytes,
2733
2749
tx_fee,
@@ -2763,7 +2779,6 @@ fn test_filter_txs_by_type() {
2763
2779
. iterate_candidates :: < _ , ChainstateError , _ > (
2764
2780
clarity_conn,
2765
2781
& mut tx_events,
2766
- 2 ,
2767
2782
mempool_settings. clone ( ) ,
2768
2783
|_, available_tx, _| {
2769
2784
count_txs += 1 ;
@@ -2799,7 +2814,6 @@ fn test_filter_txs_by_type() {
2799
2814
. iterate_candidates :: < _ , ChainstateError , _ > (
2800
2815
clarity_conn,
2801
2816
& mut tx_events,
2802
- 2 ,
2803
2817
mempool_settings. clone ( ) ,
2804
2818
|_, available_tx, _| {
2805
2819
count_txs += 1 ;
0 commit comments