certora-cli-alpha-master 20241224.0.4.890155__py3-none-any.whl → 20241224.12.18.798750__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- certora_cli/EVMVerifier/certoraBuild.py +81 -81
- certora_cli/EVMVerifier/certoraBuildRust.py +69 -0
- certora_cli/EVMVerifier/certoraCloudIO.py +13 -43
- certora_cli/EVMVerifier/certoraContext.py +0 -15
- certora_cli/certoraEVMProver.py +8 -1
- certora_cli/certoraRun.py +2 -1
- certora_cli/certoraSolanaProver.py +4 -5
- certora_cli/certoraSorobanProver.py +8 -1
- {certora_cli_alpha_master-20241224.0.4.890155.dist-info → certora_cli_alpha_master-20241224.12.18.798750.dist-info}/METADATA +2 -2
- {certora_cli_alpha_master-20241224.0.4.890155.dist-info → certora_cli_alpha_master-20241224.12.18.798750.dist-info}/RECORD +16 -15
- {certora_cli_alpha_master-20241224.0.4.890155.dist-info → certora_cli_alpha_master-20241224.12.18.798750.dist-info}/entry_points.txt +1 -1
- certora_jars/CERTORA-CLI-VERSION-METADATA.json +1 -1
- certora_jars/Typechecker.jar +0 -0
- {certora_cli_alpha_master-20241224.0.4.890155.dist-info → certora_cli_alpha_master-20241224.12.18.798750.dist-info}/LICENSE +0 -0
- {certora_cli_alpha_master-20241224.0.4.890155.dist-info → certora_cli_alpha_master-20241224.12.18.798750.dist-info}/WHEEL +0 -0
- {certora_cli_alpha_master-20241224.0.4.890155.dist-info → certora_cli_alpha_master-20241224.12.18.798750.dist-info}/top_level.txt +0 -0
@@ -2630,7 +2630,7 @@ class CertoraBuildGenerator:
|
|
2630
2630
|
sources_from_pre_finder_SDCs |= sdc.all_contract_files
|
2631
2631
|
sources = self.collect_sources(context, certora_verify_generator, sources_from_pre_finder_SDCs)
|
2632
2632
|
try:
|
2633
|
-
self.cwd_rel_in_sources =
|
2633
|
+
self.cwd_rel_in_sources = build_source_tree(sources, context)
|
2634
2634
|
except Exception as e:
|
2635
2635
|
build_logger.debug(f"build_source_tree failed. Sources: {sources}", exc_info=e)
|
2636
2636
|
raise
|
@@ -2797,85 +2797,6 @@ class CertoraBuildGenerator:
|
|
2797
2797
|
common_path = Path(os.path.commonpath(list(sources.union({cwd}))))
|
2798
2798
|
return cwd.relative_to(common_path), common_path
|
2799
2799
|
|
2800
|
-
@staticmethod
|
2801
|
-
def build_source_tree(sources: Set[Path], context: CertoraContext, overwrite: bool = False) -> Path:
|
2802
|
-
"""
|
2803
|
-
Copies files to .certora_sources
|
2804
|
-
@returns the cwd relative in sources
|
2805
|
-
"""
|
2806
|
-
sources = sources_to_abs(sources)
|
2807
|
-
cwd_rel_in_sources, common_path = CertoraBuildGenerator.get_cwd_rel_in_sources(sources)
|
2808
|
-
|
2809
|
-
for source_path in sources:
|
2810
|
-
is_dir = source_path.is_dir()
|
2811
|
-
# copy file to the path of the file from the common root under the sources directory
|
2812
|
-
|
2813
|
-
# make sure directory exists
|
2814
|
-
target_path = Util.get_certora_sources_dir() / source_path.relative_to(common_path)
|
2815
|
-
target_directory = target_path if is_dir else target_path.parent
|
2816
|
-
try:
|
2817
|
-
target_directory.mkdir(parents=True, exist_ok=True)
|
2818
|
-
except OSError as e:
|
2819
|
-
build_logger.debug(f"Failed to create directory {target_directory}", exc_info=e)
|
2820
|
-
raise
|
2821
|
-
|
2822
|
-
# copy files. if we got a directory, nothing to do
|
2823
|
-
if is_dir:
|
2824
|
-
build_logger.debug(f"Skipping directory {source_path}")
|
2825
|
-
continue
|
2826
|
-
|
2827
|
-
try:
|
2828
|
-
if overwrite:
|
2829
|
-
# expecting target path to exist.
|
2830
|
-
if target_path.exists():
|
2831
|
-
build_logger.debug(f"Overwriting {target_path} by copying from {source_path}")
|
2832
|
-
else:
|
2833
|
-
build_logger.warning(f"Supposed to overwrite {target_path} by copying from {source_path}" +
|
2834
|
-
" but it does not exist... this may indicate bad things happen")
|
2835
|
-
if overwrite or not target_path.exists():
|
2836
|
-
build_logger.debug(f"Copying {source_path} to {target_path}")
|
2837
|
-
shutil.copyfile(source_path, target_path)
|
2838
|
-
except OSError as e:
|
2839
|
-
build_logger.debug(f"Couldn't copy {source_path} to {target_path}", exc_info=e)
|
2840
|
-
raise
|
2841
|
-
|
2842
|
-
# the empty file .cwd is written in the source tree to denote the current working directory
|
2843
|
-
if cwd_rel_in_sources != '.':
|
2844
|
-
file_path = Util.get_certora_sources_dir() / cwd_rel_in_sources / Util.CWD_FILE
|
2845
|
-
file_path.parent.mkdir(parents=True, exist_ok=True)
|
2846
|
-
file_path.touch()
|
2847
|
-
|
2848
|
-
"""
|
2849
|
-
Once the resource files are copied to the source tree, the paths in the value of the 'prover_resource_files'
|
2850
|
-
attribute are replaced with the relative path of the resource file from the source tree root.
|
2851
|
-
This way The server can easily find the resource files in the source tree. The path from the source tree is the
|
2852
|
-
relative path of cwd from source tree root (most cases '.') concatenated with the relative path of the resource
|
2853
|
-
file from cwd
|
2854
|
-
"""
|
2855
|
-
if context.prover_resource_files:
|
2856
|
-
new_value = []
|
2857
|
-
len_orig = len(context.prover_resource_files)
|
2858
|
-
for value in context.prover_resource_files:
|
2859
|
-
label, file_path = value.split(':')
|
2860
|
-
rel_path = Path(os.path.relpath(file_path, '.'))
|
2861
|
-
new_value.append(':'.join([label, os.path.normpath(rel_path)]))
|
2862
|
-
if len_orig != len(new_value):
|
2863
|
-
raise RuntimeError(f"fail to process prover_resource_files {len_orig} out of {len(new_value)}")
|
2864
|
-
context.prover_resource_files = new_value
|
2865
|
-
|
2866
|
-
# Copy the repro conf file to the sources as the overall way to reproduce this run easily.
|
2867
|
-
# The file is being copied in here and not added through collect_sources, because we want
|
2868
|
-
# to avoid building the whole tree up to the common path for this file. We simply want to copy
|
2869
|
-
# the repro file from .certora_internal to .certora_sources so it will be uploaded as a run
|
2870
|
-
# resource.
|
2871
|
-
try:
|
2872
|
-
shutil.copy(Util.get_last_conf_file(), Util.get_certora_sources_dir() / Util.LAST_CONF_FILE)
|
2873
|
-
except OSError as e:
|
2874
|
-
build_logger.debug("Couldn't copy repro conf to certora sources.", exc_info=e)
|
2875
|
-
raise
|
2876
|
-
|
2877
|
-
return cwd_rel_in_sources
|
2878
|
-
|
2879
2800
|
@staticmethod
|
2880
2801
|
def normalize_path(path: str) -> str:
|
2881
2802
|
"""
|
@@ -3472,6 +3393,85 @@ def sources_to_abs(sources: Set[Path]) -> Set[Path]:
|
|
3472
3393
|
return result
|
3473
3394
|
|
3474
3395
|
|
3396
|
+
def build_source_tree(sources: Set[Path], context: CertoraContext, overwrite: bool = False) -> Path:
|
3397
|
+
"""
|
3398
|
+
Copies files to .certora_sources
|
3399
|
+
@returns the cwd relative in sources
|
3400
|
+
"""
|
3401
|
+
sources = sources_to_abs(sources)
|
3402
|
+
cwd_rel_in_sources, common_path = CertoraBuildGenerator.get_cwd_rel_in_sources(sources)
|
3403
|
+
|
3404
|
+
for source_path in sources:
|
3405
|
+
is_dir = source_path.is_dir()
|
3406
|
+
# copy file to the path of the file from the common root under the sources directory
|
3407
|
+
|
3408
|
+
# make sure directory exists
|
3409
|
+
target_path = Util.get_certora_sources_dir() / source_path.relative_to(common_path)
|
3410
|
+
target_directory = target_path if is_dir else target_path.parent
|
3411
|
+
try:
|
3412
|
+
target_directory.mkdir(parents=True, exist_ok=True)
|
3413
|
+
except OSError as e:
|
3414
|
+
build_logger.debug(f"Failed to create directory {target_directory}", exc_info=e)
|
3415
|
+
raise
|
3416
|
+
|
3417
|
+
# copy files. if we got a directory, nothing to do
|
3418
|
+
if is_dir:
|
3419
|
+
build_logger.debug(f"Skipping directory {source_path}")
|
3420
|
+
continue
|
3421
|
+
|
3422
|
+
try:
|
3423
|
+
if overwrite:
|
3424
|
+
# expecting target path to exist.
|
3425
|
+
if target_path.exists():
|
3426
|
+
build_logger.debug(f"Overwriting {target_path} by copying from {source_path}")
|
3427
|
+
else:
|
3428
|
+
build_logger.warning(f"Supposed to overwrite {target_path} by copying from {source_path}" +
|
3429
|
+
" but it does not exist... this may indicate bad things happen")
|
3430
|
+
if overwrite or not target_path.exists():
|
3431
|
+
build_logger.debug(f"Copying {source_path} to {target_path}")
|
3432
|
+
shutil.copyfile(source_path, target_path)
|
3433
|
+
except OSError as e:
|
3434
|
+
build_logger.debug(f"Couldn't copy {source_path} to {target_path}", exc_info=e)
|
3435
|
+
raise
|
3436
|
+
|
3437
|
+
# the empty file .cwd is written in the source tree to denote the current working directory
|
3438
|
+
if cwd_rel_in_sources != '.':
|
3439
|
+
file_path = Util.get_certora_sources_dir() / cwd_rel_in_sources / Util.CWD_FILE
|
3440
|
+
file_path.parent.mkdir(parents=True, exist_ok=True)
|
3441
|
+
file_path.touch()
|
3442
|
+
|
3443
|
+
"""
|
3444
|
+
Once the resource files are copied to the source tree, the paths in the value of the 'prover_resource_files'
|
3445
|
+
attribute are replaced with the relative path of the resource file from the source tree root.
|
3446
|
+
This way The server can easily find the resource files in the source tree. The path from the source tree is the
|
3447
|
+
relative path of cwd from source tree root (most cases '.') concatenated with the relative path of the resource
|
3448
|
+
file from cwd
|
3449
|
+
"""
|
3450
|
+
if context.prover_resource_files:
|
3451
|
+
new_value = []
|
3452
|
+
len_orig = len(context.prover_resource_files)
|
3453
|
+
for value in context.prover_resource_files:
|
3454
|
+
label, file_path = value.split(':')
|
3455
|
+
rel_path = Path(os.path.relpath(file_path, '.'))
|
3456
|
+
new_value.append(':'.join([label, os.path.normpath(rel_path)]))
|
3457
|
+
if len_orig != len(new_value):
|
3458
|
+
raise RuntimeError(f"fail to process prover_resource_files {len_orig} out of {len(new_value)}")
|
3459
|
+
context.prover_resource_files = new_value
|
3460
|
+
|
3461
|
+
# Copy the repro conf file to the sources as the overall way to reproduce this run easily.
|
3462
|
+
# The file is being copied in here and not added through collect_sources, because we want
|
3463
|
+
# to avoid building the whole tree up to the common path for this file. We simply want to copy
|
3464
|
+
# the repro file from .certora_internal to .certora_sources so it will be uploaded as a run
|
3465
|
+
# resource.
|
3466
|
+
try:
|
3467
|
+
shutil.copy(Util.get_last_conf_file(), Util.get_certora_sources_dir() / Util.LAST_CONF_FILE)
|
3468
|
+
except OSError as e:
|
3469
|
+
build_logger.debug("Couldn't copy repro conf to certora sources.", exc_info=e)
|
3470
|
+
raise
|
3471
|
+
|
3472
|
+
return cwd_rel_in_sources
|
3473
|
+
|
3474
|
+
|
3475
3475
|
def build_from_scratch(certora_build_generator: CertoraBuildGenerator,
|
3476
3476
|
certora_verify_generator: CertoraVerifyGenerator,
|
3477
3477
|
build_cache_enabled: bool) -> CachedFiles:
|
@@ -3635,7 +3635,7 @@ def build(context: CertoraContext, ignore_spec_syntax_check: bool = False) -> No
|
|
3635
3635
|
cached_files.all_contract_files)
|
3636
3636
|
try:
|
3637
3637
|
# Copies files, not updating state
|
3638
|
-
|
3638
|
+
build_source_tree(sources, context)
|
3639
3639
|
except Exception as e:
|
3640
3640
|
build_logger.debug("build_source_tree failed", exc_info=e)
|
3641
3641
|
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import glob
|
2
|
+
import shutil
|
3
|
+
from pathlib import Path
|
4
|
+
from typing import Set
|
5
|
+
|
6
|
+
from EVMVerifier.certoraBuild import build_source_tree
|
7
|
+
from EVMVerifier.certoraContextClass import CertoraContext
|
8
|
+
from EVMVerifier.certoraParseBuildScript import run_script_and_parse_json
|
9
|
+
from Shared import certoraUtils as Util
|
10
|
+
|
11
|
+
|
12
|
+
def build_rust_app(context: CertoraContext) -> None:
|
13
|
+
if context.build_script:
|
14
|
+
run_script_and_parse_json(context)
|
15
|
+
if not context.rust_executables:
|
16
|
+
raise Util.CertoraUserInputError("failed to get target executable")
|
17
|
+
|
18
|
+
sources: Set[Path] = set()
|
19
|
+
root_directory = Path(context.rust_project_directory)
|
20
|
+
collect_files_from_rust_sources(context, sources, root_directory)
|
21
|
+
|
22
|
+
try:
|
23
|
+
# Create generators
|
24
|
+
build_source_tree(sources, context)
|
25
|
+
|
26
|
+
copy_files_to_build_dir(context, root_directory)
|
27
|
+
|
28
|
+
except Exception as e:
|
29
|
+
raise Util.CertoraUserInputError(f"Collecting build files failed with the exception: {e}")
|
30
|
+
else:
|
31
|
+
if not context.files:
|
32
|
+
raise Util.CertoraUserInputError("'files' or 'build_script' must be set for Rust projects")
|
33
|
+
if len(context.files) > 1:
|
34
|
+
raise Util.CertoraUserInputError("Rust projects must specify exactly one executable in 'files'.")
|
35
|
+
context.rust_executables = context.files[0]
|
36
|
+
|
37
|
+
|
38
|
+
def collect_files_from_rust_sources(context: CertoraContext, sources: Set[Path], root_directory: Path) -> None:
|
39
|
+
patterns = ["*.rs", "*.so", "*.wasm", "Cargo.toml", "Cargo.lock", "justfile"]
|
40
|
+
exclude_dirs = [".certora_internal"]
|
41
|
+
|
42
|
+
if not root_directory.is_dir():
|
43
|
+
raise ValueError(f"The given directory {root_directory} is not valid.")
|
44
|
+
|
45
|
+
for source in context.rust_sources:
|
46
|
+
for file in glob.glob(f'{root_directory.joinpath(source)}', recursive=True):
|
47
|
+
file_path = Path(file)
|
48
|
+
if any(excluded in file_path.parts for excluded in exclude_dirs):
|
49
|
+
continue
|
50
|
+
if file_path.is_file() and any(file_path.match(pattern) for pattern in patterns):
|
51
|
+
sources.add(file_path)
|
52
|
+
|
53
|
+
if Path(context.build_script).exists():
|
54
|
+
sources.add(Path(context.build_script).resolve())
|
55
|
+
if context.conf_file and Path(context.conf_file).exists():
|
56
|
+
sources.add(Path(context.conf_file).absolute())
|
57
|
+
|
58
|
+
|
59
|
+
def copy_files_to_build_dir(context: CertoraContext, root_directory: Path) -> None:
|
60
|
+
rust_executable = root_directory / context.rust_executables
|
61
|
+
shutil.copyfile(rust_executable, Util.get_build_dir() / rust_executable.name)
|
62
|
+
|
63
|
+
if context.prover_resource_files:
|
64
|
+
for value in context.prover_resource_files:
|
65
|
+
_, file_path = value.split(':')
|
66
|
+
cur_path = (Path(context.conf_file).parent / file_path).resolve()
|
67
|
+
shutil.copy(cur_path, Util.get_build_dir() / cur_path.name)
|
68
|
+
if cur_path.suffix == '.txt':
|
69
|
+
shutil.copy(cur_path, Util.get_certora_sources_dir() / cur_path.name)
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import glob
|
2
1
|
import itertools
|
3
2
|
import json
|
4
3
|
import os
|
5
4
|
import re
|
6
|
-
import shutil
|
7
5
|
import uuid
|
8
6
|
|
9
7
|
import requests
|
@@ -192,45 +190,6 @@ def parse_json(response: Response) -> Dict[str, Any]:
|
|
192
190
|
return json_response
|
193
191
|
|
194
192
|
|
195
|
-
def zip_rust_files(zip_file_path: Path, context: CertoraContext, *resource_paths: Path) -> bool:
|
196
|
-
patterns = ["*.rs", "*.so", "*.wasm", "Cargo.toml", "Cargo.lock", "justfile"]
|
197
|
-
exclude_dirs = [".certora_internal"]
|
198
|
-
|
199
|
-
root_directory = Path(context.rust_project_directory)
|
200
|
-
if not root_directory.is_dir():
|
201
|
-
raise ValueError(f"The given directory {root_directory} is not valid.")
|
202
|
-
|
203
|
-
with zipfile.ZipFile(zip_file_path, 'w', zipfile.ZIP_DEFLATED) as zip_obj:
|
204
|
-
for source in context.rust_sources:
|
205
|
-
for file in glob.glob(f'{root_directory.joinpath(source)}', recursive=True):
|
206
|
-
file_path = Path(file)
|
207
|
-
if any(excluded in file_path.parts for excluded in exclude_dirs):
|
208
|
-
continue
|
209
|
-
if file_path.is_file() and any(file_path.match(pattern) for pattern in patterns):
|
210
|
-
zip_obj.write(file_path, Util.CERTORA_SOURCES / file_path.relative_to(root_directory))
|
211
|
-
if context.build_script and Path(context.build_script).exists():
|
212
|
-
zip_obj.write(Path(context.build_script),
|
213
|
-
Util.CERTORA_SOURCES / Path(context.build_script).absolute().relative_to(root_directory))
|
214
|
-
if context.conf_file and Path(context.conf_file).exists():
|
215
|
-
zip_obj.write(Path(context.conf_file),
|
216
|
-
Util.CERTORA_SOURCES / Path(context.conf_file).absolute().relative_to(root_directory))
|
217
|
-
if Util.get_last_conf_file():
|
218
|
-
zip_obj.write(Util.get_last_conf_file(),
|
219
|
-
Util.CERTORA_SOURCES / Util.get_last_conf_file().relative_to(Util.get_build_dir()))
|
220
|
-
|
221
|
-
rust_executable = root_directory.joinpath(context.rust_executables)
|
222
|
-
zip_obj.write(rust_executable, rust_executable.relative_to(rust_executable.parent))
|
223
|
-
for path in resource_paths:
|
224
|
-
zip_obj.write(path, os.path.relpath(path, Util.get_build_dir()))
|
225
|
-
if path.suffix == '.txt':
|
226
|
-
zip_obj.write(path, Util.CERTORA_SOURCES / path.relative_to(Util.get_build_dir()))
|
227
|
-
|
228
|
-
if zip_file_path.stat().st_size > MAX_FILE_SIZE:
|
229
|
-
cloud_logger.error(f"{GENERAL_ERR_PREFIX} Max 25MB file size exceeded. File is located at {zip_file_path}")
|
230
|
-
return False
|
231
|
-
return True
|
232
|
-
|
233
|
-
|
234
193
|
def compress_files(zip_file_path: Path, *resource_paths: Path, short_output: bool = False) -> bool:
|
235
194
|
with zipfile.ZipFile(zip_file_path, 'w', zipfile.ZIP_DEFLATED) as zip_obj:
|
236
195
|
|
@@ -779,14 +738,25 @@ class CloudVerification:
|
|
779
738
|
files_list = [Util.get_certora_metadata_file()]
|
780
739
|
|
781
740
|
if hasattr(self.context, 'build_script') and self.context.build_script:
|
741
|
+
result = compress_files(self.logZipFilePath, Util.get_debug_log_file(),
|
742
|
+
short_output=Ctx.is_minimal_cli_output(self.context))
|
743
|
+
|
744
|
+
if not result:
|
745
|
+
return False
|
746
|
+
files_list.append(self.logZipFilePath)
|
747
|
+
if Util.get_certora_sources_dir().exists():
|
748
|
+
files_list.append(Util.get_certora_sources_dir())
|
749
|
+
|
750
|
+
files_list.append(Util.get_build_dir() / Path(self.context.rust_executables).name)
|
751
|
+
|
782
752
|
if self.context.prover_resource_files:
|
783
753
|
for value in self.context.prover_resource_files:
|
784
754
|
_, file_path = value.split(':')
|
785
755
|
cur_path = (Path(self.context.conf_file).parent / Path(file_path)).resolve()
|
786
|
-
shutil.copy(cur_path, Util.get_build_dir())
|
787
756
|
files_list.append(Util.get_build_dir() / cur_path.name)
|
788
757
|
|
789
|
-
result =
|
758
|
+
result = compress_files(self.ZipFilePath, *files_list,
|
759
|
+
short_output=Ctx.is_minimal_cli_output(self.context))
|
790
760
|
|
791
761
|
elif Attrs.is_solana_app():
|
792
762
|
# We zip the ELF files and the two configuration files
|
@@ -11,8 +11,6 @@ from pathlib import Path
|
|
11
11
|
from typing import Dict, List, Optional, Any
|
12
12
|
from rich.console import Console
|
13
13
|
|
14
|
-
from EVMVerifier.certoraParseBuildScript import run_script_and_parse_json
|
15
|
-
|
16
14
|
scripts_dir_path = Path(__file__).parent.resolve() # containing directory
|
17
15
|
sys.path.insert(0, str(scripts_dir_path))
|
18
16
|
|
@@ -521,16 +519,3 @@ def run_local_spec_check(with_typechecking: bool, context: CertoraContext) -> No
|
|
521
519
|
else:
|
522
520
|
raise Util.CertoraUserInputError("Cannot run local checks because of missing a suitable java installation. "
|
523
521
|
"To skip local checks run with the --disable_local_typechecking flag")
|
524
|
-
|
525
|
-
|
526
|
-
def build_rust_app(context: CertoraContext) -> None:
|
527
|
-
if context.build_script:
|
528
|
-
run_script_and_parse_json(context)
|
529
|
-
if not context.rust_executables:
|
530
|
-
raise Util.CertoraUserInputError("failed to get target executable")
|
531
|
-
else:
|
532
|
-
if not context.files:
|
533
|
-
raise Util.CertoraUserInputError("'files' or 'build_script' must be set for Rust projects")
|
534
|
-
if len(context.files) > 1:
|
535
|
-
raise Util.CertoraUserInputError("Rust projects must specify exactly one executable in 'files'.")
|
536
|
-
context.rust_executables = context.files[0]
|
certora_cli/certoraEVMProver.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#!/usr/bin/env python3
|
2
2
|
|
3
3
|
import sys
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
scripts_dir_path = Path(__file__).parent.resolve() # containing directory
|
7
|
+
sys.path.insert(0, str(scripts_dir_path))
|
8
|
+
|
4
9
|
import EVMVerifier.certoraContextAttributes as Attrs
|
5
10
|
from certoraRun import run_certora, CertoraRunResult
|
6
11
|
from typing import List, Optional
|
@@ -9,6 +14,8 @@ from typing import List, Optional
|
|
9
14
|
def run_evm_prover(args: List[str]) -> Optional[CertoraRunResult]:
|
10
15
|
return run_certora(args, Attrs.EvmProverAttributes)
|
11
16
|
|
17
|
+
def entry_point() -> None:
|
18
|
+
run_evm_prover(sys.argv[1:])
|
12
19
|
|
13
20
|
if __name__ == '__main__':
|
14
|
-
|
21
|
+
entry_point()
|
certora_cli/certoraRun.py
CHANGED
@@ -18,6 +18,7 @@ from EVMVerifier.certoraCloudIO import CloudVerification, validate_version_and_b
|
|
18
18
|
from EVMVerifier.certoraCollectRunMetadata import collect_run_metadata
|
19
19
|
from Shared.certoraLogging import LoggingManager
|
20
20
|
from EVMVerifier.certoraBuild import build
|
21
|
+
from EVMVerifier.certoraBuildRust import build_rust_app
|
21
22
|
import EVMVerifier.certoraContext as Ctx
|
22
23
|
|
23
24
|
from EVMVerifier import certoraContextValidator as Cv
|
@@ -95,7 +96,7 @@ def run_certora(args: List[str], attrs_class: Optional[Type[AttrUtil.Attributes]
|
|
95
96
|
metadata.dump()
|
96
97
|
|
97
98
|
if Attrs.is_rust_app():
|
98
|
-
|
99
|
+
build_rust_app(context)
|
99
100
|
|
100
101
|
if context.local:
|
101
102
|
check_cmd = Ctx.get_local_run_cmd(context)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import sys
|
4
4
|
import time
|
5
5
|
import logging
|
6
|
-
from typing import List, Optional
|
6
|
+
from typing import List, Optional
|
7
7
|
from pathlib import Path
|
8
8
|
from rich.console import Console
|
9
9
|
|
@@ -11,7 +11,6 @@ scripts_dir_path = Path(__file__).parent.resolve() # containing directory
|
|
11
11
|
sys.path.insert(0, str(scripts_dir_path))
|
12
12
|
|
13
13
|
from Shared import certoraUtils as Util
|
14
|
-
from Shared import certoraAttrUtil as AttrUtil
|
15
14
|
from Shared.certoraLogging import LoggingManager
|
16
15
|
|
17
16
|
from EVMVerifier.certoraCloudIO import CloudVerification, validate_version_and_branch
|
@@ -20,6 +19,7 @@ from EVMVerifier import certoraContextValidator as Cv
|
|
20
19
|
|
21
20
|
import EVMVerifier.certoraContext as Ctx
|
22
21
|
import EVMVerifier.certoraContextAttributes as Attrs
|
22
|
+
from EVMVerifier.certoraBuildRust import build_rust_app
|
23
23
|
|
24
24
|
from certoraRun import CertoraRunResult, VIOLATIONS_EXIT_CODE, CertoraFoundViolations
|
25
25
|
|
@@ -28,8 +28,7 @@ from certoraRun import CertoraRunResult, VIOLATIONS_EXIT_CODE, CertoraFoundViola
|
|
28
28
|
run_logger = logging.getLogger("run")
|
29
29
|
|
30
30
|
|
31
|
-
def run_solana_prover(args: List[str]
|
32
|
-
-> Optional[CertoraRunResult]:
|
31
|
+
def run_solana_prover(args: List[str]) -> Optional[CertoraRunResult]:
|
33
32
|
"""
|
34
33
|
The main function that is responsible for the general flow of the script.
|
35
34
|
The general flow is:
|
@@ -77,7 +76,7 @@ def run_solana_prover(args: List[str], attrs_class: Optional[Type[AttrUtil.Attri
|
|
77
76
|
run_logger.debug("Build Solana target")
|
78
77
|
build_start = time.perf_counter()
|
79
78
|
|
80
|
-
|
79
|
+
build_rust_app(context)
|
81
80
|
build_end = time.perf_counter()
|
82
81
|
timings["buildTime"] = round(build_end - build_start, 4)
|
83
82
|
if context.test == str(Util.TestValue.AFTER_BUILD):
|
@@ -1,6 +1,11 @@
|
|
1
1
|
#!/usr/bin/env python3
|
2
2
|
|
3
3
|
import sys
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
scripts_dir_path = Path(__file__).parent.resolve() # containing directory
|
7
|
+
sys.path.insert(0, str(scripts_dir_path))
|
8
|
+
|
4
9
|
import EVMVerifier.certoraContextAttributes as Attrs
|
5
10
|
from certoraRun import run_certora, CertoraRunResult
|
6
11
|
from typing import List, Optional
|
@@ -9,6 +14,8 @@ from typing import List, Optional
|
|
9
14
|
def run_soroban_prover(args: List[str]) -> Optional[CertoraRunResult]:
|
10
15
|
return run_certora(args, Attrs.SorobanProverAttributes)
|
11
16
|
|
17
|
+
def entry_point() -> None:
|
18
|
+
run_soroban_prover(sys.argv[1:])
|
12
19
|
|
13
20
|
if __name__ == '__main__':
|
14
|
-
|
21
|
+
entry_point()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: certora-cli-alpha-master
|
3
|
-
Version: 20241224.
|
3
|
+
Version: 20241224.12.18.798750
|
4
4
|
Summary: Runner for the Certora Prover
|
5
5
|
Home-page: https://pypi.org/project/certora-cli-alpha-master
|
6
6
|
Author: Certora
|
@@ -23,4 +23,4 @@ Requires-Dist: StrEnum
|
|
23
23
|
Requires-Dist: tomli
|
24
24
|
Requires-Dist: universalmutator
|
25
25
|
|
26
|
-
Commit
|
26
|
+
Commit 103751c. Build and Run scripts for executing the Certora Prover on Solidity smart contracts.
|
@@ -1,21 +1,22 @@
|
|
1
1
|
certora_bins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
certora_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
certora_cli/certoraEVMProver.py,sha256=
|
3
|
+
certora_cli/certoraEVMProver.py,sha256=5bYkU_ap4tBJhnDLJuwWndJyxzOrXpbmaTBELm1mthI,551
|
4
4
|
certora_cli/certoraEqCheck.py,sha256=5LtN9GNBSYR_kYghDBeNNL4yWshPw9PNpe0stLtuIxQ,379
|
5
5
|
certora_cli/certoraMutate.py,sha256=BUK_keaunrcCYgLiwHfIkDSjIHM_KoGwwnIiuojc-ug,2643
|
6
|
-
certora_cli/certoraRun.py,sha256=
|
7
|
-
certora_cli/certoraSolanaProver.py,sha256=
|
8
|
-
certora_cli/certoraSorobanProver.py,sha256=
|
6
|
+
certora_cli/certoraRun.py,sha256=8LIFACWqme6eCTwxhoQ_0UtdUo85yu1b38soez5NdWg,11936
|
7
|
+
certora_cli/certoraSolanaProver.py,sha256=LEfKpfef0l91mqIQxSzCXtzE8oxZQek-ILcI02fj2Mc,5830
|
8
|
+
certora_cli/certoraSorobanProver.py,sha256=L7mwsHZUxdZMW20_HfPgJeDHZAwIO2Bm2oHl_Nnn1xs,563
|
9
9
|
certora_cli/rustMutator.py,sha256=ezpwwzr-OCK78PsBPVf5fC__GWaESvIbaAI7yjJ8Hs0,13862
|
10
10
|
certora_cli/EVMVerifier/__init__.py,sha256=AJxj90KAGh1JqAsxKqDBTL2rFbqgtkhDfW_XmxSHft0,159
|
11
|
-
certora_cli/EVMVerifier/certoraBuild.py,sha256=
|
11
|
+
certora_cli/EVMVerifier/certoraBuild.py,sha256=SNpafLfTRInMrns6OuI9WUrJXP7Yt4Fv53pUnpI_j60,203520
|
12
12
|
certora_cli/EVMVerifier/certoraBuildCacheManager.py,sha256=ZSVCsdTkFFtawuNJ8VK3wJOb01Uyu5e8viPQ8wTziSQ,12563
|
13
13
|
certora_cli/EVMVerifier/certoraBuildDataClasses.py,sha256=4IhvOA_fg-ij5RM9RRlvDDoS7imfp4Zru-AgHhxcHc0,13314
|
14
|
-
certora_cli/EVMVerifier/
|
14
|
+
certora_cli/EVMVerifier/certoraBuildRust.py,sha256=uOKog69nYxmevt6iPnAZa38d5u5bKZM7HywL-Dc_G60,2973
|
15
|
+
certora_cli/EVMVerifier/certoraCloudIO.py,sha256=RyNqdVkttNa7oy4NT_WdPdn49jDoA77-bo-cCFkKsi0,53418
|
15
16
|
certora_cli/EVMVerifier/certoraCollectRunMetadata.py,sha256=selEf-p7UW8_70-AbPfa5659ki6WcGrBwfPkUQWKhFU,10322
|
16
17
|
certora_cli/EVMVerifier/certoraCompilerParameters.py,sha256=PDKW3K_lNeRNPHisW0e5hYtfu6unDRjJUop-yItGHO0,762
|
17
18
|
certora_cli/EVMVerifier/certoraConfigIO.py,sha256=oyNOyBjVWFfB1dmj0jNnEwvokM7UMoGZ91luSh-cFGk,4634
|
18
|
-
certora_cli/EVMVerifier/certoraContext.py,sha256=
|
19
|
+
certora_cli/EVMVerifier/certoraContext.py,sha256=52YMEYYm67F_AsDZoIFjgcR34gQQDTnlmhiH9VrLCYE,21649
|
19
20
|
certora_cli/EVMVerifier/certoraContextAttributes.py,sha256=Lx1vi9PgPiUcv0xRsdQncvknkpdvMWagGsT-Tw0saX4,55636
|
20
21
|
certora_cli/EVMVerifier/certoraContextClass.py,sha256=qdHYmrzI4zeQaAaMnonw4C-h1PFrPEhI84trrgvxFj0,210
|
21
22
|
certora_cli/EVMVerifier/certoraContextValidator.py,sha256=_vS3CDY8cJRqxtujwiz7rwRFVgDVxNb40YgUU4t4BPM,37585
|
@@ -55,12 +56,12 @@ certora_cli/Shared/certoraAttrUtil.py,sha256=IbIIvTbtPzmPSSrK7VIWZNitkz1iwvW_e0g
|
|
55
56
|
certora_cli/Shared/certoraLogging.py,sha256=5Lx-XWKl7GnwnWi7KlwTLIfsEvUvCTZ8KeyfNyi_6RU,13323
|
56
57
|
certora_cli/Shared/certoraUtils.py,sha256=WmVX8Hz5wMZ7WI2JhYavAilH1kO3fwKLUBsf4hQ4b-o,53676
|
57
58
|
certora_cli/Shared/certoraValidateFuncs.py,sha256=OOjPAkcfrURZDD4oDjOMBFTvY6wwQSXboXzu-47AUbY,36871
|
58
|
-
certora_jars/CERTORA-CLI-VERSION-METADATA.json,sha256=
|
59
|
-
certora_jars/Typechecker.jar,sha256=
|
59
|
+
certora_jars/CERTORA-CLI-VERSION-METADATA.json,sha256=BnHzvK6Yyd1TZ62oO5uruwKtQlJIVM9ZbAt68312VhU,170
|
60
|
+
certora_jars/Typechecker.jar,sha256=e3s2OgaYwrB_DTA1S4TGL7cTZGFHn6xTDbeWcLN7vs4,16812998
|
60
61
|
certora_jars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
61
|
-
certora_cli_alpha_master-20241224.
|
62
|
-
certora_cli_alpha_master-20241224.
|
63
|
-
certora_cli_alpha_master-20241224.
|
64
|
-
certora_cli_alpha_master-20241224.
|
65
|
-
certora_cli_alpha_master-20241224.
|
66
|
-
certora_cli_alpha_master-20241224.
|
62
|
+
certora_cli_alpha_master-20241224.12.18.798750.dist-info/LICENSE,sha256=VeEBJLgfzZqyAUfjLoKUztf7KJBBUjtZ1ap99eQubOo,1065
|
63
|
+
certora_cli_alpha_master-20241224.12.18.798750.dist-info/METADATA,sha256=G8flJ2P6h6_gu_qg044GmsZFYNaZqMKuWnKin8RvWJo,838
|
64
|
+
certora_cli_alpha_master-20241224.12.18.798750.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
65
|
+
certora_cli_alpha_master-20241224.12.18.798750.dist-info/entry_points.txt,sha256=x2dyit80wAtF72k5CQj9F5lnWZEmP9ioseqvrEGWyFc,389
|
66
|
+
certora_cli_alpha_master-20241224.12.18.798750.dist-info/top_level.txt,sha256=8C77w3JLanY0-NW45vpJsjRssyCqVP-qmPiN9FjWiX4,38
|
67
|
+
certora_cli_alpha_master-20241224.12.18.798750.dist-info/RECORD,,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
[console_scripts]
|
2
|
-
certoraEVMProver = certora_cli.
|
2
|
+
certoraEVMProver = certora_cli.certoraEVMProver:entry_point
|
3
3
|
certoraEqCheck = certora_cli.certoraEqCheck:equiv_check_entry_point
|
4
4
|
certoraMutate = certora_cli.certoraMutate:mutate_entry_point
|
5
5
|
certoraRun = certora_cli.certoraRun:entry_point
|
@@ -1 +1 @@
|
|
1
|
-
{"name": "certora-cli-alpha-master", "tag": "", "branch": "master", "commit": "
|
1
|
+
{"name": "certora-cli-alpha-master", "tag": "", "branch": "master", "commit": "103751c", "timestamp": "20241224.12.18.798750", "version": "20241224.12.18.798750+103751c"}
|
certora_jars/Typechecker.jar
CHANGED
Binary file
|
File without changes
|
File without changes
|