The field naming gas_price
and gas_used
is confusing
#6623
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I've audited the data around non-constant gas_price in the system.
block.gas_price
should be actuallygas_price_for_next_block
https://github.com/near/nearcore/blob/master/core/primitives/src/views.rs#L470
chunk.gas_used
should be calledgas_used_at_previous_chunk
https://github.com/near/nearcore/blob/master/core/primitives/src/views.rs#L729
See the details here near/near-analytics#19 (comment)
Another confusing field is
receipt.gas_price
https://github.com/near/nearcore/blob/master/core/primitives/src/views.rs#L1379
As I understand, it's the value of how much gas will be blocked for this receipt until we finish processing the whole transaction. It's not equal to any of
block.gas_price
in the corresponding area. Moreover, in the final computations, we will not usereceipt.gas_price
, we will take the price fromblock.gas_price
. So, I guess the naming should tell the user that it's only about the sum that should be frozen.The text was updated successfully, but these errors were encountered: