Skip to content

Commit 82de570

Browse files
committed
Add block_proposal_max_age_secs to ConnectionOptionsFile
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 86dc10f commit 82de570

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

stacks-signer/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use std::path::PathBuf;
2121
use std::time::Duration;
2222

2323
use blockstack_lib::chainstate::stacks::TransactionVersion;
24+
use blockstack_lib::net::connection::DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS;
2425
use clarity::util::hash::to_hex;
2526
use libsigner::SignerEntries;
2627
use serde::Deserialize;
@@ -39,7 +40,6 @@ const BLOCK_PROPOSAL_VALIDATION_TIMEOUT_MS: u64 = 120_000;
3940
const DEFAULT_FIRST_PROPOSAL_BURN_BLOCK_TIMING_SECS: u64 = 60;
4041
const DEFAULT_TENURE_LAST_BLOCK_PROPOSAL_TIMEOUT_SECS: u64 = 30;
4142
const TENURE_IDLE_TIMEOUT_SECS: u64 = 300;
42-
const DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS: u64 = 600;
4343

4444
#[derive(thiserror::Error, Debug)]
4545
/// An error occurred parsing the provided configuration

stackslib/src/net/connection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use crate::net::{
4949
};
5050

5151
/// The default maximum age in seconds of a block that can be validated by the block proposal endpoint
52-
pub const BLOCK_PROPOSAL_MAX_AGE_SECS: u64 = 600;
52+
pub const DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS: u64 = 600;
5353

5454
/// Receiver notification handle.
5555
/// When a message with the expected `seq` value arrives, send it to an expected receiver (possibly
@@ -573,7 +573,7 @@ impl std::default::Default for ConnectionOptions {
573573
nakamoto_inv_sync_burst_interval_ms: 1_000, // wait 1 second after a sortition before running inventory sync
574574
nakamoto_unconfirmed_downloader_interval_ms: 5_000, // run unconfirmed downloader once every 5 seconds
575575
auth_token: None,
576-
block_proposal_max_age_secs: BLOCK_PROPOSAL_MAX_AGE_SECS,
576+
block_proposal_max_age_secs: DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS,
577577
stackerdb_hint_replicas: HashMap::new(),
578578

579579
// no faults on by default

testnet/stacks-node/src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use stacks::cost_estimates::fee_scalar::ScalarFeeRateEstimator;
4949
use stacks::cost_estimates::metrics::{CostMetric, ProportionalDotProduct, UnitMetric};
5050
use stacks::cost_estimates::{CostEstimator, FeeEstimator, PessimisticEstimator, UnitEstimator};
5151
use stacks::net::atlas::AtlasConfig;
52-
use stacks::net::connection::ConnectionOptions;
52+
use stacks::net::connection::{ConnectionOptions, DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS};
5353
use stacks::net::{Neighbor, NeighborAddress, NeighborKey};
5454
use stacks::types::chainstate::BurnchainHeaderHash;
5555
use stacks::types::EpochList;
@@ -2234,6 +2234,7 @@ pub struct ConnectionOptionsFile {
22342234
pub antientropy_retry: Option<u64>,
22352235
pub reject_blocks_pushed: Option<bool>,
22362236
pub stackerdb_hint_replicas: Option<String>,
2237+
pub block_proposal_max_age_secs: Option<u64>,
22372238
}
22382239

22392240
impl ConnectionOptionsFile {
@@ -2382,6 +2383,9 @@ impl ConnectionOptionsFile {
23822383
.transpose()?
23832384
.map(HashMap::from_iter)
23842385
.unwrap_or(default.stackerdb_hint_replicas),
2386+
block_proposal_max_age_secs: self
2387+
.block_proposal_max_age_secs
2388+
.unwrap_or(DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS),
23852389
..default
23862390
})
23872391
}

0 commit comments

Comments
 (0)