Skip to content

Commit 9391403

Browse files
authored
Merge branch 'develop' into fix/5193-stackerdb-decoherence
2 parents dbf7bf5 + f14f060 commit 9391403

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,7 @@ impl BitcoinRPCRequest {
28172817

28182818
fn send(config: &Config, payload: BitcoinRPCRequest) -> RPCResult<serde_json::Value> {
28192819
let request = BitcoinRPCRequest::build_rpc_request(&config, &payload);
2820-
let timeout = Duration::from_secs(60);
2820+
let timeout = Duration::from_secs(u64::from(config.burnchain.timeout));
28212821

28222822
let host = request.preamble().host.hostname();
28232823
let port = request.preamble().host.port();

testnet/stacks-node/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ pub struct BurnchainConfig {
14181418
pub rpc_ssl: bool,
14191419
pub username: Option<String>,
14201420
pub password: Option<String>,
1421+
/// Timeout, in seconds, for communication with bitcoind
14211422
pub timeout: u32,
14221423
pub magic_bytes: MagicBytes,
14231424
pub local_mining_public_key: Option<String>,
@@ -1557,6 +1558,7 @@ pub struct BurnchainConfigFile {
15571558
pub rpc_ssl: Option<bool>,
15581559
pub username: Option<String>,
15591560
pub password: Option<String>,
1561+
/// Timeout, in seconds, for communication with bitcoind
15601562
pub timeout: Option<u32>,
15611563
pub magic_bytes: Option<String>,
15621564
pub local_mining_public_key: Option<String>,

testnet/stacks-node/src/neon_node.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,10 @@ impl BlockMinerThread {
17151715
info!("Relayer: Stacks tip has changed to {}/{} since we last tried to mine a block in {} at burn height {}; attempt was {} (for Stacks tip {}/{})",
17161716
parent_consensus_hash, stacks_parent_header.anchored_header.block_hash(), prev_block.burn_hash, parent_block_burn_height, prev_block.attempt, &prev_block.parent_consensus_hash, &prev_block.anchored_block.header.parent_block);
17171717
best_attempt = cmp::max(best_attempt, prev_block.attempt);
1718+
// Since the chain tip has changed, we should try to mine a new block, even
1719+
// if it has less transactions than the previous block we mined, since that
1720+
// previous block would now be a reorg.
1721+
max_txs = 0;
17181722
} else {
17191723
info!("Relayer: Burn tip has changed to {} ({}) since we last tried to mine a block in {}",
17201724
&self.burn_block.burn_header_hash, self.burn_block.block_height, &prev_block.burn_hash);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,6 +3178,7 @@ fn min_gap_between_blocks() {
31783178
.as_stacks_nakamoto()
31793179
.unwrap()
31803180
.timestamp;
3181+
assert!(blocks.len() >= 2, "Expected at least 2 mined blocks");
31813182
let penultimate_block = blocks.get(blocks.len() - 2).unwrap();
31823183
let penultimate_block_time = penultimate_block
31833184
.anchored_header

0 commit comments

Comments
 (0)