Skip to content

Commit

Permalink
Merge branch 'develop' into fix/clippy-ci-stacks-lib-collapsible-else-if
Browse files Browse the repository at this point in the history
  • Loading branch information
jferrant authored Jan 17, 2025
2 parents c7ce2dd + 403aefc commit 0835819
Show file tree
Hide file tree
Showing 25 changed files with 1,203 additions and 130 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
# - tests::neon_integrations::size_overflow_unconfirmed_microblocks_integration_test
# - tests::neon_integrations::size_overflow_unconfirmed_stream_microblocks_integration_test
# - tests::neon_integrations::runtime_overflow_unconfirmed_microblocks_integration_test
# - tests::epoch_25::microblocks_disabled
# Disable this flaky test. Microblocks are no longer supported anyways.
# - tests::neon_integrations::microblock_large_tx_integration_test_FLAKY
- tests::neon_integrations::miner_submit_twice
Expand All @@ -80,7 +81,6 @@ jobs:
- tests::neon_integrations::bitcoin_reorg_flap
- tests::neon_integrations::bitcoin_reorg_flap_with_follower
- tests::neon_integrations::start_stop_bitcoind
- tests::epoch_25::microblocks_disabled
- tests::should_succeed_handling_malformed_and_valid_txs
- tests::nakamoto_integrations::simple_neon_integration
- tests::nakamoto_integrations::flash_blocks_on_epoch_3
Expand Down Expand Up @@ -132,13 +132,17 @@ jobs:
- tests::signer::v0::block_commit_delay
- tests::signer::v0::continue_after_fast_block_no_sortition
- tests::signer::v0::block_validation_response_timeout
- tests::signer::v0::block_validation_pending_table
- tests::signer::v0::new_tenure_while_validating_previous_scenario
- tests::signer::v0::tenure_extend_after_bad_commit
- tests::signer::v0::block_proposal_max_age_rejections
- tests::signer::v0::global_acceptance_depends_on_block_announcement
- tests::signer::v0::no_reorg_due_to_successive_block_validation_ok
- tests::signer::v0::incoming_signers_ignore_block_proposals
- tests::signer::v0::outgoing_signers_ignore_block_proposals
- tests::signer::v0::injected_signatures_are_ignored_across_boundaries
- tests::signer::v0::block_proposal_timeout
- tests::signer::v0::rejected_blocks_count_towards_miner_validity
- tests::nakamoto_integrations::burn_ops_integration_test
- tests::nakamoto_integrations::check_block_heights
- tests::nakamoto_integrations::clarity_burn_state
Expand Down
8 changes: 8 additions & 0 deletions libsigner/src/v0/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,14 @@ impl BlockResponse {
}
}

/// The signer signature hash for the block response
pub fn signer_signature_hash(&self) -> Sha512Trunc256Sum {
match self {
BlockResponse::Accepted(accepted) => accepted.signer_signature_hash,
BlockResponse::Rejected(rejection) => rejection.signer_signature_hash,
}
}

/// Get the block accept data from the block response
pub fn as_block_accepted(&self) -> Option<&BlockAccepted> {
match self {
Expand Down
1 change: 1 addition & 0 deletions stacks-signer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
## Added

- Introduced the `block_proposal_max_age_secs` configuration option for signers, enabling them to automatically ignore block proposals that exceed the specified age in seconds.
- When a new block proposal is received while the signer is waiting for an existing proposal to be validated, the signer will wait until the existing block is done validating before submitting the new one for validating. ([#5453](https://github.com/stacks-network/stacks-core/pull/5453))

## Changed
- Improvements to the stale signer cleanup logic: deletes the prior signer if it has no remaining unprocessed blocks in its database
Expand Down
10 changes: 4 additions & 6 deletions stacks-signer/src/chainstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ impl SortitionState {
if self.miner_status != SortitionMinerStatus::Valid {
return Ok(false);
}
// if we've already signed a block in this tenure, the miner can't have timed out.
let has_blocks = signer_db
.get_last_signed_block_in_tenure(&self.consensus_hash)?
.is_some();
// if we've already seen a proposed block from this miner. It cannot have timed out.
let has_blocks = signer_db.has_proposed_block_in_tenure(&self.consensus_hash)?;
if has_blocks {
return Ok(false);
}
Expand Down Expand Up @@ -589,8 +587,8 @@ impl SortitionsView {
signer_db.block_lookup(&nakamoto_tip.signer_signature_hash())
{
if block_info.state != BlockState::GloballyAccepted {
if let Err(e) = block_info.mark_globally_accepted() {
warn!("Failed to update block info in db: {e}");
if let Err(e) = signer_db.mark_block_globally_accepted(&mut block_info) {
warn!("Failed to mark block as globally accepted: {e}");
} else if let Err(e) = signer_db.insert_block(&block_info) {
warn!("Failed to update block info in db: {e}");
}
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 @@ -39,7 +39,7 @@ const BLOCK_PROPOSAL_TIMEOUT_MS: u64 = 600_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;
const TENURE_IDLE_TIMEOUT_SECS: u64 = 300;
const TENURE_IDLE_TIMEOUT_SECS: u64 = 120;

#[derive(thiserror::Error, Debug)]
/// An error occurred parsing the provided configuration
Expand Down
Loading

0 comments on commit 0835819

Please sign in to comment.