-
Notifications
You must be signed in to change notification settings - Fork 861
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
Log index is counted per block, not per transaction #4355
Log index is counted per block, not per transaction #4355
Conversation
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of optimizations and suggested renaming
isQueryAlive); | ||
final boolean removed = getRemoved(blockHash, isQueryAlive); | ||
|
||
final AtomicInteger logIndexOffset = new AtomicInteger(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why an AtomicInteger
here? it seems that a plain int is enough
@@ -83,16 +84,24 @@ public List<LogWithMetadata> matchingLogs( | |||
final long blockNumber = blockHeader.get().getNumber(); | |||
final boolean removed = !blockchainQueries.blockIsOnCanonicalChain(blockHash); | |||
|
|||
final AtomicInteger logIndexOffset = new AtomicInteger(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
...edger/besu/ethereum/api/jsonrpc/websocket/subscription/logs/LogsSubscriptionServiceTest.java
Outdated
Show resolved
Hide resolved
Please update the CHANGELOG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of optimizations and suggested renaming.
Consider my suggestions as non blocking for the merge of this PR
Signed-off-by: mark-terry <mark.terry@consensys.net>
* Log index is counted per block, not per transaction Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com> Co-authored-by: mark-terry <mark.terry@consensys.net>
Signed-off-by: Daniel Lehrner daniel.lehrner@consensys.net
PR description
The log index returned by
eth_getLogs
is currently counted on a transaction basis, which is incorrect. The correct way is to have it unique per block. This PR changes it to the correct behavior.Fixed Issue(s)
fixes #4114
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog