Skip to content

Commit 9921ca0

Browse files
miner: allow for extradata in post-merge blocks (#26387)
* miner: allow for extradata in post-merge blocks * miner: nits * miner: remove extradata checks
1 parent 577db2e commit 9921ca0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

miner/worker.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -959,13 +959,12 @@ func (w *worker) commitTransactions(env *environment, txs *types.TransactionsByP
959959

960960
// generateParams wraps various of settings for generating sealing task.
961961
type generateParams struct {
962-
timestamp uint64 // The timstamp for sealing task
962+
timestamp uint64 // The timestamp for sealing task
963963
forceTime bool // Flag whether the given timestamp is immutable or not
964964
parentHash common.Hash // Parent block hash, empty means the latest chain head
965965
coinbase common.Address // The fee recipient address for including transaction
966966
random common.Hash // The randomness generated by beacon chain, empty before the merge
967967
noUncle bool // Flag whether the uncle block inclusion is allowed
968-
noExtra bool // Flag whether the extra field assignment is allowed
969968
noTxs bool // Flag whether an empty block without any transaction is expected
970969
}
971970

@@ -1001,8 +1000,8 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
10011000
Time: timestamp,
10021001
Coinbase: genParams.coinbase,
10031002
}
1004-
// Set the extra field if it's allowed.
1005-
if !genParams.noExtra && len(w.extra) != 0 {
1003+
// Set the extra field.
1004+
if len(w.extra) != 0 {
10061005
header.Extra = w.extra
10071006
}
10081007
// Set the randomness field from the beacon chain if it's available.
@@ -1225,7 +1224,6 @@ func (w *worker) getSealingBlock(parent common.Hash, timestamp uint64, coinbase
12251224
coinbase: coinbase,
12261225
random: random,
12271226
noUncle: true,
1228-
noExtra: true,
12291227
noTxs: noTxs,
12301228
},
12311229
result: make(chan *newPayloadResult, 1),

miner/worker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ func testGetSealingWork(t *testing.T, chainConfig *params.ChainConfig, engine co
568568
}
569569
_, isClique := engine.(*clique.Clique)
570570
if !isClique {
571-
if len(block.Extra()) != 0 {
571+
if len(block.Extra()) != 2 {
572572
t.Error("Unexpected extra field")
573573
}
574574
if block.Coinbase() != coinbase {

0 commit comments

Comments
 (0)