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

Fix logIndex in logs subscription #4733

Merged
merged 3 commits into from
Oct 10, 2022
Merged

Conversation

marcindsobczak
Copy link
Contributor

@marcindsobczak marcindsobczak commented Oct 7, 2022

Changes:

  • fix logIndex in logs subscription

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes (adjusted existing ones - results expected by me when implementing eth_subscribe were wrong)
  • No

@marcindsobczak marcindsobczak linked an issue Oct 7, 2022 that may be closed by this pull request
@marcindsobczak
Copy link
Contributor Author

I tested it by sending requests on goerli testnet. Checked behaviour on:

  1. current master
  2. this branch

I picked address "0x607f755149cfeb3a14e1dc3a4e2450cde7dfb04d" which was regularly sending requests on goerli network and I tested requests:

  1. {"method":"eth_subscribe","params":["logs",{"address":"0x607f755149cfeb3a14e1dc3a4e2450cde7dfb04d"}],"id":1,"jsonrpc":"2.0"}
  2. curl --data '{"method":"eth_getLogs","params":[{"fromBlock":"<blockFromSubscription>","toBlock":"<blockFromSubscription>","address":"0x607f755149cfeb3a14e1dc3a4e2450cde7dfb04d"}],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

From master - results same as in reported issue:
master

From this branch - result as expected - same logIndex in eth_subscribe and in eth_getLogs:
branch

Looks fine and mergable.

@marcindsobczak marcindsobczak marked this pull request as ready for review October 7, 2022 16:52
Copy link
Contributor

@asdacap asdacap left a comment

Choose a reason for hiding this comment

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

LGTM

@marcindsobczak marcindsobczak merged commit 29e9b05 into master Oct 10, 2022
@marcindsobczak marcindsobczak deleted the fix/log_index_in_logs_sub branch October 10, 2022 14:43
rubo pushed a commit that referenced this pull request Oct 13, 2022
* fix log index in logs subscription

* adjust tests

* fix typo (not related to PR) :)
@vyzaldysanchez
Copy link

Any idea on when this fix is going to be released?

@rubo
Copy link
Contributor

rubo commented Oct 27, 2022

@vyzaldysanchez There's a pre-release including this.

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

Successfully merging this pull request may close these issues.

eth_subscribe returns wrong value for logIndex field
4 participants