From 45901f36d059a5bb19d2eafc061ff1e2f14c2b56 Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Fri, 20 Oct 2023 16:28:16 +0100 Subject: [PATCH] hacky way of reloading trusted setup --- .../java/tech/pegasys/teku/kzg/ckzg4844/CKZG4844.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/infrastructure/kzg/src/main/java/tech/pegasys/teku/kzg/ckzg4844/CKZG4844.java b/infrastructure/kzg/src/main/java/tech/pegasys/teku/kzg/ckzg4844/CKZG4844.java index 46a5befca7c..e9e0b748ea7 100644 --- a/infrastructure/kzg/src/main/java/tech/pegasys/teku/kzg/ckzg4844/CKZG4844.java +++ b/infrastructure/kzg/src/main/java/tech/pegasys/teku/kzg/ckzg4844/CKZG4844.java @@ -63,8 +63,15 @@ public synchronized void loadTrustedSetup(final String trustedSetupFile) throws } try { - // allow reloading of trusted setup - loadedTrustedSetupFile.ifPresent(__ -> freeTrustedSetup()); + // allow loading different trusted setup + loadedTrustedSetupFile.ifPresent( + currentTrustedSetupFile -> { + LOG.debug( + "Replacing current trusted setup {} with {}", + currentTrustedSetupFile, + trustedSetupFile); + freeTrustedSetup(); + }); final TrustedSetup trustedSetup = CKZG4844Utils.parseTrustedSetupFile(trustedSetupFile); final List g1Points = trustedSetup.g1Points(); final List g2Points = trustedSetup.g2Points();