Skip to content

Commit c68e1de

Browse files
committed
chore: update changelog, rename config option
1 parent 96dcd3f commit c68e1de

File tree

9 files changed

+32
-24
lines changed

9 files changed

+32
-24
lines changed

stacks-signer/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8+
## [3.1.0.0.8.1]
9+
10+
### Added
11+
12+
- The signer will now check if their associated stacks-node has processed the parent block for a block proposal before submitting that block proposal. If it cannot confirm that the parent block has been processed, it waits a default time of 15s, configurable via `proposal_wait_for_parent_time_secs` in the signer config.toml.
13+
814
## [3.1.0.0.8.0]
915

1016
### Changed

stacks-signer/src/chainstate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub struct ProposalEvalConfig {
142142
/// the new miner to reorg it as valid towards miner activity
143143
pub reorg_attempts_activity_timeout: Duration,
144144
/// Time to wait before submitting a block proposal to the stacks-node
145-
pub proposal_wait_time: Duration,
145+
pub proposal_wait_for_parent_time: Duration,
146146
}
147147

148148
impl From<&SignerConfig> for ProposalEvalConfig {
@@ -154,7 +154,7 @@ impl From<&SignerConfig> for ProposalEvalConfig {
154154
tenure_idle_timeout: value.tenure_idle_timeout,
155155
reorg_attempts_activity_timeout: value.reorg_attempts_activity_timeout,
156156
tenure_idle_timeout_buffer: value.tenure_idle_timeout_buffer,
157-
proposal_wait_time: value.proposal_wait_time,
157+
proposal_wait_for_parent_time: value.proposal_wait_for_parent_time,
158158
}
159159
}
160160
}

stacks-signer/src/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ pub(crate) mod tests {
418418
tenure_idle_timeout_buffer: config.tenure_idle_timeout_buffer,
419419
block_proposal_max_age_secs: config.block_proposal_max_age_secs,
420420
reorg_attempts_activity_timeout: config.reorg_attempts_activity_timeout,
421-
proposal_wait_time: config.proposal_wait_time,
421+
proposal_wait_for_parent_time: config.proposal_wait_for_parent_time,
422422
}
423423
}
424424

stacks-signer/src/config.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const DEFAULT_TENURE_IDLE_TIMEOUT_BUFFER_SECS: u64 = 2;
4848
/// Default time (in ms) to wait before submitting a proposal if we
4949
/// cannot determine that our stacks-node has processed the parent
5050
/// block
51-
const DEFAULT_PROPOSAL_WAIT_TIME_MS: u64 = 15_000;
51+
const DEFAULT_PROPOSAL_WAIT_TIME_FOR_PARENT_SECS: u64 = 15;
5252

5353
#[derive(thiserror::Error, Debug)]
5454
/// An error occurred parsing the provided configuration
@@ -181,7 +181,7 @@ pub struct SignerConfig {
181181
pub signer_mode: SignerConfigMode,
182182
/// Time to wait before submitting a block proposal to the stacks-node if we cannot
183183
/// determine that the stacks-node has processed the parent
184-
pub proposal_wait_time: Duration,
184+
pub proposal_wait_for_parent_time: Duration,
185185
}
186186

187187
/// The parsed configuration for the signer
@@ -230,7 +230,7 @@ pub struct GlobalConfig {
230230
pub reorg_attempts_activity_timeout: Duration,
231231
/// Time to wait before submitting a block proposal to the stacks-node if we cannot
232232
/// determine that the stacks-node has processed the parent
233-
pub proposal_wait_time: Duration,
233+
pub proposal_wait_for_parent_time: Duration,
234234
/// Is this signer binary going to be running in dry-run mode?
235235
pub dry_run: bool,
236236
}
@@ -279,7 +279,7 @@ struct RawConfigFile {
279279
/// to reorg the block as valid towards miner activity
280280
pub reorg_attempts_activity_timeout_ms: Option<u64>,
281281
/// Time to wait (in millisecs) before submitting a block proposal to the stacks-node
282-
pub proposal_wait_time_ms: Option<u64>,
282+
pub proposal_wait_for_parent_time_secs: Option<u64>,
283283
/// Is this signer binary going to be running in dry-run mode?
284284
pub dry_run: Option<bool>,
285285
}
@@ -397,10 +397,10 @@ impl TryFrom<RawConfigFile> for GlobalConfig {
397397
.unwrap_or(DEFAULT_TENURE_IDLE_TIMEOUT_BUFFER_SECS),
398398
);
399399

