From 122cffe48955ea355e3ad6091ffcea236399beb0 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ Date: Mon, 8 Apr 2024 22:18:53 +0800 Subject: [PATCH] implement --- rollup/internal/controller/relayer/l2_relayer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index 023cb8e530..4d88d9391c 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -461,6 +461,12 @@ func (r *Layer2Relayer) ProcessCommittedBatches() { } } + if r.cfg.EnableTestEnvSamplingFeature && ((batch.Index % 100) >= r.cfg.SamplingPercentage) { + if err := r.finalizeBatch(batch, false); err != nil { + log.Error("Failed to finalize skipped batch without proof", "index", batch.Index, "hash", batch.Hash, "err", err) + } + } + case types.ProvingTaskVerified: log.Info("Start to roll up zk proof", "hash", batch.Hash) r.metrics.rollupL2RelayerProcessCommittedBatchesFinalizedTotal.Inc()