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 #810

Merged
merged 3 commits into from
Dec 16, 2021
Merged

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Dec 3, 2021

Closes: #760

Description

Solution:

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

For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #810 (759fb21) into main (e752d80) will decrease coverage by 0.11%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #810      +/-   ##
==========================================
- Coverage   56.82%   56.70%   -0.12%     
==========================================
  Files          72       72              
  Lines        6041     6059      +18     
==========================================
+ Hits         3433     3436       +3     
- Misses       2409     2424      +15     
  Partials      199      199              
Impacted Files Coverage Δ
rpc/ethereum/types/utils.go 0.00% <0.00%> (ø)
x/evm/keeper/msg_server.go 75.00% <100.00%> (+1.41%) ⬆️

Copy link
Contributor

@thomas-nguy thomas-nguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you also update the spec and add the new event?

rpc/ethereum/backend/backend.go Outdated Show resolved Hide resolved
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
@yihuang
Copy link
Contributor Author

yihuang commented Dec 15, 2021

LGTM, can you also update the spec and add the new event?

done

@fedekunze fedekunze enabled auto-merge (squash) December 16, 2021 22:26
@fedekunze fedekunze merged commit 514785b into evmos:main Dec 16, 2021
@yihuang yihuang deleted the tx-index branch December 17, 2021 01:54
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 this pull request may close these issues.

Optimize tx index lookup in web3 rpc
3 participants