Skip to content

docs(pair): clarify numerator/denominator naming and document error conditions#194

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-06-30-issue-92-103-pair-natspec-rename
Open

docs(pair): clarify numerator/denominator naming and document error conditions#194
thedavidmeister wants to merge 1 commit into
mainfrom
2026-06-30-issue-92-103-pair-natspec-rename

Conversation

@thedavidmeister

Copy link
Copy Markdown
Collaborator

Closes #92
Closes #103

Summary

Two related readability issues in LibOpFtsoCurrentPricePair.sol:

#103 — inverted naming relative to call order

The pair op fetches the denominator symbol (symbolB) first via a memory-truncation trick, then the numerator (symbolA) second. The old variable names outputsB/priceB for the first call and outputsA/priceA for the second call follow the mathematical role of each price but are surprising when reading top-to-bottom code. Renames to denominatorOutputs/denominatorPrice and numeratorOutputs/numeratorPrice, and adds a comment explaining that the denominator is fetched first.

#92 — missing error documentation

run() NatSpec did not document:

  • The three inherited FTSO errors (InactiveFtso, StalePrice, PriceNotFinalized) that can be raised from either price leg.
  • That the denominator leg is evaluated first, so errors on symbolB abort before symbolA is queried.
  • The DivisionByZero revert from LibDecimalFloat when the symbolB USD price is zero.

Adds a @dev block covering all of these.

🤖 Generated with Claude Code

…onditions

Renames outputsA/priceA → numeratorOutputs/numeratorPrice and
outputsB/priceB → denominatorOutputs/denominatorPrice so the role of
each symbol is unambiguous at the call site.  Adds a comment marking
that the denominator (symbolB) is fetched first due to the memory-
truncation trick.

Expands run() NatSpec to document the three inherited FTSO error
conditions (InactiveFtso, StalePrice, PriceNotFinalized) and the
DivisionByZero from LibDecimalFloat when the denominator price is zero.

Closes #92
Closes #103

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1f6223ef-8e96-4643-bfac-e13bcd30f870

📥 Commits

Reviewing files that changed from the base of the PR and between cb20d03 and 4094f02.

📒 Files selected for processing (1)
  • src/lib/op/LibOpFtsoCurrentPricePair.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-30-issue-92-103-pair-natspec-rename

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

1 participant