Skip to content

Commit 7f21a79

Browse files
committed
fix: check errors after merge
1 parent ddf733d commit 7f21a79

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

stacks-signer/src/chainstate/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ pub struct ProposalEvalConfig {
8686
pub reorg_attempts_activity_timeout: Duration,
8787
/// Time to wait before submitting a block proposal to the stacks-node
8888
pub proposal_wait_for_parent_time: Duration,
89+
/// How many blocks after a fork should we reset the replay set,
90+
/// as a failsafe mechanism
91+
pub reset_replay_set_after_fork_blocks: u64,
8992
}
9093

9194
impl From<&SignerConfig> for ProposalEvalConfig {
@@ -98,6 +101,7 @@ impl From<&SignerConfig> for ProposalEvalConfig {
98101
reorg_attempts_activity_timeout: value.reorg_attempts_activity_timeout,
99102
tenure_idle_timeout_buffer: value.tenure_idle_timeout_buffer,
100103
proposal_wait_for_parent_time: value.proposal_wait_for_parent_time,
104+
reset_replay_set_after_fork_blocks: value.reset_replay_set_after_fork_blocks,
101105
}
102106
}
103107
}

stacks-signer/src/chainstate/tests/v2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ use crate::chainstate::v2::{GlobalStateView, SortitionState};
4747
use crate::chainstate::{ProposalEvalConfig, SignerChainstateError, SortitionData};
4848
use crate::client::tests::MockServerClient;
4949
use crate::client::StacksClient;
50+
use crate::config::DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS;
5051
use crate::signerdb::tests::tmp_db_path;
5152
use crate::signerdb::{BlockInfo, SignerDb};
5253

@@ -94,6 +95,7 @@ fn setup_test_environment(
9495
tenure_idle_timeout_buffer: Duration::from_secs(2),
9596
reorg_attempts_activity_timeout: Duration::from_secs(3),
9697
proposal_wait_for_parent_time: Duration::from_secs(0),
98+
reset_replay_set_after_fork_blocks: DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS,
9799
};
98100

99101
let stacks_client = StacksClient::new(

stacks-signer/src/tests/signer_state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use stacks_common::function_name;
4040
use crate::chainstate::{ProposalEvalConfig, SortitionData};
4141
use crate::client::tests::{build_get_tenure_tip_response, MockServerClient};
4242
use crate::client::StacksClient;
43-
use crate::config::GlobalConfig;
43+
use crate::config::{GlobalConfig, DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS};
4444
use crate::signerdb::tests::{create_block_override, tmp_db_path};
4545
use crate::signerdb::SignerDb;
4646
use crate::v0::signer_state::{LocalStateMachine, NewBurnBlock, StateMachineUpdate};
@@ -284,6 +284,7 @@ fn check_miner_inactivity_timeout() {
284284
tenure_idle_timeout_buffer: Duration::from_secs(2),
285285
reorg_attempts_activity_timeout: Duration::from_secs(3),
286286
proposal_wait_for_parent_time: Duration::from_secs(0),
287+
reset_replay_set_after_fork_blocks: DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS,
287288
};
288289

289290
let block_sk = StacksPrivateKey::from_seed(&[0, 1]);

0 commit comments

Comments
 (0)