Skip to content

chore: functional removal of cost-voting (2/2) - #7565

Merged
brice-stacks merged 5 commits into
stacks-network:mainfrom
cylewitruk-stacks:chore/remove-cost-voting-r2
Sep 4, 2026
Merged

chore: functional removal of cost-voting (2/2)#7565
brice-stacks merged 5 commits into
stacks-network:mainfrom
cylewitruk-stacks:chore/remove-cost-voting-r2

Conversation

@cylewitruk-stacks

Copy link
Copy Markdown
Contributor

Description

This PR fully removes the SIP-006's .cost-voting contract's functional side-effects.

This was contingent on SIP-044 ratification and mainnet Epoch 4.0 activation, both of which have now occurred.

Applicable issues

Additional info (benefits, drawbacks, caveats)

  • Removes a whole bunch of unused code/tests.
  • The removal of is_cost_contract_eligible from ContractAnalysis is backwards-compatible as serde_json ignores unknown fields during deserialization of previously stored analyses.

Checklist

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.

🟡 Changes recommended

Pre-4.0 replay compatibility and breaking API disclosure must be addressed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Removes SIP-006 cost-voting side effects after Epoch 4.0.

Changes:

  • Removes dynamic cost replacement and contract-call short-circuiting.
  • Removes cost-contract eligibility analysis and related APIs.
  • Deletes obsolete tests and adds an Epoch 4.0 native-cost check.
File summaries
File Description
stackslib/src/clarity_vm/tests/costs.rs Removes cost-voting tests; adds native-cost check.
stackslib/src/chainstate/stacks/boot/contract_tests.rs Removes voting and arithmetic-only tests.
stacks-node/src/tests/neon_integrations.rs Removes cost-voting integration test.
stacks-common/src/types/tests.rs Removes epoch gate test.
stacks-common/src/types/mod.rs Removes cost-voting support gate.
clarity/src/vm/functions/database.rs Removes contract-call cost interception.
clarity/src/vm/costs/mod.rs Removes voting-state loading and replacement logic.
clarity/src/vm/contexts.rs Removes free-execution support.
clarity/src/vm/ast/mod.rs Updates test cost tracker.
clarity/src/vm/analysis/types.rs Removes eligibility metadata field.
clarity/src/vm/analysis/type_checker/v2_1/mod.rs Updates cost tracker implementation.
clarity/src/vm/analysis/type_checker/v2_05/mod.rs Updates cost tracker implementation.
clarity/src/vm/analysis/mod.rs Removes arithmetic analysis pass.
clarity/src/vm/analysis/contract_interface_builder/mod.rs Updates analysis destructuring.
clarity/src/vm/analysis/arithmetic_checker/tests.rs Deletes checker tests.
clarity/src/vm/analysis/arithmetic_checker/mod.rs Deletes arithmetic checker.
changelog.d/7342-cost-voting-functional-removal.removed Adds removal notice.
Review details
  • Files reviewed: 17/17 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread clarity/src/vm/costs/mod.rs
Comment thread changelog.d/7342-cost-voting-functional-removal.removed Outdated
@coveralls

coveralls commented Sep 2, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33595864648

Coverage decreased (-0.03%) to 86.406%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: 6 uncovered changes across 1 file (23 of 29 lines covered, 79.31%).
  • 230 coverage regressions across 32 files.

Uncovered Changes

File Changed Covered %
clarity/src/vm/costs/mod.rs 25 19 76.0%
Total (2 files) 29 23 79.31%

Coverage Regressions

230 previously-covered lines in 32 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
clarity/src/vm/database/clarity_db.rs 58 79.41%
clarity/src/vm/mod.rs 17 88.97%
stackslib/src/clarity_vm/database/marf.rs 16 60.42%
stackslib/src/net/stackerdb/sync.rs 16 74.31%
clarity/src/vm/database/key_value_wrapper.rs 15 80.81%
stacks-signer/src/v0/signer_state.rs 14 92.54%
stackslib/src/net/download/nakamoto/download_state_machine.rs 9 89.74%
stackslib/src/net/download/nakamoto/tenure_downloader_unconfirmed.rs 9 74.13%
clarity/src/vm/tooling/mod.rs 8 75.76%
stackslib/src/net/relay.rs 8 74.93%

Coverage Stats

Coverage Status
Relevant Lines: 230198
Covered Lines: 198905
Line Coverage: 86.41%
Coverage Strength: 20246240.59 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.

lgtm!

@brice-stacks
brice-stacks added this pull request to the merge queue Sep 4, 2026
Merged via the queue into stacks-network:main with commit a16463f Sep 4, 2026
734 of 740 checks passed
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.

5 participants