diff --git a/ethereum/blockcreation/src/main/java/tech/pegasys/pantheon/ethereum/blockcreation/AbstractMiningCoordinator.java b/ethereum/blockcreation/src/main/java/tech/pegasys/pantheon/ethereum/blockcreation/AbstractMiningCoordinator.java index 1b477e3fcb..dd00249542 100644 --- a/ethereum/blockcreation/src/main/java/tech/pegasys/pantheon/ethereum/blockcreation/AbstractMiningCoordinator.java +++ b/ethereum/blockcreation/src/main/java/tech/pegasys/pantheon/ethereum/blockcreation/AbstractMiningCoordinator.java @@ -113,7 +113,9 @@ public void inSyncChanged(final boolean inSync) { LOG.info("Resuming mining operations"); startAsyncMiningOperation(); } else if (!inSync) { - LOG.info("Pausing mining while behind chain head"); + if (isEnabled) { + LOG.info("Pausing mining while behind chain head"); + } haltCurrentMiningOperation(); } } diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MutableProtocolSchedule.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MutableProtocolSchedule.java index ca3bdd87da..fc4654df77 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MutableProtocolSchedule.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MutableProtocolSchedule.java @@ -17,6 +17,7 @@ import java.util.Comparator; import java.util.NavigableSet; import java.util.TreeSet; +import java.util.stream.Collectors; public class MutableProtocolSchedule implements ProtocolSchedule { @@ -59,4 +60,12 @@ public ProtocolSpec getByBlockNumber(final long number) { } return null; } + + public String listMilestones() { + return protocolSpecs + .stream() + .sorted(Comparator.comparing(ScheduledProtocolSpec::getBlock)) + .map(spec -> spec.getSpec().getName() + ": " + spec.getBlock()) + .collect(Collectors.joining(", ", "[", "]")); + } } diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/ProtocolScheduleBuilder.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/ProtocolScheduleBuilder.java index 8c6ea64a8e..feb7d40e7a 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/ProtocolScheduleBuilder.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/ProtocolScheduleBuilder.java @@ -18,8 +18,11 @@ import java.util.OptionalLong; import java.util.function.Function; -public class ProtocolScheduleBuilder { +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +public class ProtocolScheduleBuilder { + private static final Logger LOG = LogManager.getLogger(); private final GenesisConfigOptions config; private final Function, ProtocolSpecBuilder> protocolSpecAdapter; private final int defaultChainId; @@ -91,6 +94,7 @@ public ProtocolSchedule createProtocolSchedule() { config.getConstantinopleFixBlockNumber(), MainnetProtocolSpecs.constantinopleFixDefinition(chainId)); + LOG.info("Protocol schedule created with milestones: {}", protocolSchedule.listMilestones()); return protocolSchedule; } diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/controller/KeyPairUtil.java b/pantheon/src/main/java/tech/pegasys/pantheon/controller/KeyPairUtil.java index 1b6561212e..60c62f572b 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/controller/KeyPairUtil.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/controller/KeyPairUtil.java @@ -33,7 +33,7 @@ public static SECP256K1.KeyPair loadKeyPair(final File keyFile) throws IOExcepti key = SECP256K1.KeyPair.generate(); key.getPrivateKey().store(keyFile); LOG.info( - "Generated new key key {} and stored it to {}", + "Generated new key {} and stored it to {}", key.getPublicKey().toString(), keyFile.getAbsolutePath()); }