Skip to content

fix(console): l1 upgrade builder follow-ups — chain-driven state, bundled predeploys, no snapshots#4294

Open
anishnar wants to merge 1 commit into
feat/l1-upgrade-json-builderfrom
fix/l1-upgrade-builder-followups
Open

fix(console): l1 upgrade builder follow-ups — chain-driven state, bundled predeploys, no snapshots#4294
anishnar wants to merge 1 commit into
feat/l1-upgrade-json-builderfrom
fix/l1-upgrade-builder-followups

Conversation

@anishnar

Copy link
Copy Markdown
Contributor

Stacked on #4276 (feat/l1-upgrade-json-builder) — final fixes for the L1 upgrade builder so testing can continue on this branch's preview without churning the base PR.

Fixes

Managed/self-hosted detection is server-authoritative

  • Select step and builder always query GET /api/console/l1-upgrade/managed (NodeRegistration table); the query-param hint and dashboard match are only in-flight fallbacks.
  • mode=detect skips the node-service round-trip on the select step; the GET reports managed: true + serviceError instead of a 5xx when reading the node's file fails.

eth_getActiveRulesAt fallback

  • Hosted public RPCs (e.g. Dispatch) don't expose eth_getActiveRulesAt. The RPC route now derives active precompiles from eth_getChainConfig (genesis configs + upgrades.precompileUpgrades replayed up to the latest block) and only surfaces an error when both methods fail. No more error banner on hosted RPCs.

Predeploy presets bundle their bytecode

  • The Source Contract dropdown (Transparent Proxy, Proxy Admin, ICM Messenger, Wrapped Native Token, Safe Singleton Factory, Multicall3, Create2 Deployer) fills runtime bytecode from the repo's compiled artifacts — the same ones genesis injects — instead of fetching from an RPC that may not have the contract deployed.
  • Presets that need storage initialization get it: proxy (EIP-1967 impl/admin slots), ICM messenger (reentrancy-guard slots), proxy admin (owner ← connected wallet). Manual code edits or custom addresses clear preset storage.

Snapshots removed; the chain itself is the source of truth

  • "Save to Builder Hub" / Save Snapshot UI is gone, snapshot route deleted, managed write/restart no longer record snapshots.
  • The existing upgrade.json prefills from: managed node file → chainConfig.upgrades over RPC → empty.
  • Apply step is strictly either/or: managed L1 → one full-width "Apply Upgrade to N Managed Nodes" button (write + restart in one click); custom/self-hosted docker → only the docker commands with the generated upgrade.json.
  • L1UpgradeSnapshot prisma model/migration left in place to avoid migrate drift on the preview DB — can be dropped before merge.

Also carries the earlier round of fixes: structural validation of pasted/imported upgrade.json, Add Wallet prompting the wallet connect flow when disconnected, native minter (and all active allowlist precompiles) getting an "Update Allowlist" path that generates the documented disable + re-enable pair, and the source contract preset dropdown.

Verification

  • 197 unit tests pass (tests/unit), including new coverage for deriveActivePrecompiles, extractUpgradeJsonFromChainConfig, storage in stateUpgrades, update-pair generation, and upgrade.json structure validation. tsc --noEmit and eslint clean.
  • 31/31 real-browser checks (Playwright + Chrome against next dev): managed/self-hosted/check-failed apply states, snapshot UI removal, base prefill from chainConfig, preset bytecode + storage fill, validation errors, one-click apply through write→restart→success, Add Wallet connect prompt.
  • Live-chain scenario against the real Dispatch RPC (no mocks): no eth_getActiveRulesAt banner, Native Minter / Fee Manager / Warp show Active via the chainConfig fallback, and the base upgrade.json prefills with Dispatch's actual feeManagerConfig upgrade.
  • Not covered: writes/restarts against the real managed-node service (mocked; needs live managed nodes — that's what this preview deployment is for).

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
builder-hub Ready Ready Preview, Comment Jun 12, 2026 4:41pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant