Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated UserOperation type #886

Closed
bh2smith opened this issue Jun 26, 2024 · 2 comments
Closed

Outdated UserOperation type #886

bh2smith opened this issue Jun 26, 2024 · 2 comments

Comments

@bh2smith
Copy link

bh2smith commented Jun 26, 2024

I am running into some errors with sendUserOperation attempting to use the relay-kit:

Error: {"message":"UserOperation mismatch, EntryPoint expects UserOperation of version 0.7","code":-32602}

According to these docs:
https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace

The initCode field should be split into factory & factoryData

toUserOperation(): UserOperation {
return {
sender: this.data.safe,
nonce: ethers.toBeHex(this.data.nonce),
initCode: this.data.initCode,
callData: this.data.callData,
callGasLimit: this.data.callGasLimit,
verificationGasLimit: this.data.verificationGasLimit,
preVerificationGas: this.data.preVerificationGas,
maxFeePerGas: this.data.maxFeePerGas,
maxPriorityFeePerGas: this.data.maxPriorityFeePerGas,
paymasterAndData: this.data.paymasterAndData,
signature: ethers.solidityPacked(
['uint48', 'uint48', 'bytes'],
[this.data.validAfter, this.data.validUntil, this.encodedSignatures()]
)
}
}
}

Note that we are using the entry point supplied by @safe-global/safe-modules-deployments

Its a bit funny because the PimlicoFeeEstimator doesn't complian about this userOperation type on gas estimation.

After splitting the initCode into factory and factoryData we also ran into an issue with the packed PaymasterData:

Error: {"message":"Validation error: Unrecognized key(s) in object: 'paymasterAndData' at \"params[0]\"","code":-32601}

It seems that we should be using:

      paymaster, // address
      paymasterVerificationGasLimit, // uint256
      paymasterPostOpGasLimit, // uint256
      paymasterData, // bytes
@dasanra
Copy link
Collaborator

dasanra commented Jul 22, 2024

Hey @bh2smith , currently the relay kit is only compatible with entrypoint v0.6. There is no expected yet to support v0.7.

Using a v0.6 entrypoint should solve your issue.

@dasanra
Copy link
Collaborator

dasanra commented Jan 31, 2025

About to add v0.7 support with #1103

@dasanra dasanra closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants