@@ -202,7 +202,7 @@ impl Batcher {
202
202
// Read batches
203
203
while let Some ( batches) = self . batcher_channel . read_batches ( ) {
204
204
batches. into_iter ( ) . for_each ( |batch| {
205
- #[ cfg( not ( target_os = "zkvm" ) ) ]
205
+ #[ cfg( feature = "std" ) ]
206
206
log:: debug!(
207
207
"received batch: timestamp={}, parent_hash={}, epoch={}" ,
208
208
batch. essence. timestamp,
@@ -316,7 +316,7 @@ impl Batcher {
316
316
// "batch.timestamp < next_timestamp -> drop"
317
317
match batch. essence . timestamp . cmp ( & next_timestamp) {
318
318
Ordering :: Greater => {
319
- #[ cfg( not ( target_os = "zkvm" ) ) ]
319
+ #[ cfg( feature = "std" ) ]
320
320
log:: debug!(
321
321
"Future batch: {} = batch.timestamp > next_timestamp = {}" ,
322
322
& batch. essence. timestamp,
@@ -325,7 +325,7 @@ impl Batcher {
325
325
return BatchStatus :: Future ;
326
326
}
327
327
Ordering :: Less => {
328
- #[ cfg( not ( target_os = "zkvm" ) ) ]
328
+ #[ cfg( feature = "std" ) ]
329
329
log:: debug!(
330
330
"Batch too old: {} = batch.timestamp < next_timestamp = {}" ,
331
331
& batch. essence. timestamp,
@@ -339,7 +339,7 @@ impl Batcher {
339
339
// From the spec:
340
340
// "batch.parent_hash != safe_l2_head.hash -> drop"
341
341
if batch. essence . parent_hash != safe_l2_head. hash {
342
- #[ cfg( not ( target_os = "zkvm" ) ) ]
342
+ #[ cfg( feature = "std" ) ]
343
343
log:: debug!(
344
344
"Incorrect parent hash: {} != {}" ,
345
345
batch. essence. parent_hash,
@@ -351,7 +351,7 @@ impl Batcher {
351
351
// From the spec:
352
352
// "batch.epoch_num + sequence_window_size < inclusion_block_number -> drop"
353
353
if batch. essence . epoch_num + self . config . seq_window_size < batch. inclusion_block_number {
354
- #[ cfg( not ( target_os = "zkvm" ) ) ]
354
+ #[ cfg( feature = "std" ) ]
355
355
log:: debug!(
356
356
"Batch is not timely: {} + {} < {}" ,
357
357
batch. essence. epoch_num,
@@ -364,7 +364,7 @@ impl Batcher {
364
364
// From the spec:
365
365
// "batch.epoch_num < epoch.number -> drop"
366
366
if batch. essence . epoch_num < epoch. number {
367
- #[ cfg( not ( target_os = "zkvm" ) ) ]
367
+ #[ cfg( feature = "std" ) ]
368
368
log:: debug!(
369
369
"Batch epoch number is too low: {} < {}" ,
370
370
batch. essence. epoch_num,
@@ -388,7 +388,7 @@ impl Batcher {
388
388
// From the spec:
389
389
// "batch.epoch_num > epoch.number+1 -> drop"
390
390
_ => {
391
- #[ cfg( not ( target_os = "zkvm" ) ) ]
391
+ #[ cfg( feature = "std" ) ]
392
392
log:: debug!(
393
393
"Batch epoch number is too large: {} > {}" ,
394
394
batch. essence. epoch_num,
@@ -401,7 +401,7 @@ impl Batcher {
401
401
// From the spec:
402
402
// "batch.epoch_hash != batch_origin.hash -> drop"
403
403
if batch. essence . epoch_hash != batch_origin. hash {
404
- #[ cfg( not ( target_os = "zkvm" ) ) ]
404
+ #[ cfg( feature = "std" ) ]
405
405
log:: debug!(
406
406
"Epoch hash mismatch: {} != {}" ,
407
407
batch. essence. epoch_hash,
@@ -413,7 +413,7 @@ impl Batcher {
413
413
// From the spec:
414
414
// "batch.timestamp < batch_origin.time -> drop"
415
415
if batch. essence . timestamp < batch_origin. timestamp {
416
- #[ cfg( not ( target_os = "zkvm" ) ) ]
416
+ #[ cfg( feature = "std" ) ]
417
417
log:: debug!(
418
418
"Batch violates timestamp rule: {} < {}" ,
419
419
batch. essence. timestamp,
@@ -426,7 +426,7 @@ impl Batcher {
426
426
// "batch.timestamp > batch_origin.time + max_sequencer_drift: enforce the L2 timestamp
427
427
// drift rule, but with exceptions to preserve above min L2 timestamp invariant:"
428
428
if batch. essence . timestamp > batch_origin. timestamp + self . config . max_seq_drift {
429
- #[ cfg( not ( target_os = "zkvm" ) ) ]
429
+ #[ cfg( feature = "std" ) ]
430
430
log:: debug!(
431
431
"Sequencer drift detected: {} > {} + {}" ,
432
432
batch. essence. timestamp,
@@ -437,7 +437,7 @@ impl Batcher {
437
437
// From the spec:
438
438
// "len(batch.transactions) > 0: -> drop"
439
439
if !batch. essence . transactions . is_empty ( ) {
440
- #[ cfg( not ( target_os = "zkvm" ) ) ]
440
+ #[ cfg( feature = "std" ) ]
441
441
log:: debug!( "Sequencer drift detected for non-empty batch; drop." ) ;
442
442
return BatchStatus :: Drop ;
443
443
}
@@ -450,15 +450,15 @@ impl Batcher {
450
450
let Some ( next_epoch) = next_epoch else {
451
451
// From the spec:
452
452
// "If next_epoch is not known -> undecided"
453
- #[ cfg( not ( target_os = "zkvm" ) ) ]
453
+ #[ cfg( feature = "std" ) ]
454
454
log:: debug!( "Sequencer drift detected, but next epoch is not known; undecided" ) ;
455
455
return BatchStatus :: Undecided ;
456
456
} ;
457
457
458
458
// From the spec:
459
459
// "If batch.timestamp >= next_epoch.time -> drop"
460
460
if batch. essence . timestamp >= next_epoch. timestamp {
461
- #[ cfg( not ( target_os = "zkvm" ) ) ]
461
+ #[ cfg( feature = "std" ) ]
462
462
log:: debug!( "Sequencer drift detected; drop; batch timestamp is too far into the future. {} >= {}" , batch. essence. timestamp, next_epoch. timestamp) ;
463
463
return BatchStatus :: Drop ;
464
464
}
@@ -472,7 +472,7 @@ impl Batcher {
472
472
// any deposited transactions (identified by the transaction type prefix byte)"
473
473
for tx in & batch. essence . transactions {
474
474
if matches ! ( tx. first( ) , None | Some ( & OPTIMISM_DEPOSITED_TX_TYPE ) ) {
475
- #[ cfg( not ( target_os = "zkvm" ) ) ]
475
+ #[ cfg( feature = "std" ) ]
476
476
log:: debug!( "Batch contains empty or invalid transaction" ) ;
477
477
return BatchStatus :: Drop ;
478
478
}
0 commit comments