diff --git a/eth/api.go b/eth/api.go index cac47bce5258..3ea53fed4107 100644 --- a/eth/api.go +++ b/eth/api.go @@ -362,9 +362,10 @@ func generateWitness(blockchain *core.BlockChain, block *types.Block) (*stateles // Collect storage locations that prover needs but sequencer might not touch necessarily statedb.GetState(rcfg.L2MessageQueueAddress, rcfg.WithdrawTrieRootSlot) - // Note: scroll-revm detects the Feynman transition block using this storage slot, - // since it does not have access to the parent block timestamp. We need to make - // sure that this is always present in the execution witness. + // Note: scroll-reth detects the Feynman transition block using the block + // timestamp, but since there might be multiple blocks with the same timestamp, + // it also needs this value to avoid applying the state update multiple times. + // So we need to make sure that this is always present in the execution witness. statedb.GetState(rcfg.L1GasPriceOracleAddress, rcfg.IsFeynmanSlot) receipts, _, usedGas, err := blockchain.Processor().Process(block, statedb, *blockchain.GetVMConfig()) diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 56b458e4d5a7..746a10073d69 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -510,9 +510,17 @@ func (w *worker) newWork(now time.Time, parent *types.Block, reorging bool, reor header.Coinbase = common.Address{} header.Nonce = types.BlockNonce{} } else { + var timeOverride *uint64 + if w.chainConfig.IsFeynmanTransitionBlock(header.Time, parent.Time()) { + // current candidate timestamp suggests that this block is the Feynman transition block, + // we forcibly set timestamp to the exact upgrade timestamp. + timeOverride = new(uint64) + *timeOverride = *w.chainConfig.FeynmanTime // IsFeynmanTransitionBlock guarantees that this is not nil + } + prepareStart := time.Now() // Note: this call will set header.Time, among other fields. - if err := w.engine.Prepare(w.chain, header, nil); err != nil { + if err := w.engine.Prepare(w.chain, header, timeOverride); err != nil { return fmt.Errorf("failed to prepare header for mining: %w", err) } prepareTimer.UpdateSince(prepareStart) diff --git a/params/version.go b/params/version.go index 13fa655ad50b..6b1ffd3c7b35 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 58 // Patch version component of the current release + VersionPatch = 59 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )