Fix txPool: excessBlobGas should be calculated before entering EVM, not after (#2149)
This commit is contained in:
parent
b9187e0493
commit
47605dbdf3
|
@ -116,9 +116,9 @@ proc newPayload*(ben: BeaconEngineRef,
|
|||
timestamp = ethTime payload.timestamp
|
||||
version = payload.version
|
||||
|
||||
validateVersion(com, timestamp, version, apiVersion)
|
||||
validatePayload(apiVersion, version, payload)
|
||||
|
||||
validateVersion(com, timestamp, version, apiVersion)
|
||||
|
||||
var header = blockHeader(payload, removeBlobs = true, beaconRoot = ethHash beaconRoot)
|
||||
|
||||
if apiVersion >= Version.V3:
|
||||
|
|
|
@ -19,6 +19,7 @@ import
|
|||
../../utils/utils,
|
||||
../../vm_state,
|
||||
../../vm_types,
|
||||
../eip4844,
|
||||
../clique/[clique_sealer, clique_desc, clique_cfg],
|
||||
../pow/difficulty,
|
||||
../executor,
|
||||
|
@ -131,12 +132,13 @@ proc resetTxEnv(dh: TxChainRef; parent: BlockHeader; fee: Option[UInt256])
|
|||
# we don't consider PoS difficulty here
|
||||
# because that is handled in vmState
|
||||
let blockCtx = BlockContext(
|
||||
timestamp : dh.prepHeader.timestamp,
|
||||
gasLimit : (if dh.maxMode: dh.limits.maxLimit else: dh.limits.trgLimit),
|
||||
fee : fee,
|
||||
prevRandao: dh.prepHeader.prevRandao,
|
||||
difficulty: dh.prepHeader.difficulty,
|
||||
coinbase : dh.feeRecipient,
|
||||
timestamp : dh.prepHeader.timestamp,
|
||||
gasLimit : (if dh.maxMode: dh.limits.maxLimit else: dh.limits.trgLimit),
|
||||
fee : fee,
|
||||
prevRandao : dh.prepHeader.prevRandao,
|
||||
difficulty : dh.prepHeader.difficulty,
|
||||
coinbase : dh.feeRecipient,
|
||||
excessBlobGas: calcExcessBlobGas(parent),
|
||||
)
|
||||
|
||||
dh.txEnv.vmState = BaseVMState.new(
|
||||
|
|
|
@ -275,8 +275,7 @@ proc vmExecCommit(pst: TxPackerStateRef)
|
|||
|
||||
if vmState.com.forkGTE(Cancun):
|
||||
# EIP-4844
|
||||
let excessBlobGas = calcExcessBlobGas(vmState.parent)
|
||||
xp.chain.excessBlobGas = some(excessBlobGas)
|
||||
xp.chain.excessBlobGas = some(vmState.blockCtx.excessBlobGas)
|
||||
xp.chain.blobGasUsed = some(pst.blobGasUsed)
|
||||
|
||||
proc balanceDelta: UInt256 =
|
||||
|
|
Loading…
Reference in New Issue