Question: can the `BlockGasMeter` be used for absolute tx position?
joshklop opened this issue · 2 comments
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")?
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.
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.