fix: 30730 prevent spurious Sei Ledger swap "Something went wrong" error#31078
Draft
dawnseeker8 wants to merge 1 commit into
Draft
fix: 30730 prevent spurious Sei Ledger swap "Something went wrong" error#31078dawnseeker8 wants to merge 1 commit into
dawnseeker8 wants to merge 1 commit into
Conversation
…elay Patch @metamask/bridge-status-controller@72.0.0 to pause 3s after the approval tx confirms on Sei (chainId 1329) before broadcasting the trade tx. Sei's Cosmos account_sequence lags local confirmation, so the immediate trade broadcast was rejected with "incorrect account sequence", surfacing a misleading "Something went wrong" hardware-wallet sheet even though the swap ultimately succeeded. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
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.
Description
On Sei, a Ledger swap that requires 2 signatures (token approval + trade) completes successfully on-chain, yet a misleading "Something went wrong" hardware-wallet sheet is still shown to the user.
Root cause: Sei (chainId
1329) is a Cosmos-SDK chain with EVM compatibility. In@metamask/bridge-status-controller's sequential EVM submit flow (submitEvmHandler), the controller waits for the approval tx to reachconfirmedstatus locally and then immediately broadcasts the trade tx. On Sei, the Cosmosaccount_sequencehas not yet propagated through the RPC at that point, so the trade tx is initially rejected withRPC submit: : incorrect account sequence. That rejection is parsed toErrorCode.Unknownand surfaced via the hardware-wallet error bottom sheet ("Something went wrong"), even though the swap ultimately lands and succeeds.Fix: Patch
@metamask/bridge-status-controller@72.0.0to pause for 3s only on Sei, after the approval tx confirms and before the trade tx is broadcast — mirroring the existing LINEA/BASE pattern inhandleApprovalDelay. This gives the chain time to update its account state, so the trade is accepted on the first broadcast and no spurious error is shown. The delay sits inside therequireApproval && approvalTxIdbranch, so it only runs on hardware-wallet flows and is invisible to other users.Implemented as a yarn-berry patch (consistent with the repo's existing dependency-patch convention):
.yarn/patches/@metamask-bridge-status-controller-npm-72.0.0-eb8f9d1327.patch— patches bothdist/strategy/evm-strategy.cjsanddist/strategy/evm-strategy.mjspackage.json— adds the patch resolution (dependency kept at^72.0.0)yarn.lock— updated accordingly (yarn install --immutablepasses)Changelog
CHANGELOG entry: Fixed a misleading "Something went wrong" error shown to Ledger users after a successful 2-approval swap on the Sei network.
Related issues
Fixes: #30730
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
Note
This change adds an intentional 3s delay on Sei hardware-wallet swaps (only after approval confirmation). It is a timing heuristic and still needs on-device verification with a Ledger on Sei to confirm the spurious error is gone across varying RPC latencies.
Pre-merge reviewer checklist
Made with Cursor