From 19b82303eec347641d9cf554d899fa68b1fb3f6c Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Fri, 15 Nov 2024 17:41:23 +0800 Subject: [PATCH] tweak asserts --- rollup/internal/controller/watcher/batch_proposer.go | 2 +- rollup/internal/controller/watcher/bundle_proposer.go | 2 +- rollup/internal/controller/watcher/chunk_proposer.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup/internal/controller/watcher/batch_proposer.go b/rollup/internal/controller/watcher/batch_proposer.go index 39e509027..f4a5a890b 100644 --- a/rollup/internal/controller/watcher/batch_proposer.go +++ b/rollup/internal/controller/watcher/batch_proposer.go @@ -248,7 +248,7 @@ func (p *BatchProposer) proposeBatch() error { return fmt.Errorf("failed to retrieve codec for block number %v and time %v", firstUnbatchedChunk.StartBlockNumber, firstUnbatchedChunk.StartBlockTime) } - if codec.Version() <= encoding.CodecV3 { + if codec.Version() < encoding.CodecV4 { return fmt.Errorf("unsupported codec version: %v, expected at least %v", codec.Version(), encoding.CodecV4) } diff --git a/rollup/internal/controller/watcher/bundle_proposer.go b/rollup/internal/controller/watcher/bundle_proposer.go index 5430a86e9..a71b0d998 100644 --- a/rollup/internal/controller/watcher/bundle_proposer.go +++ b/rollup/internal/controller/watcher/bundle_proposer.go @@ -155,7 +155,7 @@ func (p *BundleProposer) proposeBundle() error { hardforkName := encoding.GetHardforkName(p.chainCfg, firstChunk.StartBlockNumber, firstChunk.StartBlockTime) codecVersion := encoding.CodecVersion(batches[0].CodecVersion) - if codecVersion <= encoding.CodecV3 { + if codecVersion < encoding.CodecV4 { return fmt.Errorf("unsupported codec version: %v, expected at least %v", codecVersion, encoding.CodecV4) } diff --git a/rollup/internal/controller/watcher/chunk_proposer.go b/rollup/internal/controller/watcher/chunk_proposer.go index 5a6166114..8a9d0249d 100644 --- a/rollup/internal/controller/watcher/chunk_proposer.go +++ b/rollup/internal/controller/watcher/chunk_proposer.go @@ -277,7 +277,7 @@ func (p *ChunkProposer) proposeChunk() error { codecVersion := encoding.GetCodecVersion(p.chainCfg, blocks[0].Header.Number.Uint64(), blocks[0].Header.Time) - if codecVersion <= encoding.CodecV3 { + if codecVersion < encoding.CodecV4 { return fmt.Errorf("unsupported codec version: %v, expected at least %v", codecVersion, encoding.CodecV4) }