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

Commit

Permalink
add excess blob gas to mev sim bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Mar 8, 2024
1 parent d1b23a8 commit d5e5ad4
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit d5e5ad4

Please sign in to comment.