chore: better fetching#1563
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughThis PR adds ballot-aware lifecycle detection for CRISP E3s (marking tally windows with zero ballots as idle/noBallots), threads that flag through data adapters, updates active/past poll filtering and poll-card/inspector UI to surface "No ballots" / "Idle" messaging, and refreshes Sepolia contract addresses and deploy-block defaults; also adds a sticky-footer layout wrapper. ChangesE3 Poll Ballot-Aware Lifecycle and UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/enclave-dashboard/src/App.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. packages/enclave-dashboard/src/Inspector.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. packages/enclave-dashboard/src/PollCard.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.
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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@packages/enclave-dashboard/src/App.tsx`:
- Around line 200-207: The current filters treat any poll where isE3Active(...)
is false as past, which hides real "idle" polls (input window closed with zero
ballots); update the activePolls filter to include those idle polls by changing
its predicate to: keep a poll if isE3Active(p.stage, p.inputWindow[1], {
e3Program: p.e3Program, ballotCount: p.ballotCount }) OR if p.ballotCount === 0
and Date.now() > p.inputWindow[1] (i.e., input window closed with zero ballots),
and adjust pastPolls to be the inverse of that same combined condition so idle
polls are not treated as past; reference activePolls, pastPolls, isE3Active,
p.inputWindow, and p.ballotCount.
- Around line 200-207: The active/past partitions (activePolls and pastPolls
using useMemo) rely on isE3Active which uses current time, but the memos only
list polls as a dependency; update these memos to also depend on the clock/tick
value so they recompute as time advances. Locate activePolls and pastPolls in
App.tsx and add the same time-derived dependency used elsewhere (e.g., a now or
tick value from your clock hook or Date.now() state) to the dependency arrays so
isE3Active is recalculated every tick and polls move between buckets in real
time.
In `@packages/enclave-dashboard/src/lib/adapt.ts`:
- Around line 166-167: The adapter currently coerces a missing requestEventBlock
to 0; change the mapping for the requestedBlock property in the adapter (where
requestedAt and requestedBlock are set) to preserve null (e.g., requestedBlock:
detail.requestEventBlock != null ? Number(detail.requestEventBlock) : null) and
update the emitted type to allow number | null; then update the Inspector
component (Inspector) to render null as "—" so absent blocks are shown as
missing instead of "`#0`".
In `@packages/enclave-dashboard/src/lib/e3.ts`:
- Around line 300-305: After finding the requestLog, stop using the constant
DEPLOY_BLOCK for subsequent scans and set fromBlock to requestLog.blockNumber
(falling back to DEPLOY_BLOCK if requestLog is undefined); update the queries
that fetch committee/input/result logs to start from that fromBlock instead of
DEPLOY_BLOCK to avoid full-history scans (note: e3.requestBlock stores a
timestamp, so do not use its value as a block number). Ensure the code paths
that call requestLog, the fromBlock variable, and the committee/input/result
query calls are adjusted accordingly.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 47a2abd9-ad8a-4239-bcf9-431e9ee16f7f
📒 Files selected for processing (8)
packages/enclave-dashboard/.env.examplepackages/enclave-dashboard/src/App.tsxpackages/enclave-dashboard/src/Inspector.tsxpackages/enclave-dashboard/src/PollCard.tsxpackages/enclave-dashboard/src/lib/adapt.tspackages/enclave-dashboard/src/lib/chain.tspackages/enclave-dashboard/src/lib/e3.tspackages/enclave-dashboard/src/styles.css
b638a57 to
69294d8
Compare
Summary by CodeRabbit
New Features
Bug Fixes
Chores