Skip to content

Commit 65c2eb3

Browse files
committed
address PR review
1 parent 0abb85a commit 65c2eb3

File tree

2 files changed

+6
-47
lines changed

2 files changed

+6
-47
lines changed

testnet/stacks-node/src/nakamoto_node/miner.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,6 @@ impl BlockMinerThread {
360360
self.burnchain.pox_constants.clone(),
361361
)
362362
.expect("FATAL: could not open sortition DB");
363-
let burn_tip = SortitionDB::get_canonical_burn_chain_tip(sortdb.conn())
364-
.expect("FATAL: failed to query sortition DB for canonical burn chain tip");
365363

366364
// Start the signer coordinator
367365
let mut coordinator = SignerCoordinator::new(

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11534,14 +11534,13 @@ fn multiple_miners_empty_sortition() {
1153411534

1153511535
#[test]
1153611536
#[ignore]
11537-
/// This test spins up two nakamoto nodes, both configured to mine.
11537+
/// This test spins up a single nakamoto node configured to mine.
1153811538
/// After Nakamoto blocks are mined, it waits for a normal tenure, then issues
1153911539
/// two bitcoin blocks in quick succession -- the first will contain block commits,
1154011540
/// and the second "flash block" will contain no block commits.
11541-
/// The test checks if the winner of the first block is different than the previous tenure.
11542-
/// If so, it performs the actual test: asserting that the miner wakes up and produces valid blocks.
11543-
/// This test uses the burn-block-height to ensure consistent calculation of the burn view between
11544-
/// the miner thread and the block processor
11541+
/// The test then tries to continue producing a normal tenure: issuing a bitcoin block
11542+
/// with a sortition in it.
11543+
/// The test does 3 rounds of this to make sure that the network continues producing blocks throughout.
1154511544
fn single_miner_empty_sortition() {
1154611545
if env::var("BITCOIND_TEST") != Ok("1".into()) {
1154711546
return;
@@ -11551,52 +11550,15 @@ fn single_miner_empty_sortition() {
1155111550
let sender_addr = tests::to_addr(&sender_sk);
1155211551
let send_fee = 180;
1155311552

11554-
let btc_miner_1_seed = vec![1, 1, 1, 1];
11555-
let btc_miner_1_pk = Keychain::default(btc_miner_1_seed.clone()).get_pub_key();
11556-
11557-
let node_1_rpc = gen_random_port();
11558-
let node_1_p2p = gen_random_port();
11559-
11560-
let localhost = "127.0.0.1";
11561-
let node_1_rpc_bind = format!("{localhost}:{node_1_rpc}");
11562-
11563-
let max_nakamoto_tenures = 30;
1156411553
// partition the signer set so that ~half are listening and using node 1 for RPC and events,
1156511554
// and the rest are using node 2
1156611555

11567-
let mut signer_test: SignerTest<SpawnedSigner> = SignerTest::new_with_config_modifications(
11568-
num_signers,
11569-
vec![(sender_addr, send_fee * 2 * 60 + 1000)],
11570-
|signer_config| {
11571-
let node_host = &node_1_rpc_bind;
11572-
signer_config.node_host = node_host.to_string();
11573-
},
11574-
|config| {
11575-
config.node.rpc_bind = format!("{localhost}:{node_1_rpc}");
11576-
config.node.p2p_bind = format!("{localhost}:{node_1_p2p}");
11577-
config.node.data_url = format!("http://{localhost}:{node_1_rpc}");
11578-
config.node.p2p_address = format!("{localhost}:{node_1_p2p}");
11579-
config.miner.wait_on_interim_blocks = Duration::from_secs(5);
11580-
config.node.pox_sync_sample_secs = 30;
11581-
config.burnchain.pox_reward_length = Some(max_nakamoto_tenures);
11582-
11583-
config.node.seed = btc_miner_1_seed.clone();
11584-
config.node.local_peer_seed = btc_miner_1_seed.clone();
11585-
config.burnchain.local_mining_public_key = Some(btc_miner_1_pk.to_hex());
11586-
config.miner.mining_key = Some(Secp256k1PrivateKey::from_seed(&[1]));
11587-
},
11588-
Some(vec![btc_miner_1_pk]),
11589-
None,
11590-
);
11556+
let mut signer_test: SignerTest<SpawnedSigner> =
11557+
SignerTest::new(num_signers, vec![(sender_addr, send_fee * 2 * 60 + 1000)]);
1159111558
let conf = signer_test.running_nodes.conf.clone();
1159211559

11593-
let node_1_sk = Secp256k1PrivateKey::from_seed(&conf.node.local_peer_seed);
11594-
let node_1_pk = StacksPublicKey::from_private(&node_1_sk);
11595-
1159611560
signer_test.boot_to_epoch_3();
1159711561

11598-
let pre_nakamoto_peer_1_height = get_chain_info(&conf).stacks_tip_height;
11599-
1160011562
info!("------------------------- Reached Epoch 3.0 -------------------------");
1160111563

1160211564
let burn_height_contract = "
@@ -11621,7 +11583,6 @@ fn single_miner_empty_sortition() {
1162111583
for _i in 0..3 {
1162211584
// Mine 1 nakamoto tenures
1162311585
info!("Mining tenure...");
11624-
let rl1_commits_before = rl1_commits.load(Ordering::SeqCst);
1162511586

1162611587
signer_test.mine_block_wait_on_processing(
1162711588
&[&rl1_coord_channels],

0 commit comments

Comments
 (0)