Skip to content

Commit cf38139

Browse files
committed
Merge branch 'develop' into test/allow_reorg_within_first_proposal_burn_block_timing_secs
2 parents 13aaa3f + 04f6fc4 commit cf38139

File tree

52 files changed

+2484
-912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2484
-912
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ jobs:
125125
- tests::signer::v0::continue_after_tenure_extend
126126
- tests::signer::v0::tenure_extend_after_idle_signers
127127
- tests::signer::v0::tenure_extend_after_idle_miner
128+
- tests::signer::v0::tenure_extend_after_failed_miner
128129
- tests::signer::v0::tenure_extend_succeeds_after_rejected_attempt
129130
- tests::signer::v0::stx_transfers_dont_effect_idle_timeout
130131
- tests::signer::v0::idle_tenure_extend_active_mining
@@ -141,6 +142,9 @@ jobs:
141142
- tests::signer::v0::incoming_signers_ignore_block_proposals
142143
- tests::signer::v0::outgoing_signers_ignore_block_proposals
143144
- tests::signer::v0::injected_signatures_are_ignored_across_boundaries
145+
- tests::signer::v0::fast_sortition
146+
- tests::signer::v0::single_miner_empty_sortition
147+
- tests::signer::v0::multiple_miners_empty_sortition
144148
- tests::signer::v0::block_proposal_timeout
145149
- tests::signer::v0::rejected_blocks_count_towards_miner_validity
146150
- tests::signer::v0::allow_reorg_within_first_proposal_burn_block_timing_secs
@@ -163,6 +167,7 @@ jobs:
163167
- tests::nakamoto_integrations::sip029_coinbase_change
164168
- tests::nakamoto_integrations::clarity_cost_spend_down
165169
- tests::nakamoto_integrations::v3_blockbyheight_api_endpoint
170+
- tests::nakamoto_integrations::test_tenure_extend_from_flashblocks
166171
# TODO: enable these once v1 signer is supported by a new nakamoto epoch
167172
# - tests::signer::v1::dkg
168173
# - tests::signer::v1::sign_request_rejected

.github/workflows/ci.yml

Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,10 @@ jobs:
112112
## - commit to either (development, master) branch
113113
create-cache:
114114
if: |
115-
needs.check-release.outputs.is_release == 'true' || (
116-
github.event_name == 'workflow_dispatch' ||
117-
github.event_name == 'pull_request' ||
118-
github.event_name == 'merge_group' ||
119-
(
120-
contains('
121-
refs/heads/master
122-
refs/heads/develop
123-
refs/heads/next
124-
', github.event.pull_request.head.ref) &&
125-
github.event_name == 'push'
126-
)
127-
)
115+
needs.check-release.outputs.is_release == 'true' ||
116+
github.event_name == 'workflow_dispatch' ||
117+
github.event_name == 'pull_request' ||
118+
github.event_name == 'merge_group'
128119
name: Create Test Cache
129120
needs:
130121
- rustfmt
@@ -144,19 +135,9 @@ jobs:
144135
## - commit to either (development, next, master) branch
145136
stacks-core-tests:
146137
if: |
147-
needs.check-release.outputs.is_release == 'true' || (
148-
github.event_name == 'workflow_dispatch' ||
149-
github.event_name == 'pull_request' ||
150-
github.event_name == 'merge_group' ||
151-
(
152-
contains('
153-
refs/heads/master
154-
refs/heads/develop
155-
refs/heads/next
156-
', github.event.pull_request.head.ref) &&
157-
github.event_name == 'push'
158-
)
159-
)
138+
github.event_name == 'workflow_dispatch' ||
139+
github.event_name == 'pull_request' ||
140+
github.event_name == 'merge_group'
160141
name: Stacks Core Tests
161142
needs:
162143
- rustfmt
@@ -177,19 +158,9 @@ jobs:
177158
## - commit to either (development, next, master) branch
178159
stacks-core-build-tests:
179160
if: |
180-
needs.check-release.outputs.is_release == 'true' || (
181-
github.event_name == 'workflow_dispatch' ||
182-
github.event_name == 'pull_request' ||
183-
github.event_name == 'merge_group' ||
184-
(
185-
contains('
186-
refs/heads/master
187-
refs/heads/develop
188-
refs/heads/next
189-
', github.event.pull_request.head.ref) &&
190-
github.event_name == 'push'
191-
)
192-
)
161+
github.event_name == 'workflow_dispatch' ||
162+
github.event_name == 'pull_request' ||
163+
github.event_name == 'merge_group'
193164
name: Stacks Core Build Tests
194165
needs:
195166
- rustfmt
@@ -198,42 +169,21 @@ jobs:
198169

199170
bitcoin-tests:
200171
if: |
201-
needs.check-release.outputs.is_release == 'true' || (
202-
github.event_name == 'workflow_dispatch' ||
203-
github.event_name == 'pull_request' ||
204-
github.event_name == 'merge_group' ||
205-
(
206-
contains('
207-
refs/heads/master
208-
refs/heads/develop
209-
refs/heads/next
210-
', github.event.pull_request.head.ref) &&
211-
github.event_name == 'push'
212-
)
213-
)
172+
github.event_name == 'workflow_dispatch' ||
173+
github.event_name == 'pull_request' ||
174+
github.event_name == 'merge_group'
214175
name: Bitcoin Tests
215176
needs:
216177
- rustfmt
217178
- create-cache
218179
- check-release
219180
uses: ./.github/workflows/bitcoin-tests.yml
220181

221-
222182
p2p-tests:
223183
if: |
224-
needs.check-release.outputs.is_release == 'true' || (
225-
github.event_name == 'workflow_dispatch' ||
226-
github.event_name == 'pull_request' ||
227-
github.event_name == 'merge_group' ||
228-
(
229-
contains('
230-
refs/heads/master
231-
refs/heads/develop
232-
refs/heads/next
233-
', github.event.pull_request.head.ref) &&
234-
github.event_name == 'push'
235-
)
236-
)
184+
github.event_name == 'workflow_dispatch' ||
185+
github.event_name == 'pull_request' ||
186+
github.event_name == 'merge_group'
237187
name: P2P Tests
238188
needs:
239189
- rustfmt

.github/workflows/docs-pr.yml

Lines changed: 0 additions & 114 deletions
This file was deleted.

CHANGELOG.md

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

88
## [Unreleased]
99

10-
## Added
10+
### Added
11+
12+
- The stacks-node miner now performs accurate tenure-extensions in certain bitcoin block production
13+
cases: when a bitcoin block is produced before the previous bitcoin block's Stacks tenure started.
14+
Previously, the miner had difficulty restarting their missed tenure and extending into the new
15+
bitcoin block, leading to 1-2 bitcoin blocks of missed Stacks block production.
1116

1217
## Changed
1318

libstackerdb/src/libstackerdb.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ pub struct StackerDBChunkAckData {
135135
pub code: Option<u32>,
136136
}
137137

138+
impl fmt::Display for StackerDBChunkAckData {
139+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
140+
write!(f, "{:?}", self)
141+
}
142+
}
143+
138144
impl SlotMetadata {
139145
/// Make a new unsigned slot metadata
140146
pub fn new_unsigned(

stacks-signer/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1717

1818
- 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.
1919
- 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))
20+
- Introduced two new prometheus metrics:
21+
- `stacks_signer_block_validation_latencies_histogram`: the validation_time_ms reported by the node when validating a block proposal
22+
- `stacks_signer_block_response_latencies_histogram`: the "end-to-end" time it takes for the signer to issue a block response
2023

2124
## Changed
2225
- Improvements to the stale signer cleanup logic: deletes the prior signer if it has no remaining unprocessed blocks in its database

stacks-signer/src/chainstate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ impl SortitionsView {
200200
info!(
201201
"Current miner timed out, marking as invalid.";
202202
"block_height" => block.header.chain_length,
203+
"block_proposal_timeout" => ?self.config.block_proposal_timeout,
203204
"current_sortition_consensus_hash" => ?self.cur_sortition.consensus_hash,
204205
);
205206
self.cur_sortition.miner_status = SortitionMinerStatus::InvalidatedBeforeFirstBlock;
@@ -320,7 +321,7 @@ impl SortitionsView {
320321
return Ok(false);
321322
}
322323
}
323-
ProposedBy::LastSortition(_last_sortition) => {
324+
ProposedBy::LastSortition(last_sortition) => {
324325
// should only consider blocks from the last sortition if the new sortition was invalidated
325326
// before we signed their first block.
326327
if self.cur_sortition.miner_status
@@ -331,6 +332,7 @@ impl SortitionsView {
331332
"proposed_block_consensus_hash" => %block.header.consensus_hash,
332333
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
333334
"current_sortition_miner_status" => ?self.cur_sortition.miner_status,
335+
"last_sortition" => %last_sortition.consensus_hash
334336
);
335337
return Ok(false);
336338
}

0 commit comments

Comments
 (0)