From 3111ae8157fee7f732e771c45605dc9521ca3506 Mon Sep 17 00:00:00 2001 From: Jihoon Song Date: Sat, 30 Nov 2024 17:52:53 +0900 Subject: [PATCH] miner: add `inclusionList` to `BuildPayloadArgs` and `generateParams` --- miner/payload_building.go | 32 +++++++++++++++++--------------- miner/worker.go | 17 +++++++++-------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/miner/payload_building.go b/miner/payload_building.go index 6b010186bf..25a3223f28 100644 --- a/miner/payload_building.go +++ b/miner/payload_building.go @@ -37,13 +37,14 @@ import ( // Check engine-api specification for more details. // https://github.com/ethereum/execution-apis/blob/main/src/engine/cancun.md#payloadattributesv3 type BuildPayloadArgs struct { - Parent common.Hash // The parent block to build payload on top - Timestamp uint64 // The provided timestamp of generated payload - FeeRecipient common.Address // The provided recipient address for collecting transaction fee - Random common.Hash // The provided randomness value - Withdrawals types.Withdrawals // The provided withdrawals - BeaconRoot *common.Hash // The provided beaconRoot (Cancun) - Version engine.PayloadVersion // Versioning byte for payload id calculation. + Parent common.Hash // The parent block to build payload on top + Timestamp uint64 // The provided timestamp of generated payload + FeeRecipient common.Address // The provided recipient address for collecting transaction fee + Random common.Hash // The provided randomness value + Withdrawals types.Withdrawals // The provided withdrawals + BeaconRoot *common.Hash // The provided beaconRoot (Cancun) + InclusionList types.InclusionList // The provided inclusion list transactions + Version engine.PayloadVersion // Versioning byte for payload id calculation. } // Id computes an 8-byte identifier by hashing the components of the payload arguments. @@ -241,14 +242,15 @@ func (miner *Miner) buildPayload(args *BuildPayloadArgs, witness bool) (*Payload endTimer := time.NewTimer(time.Second * 12) fullParams := &generateParams{ - timestamp: args.Timestamp, - forceTime: true, - parentHash: args.Parent, - coinbase: args.FeeRecipient, - random: args.Random, - withdrawals: args.Withdrawals, - beaconRoot: args.BeaconRoot, - noTxs: false, + timestamp: args.Timestamp, + forceTime: true, + parentHash: args.Parent, + coinbase: args.FeeRecipient, + random: args.Random, + withdrawals: args.Withdrawals, + beaconRoot: args.BeaconRoot, + inclusionList: args.InclusionList, + noTxs: false, } for { diff --git a/miner/worker.go b/miner/worker.go index c0574eac23..333890a6b4 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -94,14 +94,15 @@ type newPayloadResult struct { // generateParams wraps various settings for generating sealing task. type generateParams struct { - timestamp uint64 // The timestamp for sealing task - forceTime bool // Flag whether the given timestamp is immutable or not - parentHash common.Hash // Parent block hash, empty means the latest chain head - coinbase common.Address // The fee recipient address for including transaction - random common.Hash // The randomness generated by beacon chain, empty before the merge - withdrawals types.Withdrawals // List of withdrawals to include in block (shanghai field) - beaconRoot *common.Hash // The beacon root (cancun field). - noTxs bool // Flag whether an empty block without any transaction is expected + timestamp uint64 // The timestamp for sealing task + forceTime bool // Flag whether the given timestamp is immutable or not + parentHash common.Hash // Parent block hash, empty means the latest chain head + coinbase common.Address // The fee recipient address for including transaction + random common.Hash // The randomness generated by beacon chain, empty before the merge + withdrawals types.Withdrawals // List of withdrawals to include in block (shanghai field) + beaconRoot *common.Hash // The beacon root (cancun field). + inclusionList types.InclusionList // List of inclusion list transactions. + noTxs bool // Flag whether an empty block without any transaction is expected } // generateWork generates a sealing block based on the given parameters.