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 base and priority fee to gas oracle response #9202
Conversation
4358e07
to
be6077e
Compare
fiat_price: fiat_fee(fee, exchange_rate_from_db) | ||
fiat_price: fiat_fee(fee, exchange_rate_from_db), | ||
base_fee: base_fee |> format_wei(), | ||
priority_fee: base_fee && priority_fee && priority_fee |> Decimal.new() |> Wei.from(:wei) |> format_wei() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should we check non-nil base_fee
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have no base fee, priority fee may be misleading to the user since the price would be calculated without base fee knowledge and there may be strange relations between the price and priority fee, so I decided that it's better not to give priority fee if we do not have base fee by some reason (that is much less probable with manual calculation of the next block base fee)
2163ae6
to
89705e9
Compare
89705e9
to
fc85954
Compare
I suggest to fix dialyzer errors in this PR: #8851 |
end | ||
|
||
@spec next_block_base_fee(t()) :: Decimal.t() | nil | ||
def next_block_base_fee(block) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename base_fee
to base_fee_per_gas
here and above
fc85954
to
e1871b0
Compare
Closes #9201
Changelog
Calculate the base fee of the next block by ourselves instead of query the node
Added
EIP_1559_BASE_FEE_MAX_CHANGE_DENOMINATOR
env variable with default value of 8 to accomplish the task above (AddEIP_1559_BASE_FEE_MAX_CHANGE_DENOMINATOR
docs#235)Added base and proirity fee
Response example:
Checklist for your Pull Request (PR)
CHANGELOG.md
with this PRmaster
in the Version column. Changes will be reflected in this table: https://docs.blockscout.com/for-developers/information-and-settings/env-variables.