Skip to content

Commit bfb926d

Browse files
authored
Merge pull request #5768 from stacks-network/long-block-proposal-timeout
chore: extend the default `block_proposal_timeout` to 4 hours
2 parents 9b48330 + f465d80 commit bfb926d

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

stacks-signer/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
77

88
## [Unreleased]
99

10-
### Added
11-
1210
### Changed
1311

12+
- 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.
13+
1414
## [3.1.0.0.5.0]
1515

1616
### Added

stacks-signer/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use stacks_common::util::hash::Hash160;
3535
use crate::client::SignerSlotID;
3636

3737
const EVENT_TIMEOUT_MS: u64 = 5000;
38-
const BLOCK_PROPOSAL_TIMEOUT_MS: u64 = 600_000;
38+
const BLOCK_PROPOSAL_TIMEOUT_MS: u64 = 14_400_000;
3939
const BLOCK_PROPOSAL_VALIDATION_TIMEOUT_MS: u64 = 120_000;
4040
const DEFAULT_FIRST_PROPOSAL_BURN_BLOCK_TIMING_SECS: u64 = 60;
4141
const DEFAULT_TENURE_LAST_BLOCK_PROPOSAL_TIMEOUT_SECS: u64 = 30;

testnet/stacks-node/src/tests/nakamoto_integrations.rs

+25-23
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
use std::collections::{BTreeMap, HashMap, HashSet};
17+
use std::ops::RangeBounds;
1718
use std::sync::atomic::{AtomicU64, Ordering};
1819
use std::sync::mpsc::{channel, Receiver, Sender};
1920
use std::sync::{Arc, Mutex};
@@ -1437,6 +1438,26 @@ fn wait_for_first_naka_block_commit(timeout_secs: u64, naka_commits_submitted: &
14371438
}
14381439
}
14391440

1441+
// Check for missing burn blocks in `range`, but allow for a missed block at
1442+
// the epoch 3 transition. Panic if any other blocks are missing.
1443+
fn check_nakamoto_no_missing_blocks(conf: &Config, range: impl RangeBounds<u64>) {
1444+
let epoch_3 = &conf.burnchain.epochs.as_ref().unwrap()[StacksEpochId::Epoch30];
1445+
let missing = test_observer::get_missing_burn_blocks(range).unwrap();
1446+
let missing_is_error: Vec<_> = missing
1447+
.into_iter()
1448+
.filter(|&i| {
1449+
(i != epoch_3.start_height - 1) || {
1450+
warn!("Missing burn block {} at epoch 3 transition", i);
1451+
false
1452+
}
1453+
})
1454+
.collect();
1455+
1456+
if !missing_is_error.is_empty() {
1457+
panic!("Missing the following burn blocks: {missing_is_error:?}");
1458+
}
1459+
}
1460+
14401461
#[test]
14411462
#[ignore]
14421463
/// This test spins up a nakamoto-neon node.
@@ -1628,28 +1649,9 @@ fn simple_neon_integration() {
16281649
assert!(tip.anchored_header.as_stacks_nakamoto().is_some());
16291650
assert!(tip.stacks_block_height >= block_height_pre_3_0 + 30);
16301651

1631-
// Check that we aren't missing burn blocks
1652+
// Check that we aren't missing burn blocks (except during the Nakamoto transition)
16321653
let bhh = u64::from(tip.burn_header_height);
1633-
let missing = test_observer::get_missing_burn_blocks(220..=bhh).unwrap();
1634-
1635-
// This test was flakey because it was sometimes missing burn block 230, which is right at the Nakamoto transition
1636-
// So it was possible to miss a burn block during the transition
1637-
// But I don't it matters at this point since the Nakamoto transition has already happened on mainnet
1638-
// So just print a warning instead, don't count it as an error
1639-
let missing_is_error: Vec<_> = missing
1640-
.into_iter()
1641-
.filter(|i| match i {
1642-
230 => {
1643-
warn!("Missing burn block {i}");
1644-
false
1645-
}
1646-
_ => true,
1647-
})
1648-
.collect();
1649-
1650-
if !missing_is_error.is_empty() {
1651-
panic!("Missing the following burn blocks: {missing_is_error:?}");
1652-
}
1654+
check_nakamoto_no_missing_blocks(&naka_conf, 220..=bhh);
16531655

16541656
// make sure prometheus returns an updated number of processed blocks
16551657
#[cfg(feature = "monitoring_prom")]
@@ -9941,9 +9943,9 @@ fn skip_mining_long_tx() {
99419943
assert_eq!(sender_2_nonce, 0);
99429944
assert_eq!(sender_1_nonce, 4);
99439945

9944-
// Check that we aren't missing burn blocks
9946+
// Check that we aren't missing burn blocks (except during the Nakamoto transition)
99459947
let bhh = u64::from(tip.burn_header_height);
9946-
test_observer::contains_burn_block_range(220..=bhh).unwrap();
9948+
check_nakamoto_no_missing_blocks(&naka_conf, 220..=bhh);
99479949

99489950
check_nakamoto_empty_block_heuristics();
99499951

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8140,7 +8140,7 @@ fn block_validation_pending_table() {
81408140
.expect("Timed out waiting for pending block validation to be submitted");
81418141

81428142
info!("----- Waiting for pending block validation to be removed -----");
8143-
wait_for(30, || {
8143+
wait_for(60, || {
81448144
let is_pending = signer_db
81458145
.has_pending_block_validation(&block_signer_signature_hash)
81468146
.expect("Unexpected DBError");

0 commit comments

Comments
 (0)