Skip to content

Commit 372e3e9

Browse files
committed
Use the parentArbOSVersion to calculate excessBlobGas
1 parent d7c4461 commit 372e3e9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/ethapi/simulate.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
169169
}
170170
}
171171
arbOSVersion := types.DeserializeHeaderExtraInformation(header).ArbOSFormatVersion
172+
parentArbOSVersion := types.DeserializeHeaderExtraInformation(parent).ArbOSFormatVersion
172173
if sim.chainConfig.IsCancun(header.Number, header.Time, arbOSVersion) {
173174
var excess uint64
174-
if sim.chainConfig.IsCancun(parent.Number, parent.Time, arbOSVersion) {
175+
if sim.chainConfig.IsCancun(parent.Number, parent.Time, parentArbOSVersion) {
175176
excess = eip4844.CalcExcessBlobGas(sim.chainConfig, parent, header.Time)
176177
}
177178
header.ExcessBlobGas = &excess
@@ -270,11 +271,11 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
270271
}
271272
header.Root = sim.state.IntermediateRoot(true)
272273
header.GasUsed = gasUsed
273-
if sim.chainConfig.IsCancun(header.Number, header.Time, types.DeserializeHeaderExtraInformation(header).ArbOSFormatVersion) {
274+
if sim.chainConfig.IsCancun(header.Number, header.Time, arbOSVersion) {
274275
header.BlobGasUsed = &blobGasUsed
275276
}
276277
var withdrawals types.Withdrawals
277-
if sim.chainConfig.IsShanghai(header.Number, header.Time, types.DeserializeHeaderExtraInformation(header).ArbOSFormatVersion) {
278+
if sim.chainConfig.IsShanghai(header.Number, header.Time, arbOSVersion) {
278279
withdrawals = make([]*types.Withdrawal, 0)
279280
}
280281
if requests != nil {

0 commit comments

Comments
 (0)