Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sixtysixter committed Mar 11, 2024
1 parent 22d96a8 commit 52e909a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions silkworm/rpc/core/evm_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ uint64_t EVMExecutor::refund_gas(const EVM& evm, const silkworm::Transaction& tx

const intx::uint256 base_fee_per_gas{evm.block().header.base_fee_per_gas.value_or(0)};
SILK_DEBUG << "EVMExecutor::refund_gas txn.max_fee_per_gas: " << txn.max_fee_per_gas << " base_fee_per_gas: " << base_fee_per_gas;
const intx::uint256 effective_gas_price{txn.effective_gas_price(base_fee_per_gas)};

const intx::uint256 effective_gas_price{txn.max_fee_per_gas >= base_fee_per_gas ? txn.effective_gas_price(base_fee_per_gas)
: txn.max_priority_fee_per_gas};
SILK_DEBUG << "EVMExecutor::refund_gas effective_gas_price: " << effective_gas_price;
ibs_state_.add_to_balance(*txn.sender(), gas_left * effective_gas_price);
return gas_left;
Expand Down Expand Up @@ -300,8 +302,8 @@ ExecutionResult EVMExecutor::call(
}

// Reward the fee recipient
const auto priority_fee_per_gas = txn.priority_fee_per_gas(base_fee_per_gas);

const intx::uint256 priority_fee_per_gas{txn.max_fee_per_gas >= base_fee_per_gas ? txn.priority_fee_per_gas(base_fee_per_gas)
: txn.max_priority_fee_per_gas};
SILK_DEBUG << "EVMExecutor::call evm.beneficiary: " << evm.beneficiary << " balance: " << priority_fee_per_gas * gas_used;
ibs_state_.add_to_balance(evm.beneficiary, priority_fee_per_gas * gas_used);

Expand Down

0 comments on commit 52e909a

Please sign in to comment.