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

Question: can the BlockGasMeter be used for absolute tx position? #1950

Open
joshklop opened this issue Aug 7, 2024 · 2 comments
Open

Question: can the BlockGasMeter be used for absolute tx position? #1950

joshklop opened this issue Aug 7, 2024 · 2 comments

Comments

@joshklop
Copy link

joshklop commented Aug 7, 2024

The amount of consumed block gas is used here to uniquely identify the position of a transaction in a block.

Is it possible that a transaction could consume zero gas, leading to a collision (that tx and the tx that follows will have the same "absolute index")?

@chipshort
Copy link
Collaborator

In theory that is possible, but a zero gas transaction is inherently problematic, since it can be used for spamming and potentially a DoS, so transactions shouldn't be zero gas in the first place.
Also, this is just used for metadata on the contract history, so it's not critical if this were to happen.

@chipshort
Copy link
Collaborator

Looks like a better method to get a transaction index was introduced at some point.
Let's use this as an opportunity to explore switching the contract history over to that too.

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

No branches or pull requests

2 participants