Skip to content

docs: add documentation for arithmetic_checker#7178

Open
brice-stacks wants to merge 5 commits into
stacks-network:developfrom
brice-stacks:chore/arithmetic-checker
Open

docs: add documentation for arithmetic_checker#7178
brice-stacks wants to merge 5 commits into
stacks-network:developfrom
brice-stacks:chore/arithmetic-checker

Conversation

@brice-stacks
Copy link
Copy Markdown
Contributor

@brice-stacks brice-stacks commented May 1, 2026

This just adds some documentation for the arithmetic checker because once a quarter I look at this file and think, "wait, what is this doing?"

@coveralls
Copy link
Copy Markdown

coveralls commented May 1, 2026

Coverage Report for CI Build 25824647663

Coverage decreased (-0.03%) to 85.68%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 5424 coverage regressions across 102 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

5424 previously-covered lines in 102 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
stackslib/src/config/mod.rs 358 69.04%
stackslib/src/chainstate/stacks/index/storage.rs 262 80.55%
stackslib/src/chainstate/stacks/miner.rs 238 83.35%
stackslib/src/net/inv/epoch2x.rs 222 79.49%
stackslib/src/chainstate/stacks/db/transactions.rs 203 97.13%
stackslib/src/net/chat.rs 202 92.95%
stackslib/src/chainstate/stacks/db/mod.rs 196 86.23%
stackslib/src/chainstate/stacks/index/trie_sql.rs 190 69.7%
stackslib/src/core/mempool.rs 170 86.87%
stackslib/src/chainstate/stacks/index/node.rs 160 87.35%

Coverage Stats

Coverage Status
Relevant Lines: 219691
Covered Lines: 188232
Line Coverage: 85.68%
Coverage Strength: 18845101.9 hits per line

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds module-level Rustdoc describing what the arithmetic checker does and why it exists (cost-function contract eligibility checks for SIP-006 cost-voting), plus a changelog fragment noting the documentation addition.

Changes:

  • Document the eligibility requirements enforced by ArithmeticOnlyChecker (determinism, no side effects, boundedness, trait restrictions).
  • Explain where the eligibility result is stored and how it is used by cost-voting logic.
  • Add a changelog fragment for the documentation update.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
clarity/src/vm/analysis/arithmetic_checker/mod.rs Adds module-level documentation describing the arithmetic checker’s purpose, constraints, and where its result is consumed.
changelog.d/arithmetic-checker.added Adds a changelog fragment noting the documentation addition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread clarity/src/vm/analysis/arithmetic_checker/mod.rs Outdated
Comment thread clarity/src/vm/analysis/arithmetic_checker/mod.rs Outdated
Comment thread clarity/src/vm/analysis/arithmetic_checker/mod.rs Outdated
Copy link
Copy Markdown
Contributor

@francesco-stacks francesco-stacks left a comment

Choose a reason for hiding this comment

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

LGTM! Only one nit: I'd remove any reference to at-block.. just because.

Note that the tests are failing, but that's due to a PR that was recently merged in develop. You just need to sync with develop

Comment thread clarity/src/vm/analysis/arithmetic_checker/mod.rs Outdated
@brice-stacks
Copy link
Copy Markdown
Contributor Author

LGTM! Only one nit: I'd remove any reference to at-block.. just because.

Done, 238d2f9.

Copy link
Copy Markdown
Contributor

@francesco-stacks francesco-stacks left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread clarity/src/vm/analysis/arithmetic_checker/mod.rs Outdated
Comment thread changelog.d/arithmetic-checker.added
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@cylewitruk-stacks cylewitruk-stacks left a comment

Choose a reason for hiding this comment

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

lgtm 👍

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