Skip to content

Commit

Permalink
Merge pull request #217 from eosnetworkfoundation/elmato/fix-effectiv…
Browse files Browse the repository at this point in the history
…e-gas-price-calculation

[1.0] Fix effective_gas_price calculation in EvmHost::get_tx_context
  • Loading branch information
elmato authored Oct 31, 2024
2 parents 05dc54a + 72f03dc commit dc02d78
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit dc02d78

Please sign in to comment.