etherspot / skandha

A modular typescript implementation of ERC4337 (Account Abstraction) bundler client.
https://etherspot.io
MIT License
564 stars 57 forks source link

[BUG] Issue parsing eth_call data on Bifrost nodes #106

Closed arddluma closed 1 year ago

arddluma commented 1 year ago

Describe the bug

Getting Unexpected behavior due to not normal response returned by Bifrost node Looks like the parsing cannot be done correctly due to different error code and message returned.

"code": -32603,
"message": "VM Exception while processing transaction: revert",

Expected behavior

How other EVM nodes returns data

{
    "jsonrpc": "2.0",
    "id": 60,
    "error": {
        "code": 3,
        "message": "execution reverted",
        "data": "0x220266b600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001b4141313320696e6974436f6465206661696c6564206f72204f4f470000000000"
    }
}

Steps to reproduce

To reproduce: https://public-02.testnet.thebifrost.io/rpc

{
      "method": "eth_call",
      "params": [
        {
          "to": "0x91037ed7b25d72f61b80d4376c0e66680997ce5e",
          "data": "0x8cb84e18000000000000000000000000266d07bcedee855ee6c004ffc26d6cf8e924ff1a0000000000000000000000000000000000000000000000000000000000000000"
        },
        "latest"
      ],
      "id": 44,
      "jsonrpc": "2.0"
}

Additional context

How does Bifrost nodes returns:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32603,
        "message": "VM Exception while processing transaction: revert",
        "data": "0x8b7ac980000000000000000000000000000000000000000000000000000000000012fab30000000000000000000000000000000000000000000000000000000000138cfa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000"
    },
    "id": 60
}

Operating system

macOS

Skandha version or commit hash

1.0.13-alpha

0xSulpiride commented 1 year ago

fixed in #107