fix(siwx): preserve multichain signing context - #5730
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
9 Skipped Deployments
|
🦋 Changeset detectedLatest commit: bca1ba9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 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 |
Visual Regression Test Results ✅ PassedChromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=1000 👉 Please review the visual changes in Chromatic and accept or reject them. |
📦 Bundle Size Check✅ All bundles are within size limits 📊 View detailed bundle sizes> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit > size-limit |
|
CI failure analysis for the first run:
A fresh CI run is in progress for the corrected test. |
|
Follow-up from the corrected CI attempt:
|
| }) | ||
| } as const | ||
| const signature = caipNetworkId | ||
| ? await (provider as unknown as UniversalProvider).request(request, caipNetworkId) |
There was a problem hiding this comment.
hate this pattern 😪
not saying we do it here but if the internal provider is WC, why do we have it typed as a diferent one.
There was a problem hiding this comment.
yeah can we not use as unknown kind of scary xd
| '@reown/appkit-adapter-wagmi': patch | ||
| '@reown/appkit-controllers': patch | ||
| '@reown/appkit-scaffold-ui': patch | ||
| '@reown/appkit-siwx': patch |
There was a problem hiding this comment.
Maybe include all packages or changet auto handle rest?
There was a problem hiding this comment.
+1 we need to include all packages
| if (params.connectorId === CommonConstantsUtil.CONNECTOR_ID.WALLET_CONNECT) { | ||
| if (!params.provider) { | ||
| throw new Error('WalletConnect provider is undefined') |
There was a problem hiding this comment.
Instead of having these checks to see if it's walletconnect, can't we do a fix in walletconnect connector for every adapter? Wouldn't that be easier
| async signMessage(message: string, context?: SignMessageContext) { | ||
| return ConnectionController._getClient()?.signMessage(message, context) | ||
| }, |
There was a problem hiding this comment.
Is it possible to get the context from contollers
5bf2689 to
bca1ba9
Compare
Description
Part 1 of the native GitHub stack: #5730 → #5732 → #5733 → #5734.
Fix the core SIWX time-of-check/time-of-use race. Message creation captured an account and CAIP
chain, but the default signing path discarded that context and later re-read mutable AppKit state.
In a multichain session, the active namespace could change before the user pressed Sign.
This layer:
SignMessageContextcontaining chain, account, and connectorSigning sequence
sequenceDiagram autonumber actor User participant SIWX participant State as Mutable AppKit state participant AppKit participant Adapter SIWX->>State: Read chain, account, connector once State-->>SIWX: eip155:1, 0xAccount, walletConnect SIWX->>SIWX: Create message and retain context State-->>State: Active namespace may change to Solana User->>SIWX: Sign SIWX->>AppKit: signMessage(message, capturedContext) AppKit->>AppKit: Resolve EVM adapter and provider from eip155:1 AppKit->>AppKit: Verify walletConnect is still active AppKit->>Adapter: Sign with captured network and accountType of change
Associated Issues
N/A
Validation
Checklist