evmos / ethermint

Ethermint is a Cosmos SDK library for running scalable and interoperable EVM chains
https://docs.evmos.org/
GNU Lesser General Public License v3.0
1.82k stars 561 forks source link

evm module calls are slow #1219

Closed VictorTrustyDev closed 2 years ago

VictorTrustyDev commented 2 years ago

System info:

Steps to reproduce:

  1. I have a node to sync evmos mainnet and currently running v4.0.1 to sync old blocks (I have synced to 502k atm)
  2. I have a small app and read data from the node (they work perfectly), I use gethclient to perform calls to evm module :8545
  3. I added some console println to check the time taken for each read
The following table is result when I do read from blocks height ~62k type name time (ms) usually (ms)
tendermint Block 561
evm ethClient::BlockByNumber 7192 5000 - 15000
tendermint GetTx 1151
tendermint GetTx 1300
evm ethClient::TransactionReceipt 4518 2700 - 5000
tendermint GetTx 997
tendermint GetTx 913
evm ethClient::TransactionReceipt 2749 2700 - 5000
tendermint GetTx 795
tendermint GetTx 654
tendermint Get validators 726
evm ethClient::CallContract method balanceOf 9163 3000 - 10000

As you can see, evm calls have long execution time, multiple times longer than tendermint calls

Expected behavior: evm calls should have lower execution time

I haven't tried with most recent version evmos v6 (ethermint v0.17.x) but I guess it will results the same

yihuang commented 2 years ago

https://github.com/evmos/ethermint/pull/1121 I think this PR should have some improvements on speed, although it's mainly for disk space reduction, can you give it a try? need to set enable-indexer = true to enable the custom indexer.

VictorTrustyDev commented 2 years ago

1121 I think this PR should have some improvements on speed, although it's mainly for disk space reduction, can you give it a try? need to set enable-indexer = true to enable the custom indexer.

Thanks @yihuang, but I afraid I can't try atm. I am running a achive node with ~600 gb of data, I'm afraid with that state breaking change, my data will be corrupt,... and un-recoverable

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 45 days with no activity. Remove Status: Stale label or comment or this will be closed in 7 days.