Remove Misleading Fast-Sync Logging (#2158)

Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/2196/head
Ratan (Rai) Sur 4 years ago committed by GitHub
parent 46d4952a70
commit efe845b4b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncDownloader.java
  2. 13
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/CompleteTaskStep.java
  3. 7
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/CompleteTaskStepTest.java

@ -91,8 +91,7 @@ public class FastSyncDownloader {
if (ExceptionUtils.rootCause(error) instanceof FastSyncException) {
return CompletableFuture.failedFuture(error);
} else if (ExceptionUtils.rootCause(error) instanceof StalledDownloadException) {
LOG.warn(
"Fast sync was unable to download the world state. Retrying with a new pivot block.");
LOG.info("Re-pivoting to newer block.");
return start(FastSyncState.EMPTY_SYNC_STATE);
} else {
LOG.error(

@ -22,7 +22,6 @@ import org.hyperledger.besu.plugin.services.MetricsSystem;
import org.hyperledger.besu.plugin.services.metrics.Counter;
import org.hyperledger.besu.services.tasks.Task;
import java.text.DecimalFormat;
import java.util.function.LongSupplier;
import org.apache.logging.log4j.LogManager;
@ -35,7 +34,6 @@ public class CompleteTaskStep {
private final RunnableCounter completedRequestsCounter;
private final Counter retriedRequestsCounter;
private final LongSupplier worldStatePendingRequestsCurrentSupplier;
private final DecimalFormat doubleFormatter = new DecimalFormat("#.##");
public CompleteTaskStep(
final WorldStateStorage worldStateStorage,
@ -78,16 +76,9 @@ public class CompleteTaskStep {
private void displayWorldStateSyncProgress() {
LOG.info(
"Downloaded {} world state nodes. At least {} nodes remaining. Estimated World State completion: {} %.",
"Downloaded {} world state nodes. At least {} nodes remaining.",
getCompletedRequests(),
worldStatePendingRequestsCurrentSupplier.getAsLong(),
doubleFormatter.format(computeWorldStateSyncProgress() * 100.0));
}
public double computeWorldStateSyncProgress() {
final double pendingRequests = getPendingRequests();
final double completedRequests = getCompletedRequests();
return completedRequests / (completedRequests + pendingRequests);
worldStatePendingRequestsCurrentSupplier.getAsLong());
}
long getCompletedRequests() {

@ -78,13 +78,6 @@ public class CompleteTaskStepTest {
verify(downloadState).checkCompletion(worldStateStorage, blockHeader);
}
@Test
public void shouldComputeWorldStateProgress() {
completeTaskStep.markAsCompleteOrFailed(blockHeader, downloadState, validTask());
// One task has been completed and there are 2 pending requests, progress should be 1/4 (25%)
assertThat(completeTaskStep.computeWorldStateSyncProgress()).isEqualTo(1.0 / 4.0);
}
private StubTask validTask() {
final Hash hash =
Hash.fromHexString("0x601a7b0d0267209790cf4c4d9e0cab11b26c537e2ade006412f48b070010e847");

Loading…
Cancel
Save