miner: set tx index logs#2983
Merged
fjl merged 1 commit intoethereum:developfrom Sep 14, 2016
Merged
Conversation
Contributor
|
👍 |
Contributor
|
This needs two reviews. |
Member
There was a problem hiding this comment.
This i++ won't be good here. There are a few scenarios below when a transaction is discarded (gas price too low, doesn't fit into block, etc). These scenarios will all "continue looping" without processing the transaction, but the i++ will increment nonetheless, producing gaps.
Shouldn't we use env.tcount++ (incremented in L604) to keep track of the index of the currently executing transaction and completely drop i?
Member
Author
|
@karalabe, you are right. |
Member
|
LGTM 👍 @fjl PTAL that it makes sense with the fix. |
fjl
approved these changes
Sep 14, 2016
srene
pushed a commit
to dymensionxyz/go-ethereum
that referenced
this pull request
Mar 26, 2025
Merge branch 'tag v1.5.8' into develop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The miner creates a new state record for each transaction. One of the parameters for these records is the transaction index. Currently this index is hard coded to zero and causes all logs to have a transaction index of 0. This PR corrects this.