@@ -381,11 +381,17 @@ private void putBlockUpdate(final BlockUpdate update) {
381
381
382
382
private void updateSystemConfig (BlockInfo l1BlockInfo ) throws ExecutionException , InterruptedException {
383
383
BigInteger preLastUpdateBlock = this .systemConfigUpdate .component1 ();
384
- if (preLastUpdateBlock .compareTo (this .currentBlock ) <= 0 ) {
384
+ if (preLastUpdateBlock .compareTo (this .currentBlock ) < 0 || preLastUpdateBlock . equals ( BigInteger . ZERO ) ) {
385
385
BigInteger fromBlock = preLastUpdateBlock .equals (BigInteger .ZERO )
386
386
? BigInteger .ZERO
387
387
: preLastUpdateBlock .add (BigInteger .ONE );
388
+ if (fromBlock .compareTo (this .headBlock ) > 0 ) {
389
+ fromBlock = this .headBlock ;
390
+ }
388
391
BigInteger toBlock = preLastUpdateBlock .add (BigInteger .valueOf (100L ));
392
+ if (toBlock .compareTo (this .headBlock ) > 0 ) {
393
+ toBlock = this .headBlock ;
394
+ }
389
395
LOGGER .debug (
390
396
"will get system update eth log: fromBlock={} -> toBlock={}; contract={}" ,
391
397
fromBlock ,
@@ -423,6 +429,7 @@ private void updateSystemConfig(BlockInfo l1BlockInfo) throws ExecutionException
423
429
}
424
430
}
425
431
}
432
+
426
433
BigInteger lastUpdateBlock = this .systemConfigUpdate .component1 ();
427
434
SystemConfig nextConfig = this .systemConfigUpdate .component2 ();
428
435
if (lastUpdateBlock .compareTo (currentBlock ) == 0 && nextConfig != null ) {
@@ -443,9 +450,7 @@ private Config.SystemConfig parseSystemConfigUpdate(
443
450
lastSystemConfig .l1FeeScalar (),
444
451
lastSystemConfig .unsafeBlockSigner ());
445
452
} else if (configUpdate instanceof SystemConfigUpdate .Fees ) {
446
- var ecotoneTime = this .config .chainConfig ().ecotoneTime ();
447
- if (ecotoneTime .compareTo (BigInteger .ZERO ) > 0
448
- && l1BlockInfo .timestamp ().compareTo (ecotoneTime ) >= 0 ) {
453
+ if (this .config .chainConfig ().isEcotone (l1BlockInfo .timestamp ())) {
449
454
updateSystemConfig = new Config .SystemConfig (
450
455
lastSystemConfig .batchSender (),
451
456
lastSystemConfig .gasLimit (),
0 commit comments