feat(portal): opt-in PORTAL_ALLOW_MISSING_ACCESS_LIST for RPCs that omit accessList (e.g. SQD zkSync proxy)#173
Open
abernatskiy wants to merge 1 commit into
Open
feat(portal): opt-in PORTAL_ALLOW_MISSING_ACCESS_LIST for RPCs that omit accessList (e.g. SQD zkSync proxy)#173abernatskiy wants to merge 1 commit into
abernatskiy wants to merge 1 commit into
Conversation
…mit accessList The fork's hardened RPC-path accessList-required check (in standardizeTransactions, added by every wiring patch) crashes any app whose RPC/proxy omits the spec-required accessList on typed-envelope txs. In practice this hits SQD's own zkSync RPC proxy, which returns type-0x2 txs with no accessList key at all (verified 11/11 across 50 blocks) — a fork-introduced regression vs stock ponder on a supported chain. The guard is right in general (it prevents fabricating an empty/NULL access list over a real one, #27/#32), so keep it as the default. Add an opt-in knob (default OFF, matching the PORTAL_* boolean convention): - unset → unchanged loud RpcProviderError, whose meta now NAMES the knob; - set → the missing value flows through and stores as an honest NULL (as the Portal path already does for column-less datasets, #110/#111). Read once per standardizeTransactions call (hoisted above the tx loop — cheap, and toggleable per call in tests). Applied to all 5 tracked wiring patches (0.15.17, 0.16.6-0.16.9), regenerated per PUBLISHING.md. Adds 3 tests to realtime-standardize covering: default-throws-and-names-knob, knob-passes-through-to-NULL on 0x1/2/3/4, and knob-preserves-a-present-list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011h8zdhxsC8A2bcFqZRcjeB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
accessList-required check — instandardizeTransactions(packages/core/src/rpc/actions.ts), added by everyportal/wiring/*.patch— throws on any type-0x1/0x2/0x3/0x4transaction whose RPC response omitsaccessList. That guard is correct in general: a silent omission would otherwise encode a permanentNULL(or a fabricated empty[]) over a genuinely-present on-chain access list — silent column-level data loss (realtime (RPC mode): access_list stored as NULL for realtime-ingested txs — including txs with real access lists; Portal /stream preserves them #27, cross-validation finding: single tx with fabricated-empty access_list ([]) in one of two independently-synced stores (chain 42161) #32).0x2) transactions with noaccessListkey at all (verified: 11/11 type-0x2txs across 50 blocks near the tip). So a zkSync app on the fork crashes at startup on the RPC path — on the exact proxy SQD documents — even though the Portal historical dataset for zkSync is fine. The check is fork-introduced (stock ponder has none), so this is a regression vs stock ponder on a supported chain. Found during fork testing (test report Bucket 2 style: update quote style to single in portal and adjust Biome config #4).Fix — an opt-in escape hatch
Add
PORTAL_ALLOW_MISSING_ACCESS_LIST(default OFF, matching the fork'sPORTAL_*boolean convention):accessListon a typed tx is a loudRpcProviderError.NULL— the same value the Portal path already stores for datasets that lack the column entirely (fix(transform): store NULL not fabricated [] when Portal drops accessList — refines #32 #110/fix(transform): gate accessList on the exact EIP type set {1,2,3,4}, not type≥1 (#110 follow-up) #111).Before → after (default, on SQD's zkSync proxy):
The message's
metanow reads:Why an env knob, not a config field
The check lives in upstream core (
standardizeTransactions), reached from many call sites; threading a config parameter would balloon the wiring patch and drift across ponder versions. The knob is read once per call (hoisted above the tx loop — cheap, and toggleable per call in tests), consistent with the fork's otherPORTAL_*env settings.Scope / invariants preserved
0x0), OP deposit (0x7e), and unknown/system envelopes (e.g. Arbitrum internals) — none require an access list.0.15.17,0.16.6–0.16.9), regenerated perPUBLISHING.md(git diff); the only change in each patch is the gate + hoisted read + reworded error.Test plan
scripts/sync-upstream.sh 0.16.9 --testgreen — adds 3 tests toportal/realtime-standardize.test.ts:accessListstill throws and the message names the knob;accessListon0x1/0x2/0x3/0x4passes through and encodes toNULL;accessListis preserved unchanged (no fabrication/loss).biome check .clean.Follow-up (not in this PR)
This is a mitigation, not a cure for the proxy's non-compliance. Open design question: whether the fork should additionally auto-detect a zkSync-family chain and default the knob on for it, and/or whether SQD's zkSync proxy should be made to emit the spec-required field. Tracked in the test report's deferred section.
🤖 Generated with Claude Code