Skip to content

Commit

Permalink
disable CCC for post-Euclid blocks in miner and validator
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Jan 2, 2025
1 parent bef84a4 commit 70acaeb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions rollup/ccc/async_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 70acaeb

Please sign in to comment.