fix(sdk): sync AppController ABI with deployed v1.5.1 (add containerPolicy)#167
Open
mcclurejt wants to merge 1 commit into
Open
fix(sdk): sync AppController ABI with deployed v1.5.1 (add containerPolicy)#167mcclurejt wants to merge 1 commit into
mcclurejt wants to merge 1 commit into
Conversation
…olicy) The bundled AppController ABI was stale relative to the deployed v1.5.1 contract. The on-chain `Release` struct gained a 4th field, `ContainerPolicy containerPolicy`, but the CLI's ABI still described the 3-field struct. This shifted the computed function selector for `upgradeApp`/`createApp`/`createAppWithIsolatedBilling` (e.g. upgradeApp 0xd80a956b vs deployed 0xe71ad404), so the AppController dispatcher found no match and reverted with empty data — surfaced as "EstimateGasExecutionError: execution reverted for an unknown reason" during gas estimation. Every app deploy/upgrade was broken. Fixes: - Replace the bundled ABI with the authoritative compiled v1.5.1 ABI. This also restores the missing `pendingReleaseBlockNumber` field in the AppConfig return tuple (a latent decode bug in getApps*) and adds the createEmptyApp/confirmUpgrade/getBillingAccount entries. - Add a ContainerPolicy type and EMPTY_CONTAINER_POLICY to the Release type, set at both Release construction sites, and pass it through the deploy + upgrade encoders. containerPolicy is only emitted on the release event and consumed off-chain, so an empty policy preserves the CLI's existing behavior. Verified end-to-end against sepolia-dev: gas estimation now succeeds and an upgrade tx mines with status 1, emitting ReleasePublished + AppUpgraded.
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.
Problem
Every
ecloud compute app deploy/upgradeagainstsepolia-devfailed at gas estimation with:Root cause
The bundled
AppController.jsonABI was stale relative to the deployed v1.5.1 contract. The on-chainReleasestruct gained a 4th field:A function selector is
keccak256of its signature, so the extra struct field changes the selector:upgradeApp0xd80a956b0xe71ad404createApp0xbe946ec50x5e92a19fcreateAppWithIsolatedBilling0xb7fe2169The CLI encoded calls with the old selectors, the AppController dispatcher found no match, and the call reverted with empty return data — which viem renders as the "unknown reason" error above.
How it was confirmed
PUSH4selectors:0xd80a956babsent,0xe71ad404present.eigenx-contracts@3ecd745).Fix
pendingReleaseBlockNumberfield in theAppConfigreturn tuple (a latent decode bug that brokegetAppsByDeveloper/getAppsByCreatorfor any developer with a pending upgrade), andcreateEmptyApp/createEmptyAppWithIsolatedBilling/confirmUpgrade/getAppPendingReleaseBlockNumber/getBillingAccountentries.ContainerPolicytype andEMPTY_CONTAINER_POLICYconstant; addcontainerPolicyto theReleasetype; set it at bothReleaseconstruction sites (prepare.ts,prebuilt.ts) and pass it through the deploy + upgrade encoders (caller.ts).containerPolicyis only emitted on theAppUpgraded/AppCreatedrelease event and consumed off-chain — the AppController does not read it. An empty policy therefore preserves the CLI's existing behavior (no container arg/cmd/env overrides, no restart policy).Verification
tsc --noEmitclean; SDK builds; prettier clean.srctests are pre-existing — reproduced on pristinemasterwith these changes stashed.sepolia-dev): rebuilt the CLI, rancompute app upgrade. Gas estimation now succeeds (~0.001873 ETH), and the upgrade tx mines with status 1, emittingReleasePublished(releaseId 7) +AppUpgraded.Follow-up (not in this PR)
There is no ABI-sync mechanism — ABIs are hand-copied from the contracts repo, which is how this drift happened. Worth adding a
make sync-abisthat pulls fromeigenx-contracts/out/to prevent recurrence.