Skip to content

docs(natspec): correct stale calculateClearStateChange cap description#2785

Open
thedavidmeister wants to merge 4 commits into
mainfrom
2026-06-18-issue-2671-natspec
Open

docs(natspec): correct stale calculateClearStateChange cap description#2785
thedavidmeister wants to merge 4 commits into
mainfrom
2026-06-18-issue-2671-natspec

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Corrects the stale calculateClearStateChange function-level NatSpec in RaindexV6.sol. The old prose described an obsolete formula (counterparty IO * counterparty_outputMax) inherited from a legacy OrderBook. The actual cap logic (correctly documented in the @dev on calculateClearStateAlice) caps each order's output via the counterparty's max output, with input back-derived from the IO ratio.

No bytecode change — this is a /// comment only.

Refs #2671 (partial: items 1-3 require code changes; items 5-6 are in upstream packages)

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Summary by CodeRabbit

  • Documentation
    • Clarified the description of how clear-state values are calculated, making the order of operations and limits easier to understand.

The previous prose described the old 'counterparty_IO * counterparty_outputMax'
formula. The actual cap logic: each order's output is capped by the
counterparty's max output (with input back-derived from the IO ratio).

Refs #2671
@thedavidmeister thedavidmeister self-assigned this Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e9a815f-609d-4dcd-82ea-ab225b59e6c3

📥 Commits

Reviewing files that changed from the base of the PR and between 32266db and dc87aa2.

📒 Files selected for processing (1)
  • src/concrete/raindex/RaindexV6.sol

📝 Walkthrough

Walkthrough

Updated the NatSpec comment above calculateClearStateChange to describe the clear-state calculation in terms of capped output and IO-ratio-derived input. No executable code changed.

Changes

RaindexV6 clear-state comment update

Layer / File(s) Summary
NatSpec wording
src/concrete/raindex/RaindexV6.sol
The comment above calculateClearStateChange now states that each order’s output is capped by the counterparty’s maximum output and each input is derived from the IO ratio.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I hopped by the ledger in moonlit gleam,
Reading NatSpec lines like a carrot dream.
Outputs capped, inputs traced just so,
🐰 The code stayed still, but the words now glow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the NatSpec documentation update for calculateClearStateChange and the stale cap wording fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-18-issue-2671-natspec

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant