Delete leftover

This commit is contained in:
Hsiao-Wei Wang 2023-10-17 18:30:39 +08:00
parent 63aa303c5a
commit a361aff5cf
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 0 additions and 52 deletions

View File

@ -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)

View File

@ -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')