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

[1.0] Fix effective_gas_price calculation in EvmHost::get_tx_context #217

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion silkworm/core/execution/evm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ evmc_tx_context EvmHost::get_tx_context() const noexcept {
const BlockHeader& header{evm_.block_.header};
evmc_tx_context context{};
const intx::uint256 base_fee_per_gas{header.base_fee_per_gas.value_or(0)};
const intx::uint256 effective_gas_price{evm_.txn_->effective_gas_price(base_fee_per_gas)};
const intx::uint256 effective_gas_price{evm_.txn_->max_fee_per_gas >= base_fee_per_gas ? evm_.txn_->effective_gas_price(base_fee_per_gas): evm_.txn_->max_priority_fee_per_gas};
intx::be::store(context.tx_gas_price.bytes, effective_gas_price);
context.tx_origin = *evm_.txn_->from;
context.block_coinbase = evm_.beneficiary;
Expand Down
Loading