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 f0ef6409f..d73a06ffc 100644 --- a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java +++ b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java @@ -135,7 +135,7 @@ public CHOAM(Parameters params) { session = new Session(params, service()); } - public static Checkpoint checkpoint(DigestAlgorithm algo, File state, int segmentSize, Digest initial) { + public static Checkpoint checkpoint(DigestAlgorithm algo, File state, int segmentSize, Digest initial, int crowns) { assert segmentSize > 0 : "segment size must be > 0 : " + segmentSize; long length = 0; if (state != null) { @@ -145,7 +145,7 @@ public static Checkpoint checkpoint(DigestAlgorithm algo, File state, int segmen if (length != 0 && count * segmentSize < length) { count++; } - var accumulator = new HexBloom.HexAccumulator(count, 2, initial); + var accumulator = new HexBloom.HexAccumulator(count, crowns, initial); Checkpoint.Builder builder = Checkpoint.newBuilder() .setCount(count) .setByteSize(length) @@ -386,7 +386,8 @@ private Block checkpoint() { return null; } final HashedBlock c = checkpoint.get(); - Checkpoint cp = checkpoint(params.digestAlgorithm(), state, params.checkpointSegmentSize(), c.hash); + Checkpoint cp = checkpoint(params.digestAlgorithm(), state, params.checkpointSegmentSize(), c.hash, + params.crowns()); if (cp == null) { transitions.fail(); return null; diff --git a/choam/src/test/java/com/salesforce/apollo/choam/TestChain.java b/choam/src/test/java/com/salesforce/apollo/choam/TestChain.java index 3d93b02ad..d86c4773f 100644 --- a/choam/src/test/java/com/salesforce/apollo/choam/TestChain.java +++ b/choam/src/test/java/com/salesforce/apollo/choam/TestChain.java @@ -128,7 +128,7 @@ private HashedCertifiedBlock checkpointBlock() { CHOAM.checkpoint( DigestAlgorithm.DEFAULT, null, 1, - checkpoint.hash)) + checkpoint.hash, 2)) .build()) .build()); store.put(lastBlock); diff --git a/choam/src/test/java/com/salesforce/apollo/choam/support/CheckpointAssemblerTest.java b/choam/src/test/java/com/salesforce/apollo/choam/support/CheckpointAssemblerTest.java index 315365e80..f451b8714 100644 --- a/choam/src/test/java/com/salesforce/apollo/choam/support/CheckpointAssemblerTest.java +++ b/choam/src/test/java/com/salesforce/apollo/choam/support/CheckpointAssemblerTest.java @@ -11,6 +11,7 @@ import com.salesfoce.apollo.choam.proto.CheckpointSegments; import com.salesfoce.apollo.choam.proto.Slice; import com.salesforce.apollo.archipelago.RouterImpl.CommonCommunications; +import com.salesforce.apollo.bloomFilters.BloomFilter; import com.salesforce.apollo.choam.CHOAM; import com.salesforce.apollo.choam.comm.Concierge; import com.salesforce.apollo.choam.comm.Terminal; @@ -25,7 +26,6 @@ import com.salesforce.apollo.stereotomy.mem.MemKERL; import com.salesforce.apollo.stereotomy.mem.MemKeyStore; import com.salesforce.apollo.utils.Utils; -import com.salesforce.apollo.bloomFilters.BloomFilter; import org.h2.mvstore.MVStore; import org.joou.ULong; import org.junit.jupiter.api.AfterEach; @@ -94,7 +94,8 @@ public void functional() throws Exception { .toList(); members.forEach(m -> context.activate(m)); - Checkpoint checkpoint = CHOAM.checkpoint(DigestAlgorithm.DEFAULT, chkptFile, SEGMENT_SIZE, DigestAlgorithm.DEFAULT.getOrigin()); + Checkpoint checkpoint = CHOAM.checkpoint(DigestAlgorithm.DEFAULT, chkptFile, SEGMENT_SIZE, + DigestAlgorithm.DEFAULT.getOrigin(), 2); SigningMember bootstrapping = members.get(0);