fix(sdk): use signed permit chain for decrypt requests - #307
Open
Lesnak1 wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: e162a8c The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@Lesnak1 is attempting to deploy a commit to the Fhenix Team on Vercel. A member of the Team first needs to authorize it. |
Lesnak1
marked this pull request as ready for review
August 9, 2026 21:02
Author
|
Hi team, same situation as #323 - the Permit to ACP migration on master has structurally diverged from this PR's signed permit chain logic. Happy to rewrite against the new ACP API, or close this if it's been superseded. Let me know! |
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
decryptForViewanddecryptForTxwith regression testsProblem
withPermit(permit)is documented to use the supplied permit regardless of the builder's chain ID or account. Both decrypt builders already extractedpermit._signedDomain.chainIdto choose between mock and production execution, but the production methods still resolved the threshold-network URL and populated the requestchainIdfrom the builder state.As a result, a directly supplied permit could:
ChainIdUninitializedwhen the builder chain was unset, orFix
Pass the signed permit chain ID into the production decrypt methods and use it for both configuration lookup and the threshold-network request. The global-allowance path continues to use the resolved builder/public-client chain.
A patch changeset is included.
Verification
pnpm --filter @cofhe/sdk exec vitest run --project node core/test/decryptBuilders.test.ts— 34 passedpnpm --filter @cofhe/sdk check:typespnpm --filter @cofhe/sdk buildpnpm --filter @cofhe/sdk lint— 0 errorsgit diff --checkThe regression fixtures create a real local EIP-712 permit signature; only the external threshold-network boundary is isolated.