diff --git a/stacks-signer/CHANGELOG.md b/stacks-signer/CHANGELOG.md index 2e801d680d..4eaa122f8d 100644 --- a/stacks-signer/CHANGELOG.md +++ b/stacks-signer/CHANGELOG.md @@ -7,10 +7,10 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE ## [Unreleased] -### Added - ### Changed +- Increase default `block_proposal_timeout_ms` from 10 minutes to 4 hours. Until #5729 is implemented, there is no value in rejecting a late block from a miner, since a late block is better than no block at all. + ## [3.1.0.0.5.0] ### Added diff --git a/stacks-signer/src/config.rs b/stacks-signer/src/config.rs index 29ee35c961..8902295d00 100644 --- a/stacks-signer/src/config.rs +++ b/stacks-signer/src/config.rs @@ -35,7 +35,7 @@ use stacks_common::util::hash::Hash160; use crate::client::SignerSlotID; const EVENT_TIMEOUT_MS: u64 = 5000; -const BLOCK_PROPOSAL_TIMEOUT_MS: u64 = 600_000; +const BLOCK_PROPOSAL_TIMEOUT_MS: u64 = 14_400_000; const BLOCK_PROPOSAL_VALIDATION_TIMEOUT_MS: u64 = 120_000; const DEFAULT_FIRST_PROPOSAL_BURN_BLOCK_TIMING_SECS: u64 = 60; const DEFAULT_TENURE_LAST_BLOCK_PROPOSAL_TIMEOUT_SECS: u64 = 30; diff --git a/testnet/stacks-node/src/tests/nakamoto_integrations.rs b/testnet/stacks-node/src/tests/nakamoto_integrations.rs index 4099ce64f2..3fa540d64f 100644 --- a/testnet/stacks-node/src/tests/nakamoto_integrations.rs +++ b/testnet/stacks-node/src/tests/nakamoto_integrations.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . use std::collections::{BTreeMap, HashMap, HashSet}; +use std::ops::RangeBounds; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::{Arc, Mutex}; @@ -1437,6 +1438,26 @@ fn wait_for_first_naka_block_commit(timeout_secs: u64, naka_commits_submitted: & } } +// Check for missing burn blocks in `range`, but allow for a missed block at +// the epoch 3 transition. Panic if any other blocks are missing. +fn check_nakamoto_no_missing_blocks(conf: &Config, range: impl RangeBounds) { + let epoch_3 = &conf.burnchain.epochs.as_ref().unwrap()[StacksEpochId::Epoch30]; + let missing = test_observer::get_missing_burn_blocks(range).unwrap(); + let missing_is_error: Vec<_> = missing + .into_iter() + .filter(|&i| { + (i != epoch_3.start_height - 1) || { + warn!("Missing burn block {} at epoch 3 transition", i); + false + } + }) + .collect(); + + if !missing_is_error.is_empty() { + panic!("Missing the following burn blocks: {missing_is_error:?}"); + } +} + #[test] #[ignore] /// This test spins up a nakamoto-neon node. @@ -1628,28 +1649,9 @@ fn simple_neon_integration() { assert!(tip.anchored_header.as_stacks_nakamoto().is_some()); assert!(tip.stacks_block_height >= block_height_pre_3_0 + 30); - // Check that we aren't missing burn blocks + // Check that we aren't missing burn blocks (except during the Nakamoto transition) let bhh = u64::from(tip.burn_header_height); - let missing = test_observer::get_missing_burn_blocks(220..=bhh).unwrap(); - - // This test was flakey because it was sometimes missing burn block 230, which is right at the Nakamoto transition - // So it was possible to miss a burn block during the transition - // But I don't it matters at this point since the Nakamoto transition has already happened on mainnet - // So just print a warning instead, don't count it as an error - let missing_is_error: Vec<_> = missing - .into_iter() - .filter(|i| match i { - 230 => { - warn!("Missing burn block {i}"); - false - } - _ => true, - }) - .collect(); - - if !missing_is_error.is_empty() { - panic!("Missing the following burn blocks: {missing_is_error:?}"); - } + check_nakamoto_no_missing_blocks(&naka_conf, 220..=bhh); // make sure prometheus returns an updated number of processed blocks #[cfg(feature = "monitoring_prom")] @@ -9941,9 +9943,9 @@ fn skip_mining_long_tx() { assert_eq!(sender_2_nonce, 0); assert_eq!(sender_1_nonce, 4); - // Check that we aren't missing burn blocks + // Check that we aren't missing burn blocks (except during the Nakamoto transition) let bhh = u64::from(tip.burn_header_height); - test_observer::contains_burn_block_range(220..=bhh).unwrap(); + check_nakamoto_no_missing_blocks(&naka_conf, 220..=bhh); check_nakamoto_empty_block_heuristics(); diff --git a/testnet/stacks-node/src/tests/signer/v0.rs b/testnet/stacks-node/src/tests/signer/v0.rs index dfe5c34443..a666f0ebed 100644 --- a/testnet/stacks-node/src/tests/signer/v0.rs +++ b/testnet/stacks-node/src/tests/signer/v0.rs @@ -8140,7 +8140,7 @@ fn block_validation_pending_table() { .expect("Timed out waiting for pending block validation to be submitted"); info!("----- Waiting for pending block validation to be removed -----"); - wait_for(30, || { + wait_for(60, || { let is_pending = signer_db .has_pending_block_validation(&block_signer_signature_hash) .expect("Unexpected DBError");