test(staleness): pin exact-timeout and just-stale LTS boundary tests#190
test(staleness): pin exact-timeout and just-stale LTS boundary tests#190thedavidmeister wants to merge 2 commits into
Conversation
…feed Closes #55 Adds four staleness-boundary tests to LibFtsoV2LTSTest: - testFtsoV2LTSGetFeedExactTimeoutNotStale: block.timestamp == feedTimestamp + timeout must succeed (staleness check is strict >) - testFtsoV2LTSGetFeedJustStale: block.timestamp == feedTimestamp + timeout + 1 must revert with StalePrice - testFtsoV2LTSGetFeedTimeoutZeroStale: timeout == 0, any timestamp after feedTimestamp is stale - testFtsoV2LTSGetFeedTimeoutZeroExactNotStale: timeout == 0 at exactly feedTimestamp is not stale (0 > 0 is false) A regression flipping > to >= (or off-by-one in the timeout arithmetic) would be caught by the exact-boundary tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughFour new test functions are added to ChangesFTSO V2 LTS staleness boundary tests
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 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 |
Test failed due to RPC rate limit exhausted (call rate limit exhausted, retry in 10s). Co-Authored-By: Claude <noreply@anthropic.com>
Closes #55
Problem
testFtsoV2LTSGetFeedStaleexercised only a single stale point (warp +3601 over a 3600 timeout). The off-by-one boundary of theblock.timestamp > timestamp + timeoutpredicate was unverified: a regression flipping>to>=(or an off-by-one in the timeout arithmetic) would not be caught.timeout == 0(every block is stale once the feed is updated) was also unexercised.Fix
Adds four boundary tests to
LibFtsoV2LTSTest:testFtsoV2LTSGetFeedExactTimeoutNotStaleblock.timestamp == feedTimestamp + timeout>so equal is not stale)testFtsoV2LTSGetFeedJustStaleblock.timestamp == feedTimestamp + timeout + 1StalePricetestFtsoV2LTSGetFeedTimeoutZeroStaletimeout == 0,block.timestamp = feedTimestamp + 1StalePricetestFtsoV2LTSGetFeedTimeoutZeroExactNotStaletimeout == 0,block.timestamp == feedTimestampAll four tests use
vm.warp(absolute)anchored to the hardcoded feed timestamp1729795768(the ETH_USD feed value atBLOCK_NUMBER = 31843105, already used in the existing stale test). All 7LibFtsoV2LTSTesttests pass.Summary by CodeRabbit