Prevent Index DTF auctions from crossing fee handouts - #1090
Prevent Index DTF auctions from crossing fee handouts#1090reserve-hermes wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThe change prevents launcher and community auctions from crossing the next daily TVL fee handout. It adds shared UTC-boundary detection, localized warnings, disabled controls, unit tests, end-to-end tests, and coverage documentation. ChangesAuction overlap prevention
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to The PR prevents auctions from starting when their warmup and duration would cross the next UTC-day fee handout. Merge readiness is low-risk but requires owner confirmation that both launch paths enforce this boundary with authoritative transaction timing, since a stale browser clock or submission delay could otherwise permit an overlap. Sequence Diagram(s)sequenceDiagram
participant LaunchAuctionsButton
participant CurrentTime
participant OverlapHelper
participant LaunchControl
LaunchAuctionsButton->>CurrentTime: Read current timestamp
LaunchAuctionsButton->>OverlapHelper: Check auction length against next fee handout
OverlapHelper-->>LaunchAuctionsButton: Return overlap status
LaunchAuctionsButton->>LaunchControl: Disable control and show warning
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Deploying register-app with
|
| Latest commit: |
d6fb824
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ee209d8.register-app.pages.dev |
| Branch Preview URL: | https://feature-prevent-auction-fee.register-app.pages.dev |
lcamargof
left a comment
There was a problem hiding this comment.
Good direction overall — the click-time recheck failing closed is the right guard and the e2e coverage of the stale/race scenarios is solid. Requesting a few changes before merge:
- Drop the RPC plumbing for the render-time check — we already have
auctionLengthon the DTF entity (indexDTFAtom). Governance changing it is highly unlikely, and the click handler re-reads it from RPC anyway. Details inline. - The click-time guard is a silent no-op — needs user feedback in both buttons. This becomes mandatory once the render check uses the entity value, since it's the only signal in the stale window.
- Dedupe the two 1s intervals in the community button.
Hardening steps to keep quality while addressing these:
- RED→GREEN the click-feedback change: extend the two "rechecks at click time" e2e specs to assert the overlap message/toast appears after the blocked click, not just
tx.logempty. - Keep all 7 launch-write specs green after removing the plumbing — the stale-subgraph spec should still pass since the handler still reads RPC (that's the guard it's actually proving).
- Don't touch the fail-closed behavior in the handlers: block → feedback → return, never fall through to
writeContract. - Update
src/views/index-dtf/auctions/CLAUDE.mdto match the final data flow (entity value for render, RPC at click) and re-run the full closeout gate (lint, typecheck, unit, e2e smoke). - The
>=boundary semantics and the wallet signing/inclusion delay stay flagged for engineer review — don't self-resolve those.
Summary
dtf.auctionLengthfor the render-time disabled state, while re-readingauctionLength()from live Folio RPC immediately before submissionTest plan
pnpm lintpnpm typecheckpnpm test:run(891 passed)pnpm exec tsc -p e2e/tsconfig.json --noEmitpnpm exec vitest run e2e/helpers/tests(72 passed)pnpm e2e:smoke(64 passed, 1 existing skip)launch-write.spec.ts(8 passed)pnpm exec lingui compileReview notes
wiki-lintremains blocked by the pre-existing staledocs/wiki/domains/design-system.mdpage; this change does not touch that domain.Summary by CodeRabbit
New Features
Bug Fixes
Tests