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

fix(anvil): treat 0 basefee as constant #5163

Merged
merged 1 commit into from Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions anvil/src/eth/fees.rs
Expand Up @@ -123,6 +123,12 @@ impl FeeManager {
gas_limit: U256,
last_fee_per_gas: U256,
) -> u64 {
// It's naturally impossible for base fee to be 0;
// It means it was set by the user deliberately and therefore we treat it as a constant.
// Therefore, we skip the base fee calculation altogether and we return 0.
if self.base_fee() == U256::zero() {
return 0
}
calculate_next_block_base_fee(
gas_used.as_u64(),
gas_limit.as_u64(),
Expand Down