@@ -189,24 +189,21 @@ func (s *L2Batcher) Buffer(t Testing) error {
189189 if s .l2BatcherCfg .GarbageCfg != nil {
190190 ch , err = NewGarbageChannelOut (s .l2BatcherCfg .GarbageCfg )
191191 } else {
192- c , e := compressor .NewBlindCompressor (compressor.Config {
193- TargetOutputSize : batcher .MaxDataSize (1 , s .l2BatcherCfg .MaxL1TxSize ),
192+ target := batcher .MaxDataSize (1 , s .l2BatcherCfg .MaxL1TxSize )
193+ c , e := compressor .NewShadowCompressor (compressor.Config {
194+ TargetOutputSize : target ,
194195 })
195196 require .NoError (t , e , "failed to create compressor" )
196197
197- var batchType uint = derive .SingularBatchType
198- var spanBatch * derive.SpanBatch
199-
200198 if s .l2BatcherCfg .ForceSubmitSingularBatch && s .l2BatcherCfg .ForceSubmitSpanBatch {
201199 t .Fatalf ("ForceSubmitSingularBatch and ForceSubmitSpanBatch cannot be set to true at the same time" )
202200 } else if s .l2BatcherCfg .ForceSubmitSingularBatch {
203201 // use SingularBatchType
202+ ch , err = derive .NewChannelOut (c )
204203 } else if s .l2BatcherCfg .ForceSubmitSpanBatch || s .rollupCfg .IsDelta (block .Time ()) {
205204 // If both ForceSubmitSingularBatch and ForceSubmitSpanbatch are false, use SpanBatch automatically if Delta HF is activated.
206- batchType = derive .SpanBatchType
207- spanBatch = derive .NewSpanBatch (s .rollupCfg .Genesis .L2Time , s .rollupCfg .L2ChainID )
205+ ch , err = derive .NewSpanChannelOut (s .rollupCfg .Genesis .L2Time , s .rollupCfg .L2ChainID , target )
208206 }
209- ch , err = derive .NewChannelOut (batchType , c , spanBatch )
210207 }
211208 require .NoError (t , err , "failed to create channel" )
212209 s .l2ChannelOut = ch
0 commit comments