Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

add excess blob gas to mev sim bundle #148

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions internal/ethapi/sbundle_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
"math/big"
"time"

Expand Down Expand Up @@ -254,6 +255,14 @@ func (api *MevAPI) SimBundle(ctx context.Context, args SendMevBundleArgs, aux Si
header.BaseFee = aux.BaseFee.ToInt()
}

if api.b.ChainConfig().IsCancun(header.Number, header.Time) {
var excessBlobGas uint64
if parentHeader.ExcessBlobGas != nil && parentHeader.BlobGasUsed != nil {
excessBlobGas = eip4844.CalcExcessBlobGas(*parentHeader.ExcessBlobGas, *parentHeader.BlobGasUsed)
}
header.ExcessBlobGas = &excessBlobGas
}

gp := new(core.GasPool).AddGas(header.GasLimit)

result := &SimMevBundleResponse{}
Expand Down