Benchmark eth JSON RPC endpoints #24

Closed
opened 2020-10-30 23:11:51 +00:00 by i-norden · 1 comment
Member

Compare benchmarks for

  1. Standard leveldb eth JSON RPC
  2. ipld-eth-indexer eth JSON RPC using ethdb.Database backend
  3. ipld-eth-indexer eth JSON RPC using custom backend that leverage secondary indexes in Postgres

In cases where trie traversal is usually needed we should see a significant performance improvement as we can avoid this iteration and reduce the number of db lookups.

E.g. any lookup where we need to access a state or storage leaf node, such as eth_getBalance, eth_getStorageAt, eth_getTransactionCount, eth_getCode.

Normally these lookups proceed through the trie.Trie.TryGet() which is an iterative function that retrieves the value for the provided key (path) by walking down the trie from the root to the node at that the provided path (requiring separate db lookups at each step). We can instead look the leaf node up from our statediff database in a single Postgres db transaction.

Compare benchmarks for 1) Standard leveldb eth JSON RPC 2) ipld-eth-indexer eth JSON RPC using ethdb.Database backend 3) ipld-eth-indexer eth JSON RPC using custom backend that leverage secondary indexes in Postgres In cases where trie traversal is usually needed we should see a significant performance improvement as we can avoid this iteration and reduce the number of db lookups. E.g. any lookup where we need to access a state or storage leaf node, such as `eth_getBalance`, `eth_getStorageAt`, `eth_getTransactionCount`, `eth_getCode`. Normally these lookups proceed through the `trie.Trie.TryGet()` [which is an iterative function that retrieves the value for the provided key (path) by walking down the trie from the root to the node at that the provided path](https://github.com/vulcanize/go-ethereum/blob/master/trie/trie.go#L113) (requiring separate db lookups at each step). We can instead look the leaf node up from our statediff database [in a single Postgres db transaction](https://github.com/vulcanize/ipld-eth-server/blob/eth_json_rpc/pkg/eth/ipld_retriever.go#L433).
Author
Member

@dboreham @telackey I'm going to close this very dated benchmarking issue since you two are managing that

@dboreham @telackey I'm going to close this very dated benchmarking issue since you two are managing that
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/ipld-eth-server#24
No description provided.