Skip to content

Commit

Permalink
Merge pull request #220 from eosnetworkfoundation/elmato/merge-fix-ef…
Browse files Browse the repository at this point in the history
…fective-gas-price-calculation-to-master

[1.0 -> master] Fix effective_gas_price calculation in EvmHost::get_tx_context
  • Loading branch information
yarkinwho authored Nov 1, 2024
2 parents b5b543b + 6e97166 commit 8ebd3db
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 @@ -563,7 +563,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 8ebd3db

Please sign in to comment.