From a361aff5cfa1be3b4994237ae90481ea8910ffb9 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 17 Oct 2023 18:30:39 +0800 Subject: [PATCH] Delete leftover --- scripts/gen_roots_of_unity.py | 29 ------------------------- tests/core/pyspec/eth2spec/utils/kzg.py | 23 -------------------- 2 files changed, 52 deletions(-) delete mode 100644 scripts/gen_roots_of_unity.py diff --git a/scripts/gen_roots_of_unity.py b/scripts/gen_roots_of_unity.py deleted file mode 100644 index 670fa476b..000000000 --- a/scripts/gen_roots_of_unity.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -from pathlib import Path - -from eth2spec.utils.kzg import ( - dump_kzg_roots_of_unity, -) - - -if __name__ == '__main__': - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--g1-length", - dest="g1_length", - type=int, - required=True, - help='the length of G1 trusted setup', - ) - parser.add_argument( - "-o", - "--output-dir", - dest="output_dir", - required=True, - help='the output directory', - ) - args = parser.parse_args() - - dump_kzg_roots_of_unity(args.g1_length, args.output_dir) diff --git a/tests/core/pyspec/eth2spec/utils/kzg.py b/tests/core/pyspec/eth2spec/utils/kzg.py index 8d803c73a..cef1faa66 100644 --- a/tests/core/pyspec/eth2spec/utils/kzg.py +++ b/tests/core/pyspec/eth2spec/utils/kzg.py @@ -116,26 +116,3 @@ def dump_kzg_trusted_setup_files(secret: int, g1_length: int, g2_length: int, ou }, f) print(f'Generated trusted setup file: {file_path}\n') - - -def dump_kzg_roots_of_unity(g1_length: int, output_dir: str) -> None: - bls.use_fastest() - - roots_of_unity = compute_roots_of_unity(g1_length) - serialized_roots_of_unity = [hex(x) for x in roots_of_unity] - - output_dir_path = Path(output_dir) - - if not os.path.exists(output_dir_path): - os.makedirs(output_dir_path) - print("Created directory: ", output_dir_path) - - file_path = output_dir_path / 'trusted_setup_4096_roots_of_unity.json' - - with open(file_path, 'w+') as f: - json.dump( - { - "roots_of_unity": serialized_roots_of_unity, - }, f) - - print(f'Generated trusted setup file: {file_path}\n')