Skip to content

Conversation

@aaronb-stacks
Copy link
Contributor

This PR implements miner/signer side support for read-count extends (a dimension of SIP-034).

  • bump the protocol version of signer block responses
  • add read count tenure extend timestamp to signer block responses
  • add multiversion protocol deserialize/serialize tests
  • update multiversion test suit to work with current/new version. the prior tests were broken by the new epoch (the 3.1 signer that they tested against were no longer capable of handling responses about the new epoch)
  • add integration test for read-count extends
  • update existing sip-34 e2e tests

* bump the protocol version of signer block responses
* add read count tenure extend timestamp to signer block responses
* add multiversion protocol deserialize/serialize tests
* update multiversion test suit to work with current/new version. the prior tests were broken by the new epoch (the 3.1 signer that they tested against were no longer capable of handling responses about the new epoch)
* add integration test for read-count extends
* update existing sip-34 e2e tests
@aaronb-stacks aaronb-stacks requested review from a team as code owners November 21, 2025 14:25
@aaronb-stacks aaronb-stacks self-assigned this Nov 21, 2025
@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 78.06452% with 136 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.40%. Comparing base (cda6a5e) to head (d63c0ef).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
stacks-node/src/tests/signer/v0.rs 1.81% 54 Missing ⚠️
stacks-node/src/nakamoto_node/miner.rs 63.72% 37 Missing ⚠️
stacks-signer/src/signerdb.rs 92.24% 9 Missing ⚠️
libsigner/src/v0/messages.rs 93.04% 8 Missing ⚠️
stacks-node/src/tests/nakamoto_integrations.rs 45.45% 6 Missing ⚠️
stacks-signer/src/chainstate/v1.rs 81.81% 6 Missing ⚠️
stacks-signer/src/chainstate/v2.rs 80.64% 6 Missing ⚠️
stackslib/src/chainstate/stacks/mod.rs 80.64% 6 Missing ⚠️
...tacks-node/src/nakamoto_node/stackerdb_listener.rs 95.00% 3 Missing ⚠️
stackslib/src/config/mod.rs 50.00% 1 Missing ⚠️

❌ Your project check has failed because the head coverage (74.40%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (cda6a5e) and HEAD (d63c0ef). Click for more details.

HEAD has 24 uploads less than BASE
Flag BASE (cda6a5e) HEAD (d63c0ef)
142 118
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6705      +/-   ##
===========================================
- Coverage    80.03%   74.40%   -5.64%     
===========================================
  Files          577      577              
  Lines       357651   358108     +457     
===========================================
- Hits        286235   266439   -19796     
- Misses       71416    91669   +20253     
Files with missing lines Coverage Δ
...tacks-node/src/nakamoto_node/signer_coordinator.rs 81.84% <100.00%> (+0.51%) ⬆️
stacks-node/src/tests/signer/mod.rs 76.43% <100.00%> (-5.59%) ⬇️
stacks-signer/src/chainstate/mod.rs 88.19% <100.00%> (-1.70%) ⬇️
stacks-signer/src/chainstate/tests/v1.rs 97.19% <100.00%> (-2.81%) ⬇️
stacks-signer/src/chainstate/tests/v2.rs 95.46% <100.00%> (-4.54%) ⬇️
stacks-signer/src/client/mod.rs 97.75% <100.00%> (-1.50%) ⬇️
stacks-signer/src/client/stackerdb.rs 81.90% <100.00%> (-1.29%) ⬇️
stacks-signer/src/config.rs 85.67% <100.00%> (-6.30%) ⬇️
stacks-signer/src/runloop.rs 89.77% <100.00%> (+0.02%) ⬆️
stacks-signer/src/tests/signer_state.rs 52.92% <100.00%> (-45.97%) ⬇️
... and 12 more

... and 238 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cda6a5e...d63c0ef. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jacinta-stacks
Copy link
Contributor

jacinta-stacks commented Nov 21, 2025

I feel like I should have comments, but I don't XD LGTM (aside from fmt complaints)

jacinta-stacks
jacinta-stacks previously approved these changes Nov 21, 2025
Copy link
Contributor

@brice-stacks brice-stacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just a few questions.

Comment on lines +1663 to +1670
// Do not extend if we have spent a threshold amount of the
// budget, since it is not necessary.
let usage = self
.tenure_budget
.proportion_largest_dimension(&self.tenure_cost);
if usage < self.config.miner.tenure_extend_cost_threshold {
return Ok(false);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about removing this since it would prevent a tenure extend from happening when a 51% transaction is the only one in the mempool. Should we make that change here as well?

Comment on lines +1697 to +1709
// Do not extend if we have spent a threshold amount of the
// read-count budget, since it is not necessary.
let usage = self
.tenure_budget
.proportion_largest_dimension(&self.tenure_cost);
if usage < self.config.miner.read_count_extend_cost_threshold {
info!(
"Miner: not read-count extending because threshold not reached";
"threshold" => self.config.miner.read_count_extend_cost_threshold,
"usage" => usage
);
return Ok(false);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the above comment, how about we just not add this check?

self.reason = MinerReason::ReadCountExtend {
burn_view_consensus_hash: self.burn_block.consensus_hash.clone(),
};
self.mined_blocks = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this okay to reset for any type of extend? Any side effects from this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants