Skip to content

Commit 762e44b

Browse files
authored
Merge pull request #6243 from fdefelici/refactor/regtest-controller-cleanup
refactor: regtest controller cleanup
2 parents e8a60a7 + bd84896 commit 762e44b

File tree

11 files changed

+734
-315
lines changed

11 files changed

+734
-315
lines changed

stacks-node/src/burnchains/bitcoin_regtest_controller.rs

Lines changed: 725 additions & 273 deletions
Large diffs are not rendered by default.

stacks-node/src/burnchains/mocknet_controller.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ impl BurnchainController for MocknetController {
167167
_epoch_id: StacksEpochId,
168168
operation: BlockstackOperationType,
169169
_op_signer: &mut BurnchainOpSigner,
170-
_attempt: u64,
171170
) -> Result<Txid, BurnchainControllerError> {
172171
let txid = operation.txid();
173172
self.queued_operations.push_back(operation);

stacks-node/src/burnchains/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub trait BurnchainController {
6060
epoch_id: StacksEpochId,
6161
operation: BlockstackOperationType,
6262
op_signer: &mut BurnchainOpSigner,
63-
attempt: u64,
6463
) -> Result<Txid, Error>;
6564
fn sync(&mut self, target_block_height_opt: Option<u64>) -> Result<(BurnchainTip, u64), Error>;
6665
fn sortdb_ref(&self) -> &SortitionDB;

stacks-node/src/nakamoto_node/relayer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ impl RelayerThread {
961961
let mut op_signer = self.keychain.generate_op_signer();
962962
if let Ok(txid) = self
963963
.bitcoin_controller
964-
.submit_operation(cur_epoch, op, &mut op_signer, 1)
964+
.submit_operation(cur_epoch, op, &mut op_signer)
965965
{
966966
// advance key registration state
967967
self.last_vrf_key_burn_height = Some(burn_block.block_height);
@@ -1664,7 +1664,6 @@ impl RelayerThread {
16641664
*last_committed.get_epoch_id(),
16651665
BlockstackOperationType::LeaderBlockCommit(last_committed.get_block_commit().clone()),
16661666
&mut op_signer,
1667-
1,
16681667
);
16691668
let txid = match res {
16701669
Ok(txid) => txid,

stacks-node/src/neon_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,7 +2745,7 @@ impl BlockMinerThread {
27452745
..
27462746
} = self.config.get_node_config(false);
27472747

2748-
let res = bitcoin_controller.submit_operation(target_epoch_id, op, &mut op_signer, attempt);
2748+
let res = bitcoin_controller.submit_operation(target_epoch_id, op, &mut op_signer);
27492749
match res {
27502750
Ok(_) => {
27512751
self.failed_to_submit_last_attempt = false;
@@ -3613,7 +3613,7 @@ impl RelayerThread {
36133613
let mut one_off_signer = self.keychain.generate_op_signer();
36143614
if let Ok(txid) =
36153615
self.bitcoin_controller
3616-
.submit_operation(cur_epoch, op, &mut one_off_signer, 1)
3616+
.submit_operation(cur_epoch, op, &mut one_off_signer)
36173617
{
36183618
// advance key registration state
36193619
self.last_vrf_key_burn_height = burn_block.block_height;

stacks-node/src/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ impl Node {
560560
let key_reg_op = self.generate_leader_key_register_op(vrf_pk, &consensus_hash);
561561
let mut op_signer = self.keychain.generate_op_signer();
562562
let key_txid = burnchain_controller
563-
.submit_operation(cur_epoch.epoch_id, key_reg_op, &mut op_signer, 1)
563+
.submit_operation(cur_epoch.epoch_id, key_reg_op, &mut op_signer)
564564
.expect("FATAL: failed to submit leader key register operation");
565565

566566
self.leader_key_registers.insert(key_txid);
@@ -768,7 +768,7 @@ impl Node {
768768

769769
let mut op_signer = self.keychain.generate_op_signer();
770770
let txid = burnchain_controller
771-
.submit_operation(cur_epoch.epoch_id, op, &mut op_signer, 1)
771+
.submit_operation(cur_epoch.epoch_id, op, &mut op_signer)
772772
.expect("FATAL: failed to submit block-commit");
773773

774774
self.block_commits.insert(txid);

stacks-node/src/tests/epoch_205.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,8 @@ fn transition_empty_blocks() {
627627
commit_outs,
628628
});
629629
let mut op_signer = keychain.generate_op_signer();
630-
let res = bitcoin_controller.submit_operation(
631-
StacksEpochId::Epoch2_05,
632-
op,
633-
&mut op_signer,
634-
1,
635-
);
630+
let res =
631+
bitcoin_controller.submit_operation(StacksEpochId::Epoch2_05, op, &mut op_signer);
636632
assert!(res.is_ok(), "Failed to submit block-commit");
637633
}
638634

stacks-node/src/tests/epoch_21.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ fn transition_fixes_bitcoin_rigidity() {
670670
StacksEpochId::Epoch2_05,
671671
BlockstackOperationType::PreStx(pre_stx_op),
672672
&mut miner_signer,
673-
1
674673
)
675674
.is_ok(),
676675
"Pre-stx operation should submit successfully"
@@ -705,7 +704,6 @@ fn transition_fixes_bitcoin_rigidity() {
705704
StacksEpochId::Epoch2_05,
706705
BlockstackOperationType::TransferStx(transfer_stx_op),
707706
&mut spender_signer,
708-
1
709707
)
710708
.is_ok(),
711709
"Transfer operation should submit successfully"
@@ -826,7 +824,6 @@ fn transition_fixes_bitcoin_rigidity() {
826824
StacksEpochId::Epoch21,
827825
BlockstackOperationType::PreStx(pre_stx_op),
828826
&mut miner_signer,
829-
1
830827
)
831828
.is_ok(),
832829
"Pre-stx operation should submit successfully"
@@ -857,7 +854,6 @@ fn transition_fixes_bitcoin_rigidity() {
857854
StacksEpochId::Epoch2_05,
858855
BlockstackOperationType::TransferStx(transfer_stx_op),
859856
&mut spender_signer,
860-
1
861857
)
862858
.is_ok(),
863859
"Transfer operation should submit successfully"
@@ -1899,7 +1895,7 @@ fn transition_empty_blocks() {
18991895
});
19001896
let mut op_signer = keychain.generate_op_signer();
19011897
let res =
1902-
bitcoin_controller.submit_operation(StacksEpochId::Epoch21, op, &mut op_signer, 1);
1898+
bitcoin_controller.submit_operation(StacksEpochId::Epoch21, op, &mut op_signer);
19031899
assert!(res.is_ok(), "Failed to submit block-commit");
19041900
}
19051901

stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3563,7 +3563,6 @@ fn vote_for_aggregate_key_burn_op() {
35633563
StacksEpochId::Epoch30,
35643564
BlockstackOperationType::PreStx(pre_stx_op),
35653565
&mut miner_signer,
3566-
1
35673566
)
35683567
.is_ok(),
35693568
"Pre-stx operation should submit successfully"
@@ -3633,7 +3632,6 @@ fn vote_for_aggregate_key_burn_op() {
36333632
StacksEpochId::Epoch30,
36343633
vote_for_aggregate_key_op,
36353634
&mut signer_burnop_signer,
3636-
1
36373635
)
36383636
.is_ok(),
36393637
"Vote for aggregate key operation should submit successfully"
@@ -4667,7 +4665,6 @@ fn burn_ops_integration_test() {
46674665
StacksEpochId::Epoch30,
46684666
BlockstackOperationType::PreStx(pre_stx_op),
46694667
&mut miner_signer_1,
4670-
1
46714668
)
46724669
.is_ok(),
46734670
"Pre-stx operation should submit successfully"
@@ -4691,7 +4688,6 @@ fn burn_ops_integration_test() {
46914688
StacksEpochId::Epoch30,
46924689
BlockstackOperationType::PreStx(pre_stx_op_2),
46934690
&mut miner_signer_2,
4694-
1
46954691
)
46964692
.is_ok(),
46974693
"Pre-stx operation should submit successfully"
@@ -4712,7 +4708,6 @@ fn burn_ops_integration_test() {
47124708
StacksEpochId::Epoch30,
47134709
BlockstackOperationType::PreStx(pre_stx_op_3),
47144710
&mut miner_signer_3,
4715-
1
47164711
)
47174712
.is_ok(),
47184713
"Pre-stx operation should submit successfully"
@@ -4733,7 +4728,6 @@ fn burn_ops_integration_test() {
47334728
StacksEpochId::Epoch30,
47344729
BlockstackOperationType::PreStx(pre_stx_op_4),
47354730
&mut miner_signer_4,
4736-
1
47374731
)
47384732
.is_ok(),
47394733
"Pre-stx operation should submit successfully"
@@ -4864,7 +4858,6 @@ fn burn_ops_integration_test() {
48644858
StacksEpochId::Epoch30,
48654859
BlockstackOperationType::TransferStx(transfer_stx_op),
48664860
&mut stacker_burnop_signer_1,
4867-
1
48684861
)
48694862
.is_ok(),
48704863
"Transfer STX operation should submit successfully"
@@ -4890,7 +4883,6 @@ fn burn_ops_integration_test() {
48904883
StacksEpochId::Epoch30,
48914884
BlockstackOperationType::DelegateStx(del_stx_op),
48924885
&mut stacker_burnop_signer_2,
4893-
1
48944886
)
48954887
.is_ok(),
48964888
"Delegate STX operation should submit successfully"
@@ -4920,7 +4912,6 @@ fn burn_ops_integration_test() {
49204912
StacksEpochId::Epoch30,
49214913
BlockstackOperationType::StackStx(stack_stx_op_with_some_signer_key),
49224914
&mut signer_burnop_signer_1,
4923-
1
49244915
)
49254916
.is_ok(),
49264917
"Stack STX operation should submit successfully"
@@ -4947,7 +4938,6 @@ fn burn_ops_integration_test() {
49474938
StacksEpochId::Epoch30,
49484939
BlockstackOperationType::StackStx(stack_stx_op_with_no_signer_key),
49494940
&mut signer_burnop_signer_2,
4950-
1
49514941
)
49524942
.is_ok(),
49534943
"Stack STX operation should submit successfully"

stacks-node/src/tests/neon_integrations.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,6 @@ fn stx_transfer_btc_integration_test() {
19971997
StacksEpochId::Epoch2_05,
19981998
BlockstackOperationType::PreStx(pre_stx_op),
19991999
&mut miner_signer,
2000-
1
20012000
)
20022001
.is_ok(),
20032002
"Pre-stx operation should submit successfully"
@@ -2027,7 +2026,6 @@ fn stx_transfer_btc_integration_test() {
20272026
StacksEpochId::Epoch2_05,
20282027
BlockstackOperationType::TransferStx(transfer_stx_op),
20292028
&mut spender_signer,
2030-
1
20312029
)
20322030
.is_ok(),
20332031
"Transfer operation should submit successfully"
@@ -2266,7 +2264,6 @@ fn stx_delegate_btc_integration_test() {
22662264
StacksEpochId::Epoch21,
22672265
BlockstackOperationType::PreStx(pre_stx_op),
22682266
&mut miner_signer,
2269-
1
22702267
)
22712268
.is_ok(),
22722269
"Pre-stx operation should submit successfully"
@@ -2295,7 +2292,6 @@ fn stx_delegate_btc_integration_test() {
22952292
StacksEpochId::Epoch21,
22962293
BlockstackOperationType::DelegateStx(del_stx_op),
22972294
&mut spender_signer,
2298-
1
22992295
)
23002296
.is_ok(),
23012297
"Delegate operation should submit successfully"
@@ -2555,7 +2551,6 @@ fn stack_stx_burn_op_test() {
25552551
StacksEpochId::Epoch25,
25562552
BlockstackOperationType::PreStx(pre_stx_op_1),
25572553
&mut miner_signer_1,
2558-
1
25592554
)
25602555
.is_ok(),
25612556
"Pre-stx operation should submit successfully"
@@ -2576,7 +2571,6 @@ fn stack_stx_burn_op_test() {
25762571
StacksEpochId::Epoch25,
25772572
BlockstackOperationType::PreStx(pre_stx_op_2),
25782573
&mut miner_signer_2,
2579-
1
25802574
)
25812575
.is_ok(),
25822576
"Pre-stx operation should submit successfully"
@@ -2663,7 +2657,6 @@ fn stack_stx_burn_op_test() {
26632657
StacksEpochId::Epoch25,
26642658
stack_stx_op_with_some_signer_key,
26652659
&mut spender_signer_1,
2666-
1
26672660
)
26682661
.is_ok(),
26692662
"Stack STX operation with some signer key should submit successfully"
@@ -2691,7 +2684,6 @@ fn stack_stx_burn_op_test() {
26912684
StacksEpochId::Epoch25,
26922685
stack_stx_op_with_no_signer_key,
26932686
&mut spender_signer_2,
2694-
1
26952687
)
26962688
.is_ok(),
26972689
"Stack STX operation with no signer key should submit successfully"
@@ -2991,7 +2983,6 @@ fn vote_for_aggregate_key_burn_op_test() {
29912983
StacksEpochId::Epoch25,
29922984
BlockstackOperationType::PreStx(pre_stx_op),
29932985
&mut miner_signer,
2994-
1
29952986
)
29962987
.is_ok(),
29972988
"Pre-stx operation should submit successfully"
@@ -3048,7 +3039,6 @@ fn vote_for_aggregate_key_burn_op_test() {
30483039
StacksEpochId::Epoch25,
30493040
vote_for_aggregate_key_op,
30503041
&mut spender_signer,
3051-
1
30523042
)
30533043
.is_ok(),
30543044
"Vote for aggregate key operation should submit successfully"

0 commit comments

Comments
 (0)