From ffcd75be7d896ce0da3b5ff939c96a1ea4d3ef11 Mon Sep 17 00:00:00 2001 From: protolambda Date: Fri, 16 Dec 2022 20:06:03 +0100 Subject: [PATCH] optimism: user can set pending block gas limit (#24) --- miner/worker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index d944fbc85..e7a187899 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1040,6 +1040,9 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) { } if genParams.gasLimit != nil { // override gas limit if specified header.GasLimit = *genParams.gasLimit + } else if w.chain.Config().Optimism != nil && w.config.GasCeil != 0 { + // configure the gas limit of pending blocks with the miner gas limit config when using optimism + header.GasLimit = w.config.GasCeil } // Run the consensus preparation with the default or customized consensus engine. if err := w.engine.Prepare(w.chain, header); err != nil {