txpool: fix wrong baseFee usage in runTx and runTxCommit

This commit is contained in:
jangko 2022-04-03 12:03:42 +07:00
parent 00e2ec7d38
commit ef1a68867b
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ proc runTx(pst: TxPackerStateRef; item: TxItemRef): GasInt
## `gasUsed` after executing the transaction.
let
fork = pst.xp.chain.nextFork
baseFee = pst.xp.chain.head.baseFee.truncate(uint64).GasPrice
baseFee = pst.xp.chain.baseFee
tx = item.tx.eip1559TxNormalization(baseFee, fork)
safeExecutor "tx_packer.runTx":
@ -102,7 +102,7 @@ proc runTxCommit(pst: TxPackerStateRef; item: TxItemRef; gasBurned: GasInt)
xp = pst.xp
vmState = xp.chain.vmState
inx = xp.txDB.byStatus.eq(txItemPacked).nItems
gasTip = item.tx.effectiveGasTip(xp.chain.head.baseFee)
gasTip = item.tx.effectiveGasTip(xp.chain.baseFee)
# The gas tip cannot get negative as all items in the `staged` bucket
# are vetted for profitability before entering that bucket.