-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add effectiveGasPrice
to eth_getTransactionReceipt
#206
Conversation
2fc785c
to
75e43d8
Compare
75e43d8
to
297e6b7
Compare
@timbeiko seems like there hasn't been any push back on this. Do you want to go ahead and merge or should we bring it up briefly in ACD? EDIT: sorry, we should probably discuss on ACD briefly. I see geth uses the |
Per ACD, we'll no longer return |
It's not fully clear to me what |
Also worth noting that digging up a receipt is expensive and if you only want to get the price paid, it's a bit of an overkill to do a database lookup just to get a field that doesn't even need any data whatsoever from the receipt. |
I like dropping it. We will likely continue to have more and more new transaction types over time, and not all of them will be able to backfill old properties with reasonable values. If we backfill this time around, people won't write code that is resilient to future transaction changes and they will break in the future rather than today. Given that there are probably (hopefully) more future Ethereum dapp/integration developers than there are today Ethereum dapp/integration developers, I would rather break today users than future users (e.g., train them now, while it is less damaging). |
After some discussions, it appears most prefer to add
effectiveGasPrice
to the receipt object because it is a computed value, likegasUsed
. I've written the method with the idea that legacy transactions will simply returntx.gas_price
for theeffectiveGasPrice
and EIP-1559 txs will actually compute the correct value. This should avoid a scenario where RPC consumers need to branch depending on the tx type to determine the effective cost.cc: @MicahZoltu @tkstanczak @timbeiko @GregTheGreek @fvictorio