miner: optimism block building fix - no extra data

Ensure extra-data can be set in L1 mode, but do not include any
extra-data when building a L2 optimism chain.

Co-authored-by: Adrian Sutton <adrian@oplabs.co>
This commit is contained in:
protolambda 2023-02-17 13:59:18 -06:00
parent e9f8da9ca4
commit 12d2112465
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623

View File

@ -1023,7 +1023,7 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
Coinbase: genParams.coinbase,
}
// Set the extra field.
if len(w.extra) != 0 {
if len(w.extra) != 0 && w.chainConfig.Optimism == nil { // Optimism chains must not set any extra data.
header.Extra = w.extra
}
// Set the randomness field from the beacon chain if it's available.