400-
let proposal_wait_time = Duration::from_millis(
400+
let proposal_wait_for_parent_time = Duration::from_secs(
401401
raw_data
402-
.proposal_wait_time_ms
403-
.unwrap_or(DEFAULT_PROPOSAL_WAIT_TIME_MS),
402+
.proposal_wait_for_parent_time_secs
403+
.unwrap_or(DEFAULT_PROPOSAL_WAIT_TIME_FOR_PARENT_SECS),
404404
);
405405

406406
Ok(Self {
@@ -423,7 +423,7 @@ impl TryFrom<RawConfigFile> for GlobalConfig {
423423
reorg_attempts_activity_timeout,
424424
dry_run,
425425
tenure_idle_timeout_buffer,
426-
proposal_wait_time,
426+
proposal_wait_for_parent_time,
427427
})
428428
}
429429
}

stacks-signer/src/runloop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl<Signer: SignerTrait<T>, T: StacksMessageCodec + Clone + Send + Debug> RunLo
322322
tenure_idle_timeout_buffer: self.config.tenure_idle_timeout_buffer,
323323
block_proposal_max_age_secs: self.config.block_proposal_max_age_secs,
324324
reorg_attempts_activity_timeout: self.config.reorg_attempts_activity_timeout,
325-
proposal_wait_time: self.config.proposal_wait_time,
325+
proposal_wait_for_parent_time: self.config.proposal_wait_for_parent_time,
326326
}))
327327
}
328328

stacks-signer/src/tests/chainstate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn setup_test_environment(
9191
tenure_idle_timeout: Duration::from_secs(300),
9292
tenure_idle_timeout_buffer: Duration::from_secs(2),
9393
reorg_attempts_activity_timeout: Duration::from_secs(3),
94-
proposal_wait_time: Duration::from_secs(0),
94+
proposal_wait_for_parent_time: Duration::from_secs(0),
9595
},
9696
};
9797

