You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(portal): close silent-gap paths (backfill floor + stream realtime), rebased onto the invariant re-architecture
Re-applies three silent-gap fixes from the pre-rearchitecture branch onto the
new module layout (portal.ts monolith → functional core + shell). Each ships a
regression test; the full Portal suite stays green (138 tests).
- backfill floor (finding 3, portal-filters.ts): an undefined fromBlock is
genesis (`filter.fromBlock ?? 0`), so if ANY source omits it the floor MUST be
0. compileFetchSpec's Math.min over the DEFINED-only fromBlocks let a bounded
source clamp every chunk fetch past an unbounded source's history, marking that
prefix synced over a silent gap.
- reconnect on child discovery (finding 4, portal-realtime*.ts): stream mode
filters /stream server-side, so a child discovered after a connection opens
can't reach it. streamHotBlocks now snapshots a logsRevision at open and
re-opens with the widened filter the moment it advances (bumped in the wire on
each child); ndjsonLines cancels its reader on early break so the old
connection closes.
- refuse unsupported stream mode (finding 5, portal-realtime-wire.ts): stream
mode emits only log-bearing block events, so a non-log source (trace/transfer/
transaction/block) or a receipt-requiring log source would be silently skipped
while its intervals finalized as cached. assertStreamModeSupported() fails loud
at startup instead.
Findings 6 (finalized-head probe) and 7 (unknown-parent gap) are intentionally
dropped: the re-architecture (#6) made the opposite, conservative choice on both
(passthrough / clear-window) as documented decisions — raise separately rather
than override here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`Portal ${chainName}: PORTAL_REALTIME=stream serves only log sources, but this chain has ${nonLog.join(', ')} source(s). Realtime would silently skip their events while marking the range synced. Use the default RPC realtime (unset PORTAL_REALTIME) or remove the non-log sources.`,
`Portal ${chainName}: PORTAL_REALTIME=stream cannot serve transaction receipts (a log source sets hasTransactionReceipt), so realtime would drop them. Use the default RPC realtime (unset PORTAL_REALTIME).`,
0 commit comments