|
4 | 4 | import io.optimism.common.Epoch;
|
5 | 5 | import io.optimism.config.Config;
|
6 | 6 | import io.optimism.driver.HeadInfo;
|
| 7 | +import io.optimism.driver.L1AttributesDepositedTxNotFoundException; |
7 | 8 | import io.optimism.l1.L1Info;
|
8 | 9 | import java.math.BigInteger;
|
9 | 10 | import java.util.Map.Entry;
|
@@ -142,7 +143,7 @@ public Tuple2<BlockInfo, Epoch> l2Info(BigInteger timestamp) {
|
142 | 143 | if (cache != null) {
|
143 | 144 | return cache;
|
144 | 145 | }
|
145 |
| - |
| 146 | + LOGGER.warn("L2 refs cache not contains, will fetch from geth: blockNum = {}", blockNum); |
146 | 147 | var res = l2Fetcher.apply(blockNum);
|
147 | 148 | this.l2Refs.put(res.component1().number(), res);
|
148 | 149 | return res;
|
@@ -337,10 +338,14 @@ public static TreeMap<BigInteger, Tuple2<BlockInfo, Epoch>> initL2Refs(
|
337 | 338 | if (block == null) {
|
338 | 339 | continue;
|
339 | 340 | }
|
340 |
| - final HeadInfo l2BlockInfo = HeadInfo.from(block); |
341 |
| - l2Refs.put( |
342 |
| - l2BlockInfo.l2BlockInfo().number(), |
343 |
| - new Tuple2<>(l2BlockInfo.l2BlockInfo(), l2BlockInfo.l1Epoch())); |
| 341 | + try { |
| 342 | + final HeadInfo l2BlockInfo = HeadInfo.from(block); |
| 343 | + l2Refs.put( |
| 344 | + l2BlockInfo.l2BlockInfo().number(), |
| 345 | + new Tuple2<>(l2BlockInfo.l2BlockInfo(), l2BlockInfo.l1Epoch())); |
| 346 | + } catch (L1AttributesDepositedTxNotFoundException ignore) { |
| 347 | + LOGGER.debug("Can't found deposited transaction (at blockNum = %d)".formatted(i)); |
| 348 | + } |
344 | 349 | }
|
345 | 350 | }
|
346 | 351 | return l2Refs;
|
|
0 commit comments