Skip to content

Feat/signer state machine rollout #6215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: develop
Choose a base branch
from

Conversation

jferrant
Copy link
Contributor

@jferrant jferrant commented Jun 20, 2025

Closes #6092

Note disallow_reorg_within_first_proposal_burn_block_timing_secs_but_more_than_one_block_scenario will be flaky until #6221 is fixed

@jferrant jferrant force-pushed the feat/signer-state-machine-rollout branch from 58f8f12 to 0d44833 Compare June 20, 2025 20:53
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

Attention: Patch coverage is 88.72933% with 259 lines in your changes missing coverage. Please review.

Project coverage is 83.40%. Comparing base (391262c) to head (0d44833).

Files with missing lines Patch % Lines
stacks-signer/src/chainstate/v2.rs 61.58% 58 Missing ⚠️
stacks-signer/src/v0/signer_state.rs 77.29% 52 Missing ⚠️
stacks-signer/src/v0/signer.rs 46.59% 47 Missing ⚠️
stacks-signer/src/signerdb.rs 77.57% 37 Missing ⚠️
libsigner/src/v0/messages.rs 43.75% 27 Missing ⚠️
stacks-signer/src/chainstate/mod.rs 92.25% 21 Missing ⚠️
stacks-signer/src/chainstate/v1.rs 96.95% 9 Missing ⚠️
libsigner/src/tests/signer_state.rs 98.27% 2 Missing ⚠️
stacks-signer/src/tests/signer_state.rs 99.31% 2 Missing ⚠️
...tacks-node/src/tests/signer/commands/block_wait.rs 0.00% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6215      +/-   ##
===========================================
+ Coverage    83.26%   83.40%   +0.14%     
===========================================
  Files          541      544       +3     
  Lines       397695   398981    +1286     
  Branches       323      323              
===========================================
+ Hits        331132   332771    +1639     
+ Misses       66555    66202     -353     
  Partials         8        8              
Files with missing lines Coverage Δ
stacks-signer/src/chainstate/tests/v1.rs 100.00% <100.00%> (ø)
stacks-signer/src/chainstate/tests/v2.rs 100.00% <100.00%> (ø)
stacks-signer/src/client/mod.rs 99.28% <100.00%> (+<0.01%) ⬆️
stacks-signer/src/config.rs 93.73% <100.00%> (+0.24%) ⬆️
stacks-signer/src/lib.rs 90.00% <ø> (ø)
stacks-signer/src/runloop.rs 90.54% <100.00%> (ø)
...net/stacks-node/src/tests/nakamoto_integrations.rs 87.48% <100.00%> (+6.77%) ⬆️
libsigner/src/v0/signer_state.rs 85.56% <98.27%> (+1.22%) ⬆️
testnet/stacks-node/src/tests/signer/v0.rs 45.55% <75.00%> (-0.95%) ⬇️
libsigner/src/tests/signer_state.rs 97.85% <98.27%> (+0.18%) ⬆️
... and 9 more

... and 35 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 391262c...0d44833. 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.

@jferrant jferrant requested review from hstove, kantai and obycode June 23, 2025 16:30
@jferrant jferrant added this to the 3.1.0.0.13 milestone Jun 23, 2025
@jferrant jferrant force-pushed the feat/signer-state-machine-rollout branch from 35ad183 to ea69d33 Compare June 23, 2025 19:22
@kantai kantai moved this to Status: 💻 In Progress in Stacks Core Eng Jun 24, 2025
@jferrant jferrant force-pushed the feat/signer-state-machine-rollout branch from 6fd42cb to 4d199ef Compare June 25, 2025 01:37
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

I'm still reviewing the new tests, but I wanted to submit this now since I caught the signerdb migration issue

Copy link
Contributor

@kantai kantai left a comment

Choose a reason for hiding this comment

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

This looks good to me once the migration changes are handled. I haven't reviewed the test code yet, but wanted to get my comments in on the codebase first.

pub static SUPPORTED_SIGNER_PROTOCOL_VERSION: u64 = 1;
pub static SUPPORTED_SIGNER_PROTOCOL_VERSION: u64 = 2;
/// The version at which global signer state activates
pub static GLOBAL_SIGNER_STATE_ACTIVATION_VERSION: u64 = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should bump this to u64::MAX at the moment. We still haven't confirmed that the mainnet signers will perform as well as the do today, so we want there to be a release with all these changes in it that doesn't "activate", we'll just monitor the updates and confirm that in all cases, the signer set would have continued signing as well as they are currently. Then in the next release, we could bump the support signer protocol version to 3 and change the ACTIVATION_VERSION to 3 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in a971450

Would you expect the SUPPORTED_SIGNER_PROTOCOL_VERSION stay at 1 then? Version 1 and Version 2 are identical. if we don't plan to do anything with it, would just keep SUPPORTED_SIGNER_PRTOCOL_VERSION as 1 and then when we want to activate it...set it to 2 and GLOBAL_SIGNER_STATE_ACTIVATION_VERSION to 2 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to this change, I will have to revert almost all test changes. OR I can force all those tests to have a pinned version but htat is dangerous as they should only be pinned until we rollover the test version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would you expect the SUPPORTED_SIGNER_PROTOCOL_VERSION stay at 1 then? Version 1 and Version 2 are identical. if we don't plan to do anything with it, would just keep SUPPORTED_SIGNER_PRTOCOL_VERSION as 1 and then when we want to activate it...set it to 2 and GLOBAL_SIGNER_STATE_ACTIVATION_VERSION to 2 as well.

Oh, yes, lets do that. Obviously, keep all the signer state machine versioning logic in place, but we can just set:

pub static SUPPORTED_SIGNER_PROTOCOL_VERSION: u64 = 1;
/// The version at which global signer state activates
pub static GLOBAL_SIGNER_STATE_ACTIVATION_VERSION: u64 = 2;

And then, for testing, I think we should do something like set the supported_signer_protocol_version in the signer config, and read it from the config rather than the static. It shouldn't be modifiable in non-testing environments, so a check like:

if !cfg!(feature(testing), test) {
    assert_eq!(config.supported_signer_protocol_version, SUPPORTED_SIGNER_PROTOCOL_VERSION);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't actually have to revert much. Just a few that expect a specific reject code. Thankfully everything else works regardless.

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

First pass, will add some more comments in the next pass.

Signed-off-by: Jacinta Ferrant <[email protected]>
@obycode obycode modified the milestones: 3.1.0.0.13, 3.1.0.0.14 Jul 1, 2025
…fix typos, remove duplicate code in make_miner_state

Signed-off-by: Jacinta Ferrant <[email protected]>
@jferrant jferrant requested a review from a team as a code owner July 1, 2025 19:01
@jferrant jferrant force-pushed the feat/signer-state-machine-rollout branch from 47c22a5 to a971450 Compare July 1, 2025 20:17
Signed-off-by: Jacinta Ferrant <[email protected]>
@jferrant jferrant requested review from kantai, obycode and hstove July 1, 2025 20:23
@jferrant jferrant force-pushed the feat/signer-state-machine-rollout branch from 28d6160 to 8a8c650 Compare July 2, 2025 00:08
obycode
obycode previously approved these changes Jul 2, 2025
…v_miner as global signer state is not active yet

Signed-off-by: Jacinta Ferrant <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: 💻 In Progress
Development

Successfully merging this pull request may close these issues.

4 participants