Skip to content

Commit

Permalink
add overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
Code0x2 committed Oct 21, 2023
1 parent 1a15792 commit f575fe8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2473,6 +2473,7 @@ type CallBundleArgs struct {
SimulationLogs bool `json:"simulationLogs"`
CreateAccessList bool `json:"createAccessList"`
StateOverrides *StateOverride `json:"stateOverrides"`
MixDigest *common.Hash `json:"mixDigest"`
}

// CallBundle will simulate a bundle of transactions at the top of a given block
Expand Down Expand Up @@ -2514,7 +2515,7 @@ func (s *SearcherAPI) CallBundle(ctx context.Context, args CallBundleArgs) (map[
}
blockNumber := big.NewInt(int64(args.BlockNumber))

timestamp := parent.Time + 1
timestamp := parent.Time + 12
if args.Timestamp != nil {
timestamp = *args.Timestamp
}
Expand All @@ -2536,6 +2537,10 @@ func (s *SearcherAPI) CallBundle(ctx context.Context, args CallBundleArgs) (map[
} else if s.b.ChainConfig().IsLondon(big.NewInt(args.BlockNumber.Int64())) {
baseFee = eip1559.CalcBaseFee(s.b.ChainConfig(), parent)
}
mixDigest := parent.MixDigest
if args.MixDigest != nil {
mixDigest = *args.MixDigest
}
header := &types.Header{
ParentHash: parent.Hash(),
Number: blockNumber,
Expand All @@ -2544,6 +2549,7 @@ func (s *SearcherAPI) CallBundle(ctx context.Context, args CallBundleArgs) (map[
Difficulty: difficulty,
Coinbase: coinbase,
BaseFee: baseFee,
MixDigest: mixDigest,
}

// Setup context so it may be cancelled the call has completed
Expand Down

0 comments on commit f575fe8

Please sign in to comment.