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

[BUG] eth_getUserOperationByHash fails with unable to parse transaction error #256

Open
gnpar opened this issue Oct 9, 2024 · 0 comments

Comments

@gnpar
Copy link

gnpar commented Oct 9, 2024

Describe the bug

I'm using skandha in standalone mode with a local fork using foundry's anvil. The entrypoint address is set via env variables:

SKANDHA_ENTRYPOINTS=0x0000000071727De22E5E9d8BAf0edAc6f37da032

This causes calls to eth_getUserOperationByHash to fail because the check that tx.to == this.address on the EntryPointV7Service is comparing a checksummed address with a lowercase address.

Specifically, the transaction receipt has to: "0x0000000071727De22E5E9d8BAf0edAc6f37da032" and the EntryPointV7Service instance has address: "0x0000000071727de22e5e9d8baf0edac6f37da032".

Expected behavior

eth_getUserOperationByHash should return the user operation with the details of the transaction.

Steps to reproduce

  1. Start skandha in standalone mode
  2. Send a useroperation
  3. Wait for the useroperation to be executed
  4. Call eth_getUserOperationByHash with the operation

Additional context

User ops are received and relayed correctly to the node (log output):

skandha-1  | [18:46:35.683] DEBUG (1): Found some entries, trying to create a bundle
skandha-1  | [18:46:35.693] DEBUG (1): Sent new bundle to Skandha relayer...
skandha-1  | [18:46:35.713] DEBUG (1): Trying to submit userops: 0xdf0f5cea19c7ca14a7f4105b168359081aa66b24a48e89b6fac4b8c44b472668
[...]
skandha-1  | [18:46:35.729] DEBUG (1): Sent new bundle 0xf4d8a12d6305b7422545a76803c0a45764a167fa5f0bd044f3b682b9aaedd85a
skandha-1  | [18:46:35.729] DEBUG (1): Bundle submitted: 0xf4d8a12d6305b7422545a76803c0a45764a167fa5f0bd044f3b682b9aaedd85a
skandha-1  | [18:46:35.729] DEBUG (1): User op hashes 0xdf0f5cea19c7ca14a7f4105b168359081aa66b24a48e89b6fac4b8c44b472668

But calling eth_getUserOperationByHash fails with Error: unable to parse transaction:

skandha-1  | [18:47:47.598] INFO (1): REQUEST ::
skandha-1  |     reqId: "req-5"
skandha-1  |     method: "POST"
skandha-1  |     url: "/rpc"
skandha-1  |     body: {
skandha-1  |       "jsonrpc": "2.0",
skandha-1  |       "method": "eth_getUserOperationByHash",
skandha-1  |       "params": [
skandha-1  |         "0xdf0f5cea19c7ca14a7f4105b168359081aa66b24a48e89b6fac4b8c44b472668"
skandha-1  |       ],
skandha-1  |       "id": 4
skandha-1  |     }
skandha-1  | [18:47:47.879] ERROR (1): unable to parse transaction
skandha-1  |     err: {
skandha-1  |       "type": "Error",
skandha-1  |       "message": "unable to parse transaction",
skandha-1  |       "stack":
skandha-1  |           Error: unable to parse transaction
skandha-1  |               at EntryPointV7Service.getUserOperationByHash (file:///usr/app/packages/executor/lib/services/EntryPointService/versions/0.0.7.js:184:19)
skandha-1  |               at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
skandha-1  |               at async Eth.getUserOperationByHash (file:///usr/app/packages/executor/lib/modules/eth.js:285:31)
skandha-1  |               at async EthAPI.getUserOperationByHash (file:///usr/app/packages/api/lib/modules/eth.js:47:16)
skandha-1  |               at async ApiApp.handleRpcRequest (file:///usr/app/packages/api/lib/app.js:222:30)
skandha-1  |               at async Object.<anonymous> (file:///usr/app/packages/api/lib/app.js:41:28)
skandha-1  |     }
skandha-1  | [18:47:47.879] INFO (1): RESPONSE ::
skandha-1  |     reqId: "req-5"
skandha-1  |     body: {
skandha-1  |       "error": "Unexpected behaviour"
skandha-1  |     }

The root cause seems to be the way that env vars are loaded into the config. A current workaround is to set the relayer in config.json instead of through env vars, this prevents the issue.

But a real fix would probably be to always normalize addresses for comparison.

Operating system

Linux

Skandha version or commit hash

v2-2.0.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant