Repository navigation
fix: respect stop= in nakamoto unconfirmed tenure downloads - #7917
Open
cylewitruk-stacks wants to merge 1 commit into
Open
cylewitruk-stacks wants to merge 1 commit into
cylewitruk-stacks wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the unconfirmed tenure synchronization fix.
No open issues 🎉
What changed in this PR
Fixes stop= handling in Nakamoto unconfirmed tenure synchronization, avoiding unnecessary downloads of already-processed blocks.
Changes:
- Preserves the
stopquery parameter when constructing tenure requests. - Completes downloads at the child of the highest processed block, matching the server’s exclusive stop boundary.
- Adds request round-trip coverage, updates downloader assertions, and documents the fix.
| File | Description |
|---|---|
stackslib/src/net/tests/download/nakamoto.rs |
Updates completion and returned-block expectations. |
stackslib/src/net/download/nakamoto/tenure_downloader_unconfirmed.rs |
Detects completion using the block’s parent ID. |
stackslib/src/net/api/tests/gettenure.rs |
Tests serialization and parsing of stop. |
stackslib/src/net/api/gettenure.rs |
Passes stop through request query arguments. |
changelog.d/nakamoto-tenure-request-stop-query.fixed |
Documents the corrected download behavior. |
Review effort: Balanced
stop= in nakamoto unconfirmed tenure downloadsstop= in nakamoto unconfirmed tenure downloads
brice-stacks
approved these changes
Nov 30, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes two issues preventing
stop=from working in Nakamoto unconfirmed tenure downloads:stop=query parameter on/v3/tenures/{block_id}requests (stackslib/src/net/api/gettenure.rs):StacksHttpRequest::new_get_nakamoto_tenurepreviously embedded?stop=<block_id>directly in the path string, whichStacksHttpRequest::new_for_peerstripped and replaced withHttpRequestContentsquery args. PassstopviaHttpRequestContents::query_arginstead so peers actually receive it.highest_processed_block_id(stackslib/src/net/download/nakamoto/tenure_downloader_unconfirmed.rs): a peer honouringstop=<id>stops before sending<id>, so the downloader now marks the download complete whenblock.header.parent_block_id == highest_processed_block_idrather than waiting forhighest_processed_block_iditself.Adds a request round-trip test for
stop=parsing (test_try_parse_request_with_stop), updates unconfirmed tenure downloader tests, and adds a changelog fragment (changelog.d/nakamoto-tenure-request-stop-query.fixed).Additional info (benefits, drawbacks, caveats)
stop=continue to work; the downloader still stops once it reaches the child ofhighest_processed_block_idand truncates any trailing blocks.Checklist
clarity-benchmarkingrepo (N/A)