Skip to content

Commit

Permalink
Merge pull request ethereum#15 from flashbots/fix/SUAVE-236-deuce
Browse files Browse the repository at this point in the history
Set beaconRoot in block header field
  • Loading branch information
lthibault authored Feb 14, 2024
2 parents 9b2bee5 + 4b6f39e commit 8f45137
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 2 additions & 4 deletions core/types/suave_structs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code generated by suave/gen in https://github.com/flashbots/suave-geth.
// DO NOT EDIT.
// Hash: c60f303834fbdbbd940aae7cb3679cf3755a25f7384f1052c20bf6c38d9a0451
package types

import "github.com/ethereum/go-ethereum/common"
Expand All @@ -19,6 +16,7 @@ type BuildBlockArgs struct {
Random common.Hash
Withdrawals []*Withdrawal
Extra []byte
BeaconRoot common.Hash
FillPending bool
}

Expand Down Expand Up @@ -50,4 +48,4 @@ type SimulatedLog struct {
Data []byte
Addr common.Address
Topics []common.Hash
}
}
13 changes: 8 additions & 5 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,12 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
}
// Construct the sealing block header.
header := &types.Header{
ParentHash: parent.Hash(),
Number: new(big.Int).Add(parent.Number, common.Big1),
GasLimit: core.CalcGasLimit(parent.GasLimit, w.config.GasCeil),
Time: timestamp,
Coinbase: genParams.coinbase,
ParentHash: parent.Hash(),
Number: new(big.Int).Add(parent.Number, common.Big1),
GasLimit: core.CalcGasLimit(parent.GasLimit, w.config.GasCeil),
Time: timestamp,
Coinbase: genParams.coinbase,
ParentBeaconRoot: genParams.beaconRoot,
}
// Set the extra field.
if len(w.extra) != 0 {
Expand Down Expand Up @@ -1291,6 +1292,7 @@ func (w *worker) buildBlockFromTxs(ctx context.Context, args *types.BuildBlockAr
random: args.Random,
extra: args.Extra,
withdrawals: args.Withdrawals,
beaconRoot: &args.BeaconRoot,
// noUncle: true,
noTxs: false,
}
Expand Down Expand Up @@ -1339,6 +1341,7 @@ func (w *worker) buildBlockFromBundles(ctx context.Context, args *types.BuildBlo
random: args.Random,
extra: args.Extra,
withdrawals: args.Withdrawals,
beaconRoot: &args.BeaconRoot,
// noUncle: true,
noTxs: false,
}
Expand Down

0 comments on commit 8f45137

Please sign in to comment.