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

Use ipld-eth-server RPC endpoint for eth_call #169

Closed
ashwinphatak opened this issue Jul 28, 2021 · 7 comments
Closed

Use ipld-eth-server RPC endpoint for eth_call #169

ashwinphatak opened this issue Jul 28, 2021 · 7 comments
Assignees

Comments

@ashwinphatak
Copy link
Collaborator

ashwinphatak commented Jul 28, 2021

Fix depends on https://github.com/vulcanize/ops/issues/64

@nikugogoi
Copy link
Collaborator

Getting errors in eth_call when using ipld-eth-server RPC endpoint
Error from ethers.js which is using the endpoint

reason: 'processing response error',
code: 'SERVER_ERROR',
body: '{"jsonrpc":"2.0","id":44,"error":{"code":-32000,"message":"eth_call failed without error"}}\n',
error: Error: eth_call failed without error
  code: -32000,
  data: undefined

Error in ipld-eth-server log

ERRO[2021-08-06T12:02:18+05:30] tx cid retrieval error                       
ERRO[2021-08-06T12:02:18+05:30] ChainId failed with err missing destination name tx_type in *[]eth.TxModel 
WARN[2021-08-06T12:02:18+05:30] Caller gas above allowance, capping; requested: 9223372036854775807, cap: 1000000000000

Notes:

  • Same eth_call works for geth_server.
  • Methods like getBalance and blockNumber are working for ipld-eth-server.

@ramilexe
Copy link
Contributor

ramilexe commented Aug 9, 2021

Probably the problem with chain config. Please take a look: cerc-io/ipld-eth-server@97d8c4d
ipld-eth-server accepts chain parameter to pass custom chain config.

@nikugogoi
Copy link
Collaborator

Getting response now with proper values.

Using JSON RPC methods like getBalance and blockNumber log errors in ipld-eth-server

ERRO[2021-08-12T11:34:59+05:30] tx cid retrieval error                       
ERRO[2021-08-12T11:34:59+05:30] ChainId failed with err missing destination name tx_type in *[]eth.TxModel

Using eth_call for a contract shows the same errors along with a warning

WARN[2021-08-12T11:35:38+05:30] Caller gas above allowance, capping; requested: 9223372036854775807, cap: 1000000000000

@ashwinphatak ashwinphatak assigned ramilexe and unassigned nikugogoi Aug 13, 2021
@ramilexe
Copy link
Contributor

As discussed in slack channel:

It appears when you use incompatible versions of statediff-migrations and ipld-eth-server.

here we added tx_type to transaction_cids table

here we do select * from transaction_cids and put it to TxModel object.

TxModel imported from ipld-eth-indexer and it is not updated to use tx_type field: https://github.com/vulcanize/ipld-eth-indexer/blob/c365dad5f72ec78e0f881421effc3fff9ae4737c/pkg/eth/models.go#L53-L63

Upgrading dependency to latest ipld-eth-indexer is in this PR cerc-io/ipld-eth-server#92

Also, to be able to work with existing version of ipld-eth-server please use statediff-migrations the same version
as in docker-compose file https://github.com/vulcanize/ipld-eth-server/blob/master/docker-compose.yml#L19

@ashwinphatak
Copy link
Collaborator Author

Works on ipld-eth-server master

@ashwinphatak
Copy link
Collaborator Author

Reopening as on current master, it shows the following error, though smoke tests pass:

WARN [09-23|11:48:37.083] Served eth_call                          conn=127.0.0.1:50906 reqid=92 t=3.312746ms err="eth_call failed without error"

@ashwinphatak ashwinphatak reopened this Sep 23, 2021
@ashwinphatak ashwinphatak assigned arijitAD and unassigned ramilexe Sep 23, 2021
@nikugogoi
Copy link
Collaborator

nikugogoi commented Sep 29, 2021

eth_call working and tested with ipld-eth-server master branch. Commit hash:
https://github.com/vulcanize/ipld-eth-server/tree/0f2b6fd84351aa91fd8aaeab75f7a67a23182c8f

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