diff --git a/src/modules/quotes/quotes.service.ts b/src/modules/quotes/quotes.service.ts index 715de9c4..2632bef1 100644 --- a/src/modules/quotes/quotes.service.ts +++ b/src/modules/quotes/quotes.service.ts @@ -122,7 +122,7 @@ export class QuotesService { } = options; const isEIP712SupportedMeeVersion = this.isVersionConsistentAndAboveTarget( - "2.2.0", + "2.2.1", meeVersions, ); @@ -677,7 +677,7 @@ export class QuotesService { } = options; const isEIP712SupportedMeeVersion = this.isVersionConsistentAndAboveTarget( - "2.2.0", + "2.2.1", meeVersions, ); const isStxValidatorSupportedMeeVersion = @@ -894,32 +894,18 @@ export class QuotesService { case "simple": { if (isSessionExists) { if (isEIP712SupportedMeeVersion) { - signature = concatHex([ - signatureType, // Simple signature type - encodeAbiParameters( - [ - { type: "bytes32" }, // stxStructTypeHash - { type: "uint256" }, // userOp index - { type: "bytes32[]" }, // meeUserOpHashes - array of hashes - { type: "bytes" }, // superTxSignature - ], - [ - SUPERTX_MEEUSEROP_STRUCT_TYPEHASH, - // For trusted sponsorship, as we're ignoring the payment userOp, index should be sub by 1 to account for that - // The index will be always greater than 1 if its sponsorship mode so sub by 1 is not a problem - isEIP712TrustedSponsorshipSupported && - isTrustedSponsorship - ? BigInt(index - 1) - : BigInt(index), - // If it is a trusted sponsorship, the payment userop can be skipped because it is not going to be executed at all. - isEIP712TrustedSponsorshipSupported && - isTrustedSponsorship - ? meeUserOpHashes.slice(1) - : meeUserOpHashes, - signatureData, - ], - ), - ]); + // Smart sessions with MEE >= 2.2.1: use raw ECDSA signature (no MEE prefix). + // This routes through NoMeeFlowLib.validateSignatureForOwner on-chain, + // which does plain ECDSA recovery against the raw userOpHash. + // + // We cannot use the MEE simple mode (0x177eee00) because: + // - SmartSession calls K1MeeValidator.validateSignatureWithData externally + // - compareAndGetFinalHash calls hashTypedDataForAccount(msg.sender, ...) + // - msg.sender is SmartSession's address, not the account + // - SmartSession doesn't implement eip712Domain() → reverts + // + // Session expiry is handled by SmartSession's own policies. + signature = signatureData; } else { signature = concatHex([ signatureType, diff --git a/src/modules/quotes/schemas.ts b/src/modules/quotes/schemas.ts index bacc8d0e..23adc690 100644 --- a/src/modules/quotes/schemas.ts +++ b/src/modules/quotes/schemas.ts @@ -23,7 +23,6 @@ export const meeVersionSchema = z.enum([ "3.0.0", "2.3.0", "2.2.1", - "2.2.0", "2.1.0", "2.0.0", "1.1.0", diff --git a/src/modules/simulator/simulation.service.ts b/src/modules/simulator/simulation.service.ts index 95dd44f7..6827670e 100644 --- a/src/modules/simulator/simulation.service.ts +++ b/src/modules/simulator/simulation.service.ts @@ -121,24 +121,9 @@ export class SimulationService { "0xcae0d1955b99d4832aef73ed0a2237045fad91a738ee5b96ba76b9a12ffc6f824ab2ecaeeeb903b50704fdf4a5d64216adf7d6aaaca0ed2a67b86d8525c4b4bb1c" as Hex; if (sessionInfo?.sessionDetails) { - const dummySignature = concatHex([ - "0x177eee00", // Simple signature type - encodeAbiParameters( - [ - { type: "bytes32" }, // stxStructTypeHash - { type: "uint256" }, // userOp index - { type: "bytes32[]" }, // meeUserOpHashes - array of hashes - { type: "bytes" }, // superTxSignature - ], - [ - SUPERTX_MEEUSEROP_STRUCT_TYPEHASH, - BigInt(index), - // If it is a trusted sponsorship, the payment userop can be skipped because it is not going to be executed at all. - isTrustedSponsorship ? meeUserOpHashes.slice(1) : meeUserOpHashes, - dummyStxSig, - ], - ), - ]); + // Smart sessions with MEE >= 2.2.1: use raw ECDSA signature (no MEE prefix). + // Routes through NoMeeFlowLib.validateSignatureForOwner on-chain. + const dummySignature = dummyStxSig; const dummySessionDetails: GrantPermissionResponseType = { ...sessionInfo?.sessionDetails, @@ -635,7 +620,7 @@ export class SimulationService { let meeVersion: MeeVersionsType = "2.0.0"; // From this version, the EIP712 signatures are being supported and the dummy signature needs to be different here - const eip712SignatureVersionTarget: MeeVersionsType = "2.2.0"; + const eip712SignatureVersionTarget: MeeVersionsType = "2.2.1"; if (meeVersionInfo) { meeVersion = meeVersionInfo.version.version; diff --git a/src/modules/user-ops/userop.service.ts b/src/modules/user-ops/userop.service.ts index 97d0bfca..3a7a1e52 100644 --- a/src/modules/user-ops/userop.service.ts +++ b/src/modules/user-ops/userop.service.ts @@ -458,14 +458,14 @@ export class UserOpService { let meeUserOpHash: Hex; if (isEIP712SupportedMeeVersion && isSimpleMode) { - // If the meeVersion >= 2.2.0, V2 meeUserOp hash will be generated for simple mode + // If the meeVersion >= 2.2.1, V2 meeUserOp hash will be generated for simple mode meeUserOpHash = getMeeUserOpHashEip712( userOpHash, lowerBoundTimestamp, upperBoundTimestamp, ); } else { - // If the meeVersion is less than 2.2.0, legacy meeUserOp hash will be generated + // If the meeVersion is less than 2.2.1, legacy meeUserOp hash will be generated meeUserOpHash = getMeeUserOpHash( userOpHash, lowerBoundTimestamp,