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

Implement eth_getTransactionReceipt #73

Closed
gluneau opened this issue Nov 1, 2021 · 4 comments
Closed

Implement eth_getTransactionReceipt #73

gluneau opened this issue Nov 1, 2021 · 4 comments
Assignees

Comments

@gluneau
Copy link
Contributor

gluneau commented Nov 1, 2021

This is a requirement to get the Kreatr test running.

https://github.com/AcalaNetwork/bodhi.js/blob/master/eth-rpc-adapter/src/eip1193-bridge.ts#L219

@xlc
Copy link
Member

xlc commented Nov 10, 2021

It is kind of working now except subquery only index finalized blocks so tx in unfinalized blocks or txpool are not accessible, which is not matching to eth node behavior.

We need to maintain a cache and index tx in unfinalized blocks & txpool locally in order to support those

@shunjizhan
Copy link
Collaborator

we probably need this cache for all of the evm-subql related methods, so let's wait for these methods are implemented first, then we can add this feature for all of them. I will close this one and open another issue

@gluneau
Copy link
Contributor Author

gluneau commented Nov 16, 2021

With a delay I got to be able to actually get some results out of this function:

Quite too many 0x for my liking. ;-)

Here is the error from the console:

➜  hardhat npx hardhat run scripts/sample-script.js --network development
Error: invalid address (argument="address", value="0x", code=INVALID_ARGUMENT, version=address/5.5.0)
    at Logger.makeError (/home/acala/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError (/home/acala/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at Logger.throwArgumentError (/home/acala/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:241:21)
    at getAddress (/home/acala/hardhat/node_modules/@ethersproject/address/src.ts/index.ts:109:16)
    at Formatter.address (/home/acala/hardhat/node_modules/@ethersproject/providers/src.ts/formatter.ts:235:26)
    at Object.to (/home/acala/hardhat/node_modules/@ethersproject/providers/src.ts/formatter.ts:464:20)
    at Function.Formatter.check (/home/acala/hardhat/node_modules/@ethersproject/providers/src.ts/formatter.ts:449:42)
    at Formatter.receipt (/home/acala/hardhat/node_modules/@ethersproject/providers/src.ts/formatter.ts:396:54)
    at EthersProviderWrapper.<anonymous> (/home/acala/hardhat/node_modules/@ethersproject/providers/src.ts/base-provider.ts:1585:44)
    at step (/home/acala/hardhat/node_modules/@ethersproject/providers/lib/base-provider.js:48:23) {
  reason: 'invalid address',
  code: 'INVALID_ARGUMENT',
  argument: 'address',
  value: '0x',
  checkKey: 'to',
  checkValue: '0x'
}

And here are the logs from the RPC:

[1637102800695] DEBUG (1732491 on XPS-15-7590): incoming request
    jsonrpc: "2.0"
    method: "eth_getTransactionReceipt"
    params: [
      "0xfc78254710528e5512b56cb65fd82b20e07096c8613c1818f83b756c555658da"
    ]
    id: 17
[1637102800702] DEBUG (1732491 on XPS-15-7590): request completed
    id: 17
    jsonrpc: "2.0"
    result: {
      "to": "0x",
      "from": "0x75e480db528101a381ce68544611c169ad7eb342",
      "contractAddress": "0x3d3593927228553b349767aba68d4fb1514678cb",
      "transactionIndex": "2",
      "gasUsed": "0",
      "logsBloom": "0x",
      "blockHash": "0x80445fdb250a70538caee9eba28c8685073a99a935911c8f69a6f6425433d9a8",
      "transactionHash": "0xfc78254710528e5512b56cb65fd82b20e07096c8613c1818f83b756c555658da",
      "logs": [],
      "blockNumber": "28",
      "cumulativeGasUsed": "0",
      "type": "0",
      "status": "1",
      "effectiveGasPrice": "0x1",
      "confirmations": "0x0",
      "byzantium": false
    }

@shunjizhan
Copy link
Collaborator

I can fix this today

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

4 participants