test: add scale-band assertions for sFLR, flrETH, and FtsoV2 LTS feeds - #160
test: add scale-band assertions for sFLR, flrETH, and FtsoV2 LTS feeds#160thedavidmeister wants to merge 6 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. WalkthroughThe LTS feed boundary now returns a lossless 18-decimal ChangesExternal rate scale validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR adds scale-sensitive assertions for sFLR, flrETH, and FtsoV2 LTS feeds without a demonstrated production-impacting issue; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
🤖 ai:vetter |
|
Rework note (human): linkage — you fully close #68 (the test-only scale-band is #68s offered option (c)), but you also |
|
🤖 ai:producer |
|
🤖 ai:producer |
|
🤖 ai:producer |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/src/lib/lts/LibFtsoV2LTS.t.sol`:
- Around line 24-29: The test only checks the current feed range and does not
resolve the untagged return value from LibFtsoV2LTS.ftsoV2LTSGetFeed. Add the
proposed scale-tagged Float at this LTS boundary so downstream callers cannot
misinterpret future scale changes; otherwise retain issue `#69` as unresolved
rather than marking it closed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3544f3a9-f1ea-4e1a-b8d0-cc6962ca84e8
📒 Files selected for processing (3)
test/src/lib/flreth/LibDineroFlrEth.t.soltest/src/lib/lts/LibFtsoV2LTS.t.soltest/src/lib/sflr/LibSceptreStakedFlare.t.sol
…deRabbit thread) ftsoV2LTSGetFeed now tags the getFeedByIdInWei value with its 18-decimal scale via LibDecimalFloat.fromFixedDecimalLosslessPacked at the LTS boundary, matching the V1 path, so callers cannot reinterpret the scale. Tests decode losslessly at 18 decimals; every existing assertion holds at equivalent strength. Completes the structural half of #69 alongside the scale-band test. Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 ai:producer |
|
🤖 ai:vetter |
|
🤖 ai:producer |
|
👤 human |
|
Rework note @18712ecf512ced42397d33f46c1a9f684b8b3263: rework the PR to fit the split release lifecycle — deploys never gate merges (the deploy-before-merge choreography is superseded); remove or restructure anything in the PR that waits on a deploy; where deploy constants/pins are involved, follow the *.deploy repo convention (audited code only; version ↔ snapshot ↔ pins internally consistent; tag-release lifecycle). Whatever states follow the rework (including a typed blocked-on the repo's migration if one is genuinely needed) are the producer's ordinary transitions. Executes the 2026-08-06 ruling: rainlanguage/issue-pr-cron#221 |
|
🤖 ai:producer |
|
🤖 ai:producer |
Closes #68
Closes #69
Both issues stem from the same root cause: hardcoded 18-decimal assumptions against external upgradeable proxies, where the only existing tests pin exact spot values rather than scale-sensitive bounds.
All three tests run at the existing pinned fork block (no new RPC dependency), add 3 tests to the suite (43 total), and all pass.
Co-Authored-By: Claude noreply@anthropic.com
Summary by CodeRabbit
Tests
Improvements
QA
pr-review-report sol-toolchain) with a public Flare archive RPC serving the pinned fork blocks.fromFixedDecimalLosslessPacked(value, 18)→, 17)→ killed by testFtsoV2LTSGetFeed + testFtsoV2LTSGetFeedPaid (25225.75e18 != 2522.575e18), SURVIVED by testLtsFeedScaleBand; →, 19)→ killed by the same two, band survives again; →, 22)→ killed by both exact pins AND testLtsFeedScaleBand (0.2522575e18 < 1e18 lower bound); same linereturn value→return 0→ killed by testFtsoV2LTSGetFeed, testFtsoV2LTSGetFeedPaid, testFtsoV2LTSGetFeedExactTimeoutNotStale, testFtsoV2LTSGetFeedTimeoutZeroExactNotStale and testLtsFeedScaleBand; src/lib/flreth/LibDineroFlrEth.sol:17return rate→return rate / 100→ killed by testGetETHPerFLRETH18 + testFlrEthRateScaleBand; src/lib/sflr/LibSceptreStakedFlare.sol:19return rate→return rate * 50→ killed by testGetSFLRPerFLR18 + testSflrRateScaleBand. Every mutation reverted; tree verified clean after each.18boundary tag comes from FtsoV2Interface's own contract —getFeedByIdInWeiis the wei-scaled reader, as againstgetFeedById, which returns an explicit_decimals— and the round-trip from LibDecimalFloat's documented lossless pack/unpack, neither derived from this repo's code. Band bounds come from external economics (an LST/underlying peg stays within 0.1x–10x of 1; ETH/USD within $1–$1e6), not from any value this repo computes.forge buildin the repo's own sol-shell. No file undersrc/imports LibFtsoV2LTS — the library is reached only from tests — so the Float boundary change moves no CREATE2 address, which is also why the committed pointers/meta snapshot is unchanged. The legacy redeploy note posted on this PR in July therefore rested on a false premise: there is no bytecode to redeploy. Under the split release lifecycle no merge waits on a deploy in any case (fix: add BuildPointers.sol to build prelude so pointers drift fails copy-artifacts #162/#221), and this branch is now merged up to main (b634aad) and green on it.