stacks-signer/src/v0/signer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,9 @@ impl Signer {
15201520
let signer_signature_hash = block.header.signer_signature_hash();
15211521
if !self.maybe_processed_parent(stacks_client, block) {
15221522
let time_elapsed = get_epoch_time_secs().saturating_sub(added_epoch_time);
1523-
if Duration::from_secs(time_elapsed) < self.proposal_config.proposal_wait_time {
1523+
if Duration::from_secs(time_elapsed)
1524+
< self.proposal_config.proposal_wait_for_parent_time
1525+
{
15241526
info!("{self}: Have not processed parent of block proposal yet, inserting pending block validation and will try again later";
15251527
"signer_signature_hash" => %signer_signature_hash,
15261528
);
@@ -1531,7 +1533,7 @@ impl Signer {
15311533
});
15321534
return;
15331535
} else {
1534-
debug!("{self}: Cannot confirm that we have processed parent, but we've waiting proposal_wait_time, will submit proposal");
1536+
debug!("{self}: Cannot confirm that we have processed parent, but we've waiting proposal_wait_for_parent_time, will submit proposal");
15351537
}
15361538
}
15371539
match stacks_client.submit_block_for_validation(block.clone()) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6577,7 +6577,7 @@ fn signer_chainstate() {
65776577

65786578
// this config disallows any reorg due to poorly timed block commits
65796579
let proposal_conf = ProposalEvalConfig {
6580-
proposal_wait_time: Duration::from_secs(0),
6580+
proposal_wait_for_parent_time: Duration::from_secs(0),
65816581
first_proposal_burn_block_timing: Duration::from_secs(0),
65826582
block_proposal_timeout: Duration::from_secs(100),
65836583
tenure_last_block_proposal_timeout: Duration::from_secs(30),
@@ -6704,7 +6704,7 @@ fn signer_chainstate() {
67046704

67056705
// this config disallows any reorg due to poorly timed block commits
67066706
let proposal_conf = ProposalEvalConfig {
6707-
proposal_wait_time: Duration::from_secs(0),
6707+
proposal_wait_for_parent_time: Duration::from_secs(0),
67086708
first_proposal_burn_block_timing: Duration::from_secs(0),
67096709
block_proposal_timeout: Duration::from_secs(100),
67106710
tenure_last_block_proposal_timeout: Duration::from_secs(30),
@@ -6782,7 +6782,7 @@ fn signer_chainstate() {
67826782

67836783
// this config disallows any reorg due to poorly timed block commits
67846784
let proposal_conf = ProposalEvalConfig {
6785-
proposal_wait_time: Duration::from_secs(0),
6785+
proposal_wait_for_parent_time: Duration::from_secs(0),
67866786
first_proposal_burn_block_timing: Duration::from_secs(0),
67876787
block_proposal_timeout: Duration::from_secs(100),
67886788
tenure_last_block_proposal_timeout: Duration::from_secs(30),

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ fn block_proposal_rejection() {
14671467

14681468
info!("------------------------- Send Block Proposal To Signers -------------------------");
14691469
let proposal_conf = ProposalEvalConfig {
1470-
proposal_wait_time: Duration::from_secs(0),
1470+
proposal_wait_for_parent_time: Duration::from_secs(0),
14711471
first_proposal_burn_block_timing: Duration::from_secs(0),
14721472
block_proposal_timeout: Duration::from_secs(100),
14731473
tenure_last_block_proposal_timeout: Duration::from_secs(30),
@@ -1707,7 +1707,7 @@ fn revalidate_unknown_parent() {
17071707
signer_config.node_host = node_1_rpc_bind.clone();
17081708
signer_config.first_proposal_burn_block_timing = Duration::from_secs(0);
17091709
// rely on actually checking that the block is processed
1710-
signer_config.proposal_wait_time = Duration::from_secs(600);
1710+
signer_config.proposal_wait_for_parent_time = Duration::from_secs(600);
17111711
},
17121712
|config| {
17131713
config.node.rpc_bind = format!("{localhost}:{node_1_rpc}");
@@ -7622,7 +7622,7 @@ fn block_validation_response_timeout() {
76227622

76237623
info!("------------------------- Propose Another Block Before Hitting the Timeout -------------------------");
76247624
let proposal_conf = ProposalEvalConfig {
7625-
proposal_wait_time: Duration::from_secs(0),
7625+
proposal_wait_for_parent_time: Duration::from_secs(0),
76267626
first_proposal_burn_block_timing: Duration::from_secs(0),
76277627
tenure_last_block_proposal_timeout: Duration::from_secs(30),
76287628
block_proposal_timeout: Duration::from_secs(100),
@@ -7911,7 +7911,7 @@ fn block_validation_pending_table() {
79117911

79127912
info!("----- Proposing a concurrent block -----");
79137913
let proposal_conf = ProposalEvalConfig {
7914-
proposal_wait_time: Duration::from_secs(0),
7914+
proposal_wait_for_parent_time: Duration::from_secs(0),
79157915
first_proposal_burn_block_timing: Duration::from_secs(0),
79167916
block_proposal_timeout: Duration::from_secs(100),
79177917
tenure_last_block_proposal_timeout: Duration::from_secs(30),
@@ -9200,7 +9200,7 @@ fn incoming_signers_ignore_block_proposals() {
92009200
no_next_signer_messages();
92019201

92029202
let proposal_conf = ProposalEvalConfig {
9203-
proposal_wait_time: Duration::from_secs(0),
9203+
proposal_wait_for_parent_time: Duration::from_secs(0),
92049204
first_proposal_burn_block_timing: Duration::from_secs(0),
92059205
block_proposal_timeout: Duration::from_secs(100),
92069206
tenure_last_block_proposal_timeout: Duration::from_secs(30),
@@ -9381,7 +9381,7 @@ fn outgoing_signers_ignore_block_proposals() {
93819381
old_signers_ignore_block_proposals(new_signature_hash);
93829382

93839383
let proposal_conf = ProposalEvalConfig {
9384-
proposal_wait_time: Duration::from_secs(0),
9384+
proposal_wait_for_parent_time: Duration::from_secs(0),
93859385
first_proposal_burn_block_timing: Duration::from_secs(0),
93869386
block_proposal_timeout: Duration::from_secs(100),
93879387
tenure_last_block_proposal_timeout: Duration::from_secs(30),

0 commit comments

Comments
 (0)