fix: getBridgeUiConfig publishes the orbit-chain proxyAdmin under l2Contracts (parent chain) - #749
Open
gomesalexandre wants to merge 1 commit into
Conversation
…rent-chain one l2Contracts.proxyAdmin (docs: "Parent chain (L2) contract addresses") was populated from tokenBridgeContracts.orbitChainContracts.proxyAdmin instead of the parent chain's own admin proxy. coreContracts.adminProxy (decoded from the RollupCreated event, already bound in scope) is the correct value. Verified on-chain against the deployment tx the existing test already uses (0xc172278b...a7a8, Sepolia): the previously-emitted address (0x7618B3d4d8C71132BfCd33fDD98424a060F37470) has zero bytecode on Sepolia, while coreContracts.adminProxy (0xA811e68582E043680D915a38Cc11005Ef1F0A509) has 1933 bytes of real contract code there. Added a regression test asserting l2Contracts.proxyAdmin != l3Contracts.proxyAdmin and that it resolves to a real contract on the parent chain.
gomesalexandre
marked this pull request as ready for review
September 1, 2026 13:02
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.
bug
getBridgeUiConfig(src/getBridgeUiConfig.ts) publishes the orbit/child-chain ProxyAdmin address underl2Contracts.proxyAdmin, which the type's own doc comment says is "Parent chain (L2) contract addresses":Every other field in
l2Contractsis sourced fromparentChainContracts; onlyproxyAdminreaches intoorbitChainContracts. Root cause:TokenBridgeParentChainContractshas noproxyAdminfield of its own (inboxToL1Deploymentonly returns 6 addresses for the parent side), so the onlyproxyAdminin scope was the child chain's. The correct value is available in the same function:coreContracts.adminProxy, decoded from theRollupCreatedevent and already bound at the top ofgetBridgeUiConfig.on-chain verification (real RPC calls, not inferred)
Ran against the exact deployment tx the repo's own unit test already uses (
0xc172278b80251a7368409b5358fbf7e6250c1afc9a262e38ca15e1ba2bb9a7a8, Sepolia, viahttps://sepolia.gateway.tenderly.co):The address the SDK currently hands out as the parent chain's ProxyAdmin has zero bytecode on the parent chain — it doesn't exist there.
coreContracts.adminProxydoes, with a bytecode size consistent with the other real proxies on that chain.fix
proxyAdmin: coreContracts.adminProxyatsrc/getBridgeUiConfig.ts:114. Re-recorded the snapshot (src/__snapshots__/getBridgeUiConfig.unit.test.ts.snap) — the only field that changes isl2Contracts.proxyAdmin, from the wrong-chain address tocoreContracts.adminProxy, matching the on-chain evidence above.Added a regression test:
l2Contracts.proxyAdmin !== l3Contracts.proxyAdmin(catches the exact regression: reusing the same value across both chains)l2Contracts.proxyAdminhas real bytecode on the parent-chain client (catches a future wrong-but-different value too, not just this specific one)testing
Full suite before vs. after the fix, to confirm no regressions beyond the one expected snapshot change:
Identical failure counts — the 18 pre-existing failures (mostly
createRollupPrepareTransactionRequest.type.test.tserroring onParent chain not supported: undefined, unrelated to this file) are already present on unmodifiedmainand untouched by this change; my one new test is now green and counted in the 312.review note
Ran a synchronous adversarial Codex pass as a second reviewer; it didn't finish producing a verdict within a reasonable window (killed rather than left running indefinitely), so this went through a second thorough self-review pass instead, specifically re-checking: (1) whether
coreContracts.adminProxyis really the correct semantic value here (yes — consistent withl3Contractsalready correctly usingorbitChainContracts.proxyAdminthe same way, and confirmed on-chain above), (2) whether the new test has gaps (addressed by pairing the inequality check with a bytecode-presence check), (3) whether anything else nearby in this function is wrong (re-read every field; all others are already correctly matched to their chain's contracts object).risk
Low. Single-field fix reusing a value (
coreContracts.adminProxy) that's already computed and used elsewhere in the same function; no new dependencies, no change to any other field.