From 7443a4ac086000b1d2a7d5af6685cc5ef9537b9d Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Tue, 16 Jan 2024 01:58:07 +0100 Subject: [PATCH] load Ethereum mainnet KZG setup on Gnosis networks (#5756) Gnosis networks re-use the trusted setup from Ethereum mainnet. Load it to support Deneb. --- beacon_chain/conf.nim | 6 ++---- beacon_chain/spec/presets.nim | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/beacon_chain/conf.nim b/beacon_chain/conf.nim index 2fe506cdc..f9fa2a321 100644 --- a/beacon_chain/conf.nim +++ b/beacon_chain/conf.nim @@ -1483,10 +1483,8 @@ proc loadKzgTrustedSetup*(): Result[void, string] = trustedSetup = staticRead( vendorDir & "/nim-kzg4844/kzg4844/csources/src/trusted_setup.txt") - if const_preset == "mainnet" or const_preset == "minimal": - Kzg.loadTrustedSetupFromString(trustedSetup) - else: - ok() + static: doAssert const_preset in ["mainnet", "gnosis", "minimal"] + Kzg.loadTrustedSetupFromString(trustedSetup) proc loadKzgTrustedSetup*(trustedSetupPath: string): Result[void, string] = try: diff --git a/beacon_chain/spec/presets.nim b/beacon_chain/spec/presets.nim index 6dcceb656..b113d9d60 100644 --- a/beacon_chain/spec/presets.nim +++ b/beacon_chain/spec/presets.nim @@ -559,7 +559,7 @@ elif const_preset == "minimal": ) else: - {.error: "Only mainnet and minimal presets supported".} + {.error: "Only mainnet, gnosis, and minimal presets supported".} # macro createConstantsFromPreset*(path: static string): untyped = # result = newStmtList()