Skip to content

Commit

Permalink
try to speed build
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Oct 27, 2023
1 parent 3556ba9 commit 9f00f41
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ public ExecutionLayerChannelStub(
this.transitionEmulationEnabled = enableTransitionEmulation;
this.terminalBlockHashInTTDMode =
terminalBlockHashInTTDMode.orElse(Bytes32.fromHexStringLenient("0x01"));
this.blobsUtil = new BlobsUtil(spec, KZG.INSTANCE);
final KZG kzg;
if (spec.isMilestoneSupported(SpecMilestone.DENEB)) {
kzg = KZG.getInstance();
} else {
kzg = KZG.NOOP;
}
this.blobsUtil = new BlobsUtil(spec, kzg);
}

public ExecutionLayerChannelStub(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private KZG getKzgWithTrustedSetup() {

private static class KzgAutoLoadFree implements Store.CloseOnReset {

private final KZG kzg = KZG.INSTANCE;
private final KZG kzg = KZG.getInstance();

private KzgAutoLoadFree() {
TrustedSetupLoader.loadTrustedSetupForTests(kzg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import tech.pegasys.teku.kzg.KZG;
import tech.pegasys.teku.kzg.KZGCommitment;
import tech.pegasys.teku.kzg.KZGProof;
import tech.pegasys.teku.kzg.trusted_setups.TrustedSetupLoader;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.SpecMilestone;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob;
Expand Down Expand Up @@ -108,14 +107,7 @@ private ChainBuilder(
final Optional<UInt64> maybeEarliestBlobSidecarSlot) {
this.spec = spec;
this.validatorKeys = validatorKeys;
final KZG kzg;
if (spec.isMilestoneSupported(SpecMilestone.DENEB)) {
kzg = KZG.INSTANCE;
TrustedSetupLoader.loadTrustedSetupForTests(kzg);
} else {
kzg = KZG.NOOP;
}
blobsUtil = new BlobsUtil(spec, kzg);
blobsUtil = new BlobsUtil(spec, KZG.NOOP);
attestationGenerator = new AttestationGenerator(spec, validatorKeys);
attesterSlashingGenerator = new AttesterSlashingGenerator(spec, validatorKeys);
blockProposalTestUtil = new BlockProposalTestUtil(spec);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
*/
public interface KZG {

KZG INSTANCE = CKZG4844.getInstance();
static KZG getInstance() {
return CKZG4844.getInstance();
}

KZG NOOP =
new KZG() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ protected void initExecutionLayer() {

protected void initKzg() {
if (spec.isMilestoneSupported(SpecMilestone.DENEB)) {
kzg = KZG.INSTANCE;
kzg = KZG.getInstance();
final String trustedSetupFile =
beaconConfig
.eth2NetworkConfig()
Expand Down

0 comments on commit 9f00f41

Please sign in to comment.