Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: extend the default block_proposal_timeout to 4 hours #5768

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stacks-signer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to the versioning scheme outlined in the [README.md](README.md).

## [Unreleased]

### 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.4.0]

## Added
Expand Down
2 changes: 1 addition & 1 deletion stacks-signer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
32 changes: 23 additions & 9 deletions testnet/stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,22 +1688,22 @@ 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 epoch_3 = &naka_conf.burnchain.epochs.unwrap()[StacksEpochId::Epoch30];
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
// This test was flaky 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
// But I don't think 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}");
.filter(|&i| {
(i != epoch_3.start_height - 1) || {
warn!("Missing burn block {} at epoch 3 transition", i);
false
}
_ => true,
})
.collect();

Expand Down Expand Up @@ -10105,9 +10105,23 @@ 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 epoch_3 = &naka_conf.burnchain.epochs.unwrap()[StacksEpochId::Epoch30];
let bhh = u64::from(tip.burn_header_height);
test_observer::contains_burn_block_range(220..=bhh).unwrap();
let missing = test_observer::get_missing_burn_blocks(220..=bhh).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:?}");
}
Comment on lines -10108 to +10124
Copy link
Member

@kantai kantai Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move these checks into a fn check_nakamoto_no_missing_blocks(conf: &Config) function? That way, its reusable between at least these two tests.


check_nakamoto_empty_block_heuristics();

Expand Down
2 changes: 1 addition & 1 deletion testnet/stacks-node/src/tests/signer/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8028,7 +8028,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");
Expand Down
Loading