chore: remove cost voting r1 - epoch 4.0 disablement gate - #7341
Conversation
There was a problem hiding this comment.
Pull request overview
This PR retires SIP-006 .cost-voting side effects starting at epoch 4.0 (per SIP-044), so the cost tracker ignores .cost-voting state at/after epoch 4.0 and resolves cost functions exclusively via the epoch’s boot cost contract (e.g. .costs-5 in 4.0).
Changes:
- Gate cost-voting state loading in the Clarity cost tracker so it is ignored for epoch >= 4.0.
- Add/refactor cost-voting integration tests to assert behavior before epoch 4.0 and after epoch 4.0, plus test harness helpers for epoch bootstrapping.
- Introduce a test-only
StacksEpochIdrange helper trait to simplify epoch-range iteration in tests and update existing tests to use Rust range syntax.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| stackslib/src/net/api/tests/postblock_v3.rs | Removes an unused Clarity hash import from API tests. |
| stackslib/src/clarity_vm/tests/costs.rs | Refactors epoch setup for cost tests and adds assertions for pre/post epoch-4.0 cost-voting behavior. |
| stackslib/src/clarity_vm/clarity.rs | Adds boot-contract instantiation helpers and exposes an epoch-4.0 cost-contract-only initializer for tests. |
| stackslib/src/chainstate/tests/runtime_tests.rs | Switches test epoch ranges to use the new range extension helper. |
| stackslib/src/chainstate/tests/runtime_analysis_tests.rs | Switches test epoch ranges to use the new range extension helper. |
| stackslib/src/chainstate/tests/consensus.rs | Updates epoch range handling in tests and adjusts doc comment to match new range usage. |
| stackslib/src/chainstate/tests/consensus_unit_tests.rs | Switches test epoch ranges to use the new range extension helper. |
| stacks-common/src/types/tests.rs | Adds tests for the epoch-4.0 cost-voting gate and the new epoch range extension behavior. |
| stacks-common/src/types/mod.rs | Adds supports_cost_voting_contract() and introduces a test-only epoch range extension trait + helpers. |
| clarity/src/vm/tests/epoch_gating.rs | Updates epoch gating test to use the new range-based helper. |
| clarity/src/vm/costs/mod.rs | Skips loading .cost-voting state at/after epoch 4.0 and falls back to boot defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Whoops, think I forgot the |
Coverage Report for CI Build 27958144415Coverage increased (+0.2%) to 86.195%Details
Uncovered Changes
Coverage Regressions8107 previously-covered lines in 119 files lost coverage.
Coverage Stats
💛 - Coveralls |
brice-stacks
left a comment
There was a problem hiding this comment.
lgtm! 95% refactoring and code cleanup and 5% disabling cost-voting 😅
bb48404
into
stacks-network:pox-wf-integration
|
Closed PR has been locked after 14 days of inactivity. |
This PR disables the
SIP-006's.cost-votingcontract's side-effects starting from epoch 4.0 as proposed inSIP-044.Most of the code additions here are tests and related; and most will get axed in
r2.Description
Applicable issues
Additional info (benefits, drawbacks, caveats)
.cost-votingstate entirely and resolves all cost functions through the node's latest initialized boot cost contract (based on its current epoch). For epoch 4.0, this is the.costs-5contract..cost-votingbefore and after epoch 4.0.Rangesyntax support and a couple of helpers forStacksEpochId.initialize_epoch_4_0()requires.sbtc-tokenand.sbtc-registry, so I split out a boot-contract initialization helper and epoch 4.0 cost-contract initialization helper (whichinitialize_epoch_4_0()now calls -- future refactor potential for remaining initialization functions).Checklist
docs/property-testing.md)changelog.d/README.md)