Repository navigation
[sdk]: emit standard eth_signTypedData_v4 payload for userop signing - #1134
Merged
Merged
Conversation
Wizdave97
reviewed
Aug 14, 2026
royvardhan
force-pushed
the
roy/mpc-userop-typed-data
branch
from
August 14, 2026 14:42
abe3884 to
03258d3
Compare
Member
|
Also revert this commit |
The length-only assertions let MPCVault's typed-data endpoint ship signatures that verify against nothing (#1132). Every signing test now recovers the signer address; the typed-data case uses the canonical v4 payload shape that packedUserOpTypedData emits, so it verifies the fix in this branch directly.
…enerics viem derives the domain's type from types.EIP712Domain, so the entries must be string literals (as const) and the numeric chainId needs a cast to bigint — viem's uint256 mapping wants bigint at the type level while its runtime accepts the number the canonical v4 JSON requires. Fixes the indexer and sdk test builds without changing the emitted payload.
Member
|
Empirically validated against a live MPCVault vault: the canonical payload ( |
seunlanlege
approved these changes
Aug 14, 2026
Member
|
Tested & working |
seunlanlege
added a commit
that referenced
this pull request
Aug 15, 2026
…ners Rebase integration. Main's #1136 batches every phantom bid registered in one Hyperbridge block into a single extrinsic — one bid per chain used to mean one extrinsic per chain, serialised on the account nonce, so the last chain's bid trailed the first by many blocks against a bid window measured in tens. This branch had meanwhile moved phantom consumption into the shared HyperbridgeScanner. The two now compose: - the scanner delivers per-block batches (`onPhantomOrders`), because the batch boundary is load-bearing — flattening it to per-order events would rebuild the nonce queue main just removed - the filler keeps main's preparePhantomBid/handlePhantomOrders pair unchanged; quoting stays concurrent per chain, submission is one extrinsic - BalanceProvider takes main's shape — it reuses the filler's Hyperbridge connection instead of dialling a second socket to the same node — merged with this branch's per-instance logger and the no-timer-after-stop guard - IntentFiller regains the hyperbridgeConnection getter boot now feeds it The sdk-side hardening (#1136's HTTP fallback and batch submission, #1134's typed-data payloads) flows through untouched: the scanner calls the same pollPhantomOrders and the filler the same submitPhantomBids.
seunlanlege
added a commit
that referenced
this pull request
Aug 18, 2026
Points the MPCVault integration test at what actually ships: the three operations through `mpcVaultSigner`, each checked by recovery, plus the set-code branch asserting a 0x04 envelope. 10/10 against a live vault on chain 1. Deletes `createMpcVaultAccount`. With the interface no longer carrying a viem account and `accountFor` building one from any Signer, nothing called it — the test was the only caller, exercising a factory the solver no longer runs. Its 7702 branch already moved to `mpcVaultSigner.signTransaction` and its `signMessage` throw to `accountFor`. An MPC-backed viem account, if anything wants one, is `accountFor(mpcVaultSigner(config))`. The first live run failed one case and the cause was the test's own payload: it omitted `types.EIP712Domain`. viem ignores that entry when hashing locally, but MPCVault hashes server-side from the JSON and derives the domain type from it, so the vault signed a digest recovery never checked — the #1134 failure, exactly. The constraint is now on `TypedDataPayload`'s doc comment, where someone building a payload will read it, instead of only in the sdk builder that already knew.
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.
packedUserOpTypedDataomittedEIP712Domainfromtypesand passedchainIdas a bigint. Local signers hash this fine, but backends that hash the typed data server-side from JSON do not: viem'sserializeTypedDatastrips the domain to{}whentypes.EIP712Domainis absent (Turnkey path), and MPC Vault builds an empty domain separator, so the signature recovers to the wrong address and userops fail ERC-4337 validation with AA24 "invalid account signature".Emit the canonical v4 payload instead:
EIP712Domainlisted intypes,chainIdas a number. The digest is unchanged for local signers (hashTypedDataparity withcomputeUserOpHashis covered by the existing tests).