From fdb9c6d7849e4badc9bfa4a0607222b2fc1c9b46 Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Wed, 12 Mar 2025 17:35:38 +0300 Subject: [PATCH 1/8] trading_pairs_file_configuration --- cli/parse_and_prove.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cli/parse_and_prove.py b/cli/parse_and_prove.py index c1fb877..13d87f8 100644 --- a/cli/parse_and_prove.py +++ b/cli/parse_and_prove.py @@ -15,7 +15,7 @@ def find_latest_data(): latest_data = max(latest_data, int(d)) return latest_data -def prepare_json (net, _test_data, _binance_onchain, _binance_zk_bonsai, _binance_zk_local): +def prepare_json(net, _test_data, _binance_onchain, _binance_zk_bonsai, _binance_zk_local, pairs_file_path): assert _test_data + _binance_onchain + _binance_zk_bonsai + _binance_zk_local == 1, "exactly one of flags is required" @@ -38,7 +38,12 @@ def prepare_json (net, _test_data, _binance_onchain, _binance_zk_bonsai, _binanc parse_env_var(net, DCAP_ATTESTATION, root="lib/sgx_verifier_deployer/") os.environ["RPC_URL"] = net.rpc_url - run_subprocess(["./lib/zktls-enclave/target/debug/zktls-pairs"], "request from binance using sgx") + app_cmd = ["./lib/zktls-enclave/target/debug/zktls-pairs"] + + if pairs_file_path: + app_cmd += ["--pairs_file_path", pairs_file_path] + + run_subprocess(app_cmd, "request from binance using sgx") for f in files_1: run_subprocess(["mv", f, new_data_dir + f], "move requested " + f + " to " + new_data_dir) if _binance_onchain == True: @@ -66,9 +71,11 @@ def main(): data_source_group.add_argument('--binance-zk-bonsai', action='store_true', help='Request data from binance and prove using bonsai (quite fast and checks proving process)') data_source_group.add_argument('--binance-zk-local', action='store_true', help='Request data from binance and prove locally (15 minutes but checks that local proving works)') + parser.add_argument('--pairs_file_path', type=str, required=False, help='Path to the pairs file') + args = parser.parse_args() - prepare_json(args.network, args.test_data, args.binance_onchain, args.binance_zk_bonsai, args.binance_zk_local) + prepare_json(args.network, args.test_data, args.binance_onchain, args.binance_zk_bonsai, args.binance_zk_local, args.pairs_file_path) if __name__ == "__main__": main() From 861990624910bb16dd366e32240c5931ede51c4c Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Thu, 13 Mar 2025 16:51:07 +0300 Subject: [PATCH 2/8] tmp switch zktls-enclave to the trading_pairs_file_configuration branch --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 8dece2b..7e6e947 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "lib/zktls-enclave"] path = lib/zktls-enclave url = ../../Diffuse-fi/zktls-enclave.git + branch = trading_pairs_file_configuration [submodule "lib/automata-dcap-zkvm-cli"] path = lib/automata-dcap-zkvm-cli url = ../../Diffuse-fi/automata-dcap-zkvm-cli.git From 94673c3d38a4c43f83ae65444ea41162a8ee95f6 Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Mon, 17 Mar 2025 10:00:39 +0300 Subject: [PATCH 3/8] parser and prove trace info --- cli/parse_and_prove.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/parse_and_prove.py b/cli/parse_and_prove.py index 13d87f8..7ed6ca6 100644 --- a/cli/parse_and_prove.py +++ b/cli/parse_and_prove.py @@ -39,11 +39,13 @@ def prepare_json(net, _test_data, _binance_onchain, _binance_zk_bonsai, _binance os.environ["RPC_URL"] = net.rpc_url app_cmd = ["./lib/zktls-enclave/target/debug/zktls-pairs"] - if pairs_file_path: app_cmd += ["--pairs_file_path", pairs_file_path] - run_subprocess(app_cmd, "request from binance using sgx") + + print("DEBUG: Current working directory:", os.getcwd()) + print("DEBUG: Listing files in current directory after SGX request:") + run_subprocess(["ls", "-la"], "list directory contents for debugging") for f in files_1: run_subprocess(["mv", f, new_data_dir + f], "move requested " + f + " to " + new_data_dir) if _binance_onchain == True: From cc11c275d626b9b399acfed2c17f5159093976ef Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Mon, 17 Mar 2025 10:06:02 +0300 Subject: [PATCH 4/8] temp path fix --- cli/parse_and_prove.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/parse_and_prove.py b/cli/parse_and_prove.py index 7ed6ca6..bc7881b 100644 --- a/cli/parse_and_prove.py +++ b/cli/parse_and_prove.py @@ -47,7 +47,7 @@ def prepare_json(net, _test_data, _binance_onchain, _binance_zk_bonsai, _binance print("DEBUG: Listing files in current directory after SGX request:") run_subprocess(["ls", "-la"], "list directory contents for debugging") for f in files_1: - run_subprocess(["mv", f, new_data_dir + f], "move requested " + f + " to " + new_data_dir) + run_subprocess(["mv", "cli/test_data/0/" + f, new_data_dir + f], "move requested " + f + " to " + new_data_dir) if _binance_onchain == True: return From c2f264b93d6abdc0297d2e56be8b13e5b9be3cc1 Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Wed, 19 Mar 2025 16:59:11 +0300 Subject: [PATCH 5/8] Revert trace fix --- cli/parse_and_prove.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cli/parse_and_prove.py b/cli/parse_and_prove.py index bc7881b..5a5fb27 100644 --- a/cli/parse_and_prove.py +++ b/cli/parse_and_prove.py @@ -43,11 +43,8 @@ def prepare_json(net, _test_data, _binance_onchain, _binance_zk_bonsai, _binance app_cmd += ["--pairs_file_path", pairs_file_path] run_subprocess(app_cmd, "request from binance using sgx") - print("DEBUG: Current working directory:", os.getcwd()) - print("DEBUG: Listing files in current directory after SGX request:") - run_subprocess(["ls", "-la"], "list directory contents for debugging") for f in files_1: - run_subprocess(["mv", "cli/test_data/0/" + f, new_data_dir + f], "move requested " + f + " to " + new_data_dir) + run_subprocess(["mv", f, new_data_dir + f], "move requested " + f + " to " + new_data_dir) if _binance_onchain == True: return From 202f32bf67edc10e56036cbc4b479a3a14348a94 Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Fri, 21 Mar 2025 14:32:42 +0300 Subject: [PATCH 6/8] git submodule updated --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7e6e947..8dece2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "lib/zktls-enclave"] path = lib/zktls-enclave url = ../../Diffuse-fi/zktls-enclave.git - branch = trading_pairs_file_configuration [submodule "lib/automata-dcap-zkvm-cli"] path = lib/automata-dcap-zkvm-cli url = ../../Diffuse-fi/automata-dcap-zkvm-cli.git From 9d4de483e674f2b79465c0de55760fe31ce88883 Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Fri, 21 Mar 2025 14:51:29 +0300 Subject: [PATCH 7/8] review fixes --- cli/test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/test.py b/cli/test.py index ceafd72..c78117a 100644 --- a/cli/test.py +++ b/cli/test.py @@ -13,7 +13,7 @@ from lib.sgx_verifier_deployer.script.utils.network import * -def test(test_data, binance_zk_bonsai, binance_zk_local): +def test(test_data, binance_zk_bonsai, binance_zk_local, pairs_file_path): assert test_data + binance_zk_bonsai + binance_zk_local == 1, "test requires exactly one flag" @@ -64,7 +64,7 @@ def test(test_data, binance_zk_bonsai, binance_zk_local): step+=1 print(f"step {step}: request and prove data from binance...") - prepare_json(LOCAL_NETWORK, False, False, binance_zk_bonsai, binance_zk_local) + prepare_json(LOCAL_NETWORK, False, False, binance_zk_bonsai, binance_zk_local, pairs_file_path) step+=1 print(f"step {step}: Print traces of feeding execution(zk)...") @@ -147,6 +147,8 @@ def test(test_data, binance_zk_bonsai, binance_zk_local): test_config.add_argument('--binance-zk-bonsai', action='store_true', help='Request data from binance and prove using bonsai (quite fast and checks proving process)') test_config.add_argument('--binance-zk-local', action='store_true', help='Request data from binance and prove locally (15 minutes but checks that local proving works)') +parser.add_argument('--pairs_file_path', type=str, required=False, help='Path to the pairs file') + args = parser.parse_args() -test(args.test_data, args.binance_zk_bonsai, args.binance_zk_local) +test(args.test_data, args.binance_zk_bonsai, args.binance_zk_local, args.pairs_file_path) From 84d4c843d98b42cce57cf50e3a775572dd7f6f0e Mon Sep 17 00:00:00 2001 From: akablockchain1 Date: Fri, 21 Mar 2025 17:05:38 +0300 Subject: [PATCH 8/8] review fix --- cli/parse_and_prove.py | 4 ++-- cli/test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/parse_and_prove.py b/cli/parse_and_prove.py index 5a5fb27..4d0c2b2 100644 --- a/cli/parse_and_prove.py +++ b/cli/parse_and_prove.py @@ -40,7 +40,7 @@ def prepare_json(net, _test_data, _binance_onchain, _binance_zk_bonsai, _binance app_cmd = ["./lib/zktls-enclave/target/debug/zktls-pairs"] if pairs_file_path: - app_cmd += ["--pairs_file_path", pairs_file_path] + app_cmd += ["--pairs-file-path", pairs_file_path] run_subprocess(app_cmd, "request from binance using sgx") for f in files_1: @@ -70,7 +70,7 @@ def main(): data_source_group.add_argument('--binance-zk-bonsai', action='store_true', help='Request data from binance and prove using bonsai (quite fast and checks proving process)') data_source_group.add_argument('--binance-zk-local', action='store_true', help='Request data from binance and prove locally (15 minutes but checks that local proving works)') - parser.add_argument('--pairs_file_path', type=str, required=False, help='Path to the pairs file') + parser.add_argument('--pairs-file-path', type=str, required=False, help='Path to the pairs file') args = parser.parse_args() diff --git a/cli/test.py b/cli/test.py index c78117a..5527fb7 100644 --- a/cli/test.py +++ b/cli/test.py @@ -147,7 +147,7 @@ def test(test_data, binance_zk_bonsai, binance_zk_local, pairs_file_path): test_config.add_argument('--binance-zk-bonsai', action='store_true', help='Request data from binance and prove using bonsai (quite fast and checks proving process)') test_config.add_argument('--binance-zk-local', action='store_true', help='Request data from binance and prove locally (15 minutes but checks that local proving works)') -parser.add_argument('--pairs_file_path', type=str, required=False, help='Path to the pairs file') +parser.add_argument('--pairs-file-path', type=str, required=False, help='Path to the pairs file') args = parser.parse_args()