Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Optimize tx index lookup in web3 rpc #760

Closed
yihuang opened this issue Nov 18, 2021 · 2 comments · Fixed by #810
Closed

Optimize tx index lookup in web3 rpc #760

yihuang opened this issue Nov 18, 2021 · 2 comments · Fixed by #810

Comments

@yihuang
Copy link
Contributor

yihuang commented Nov 18, 2021

Proposal: Optimize tx index lookup in web3 rpc

Current behavior:

Currently, the tx index is looked up by loading all the eth transactions in the block and iterating through them.

Desired behavior:

A more efficient way could be emitting the tx index into cosmos events, fetched by query tx result.

Use case:

Optimize performance of web3 rpc api.

@fedekunze
Copy link
Contributor

sounds good to me 👍

@yihuang
Copy link
Contributor Author

yihuang commented Dec 3, 2021

I'll work on this.

yihuang added a commit to yihuang/ethermint that referenced this issue Dec 3, 2021
Closes: evmos#760

Solution:
- emit tx index to cosmos events
- rpc side try to use the events, but fallback to heavier approach when fails.
yihuang added a commit to yihuang/ethermint that referenced this issue Dec 15, 2021
Closes: evmos#760

Solution:
- emit tx index to cosmos events
- rpc side try to use the events, but fallback to heavier approach when fails.

Update rpc/ethereum/namespaces/eth/api.go

changelog

fix lint

fix TxIndexFromEvents

fix

Update rpc/ethereum/backend/backend.go
fedekunze added a commit that referenced this issue Dec 16, 2021
Closes: #760

Solution:
- emit tx index to cosmos events
- rpc side try to use the events, but fallback to heavier approach when fails.

Update rpc/ethereum/namespaces/eth/api.go

changelog

fix lint

fix TxIndexFromEvents

fix

Update rpc/ethereum/backend/backend.go

Co-authored-by: Federico Kunze Küllmer <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants