diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f39b6ff644..92d56f663b 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1012,9 +1012,7 @@ type BlockOverrides struct { FeeRecipient *common.Address PrevRandao *common.Hash BaseFeePerGas *hexutil.Big - // TODO: is this right? should we override this since it doesn't exist - // in header or excessBlobGas which is used to calculate the base fee? - BlobBaseFee *hexutil.Big + BlobGasPrice *hexutil.Big } // Apply overrides the given header fields into the given block context. @@ -1043,13 +1041,15 @@ func (o *BlockOverrides) Apply(blockCtx *vm.BlockContext) { if o.BaseFeePerGas != nil { blockCtx.BaseFee = o.BaseFeePerGas.ToInt() } - if o.BlobBaseFee != nil { - blockCtx.BlobBaseFee = o.BlobBaseFee.ToInt() + if o.BlobGasPrice != nil { + blockCtx.BlobBaseFee = o.BlobGasPrice.ToInt() } } // MakeHeader returns a new header object with the overridden // fields. +// Note: MakeHeader ignores blobGasPrice if set. That's because +// header has no such field. func (o *BlockOverrides) MakeHeader(header *types.Header) *types.Header { if o == nil { return header diff --git a/internal/ethapi/multicall.go b/internal/ethapi/multicall.go index fecc23afac..0e53147350 100644 --- a/internal/ethapi/multicall.go +++ b/internal/ethapi/multicall.go @@ -141,8 +141,8 @@ func (mc *multicall) execute(ctx context.Context, opts mcOpts) ([]mcBlockResult, for bi, block := range blocks { header := headers[bi] blockContext := core.NewEVMBlockContext(header, NewChainContext(ctx, mc.b), nil) - if block.BlockOverrides != nil && block.BlockOverrides.BlobBaseFee != nil { - blockContext.BlobBaseFee = block.BlockOverrides.BlobBaseFee.ToInt() + if block.BlockOverrides != nil && block.BlockOverrides.BlobGasPrice != nil { + blockContext.BlobBaseFee = block.BlockOverrides.BlobGasPrice.ToInt() } // Respond to BLOCKHASH requests. blockContext.GetHash = func(n uint64) common.Hash {