Skip to content

Commit ac370c0

Browse files
committed
address PR reviews
1 parent c68e1de commit ac370c0

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

stacks-signer/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
### Added
1111

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.
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 before submitting, configurable via `proposal_wait_for_parent_time_secs` in the signer config.toml.
1313

1414
## [3.1.0.0.8.0]
1515

stacks-signer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub trait Signer<T: SignerEventTrait>: Debug + Display {
7878
fn has_unprocessed_blocks(&self) -> bool;
7979
/// Get a reference to the local state machine of the signer
8080
fn get_local_state_machine(&self) -> &LocalStateMachine;
81-
/// Get a reference to the local state machine of the signer
81+
/// Get the number of pending block proposals
8282
fn get_pending_proposals_count(&self) -> u64;
8383
}
8484

stacks-signer/src/v0/signer.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,9 @@ impl Signer {
540540
return false;
541541
};
542542

543-
if peer_info.stacks_tip_height >= block.header.chain_length.saturating_sub(1) {
544-
true
545-
} else {
546-
false
547-
}
543+
// if our stacks node has processed block height >= block proposal's parent
544+
// return true
545+
peer_info.stacks_tip_height >= block.header.chain_length.saturating_sub(1)
548546
}
549547

550548
/// Check if block should be rejected based on sortition state
@@ -1533,7 +1531,7 @@ impl Signer {
15331531
});
15341532
return;
15351533
} else {
1536-
debug!("{self}: Cannot confirm that we have processed parent, but we've waiting proposal_wait_for_parent_time, will submit proposal");
1534+
debug!("{self}: Cannot confirm that we have processed parent, but we've waited proposal_wait_for_parent_time, will submit proposal");
15371535
}
15381536
}
15391537
match stacks_client.submit_block_for_validation(block.clone()) {

0 commit comments

Comments
 (0)