Skip to content

Commit

Permalink
CRS / protocol setups: rename truted_setups folder to prepare for tra…
Browse files Browse the repository at this point in the history
…nsparent IPA setup
  • Loading branch information
mratsim committed Jun 9, 2024
1 parent c93b523 commit 35d9938
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions benchmarks/bench_eth_eip4844_kzg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ proc benchVerifyBlobKzgProofBatch(b: BenchSet, ctx: ptr EthereumKZGContext, iter
const TrustedSetupMainnet =
currentSourcePath.rsplit(DirSep, 1)[0] /
".." / "constantine" /
"trusted_setups" /
"commitments_setups" /
"trusted_setup_ethereum_kzg4844_reference.dat"

proc trusted_setup*(): ptr EthereumKZGContext =
Expand Down Expand Up @@ -261,4 +261,4 @@ proc main() =


when isMainModule:
main()
main()
2 changes: 1 addition & 1 deletion bindings/lib_constantine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import
# Protocols
../constantine/ethereum_bls_signatures,
../constantine/ethereum_bls_signatures_parallel,
../constantine/trusted_setups/ethereum_kzg_srs,
../constantine/commitments_setups/ethereum_kzg_srs,
../constantine/ethereum_eip4844_kzg,
../constantine/ethereum_eip4844_kzg_parallel,

Expand Down
2 changes: 1 addition & 1 deletion constantine-go/constantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestThreadpool(t *testing.T) {
// Source: https://github.com/ethereum/c-kzg-4844

var (
trustedSetupFile = "../constantine/trusted_setups/trusted_setup_ethereum_kzg4844_reference.dat"
trustedSetupFile = "../constantine/commitments_setups/trusted_setup_ethereum_kzg4844_reference.dat"
testDir = "../tests/protocol_ethereum_eip4844_deneb_kzg"
blobToKZGCommitmentTests = filepath.Join(testDir, "blob_to_kzg_commitment/*/*/*")
computeKZGProofTests = filepath.Join(testDir, "compute_kzg_proof/*/*/*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use serde_yaml;
#[test]
fn t_smoke_load_trusted_setup() {
let _ctx = EthKzgContext::load_trusted_setup(Path::new(
"../../constantine/trusted_setups/trusted_setup_ethereum_kzg4844_reference.dat",
"../../constantine/commitments_setups/trusted_setup_ethereum_kzg4844_reference.dat",
))
.expect("Trusted setup should be loaded without error.");
}
Expand All @@ -46,7 +46,7 @@ const VERIFY_BLOB_KZG_PROOF_BATCH_TESTS: &str =
concat!(test_dir!(), "verify_blob_kzg_proof_batch/*/*/*");

const SRS_PATH: &str =
"../../constantine/trusted_setups/trusted_setup_ethereum_kzg4844_reference.dat";
"../../constantine/commitments_setups/trusted_setup_ethereum_kzg4844_reference.dat";

struct OptRawBytes<const N: usize>(Option<Box<[u8; N]>>);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Trusted Setups
# Reference Strings & Trusted Setups

This folder holds code and data related to trusted setups necessary
This folder holds code and data related to Common Reference Strings, Structured Reference Strings and trusted setups necessary
for implemented protocols.

It also holds a spec proposal for an efficient trusted setup format,
Expand All @@ -13,4 +13,4 @@ to limit memory and deserialization cost for very large trusted setups.
- The Ethereum KZG EIP-4844 protocol is implemented. \
As the trusted setup is small, it is stored directly in the repo.\
The trusted setup is available from the KZG ceremony at https://github.com/CarlBeek/kzg-ceremony-verifier/blob/master/output_setups/trusted_setup_4096.json \
To avoid vulnerabilities in json parsers (no formally-verified ones exist), we use the plaintext setup from the audited and fuzzed reference implementation at https://github.com/ethereum/c-kzg-4844/blob/main/src/trusted_setup.txt
To avoid vulnerabilities in json parsers (no formally-verified ones exist), we use the plaintext setup from the audited and fuzzed reference implementation at https://github.com/ethereum/c-kzg-4844/blob/main/src/trusted_setup.txt
2 changes: 1 addition & 1 deletion constantine/ethereum_eip4844_kzg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import
./hashes,
./platforms/[abstractions, allocs],
./serialization/[codecs_status_codes, codecs_bls12_381, endians],
./trusted_setups/ethereum_kzg_srs
./commitments_setups/ethereum_kzg_srs

export trusted_setup_load, trusted_setup_delete, TrustedSetupFormat, TrustedSetupStatus, EthereumKZGContext

Expand Down
2 changes: 1 addition & 1 deletion tests/t_ethereum_eip4844_deneb_kzg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import
const TrustedSetupMainnet =
currentSourcePath.rsplit(DirSep, 1)[0] /
".." / "constantine" /
"trusted_setups" /
"commitments_setups" /
"trusted_setup_ethereum_kzg4844_reference.dat"

proc trusted_setup*(): ptr EthereumKZGContext =
Expand Down
2 changes: 1 addition & 1 deletion tests/t_ethereum_eip4844_deneb_kzg_parallel.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import
const TrustedSetupMainnet =
currentSourcePath.rsplit(DirSep, 1)[0] /
".." / "constantine" /
"trusted_setups" /
"commitments_setups" /
"trusted_setup_ethereum_kzg4844_reference.dat"

proc trusted_setup*(): ptr EthereumKZGContext =
Expand Down

0 comments on commit 35d9938

Please sign in to comment.