From 17da1224242b27d2c10eca7c0b531c3375891cd8 Mon Sep 17 00:00:00 2001 From: Hellblazer Date: Sat, 13 Apr 2024 16:02:08 -0700 Subject: [PATCH] revert dat and clean --- choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java | 4 +++- choam/src/main/java/com/salesforce/apollo/choam/Session.java | 2 +- .../src/main/java/com/salesforce/apollo/ethereal/Adder.java | 2 +- .../main/java/com/salesforce/apollo/ethereal/Ethereal.java | 2 ++ .../salesforce/apollo/ethereal/memberships/ChRbcGossip.java | 2 +- .../src/main/java/com/salesforce/apollo/fireflies/View.java | 2 +- grpc/src/main/proto/choam.proto | 1 + 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java index 2b1783083..a751be158 100644 --- a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java +++ b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java @@ -1237,7 +1237,9 @@ public Logger log() { @Override public void nextView(Context pendingView) { var previous = CHOAM.this.pendingView.getAndSet(pendingView); - log.info("Pending view: {} size: {} on: {}", nextViewId.get(), pendingView.size(), params.member().getId()); + log.info("Pending context for view: {} size: {} on: {}", + nextViewId.get() == null ? "" : nextViewId.get(), pendingView.size(), + params.member().getId()); } @Override diff --git a/choam/src/main/java/com/salesforce/apollo/choam/Session.java b/choam/src/main/java/com/salesforce/apollo/choam/Session.java index 99aa48076..31c09603e 100644 --- a/choam/src/main/java/com/salesforce/apollo/choam/Session.java +++ b/choam/src/main/java/com/salesforce/apollo/choam/Session.java @@ -91,7 +91,7 @@ public static CompletableFuture retryNesting(Supplier { - log.warn("resubmitting, next attempt: {}", attempt); + log.trace("resubmitting after attempt: {}", attempt + 1); return supplier.get(); }).thenCompose(java.util.function.Function.identity()); } diff --git a/ethereal/src/main/java/com/salesforce/apollo/ethereal/Adder.java b/ethereal/src/main/java/com/salesforce/apollo/ethereal/Adder.java index be093a8ce..0d040d191 100644 --- a/ethereal/src/main/java/com/salesforce/apollo/ethereal/Adder.java +++ b/ethereal/src/main/java/com/salesforce/apollo/ethereal/Adder.java @@ -294,7 +294,7 @@ void commit(Digest digest, short member) { return; } - // Check for existing proposal + // Check for an existing proposal if (wpu == null) { log.trace("Committed, but no proposal: {} count: {} on: {}", digest, committed.size(), conf.logLabel()); return; diff --git a/ethereal/src/main/java/com/salesforce/apollo/ethereal/Ethereal.java b/ethereal/src/main/java/com/salesforce/apollo/ethereal/Ethereal.java index fc89abd77..f11310a96 100644 --- a/ethereal/src/main/java/com/salesforce/apollo/ethereal/Ethereal.java +++ b/ethereal/src/main/java/com/salesforce/apollo/ethereal/Ethereal.java @@ -68,6 +68,8 @@ private Ethereal(String label, Config conf, int maxSerializedSize, DataSource ds log.trace("Sending: {} on: {}", u, config.logLabel()); insert(u); }, epoch -> new epochProofImpl(config, epoch, new sharesDB(config, new ConcurrentHashMap<>()))); + + log.trace("Configured {} processes {}", config.nProc(), config.logLabel()); } private static ThreadPoolExecutor consumer(String label) { diff --git a/ethereal/src/main/java/com/salesforce/apollo/ethereal/memberships/ChRbcGossip.java b/ethereal/src/main/java/com/salesforce/apollo/ethereal/memberships/ChRbcGossip.java index ff8c048a4..69b7a0685 100644 --- a/ethereal/src/main/java/com/salesforce/apollo/ethereal/memberships/ChRbcGossip.java +++ b/ethereal/src/main/java/com/salesforce/apollo/ethereal/memberships/ChRbcGossip.java @@ -145,7 +145,7 @@ private Update gossipRound(Gossiper link, int ring) { */ private void handle(Optional result, RingCommunications.Destination destination, Duration duration, ScheduledExecutorService scheduler, Timer.Context timer) { - if (!started.get() || destination.link() == null) { + if (!started.get() || destination == null || destination.link() == null) { if (timer != null) { timer.stop(); } diff --git a/fireflies/src/main/java/com/salesforce/apollo/fireflies/View.java b/fireflies/src/main/java/com/salesforce/apollo/fireflies/View.java index a4153e0a9..7c9b702c8 100644 --- a/fireflies/src/main/java/com/salesforce/apollo/fireflies/View.java +++ b/fireflies/src/main/java/com/salesforce/apollo/fireflies/View.java @@ -1508,7 +1508,7 @@ public static BitSet createInitialMask(DynamicContext context) { int nbits = context.getRingCount(); BitSet mask = new BitSet(nbits); List random = new ArrayList<>(); - for (int i = 0; i < ((context.getBias() - 1) * context.toleranceLevel()) + 1; i++) { + for (int i = 0; i < context.majority(); i++) { random.add(true); } for (int i = 0; i < context.toleranceLevel(); i++) { diff --git a/grpc/src/main/proto/choam.proto b/grpc/src/main/proto/choam.proto index 4f7e5af9c..1cc17b0d0 100644 --- a/grpc/src/main/proto/choam.proto +++ b/grpc/src/main/proto/choam.proto @@ -154,6 +154,7 @@ message Validate { message Reassemble { repeated SignedViewMember members = 1; repeated Validate validations = 2; + repeated crypto.Digeste slate = 3; } message Validations {