Skip to content

test: add PoX-5 support for TestChainstate - #7508

Open
francesco-stacks wants to merge 13 commits into
stacks-network:mainfrom
francesco-stacks:feat/pox5-testchainstate
Open

test: add PoX-5 support for TestChainstate#7508
francesco-stacks wants to merge 13 commits into
stacks-network:mainfrom
francesco-stacks:feat/pox5-testchainstate

Conversation

@francesco-stacks

Copy link
Copy Markdown
Contributor

Description

Builds on top of #7507

Update TestChainstate to mine through Epoch 4.0 into PoX-5 cycles (and on into 4.1). Previously, any test crossing a reward cycle into Epoch 4.0 failed, because the harness only knew how to stack via pox-4.

It's unfortunately a lot of code, but 3-4k lines of changes are just the MARF hashes of the snapshots.

  • setup_pox_5_signers: idempotent signer enrollment (signer-manager contract per key, key registration, staking), run automatically when advancing into Epoch 4.0+.
  • Epoch fixtures place the 4.0/PoX-5 boundary at a "safe" reward-cycle offset and reject invalid schedules.

Applicable issues

  • fixes #

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • For new Clarity features or consensus changes, add property tests (see
    docs/property-testing.md)
  • Changelog fragment(s) or "no changelog" label added (see
    changelog.d/README.md). If this PR breaks
    anything for node operators or users, or requires them to manually do
    anything (such as adjust a setting), use the breaking category.
  • Required documentation changes (e.g.,
    rpc/openapi.yaml for RPC endpoints,
    event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo

@francesco-stacks
francesco-stacks requested a balanced review from Copilot August 12, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@francesco-stacks
francesco-stacks marked this pull request as ready for review August 18, 2026 14:37
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 32149491576

Coverage increased (+0.01%) to 86.578%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: Could not be determined — this PR's diff is too large for GitHub to return (406 error at GitHub).
  • 326 coverage regressions across 32 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

326 previously-covered lines in 32 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
stackslib/src/chainstate/stacks/boot/mod.rs 212 94.38%
stackslib/src/net/p2p.rs 17 74.14%
stackslib/src/net/neighbors/comms.rs 10 77.25%
stacks-signer/src/v0/signer.rs 10 87.8%
stacks-node/src/neon_node.rs 8 83.27%
stacks-node/src/nakamoto_node/miner.rs 7 86.49%
stackslib/src/net/stackerdb/config.rs 6 81.45%
stacks-signer/src/chainstate/v2.rs 6 88.38%
stackslib/src/net/unsolicited.rs 5 82.4%
clarity/src/vm/functions/bitcoin_madhouse.rs 4 82.26%

Coverage Stats

Coverage Status
Relevant Lines: 233020
Covered Lines: 201744
Line Coverage: 86.58%
Coverage Strength: 20053564.23 hits per line

💛 - Coveralls

@brice-stacks brice-stacks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice! just one tiny nit.

block.header.tx_merkle_root = compute_tx_merkle_root(&block.txs);
block.header.state_index_root = self
.compute_nakamoto_marf_root(block.header.timestamp, &block.txs)
.unwrap_or_else(|e| TrieHash::ZERO);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: _e

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants