Skip to content

Commit eb0be76

Browse files
Remove debug output
Signed-off-by: Michael Tinker <[email protected]>
1 parent 613a259 commit eb0be76

File tree

2 files changed

+12
-52
lines changed

2 files changed

+12
-52
lines changed

hedera-node/hedera-app/src/main/java/com/hedera/node/app/history/impl/HistoryLibraryImpl.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@
1212
import com.hedera.cryptography.wraps.WRAPSLibraryBridge;
1313
import com.hedera.node.app.history.HistoryLibrary;
1414
import edu.umd.cs.findbugs.annotations.NonNull;
15-
import java.util.Arrays;
1615
import java.util.Set;
1716
import java.util.SplittableRandom;
18-
import org.apache.logging.log4j.LogManager;
19-
import org.apache.logging.log4j.Logger;
20-
import org.hiero.base.utility.CommonUtils;
2117

2218
/**
2319
* Default implementation of the {@link HistoryLibrary}.
2420
*/
2521
public class HistoryLibraryImpl implements HistoryLibrary {
26-
private static final Logger logger = LogManager.getLogger(HistoryLibraryImpl.class);
27-
2822
public static final SplittableRandom RANDOM = new SplittableRandom();
2923
public static final WRAPSLibraryBridge WRAPS = WRAPSLibraryBridge.getInstance();
3024

@@ -129,45 +123,6 @@ public Proof constructGenesisWrapsProof(
129123
requireNonNull(aggregatedSignature);
130124
requireNonNull(signers);
131125
requireNonNull(addressBook);
132-
133-
final var prevSchnorrPublicKeys = addressBook.publicKeys();
134-
final var prevWeights = addressBook.weights();
135-
final var nextSchnorrPublicKeys = addressBook.publicKeys();
136-
final var nextWeights = addressBook.weights();
137-
final var mask = addressBook.signersMask(signers);
138-
final var tssVerificationKey = GENESIS_WRAPS_METADATA;
139-
logger.info(" genesisAddressBookHash == null ? {}", genesisAddressBookHash == null);
140-
logger.info(" genesisAddressBookHash.length == 0 ? {}", genesisAddressBookHash.length == 0);
141-
logger.info(" prevSchnorrPublicKeys == null ? {}", prevSchnorrPublicKeys == null);
142-
logger.info(" prevWeights == null ? {}", prevWeights == null);
143-
logger.info(" prevSchnorrPublicKeys.length == 0 ? {}", prevSchnorrPublicKeys.length == 0);
144-
logger.info(
145-
" prevSchnorrPublicKeys.length != prevWeights.length ? {}",
146-
prevSchnorrPublicKeys.length != prevWeights.length);
147-
logger.info(" !WRAPSLibraryBridge.validateWeightsSum(prevWeights) ? {}", !validateWeightsSum(prevWeights));
148-
logger.info(" nextSchnorrPublicKeys == null ? {}", nextSchnorrPublicKeys == null);
149-
logger.info(" nextWeights == null ? {}", nextWeights == null);
150-
logger.info(" nextSchnorrPublicKeys.length == 0 ? {}", nextSchnorrPublicKeys.length == 0);
151-
logger.info(
152-
" nextSchnorrPublicKeys.length != nextWeights.length ? {}",
153-
nextSchnorrPublicKeys.length != nextWeights.length);
154-
logger.info(" !WRAPSLibraryBridge.validateWeightsSum(nextWeights) ? {}", !validateWeightsSum(nextWeights));
155-
logger.info(" tssVerificationKey == null ? {}", tssVerificationKey == null);
156-
logger.info(" tssVerificationKey.length == 0 ? {}", tssVerificationKey.length == 0);
157-
logger.info(" aggregateSignature == null ? {}", aggregatedSignature == null);
158-
logger.info(" aggregateSignature.length == 0 ? {}", aggregatedSignature.length == 0);
159-
logger.info(" signers == null ? {}", mask == null);
160-
logger.info(
161-
" signers.length != prevSchnorrPublicKeys.length ? {}", mask.length != prevSchnorrPublicKeys.length);
162-
logger.info(
163-
" !WRAPSLibraryBridge.validateSchnorrPublicKeys(prevSchnorrPublicKeys) ? {}",
164-
!validateSchnorrPublicKeys(prevSchnorrPublicKeys));
165-
logger.info(
166-
") !WRAPSLibraryBridge.validateSchnorrPublicKeys(nextSchnorrPublicKeys) ? {}",
167-
!validateSchnorrPublicKeys(nextSchnorrPublicKeys));
168-
logger.info("Is proof supported? {}", WRAPSLibraryBridge.isProofSupported());
169-
logger.info("Genesis hash: " + CommonUtils.hex(genesisAddressBookHash));
170-
logger.info("Signers: " + Arrays.toString(mask));
171126
return WRAPS.constructWrapsProof(
172127
genesisAddressBookHash,
173128
addressBook.publicKeys(),

hedera-node/hedera-app/src/main/java/com/hedera/node/app/history/impl/WrapsHistoryProver.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import edu.umd.cs.findbugs.annotations.NonNull;
3636
import edu.umd.cs.findbugs.annotations.Nullable;
3737
import java.security.SecureRandom;
38+
import java.time.Duration;
3839
import java.time.Instant;
3940
import java.util.ArrayList;
4041
import java.util.EnumMap;
@@ -571,7 +572,10 @@ yield new AggregatePhaseOutput(
571572
}
572573
final var isValid =
573574
historyLibrary.verifyAggregateSignature(message, publicKeysForR1(), signature);
574-
log.info("Aggregate signature is {}", isValid ? "valid" : "invalid");
575+
if (!isValid) {
576+
throw new IllegalStateException("Invalid aggregate signature using nodes "
577+
+ phaseMessages.get(R1).keySet());
578+
}
575579
Proof proof;
576580
if (!isWrapsExtensible(sourceProof)) {
577581
final long now = System.nanoTime();
@@ -581,9 +585,7 @@ yield new AggregatePhaseOutput(
581585
signature,
582586
phaseMessages.get(R1).keySet(),
583587
targetBook);
584-
log.info(
585-
"Constructed genesis WRAPS proof in {}ms",
586-
(System.nanoTime() - now) / 1_000_000);
588+
logElapsed("constructing genesis WRAPS proof", now);
587589
} else {
588590
proof = new Proof(
589591
sourceProof.uncompressedWrapsProof().toByteArray(),
@@ -620,16 +622,19 @@ yield new AggregatePhaseOutput(
620622
targetMetadata.toByteArray(),
621623
effectiveSignature,
622624
effectiveSigners);
623-
log.info(
624-
"Constructed incremental WRAPS proof in {}ms",
625-
(System.nanoTime() - now) / 1_000_000);
625+
logElapsed("constructing incremental WRAPS proof", now);
626626
yield new ProofPhaseOutput(proof.compressed(), proof.uncompressed());
627627
}
628628
}
629629
},
630630
executor);
631631
}
632632

633+
private void logElapsed(@NonNull final String event, final long startNs) {
634+
final var duration = Duration.ofNanos(System.nanoTime() - startNs);
635+
log.info("FINISHED {} - took {}m {}s", event, duration.toMinutes(), duration.toSecondsPart());
636+
}
637+
633638
private byte[][] publicKeysForR1() {
634639
return phaseMessages.get(R1).keySet().stream()
635640
.map(nodeId -> proofKeys.get(nodeId).toByteArray())

0 commit comments

Comments
 (0)