From 70acaeb0c053359bda232d3e81678b52d749e10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Thu, 2 Jan 2025 20:28:42 +0300 Subject: [PATCH] disable CCC for post-Euclid blocks in miner and validator --- miner/scroll_worker.go | 8 +++++--- params/config.go | 2 +- rollup/ccc/async_checker.go | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 688639b919caa..6c202805470f4 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -889,7 +889,7 @@ func (w *worker) commit() (common.Hash, error) { currentHeight := w.current.header.Number.Uint64() maxReorgDepth := uint64(w.config.CCCMaxWorkers + 1) - if !w.current.reorging && currentHeight > maxReorgDepth { + if w.chainConfig.Scroll.UseZktrie && !w.current.reorging && currentHeight > maxReorgDepth { ancestorHeight := currentHeight - maxReorgDepth ancestorHash := w.chain.GetHeaderByNumber(ancestorHeight).Hash() if rawdb.ReadBlockRowConsumption(w.chain.Database(), ancestorHash) == nil { @@ -917,8 +917,10 @@ func (w *worker) commit() (common.Hash, error) { w.mux.Post(core.NewMinedBlockEvent{Block: block}) checkStart := time.Now() - if err = w.asyncChecker.Check(block); err != nil { - log.Error("failed to launch CCC background task", "err", err) + if w.chainConfig.Scroll.UseZktrie { + if err = w.asyncChecker.Check(block); err != nil { + log.Error("failed to launch CCC background task", "err", err) + } } cccStallTimer.UpdateSince(checkStart) diff --git a/params/config.go b/params/config.go index f6d6a1f6e3544..dc14a8b0769c5 100644 --- a/params/config.go +++ b/params/config.go @@ -668,7 +668,7 @@ type ScrollConfig struct { L1Config *L1Config `json:"l1Config,omitempty"` // Genesis State Root for MPT clients - GenesisStateRoot *common.Hash + GenesisStateRoot *common.Hash `json:"genesisStateRoot,omitempty"` } // L1Config contains the l1 parameters needed to sync l1 contract events (e.g., l1 messages, commit/revert/finalize batches) in the sequencer diff --git a/rollup/ccc/async_checker.go b/rollup/ccc/async_checker.go index 1cb9b7d787681..b5815cb58403a 100644 --- a/rollup/ccc/async_checker.go +++ b/rollup/ccc/async_checker.go @@ -98,6 +98,11 @@ func (c *AsyncChecker) Wait() { // Check spawns an async CCC verification task. func (c *AsyncChecker) Check(block *types.Block) error { + if c.bc.Config().IsEuclid(block.Time()) { + // Euclid blocks use MPT and CCC doesn't support them + return nil + } + if block.NumberU64() > c.currentHead.Number.Uint64()+1 { log.Warn("non continuous chain observed in AsyncChecker", "prev", c.currentHead, "got", block.Header()) }