Skip to content

Commit

Permalink
log: level
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkAfCod committed Apr 26, 2024
1 parent 27a98c2 commit 22f82a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions hildr-node/src/main/java/io/optimism/driver/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ private void advanceUnsafeHead() throws ExecutionException, InterruptedException
payload = this.unsafeBlockQueue.poll()) {
BigInteger unsafeBlockNum = payload.blockNumber();
BigInteger syncedBlockNum = Driver.this.engineDriver.getUnsafeHead().number();
if (Driver.this.config.syncMode().isEl()) {
if (syncedBlockNum.compareTo(BigInteger.ZERO) == 0) {
this.futureUnsafeBlocks.add(payload);
break;
} else if (this.engineDriver.isEngineSyncing() && unsafeBlockNum.compareTo(syncedBlockNum) > 0) {
this.futureUnsafeBlocks.add(payload);
} else if (unsafeBlockNum.compareTo(syncedBlockNum) > 0
&& unsafeBlockNum.subtract(syncedBlockNum).compareTo(BigInteger.valueOf(1024L)) < 0) {
Expand All @@ -498,9 +501,8 @@ private void advanceUnsafeHead() throws ExecutionException, InterruptedException
}
LOGGER.debug("will handle future unsafe blocks: size={}", this.futureUnsafeBlocks.size());
Optional<ExecutionPayload> nextUnsafePayload;
if (Driver.this.engineDriver.isEngineSyncing()) {
nextUnsafePayload = Optional.of(this.futureUnsafeBlocks.getLast());
this.futureUnsafeBlocks = Lists.newArrayList();
if (this.engineDriver.isEngineSyncing()) {
nextUnsafePayload = Optional.of(this.futureUnsafeBlocks.removeFirst());
} else {
nextUnsafePayload = Iterables.tryFind(this.futureUnsafeBlocks, input -> input.parentHash()
.equalsIgnoreCase(
Expand Down
4 changes: 2 additions & 2 deletions hildr-node/src/main/java/io/optimism/driver/EngineDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ private void updateForkchoice() throws InterruptedException, ExecutionException

var forkChoiceUpdate = forkChoiceUpdateFuture.get();
if (forkChoiceUpdate.hasError()) {
throw new ForkchoiceUpdateException(
"could not accept new forkchoice: %s".formatted(forkChoiceUpdate.getError().getMessage()));
throw new ForkchoiceUpdateException("could not accept new forkchoice: %s"
.formatted(forkChoiceUpdate.getError().getMessage()));
}
var forkChoiceUpdateStatus = forkChoiceUpdate.getForkChoiceUpdate().payloadStatus();
var updateStatus = forkChoiceUpdateStatus.getStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ protected void processMessage(
case IGNORE -> LOGGER.debug("Ignoring message for topic: {}", topic);
case SAVE_FOR_FUTURE -> LOGGER.debug("Deferring message for topic: {}", topic);
case ACCEPT -> {
LOGGER.info("Accepting message for topic: {}", topic);
LOGGER.info(
"Accepting message for topic: {}, number: {}",
topic,
blockMessage.payloadEnvelop.executionPayload().blockNumber());
this.unsafeBlockQueue.offer(blockMessage.payloadEnvelop.executionPayload());
}
default -> throw new UnsupportedOperationException(
Expand Down

0 comments on commit 22f82a6

Please sign in to comment.