certora-cli-beta-mirror 7.31.0__py3-none-any.whl → 8.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- certora_cli/CertoraProver/Compiler/CompilerCollectorFactory.py +1 -3
- certora_cli/CertoraProver/Compiler/CompilerCollectorYul.py +3 -0
- certora_cli/CertoraProver/certoraApp.py +49 -0
- certora_cli/CertoraProver/certoraBuild.py +197 -44
- certora_cli/CertoraProver/certoraBuildCacheManager.py +2 -0
- certora_cli/CertoraProver/certoraBuildDataClasses.py +3 -1
- certora_cli/CertoraProver/certoraBuildRust.py +32 -21
- certora_cli/{Shared/rustProverCommon.py → CertoraProver/certoraBuildSui.py} +24 -18
- certora_cli/CertoraProver/certoraCloudIO.py +37 -8
- certora_cli/CertoraProver/certoraCollectConfigurationLayout.py +1 -1
- certora_cli/CertoraProver/certoraCollectRunMetadata.py +20 -5
- certora_cli/CertoraProver/certoraConfigIO.py +23 -22
- certora_cli/CertoraProver/certoraContext.py +77 -45
- certora_cli/CertoraProver/certoraContextAttributes.py +122 -195
- certora_cli/CertoraProver/certoraContextValidator.py +78 -49
- certora_cli/CertoraProver/certoraContractFuncs.py +6 -0
- certora_cli/CertoraProver/certoraType.py +10 -1
- certora_cli/CertoraProver/certoraVerifyGenerator.py +10 -4
- certora_cli/CertoraProver/splitRules.py +20 -17
- certora_cli/CertoraProver/storageExtension.py +0 -35
- certora_cli/EquivalenceCheck/equivCheck.py +2 -1
- certora_cli/Mutate/mutateApp.py +28 -16
- certora_cli/Mutate/mutateAttributes.py +11 -0
- certora_cli/Mutate/mutateValidate.py +2 -2
- certora_cli/Shared/certoraAttrUtil.py +11 -5
- certora_cli/Shared/certoraUtils.py +99 -35
- certora_cli/Shared/certoraValidateFuncs.py +24 -12
- certora_cli/Shared/proverCommon.py +10 -8
- certora_cli/certoraCVLFormatter.py +76 -0
- certora_cli/certoraConcord.py +39 -0
- certora_cli/certoraEVMProver.py +2 -2
- certora_cli/certoraRanger.py +2 -2
- certora_cli/certoraRun.py +58 -98
- certora_cli/certoraSolanaProver.py +3 -3
- certora_cli/certoraSorobanProver.py +3 -4
- {certora_cli_beta_mirror-7.31.0.dist-info → certora_cli_beta_mirror-8.1.0.dist-info}/METADATA +4 -3
- certora_cli_beta_mirror-8.1.0.dist-info/RECORD +79 -0
- {certora_cli_beta_mirror-7.31.0.dist-info → certora_cli_beta_mirror-8.1.0.dist-info}/entry_points.txt +1 -0
- certora_jars/ASTExtraction.jar +0 -0
- certora_jars/CERTORA-CLI-VERSION-METADATA.json +1 -1
- certora_jars/Typechecker.jar +0 -0
- certora_cli_beta_mirror-7.31.0.dist-info/RECORD +0 -75
- {certora_cli_beta_mirror-7.31.0.dist-info → certora_cli_beta_mirror-8.1.0.dist-info}/LICENSE +0 -0
- {certora_cli_beta_mirror-7.31.0.dist-info → certora_cli_beta_mirror-8.1.0.dist-info}/WHEEL +0 -0
- {certora_cli_beta_mirror-7.31.0.dist-info → certora_cli_beta_mirror-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
import logging
|
|
17
17
|
|
|
18
|
-
import json5
|
|
19
18
|
import sys
|
|
20
19
|
from pathlib import Path
|
|
21
20
|
from typing import Type, List, Optional
|
|
@@ -30,6 +29,8 @@ from CertoraProver.certoraCollectConfigurationLayout import AttributeJobConfigDa
|
|
|
30
29
|
|
|
31
30
|
attributes_logger = logging.getLogger("attributes")
|
|
32
31
|
|
|
32
|
+
FORBIDDEN_PROVER_ARGS = ['-solanaInlining', '-solanaSummaries']
|
|
33
|
+
|
|
33
34
|
|
|
34
35
|
def validate_prover_args(value: str) -> str:
|
|
35
36
|
|
|
@@ -50,6 +51,11 @@ def validate_prover_args(value: str) -> str:
|
|
|
50
51
|
if not attr.temporary_jar_invocation_allowed:
|
|
51
52
|
raise Util.CertoraUserInputError(
|
|
52
53
|
f"Use CLI flag '{flag_name}' instead of 'prover_attrs' with {string} as value")
|
|
54
|
+
|
|
55
|
+
for string in strings:
|
|
56
|
+
if string in FORBIDDEN_PROVER_ARGS:
|
|
57
|
+
raise Util.CertoraUserInputError(
|
|
58
|
+
f"Use a Prover option instead of 'prover_attrs' with {string} as value")
|
|
53
59
|
return value
|
|
54
60
|
|
|
55
61
|
|
|
@@ -210,87 +216,58 @@ class CommonAttributes(AttrUtil.Attributes):
|
|
|
210
216
|
disables_build_cache=False
|
|
211
217
|
)
|
|
212
218
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
deprecation_msg="`auto_nondet_difficult_internal_funcs` is deprecated, use `nondet_difficult_funcs` instead",
|
|
218
|
-
argparse_args={
|
|
219
|
-
'action': AttrUtil.STORE_TRUE
|
|
220
|
-
},
|
|
221
|
-
affects_build_cache_key=False,
|
|
222
|
-
disables_build_cache=False
|
|
223
|
-
)
|
|
224
|
-
AUTO_NONDET_MINIMAL_DIFFICULTY = AttrUtil.AttributeDefinition(
|
|
225
|
-
attr_validation_func=Vf.validate_non_negative_integer,
|
|
226
|
-
deprecation_msg="`auto_nondet_minimal_difficulty` is deprecated, use `nondet_minimal_difficulty` instead",
|
|
219
|
+
URL_VISIBILITY = AttrUtil.AttributeDefinition(
|
|
220
|
+
attr_validation_func=Vf.validate_url_visibility,
|
|
221
|
+
help_msg="Sets the visibility of the generated report link",
|
|
222
|
+
default_desc="Generate a Private report link",
|
|
227
223
|
argparse_args={
|
|
228
|
-
'
|
|
224
|
+
'nargs': AttrUtil.SINGLE_OR_NONE_OCCURRENCES,
|
|
225
|
+
'action': AttrUtil.UniqueStore,
|
|
226
|
+
'default': None, # 'default': when --url_visibility was not used
|
|
227
|
+
# when --url_visibility was used without an argument its probably because the link should be public
|
|
228
|
+
'const': str(Vf.UrlVisibilityOptions.PUBLIC)
|
|
229
229
|
},
|
|
230
230
|
affects_build_cache_key=False,
|
|
231
|
-
disables_build_cache=False
|
|
232
|
-
)
|
|
233
|
-
CONTRACT_COMPILER_SKIP_SEVERE_WARNING_AS_ERROR = AttrUtil.AttributeDefinition(
|
|
234
|
-
arg_type=AttrUtil.AttrArgType.BOOLEAN,
|
|
235
|
-
deprecation_msg="`contract_compiler_skip_severe_warning_as_error` is deprecated. "
|
|
236
|
-
"Use `ignore_solidity_warnings` instead",
|
|
237
|
-
affects_build_cache_key=True,
|
|
238
231
|
disables_build_cache=False,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
)
|
|
243
|
-
|
|
244
|
-
SEND_ONLY = AttrUtil.AttributeDefinition(
|
|
245
|
-
arg_type=AttrUtil.AttrArgType.BOOLEAN,
|
|
246
|
-
deprecation_msg="'send_only' is deprecated and is now the default. In CI, use 'wait_for_results none' instead",
|
|
247
|
-
argparse_args={
|
|
248
|
-
'action': AttrUtil.STORE_TRUE
|
|
249
|
-
},
|
|
250
|
-
affects_build_cache_key=False,
|
|
251
|
-
disables_build_cache=False
|
|
232
|
+
# Avoiding presentation of this attribute in Config Tab
|
|
233
|
+
config_data=None
|
|
252
234
|
)
|
|
253
235
|
|
|
254
|
-
USE_MEMORY_SAFE_AUTOFINDERS = AttrUtil.AttributeDefinition(
|
|
255
|
-
arg_type=AttrUtil.AttrArgType.BOOLEAN,
|
|
256
|
-
deprecation_msg="`use_memory_safe_autofinders` is deprecated and is turned on by default. To disable it"
|
|
257
|
-
" use `no_memory_safe_autofinders`",
|
|
258
|
-
argparse_args={
|
|
259
|
-
'action': AttrUtil.STORE_TRUE
|
|
260
|
-
},
|
|
261
|
-
affects_build_cache_key=True,
|
|
262
|
-
disables_build_cache=False
|
|
263
|
-
)
|
|
264
236
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
deprecation_msg="`disable_finder_friendly_optimizer` is deprecated, use `strict_solc_optimizer` instead",
|
|
268
|
-
argparse_args={
|
|
269
|
-
'action': AttrUtil.STORE_TRUE
|
|
270
|
-
},
|
|
271
|
-
affects_build_cache_key=True,
|
|
272
|
-
disables_build_cache=False
|
|
273
|
-
)
|
|
237
|
+
class DeprecatedAttributes(AttrUtil.Attributes):
|
|
238
|
+
pass
|
|
274
239
|
|
|
275
|
-
|
|
276
|
-
arg_type=AttrUtil.AttrArgType.BOOLEAN,
|
|
277
|
-
deprecation_msg="`do_not_use_memory_safe_autofinders` is deprecated, use `no_memory_safe_autofinders` instead",
|
|
240
|
+
PROCESS = AttrUtil.AttributeDefinition(
|
|
278
241
|
argparse_args={
|
|
279
|
-
'action': AttrUtil.
|
|
242
|
+
'action': AttrUtil.UniqueStore,
|
|
280
243
|
},
|
|
281
|
-
|
|
244
|
+
deprecation_msg="`process` is deprecated and will be removed in a future release.",
|
|
245
|
+
affects_build_cache_key=False,
|
|
282
246
|
disables_build_cache=False
|
|
283
247
|
)
|
|
284
248
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
249
|
+
SOLC_MAP = AttrUtil.AttributeDefinition(
|
|
250
|
+
attr_validation_func=Vf.validate_compiler_map,
|
|
251
|
+
arg_type=AttrUtil.AttrArgType.MAP,
|
|
252
|
+
deprecation_msg="`solc_map` is deprecated, use `compiler_map` instead",
|
|
253
|
+
help_msg='Map contracts to the appropriate Solidity compiler in case not all contract files are compiled '
|
|
254
|
+
'with the same Solidity compiler version. \n\nCLI Example: '
|
|
255
|
+
'\n --solc_map A=solc8.11,B=solc8.9,C=solc7.5\n\nJSON Example: '
|
|
256
|
+
'\n "solc_map: {"'
|
|
257
|
+
'\n "A": "solc8.11",'
|
|
258
|
+
'\n "B": "solc8.9",'
|
|
259
|
+
'\n "C": "solc7.5"'
|
|
260
|
+
'\n }',
|
|
261
|
+
default_desc="Uses the same Solidity compiler version for all contracts",
|
|
289
262
|
argparse_args={
|
|
290
|
-
'action': AttrUtil.
|
|
263
|
+
'action': AttrUtil.UniqueStore,
|
|
264
|
+
'type': lambda value: Vf.parse_ordered_dict('solc_map', value)
|
|
291
265
|
},
|
|
292
266
|
affects_build_cache_key=True,
|
|
293
|
-
disables_build_cache=False
|
|
267
|
+
disables_build_cache=False,
|
|
268
|
+
config_data=AttributeJobConfigData(
|
|
269
|
+
main_section=MainSection.SOLIDITY_COMPILER
|
|
270
|
+
)
|
|
294
271
|
)
|
|
295
272
|
|
|
296
273
|
|
|
@@ -393,29 +370,6 @@ class EvmAttributes(AttrUtil.Attributes):
|
|
|
393
370
|
)
|
|
394
371
|
)
|
|
395
372
|
|
|
396
|
-
SOLC_MAP = AttrUtil.AttributeDefinition(
|
|
397
|
-
attr_validation_func=Vf.validate_compiler_map,
|
|
398
|
-
arg_type=AttrUtil.AttrArgType.MAP,
|
|
399
|
-
help_msg='Map contracts to the appropriate Solidity compiler in case not all contract files are compiled '
|
|
400
|
-
'with the same Solidity compiler version. \n\nCLI Example: '
|
|
401
|
-
'\n --solc_map A=solc8.11,B=solc8.9,C=solc7.5\n\nJSON Example: '
|
|
402
|
-
'\n "solc_map: {"'
|
|
403
|
-
'\n "A": "solc8.11",'
|
|
404
|
-
'\n "B": "solc8.9",'
|
|
405
|
-
'\n "C": "solc7.5"'
|
|
406
|
-
'\n }',
|
|
407
|
-
default_desc="Uses the same Solidity compiler version for all contracts",
|
|
408
|
-
argparse_args={
|
|
409
|
-
'action': AttrUtil.UniqueStore,
|
|
410
|
-
'type': lambda value: Vf.parse_ordered_dict('solc_map', value)
|
|
411
|
-
},
|
|
412
|
-
affects_build_cache_key=True,
|
|
413
|
-
disables_build_cache=False,
|
|
414
|
-
config_data=AttributeJobConfigData(
|
|
415
|
-
main_section=MainSection.SOLIDITY_COMPILER
|
|
416
|
-
)
|
|
417
|
-
)
|
|
418
|
-
|
|
419
373
|
COMPILER_MAP = AttrUtil.AttributeDefinition(
|
|
420
374
|
attr_validation_func=Vf.validate_compiler_map,
|
|
421
375
|
arg_type=AttrUtil.AttrArgType.MAP,
|
|
@@ -824,17 +778,6 @@ class EvmAttributes(AttrUtil.Attributes):
|
|
|
824
778
|
disables_build_cache=False
|
|
825
779
|
)
|
|
826
780
|
|
|
827
|
-
ASSERT_CONTRACTS = AttrUtil.AttributeDefinition(
|
|
828
|
-
attr_validation_func=Vf.validate_assert_contracts,
|
|
829
|
-
arg_type=AttrUtil.AttrArgType.LIST,
|
|
830
|
-
argparse_args={
|
|
831
|
-
'nargs': AttrUtil.ONE_OR_MORE_OCCURRENCES,
|
|
832
|
-
'action': AttrUtil.APPEND,
|
|
833
|
-
},
|
|
834
|
-
affects_build_cache_key=False,
|
|
835
|
-
disables_build_cache=False
|
|
836
|
-
)
|
|
837
|
-
|
|
838
781
|
EQUIVALENCE_CONTRACTS = AttrUtil.AttributeDefinition(
|
|
839
782
|
attr_validation_func=Vf.validate_equivalence_contracts,
|
|
840
783
|
arg_type=AttrUtil.AttrArgType.STRING,
|
|
@@ -1172,6 +1115,15 @@ class EvmAttributes(AttrUtil.Attributes):
|
|
|
1172
1115
|
disables_build_cache=False,
|
|
1173
1116
|
)
|
|
1174
1117
|
|
|
1118
|
+
DISALLOW_INTERNAL_FUNCTION_CALLS = AttrUtil.AttributeDefinition(
|
|
1119
|
+
arg_type=AttrUtil.AttrArgType.BOOLEAN,
|
|
1120
|
+
argparse_args={
|
|
1121
|
+
'action': AttrUtil.STORE_TRUE
|
|
1122
|
+
},
|
|
1123
|
+
affects_build_cache_key=True,
|
|
1124
|
+
disables_build_cache=False,
|
|
1125
|
+
)
|
|
1126
|
+
|
|
1175
1127
|
@classmethod
|
|
1176
1128
|
def hide_attributes(cls) -> List[str]:
|
|
1177
1129
|
# do not show these attributes in the help message
|
|
@@ -1357,12 +1309,10 @@ class BackendAttributes(AttrUtil.Attributes):
|
|
|
1357
1309
|
attr_validation_func=Vf.validate_sanity_value,
|
|
1358
1310
|
help_msg="Select the type of sanity check that will be performed during execution",
|
|
1359
1311
|
jar_flag='-ruleSanityChecks',
|
|
1360
|
-
default_desc="
|
|
1312
|
+
default_desc="Basic sanity checks (Vacuity and trivial invariant check)",
|
|
1361
1313
|
argparse_args={
|
|
1362
|
-
'nargs': AttrUtil.SINGLE_OR_NONE_OCCURRENCES,
|
|
1363
1314
|
'action': AttrUtil.UniqueStore,
|
|
1364
1315
|
'default': None, # 'default': when no --rule_sanity given
|
|
1365
|
-
'const': Vf.RuleSanityValue.BASIC.name.lower() # 'default': when empty --rule_sanity is given
|
|
1366
1316
|
},
|
|
1367
1317
|
affects_build_cache_key=False,
|
|
1368
1318
|
disables_build_cache=False
|
|
@@ -1474,17 +1424,6 @@ class BackendAttributes(AttrUtil.Attributes):
|
|
|
1474
1424
|
disables_build_cache=False
|
|
1475
1425
|
)
|
|
1476
1426
|
|
|
1477
|
-
PROCESS = AttrUtil.AttributeDefinition(
|
|
1478
|
-
argparse_args={
|
|
1479
|
-
'action': AttrUtil.UniqueStore,
|
|
1480
|
-
'default': 'emv'
|
|
1481
|
-
},
|
|
1482
|
-
affects_build_cache_key=False,
|
|
1483
|
-
disables_build_cache=False,
|
|
1484
|
-
# Avoiding presentation of this attribute in Config Tab
|
|
1485
|
-
config_data=None
|
|
1486
|
-
)
|
|
1487
|
-
|
|
1488
1427
|
PROVER_ARGS = AttrUtil.AttributeDefinition(
|
|
1489
1428
|
arg_type=AttrUtil.AttrArgType.LIST,
|
|
1490
1429
|
attr_validation_func=validate_prover_args,
|
|
@@ -1663,16 +1602,6 @@ class BackendAttributes(AttrUtil.Attributes):
|
|
|
1663
1602
|
disables_build_cache=False
|
|
1664
1603
|
)
|
|
1665
1604
|
|
|
1666
|
-
ALLOW_SOLIDITY_CALLS_IN_QUANTIFIERS = AttrUtil.AttributeDefinition(
|
|
1667
|
-
arg_type=AttrUtil.AttrArgType.BOOLEAN,
|
|
1668
|
-
jar_flag='-allowSolidityQuantifierCalls',
|
|
1669
|
-
argparse_args={
|
|
1670
|
-
'action': AttrUtil.STORE_TRUE
|
|
1671
|
-
},
|
|
1672
|
-
affects_build_cache_key=False,
|
|
1673
|
-
disables_build_cache=False
|
|
1674
|
-
)
|
|
1675
|
-
|
|
1676
1605
|
|
|
1677
1606
|
class RustAttributes(AttrUtil.Attributes):
|
|
1678
1607
|
|
|
@@ -1708,10 +1637,11 @@ class RustAttributes(AttrUtil.Attributes):
|
|
|
1708
1637
|
disables_build_cache=False
|
|
1709
1638
|
)
|
|
1710
1639
|
|
|
1640
|
+
|
|
1711
1641
|
class EvmProverAttributes(CommonAttributes, DeprecatedAttributes, EvmAttributes, InternalUseAttributes,
|
|
1712
1642
|
BackendAttributes):
|
|
1713
1643
|
FILES = AttrUtil.AttributeDefinition(
|
|
1714
|
-
attr_validation_func=Vf.
|
|
1644
|
+
attr_validation_func=Vf.validate_evm_input_file,
|
|
1715
1645
|
arg_type=AttrUtil.AttrArgType.LIST,
|
|
1716
1646
|
help_msg="Solidity or Vyper contract files for analysis or a conf file",
|
|
1717
1647
|
default_desc="",
|
|
@@ -1726,22 +1656,46 @@ class EvmProverAttributes(CommonAttributes, DeprecatedAttributes, EvmAttributes,
|
|
|
1726
1656
|
)
|
|
1727
1657
|
|
|
1728
1658
|
|
|
1659
|
+
class ConcordAttributes(EvmProverAttributes):
|
|
1660
|
+
CHECK_METHOD = AttrUtil.AttributeDefinition(
|
|
1661
|
+
attr_validation_func=Vf.validate_check_method_flag,
|
|
1662
|
+
help_msg="the method to be checked by Concord equivalent checker",
|
|
1663
|
+
default_desc="Mandatory for Concord",
|
|
1664
|
+
jar_flag='-method',
|
|
1665
|
+
argparse_args={
|
|
1666
|
+
'action': AttrUtil.UniqueStore
|
|
1667
|
+
},
|
|
1668
|
+
affects_build_cache_key=False,
|
|
1669
|
+
disables_build_cache=False
|
|
1670
|
+
)
|
|
1671
|
+
|
|
1672
|
+
@classmethod
|
|
1673
|
+
def unsupported_attributes(cls) -> List[AttrUtil.AttributeDefinition]:
|
|
1674
|
+
return [cls.VERIFY, cls.MSG, cls.PROTOCOL_NAME, cls.PROTOCOL_AUTHOR, cls.RULE, cls.EXCLUDE_RULE,
|
|
1675
|
+
cls.SPLIT_RULES, cls.EXCLUDE_METHOD, cls.PARAMETRIC_CONTRACTS, cls.COVERAGE_INFO, cls.FOUNDRY,
|
|
1676
|
+
cls.INDEPENDENT_SATISFY, cls.MULTI_ASSERT_CHECK, cls.MULTI_EXAMPLE, cls.PROJECT_SANITY,
|
|
1677
|
+
cls.RULE_SANITY, cls.ADDRESS, cls.CONTRACT_EXTENSIONS, cls.CONTRACT_RECURSION_LIMIT, cls.LINK,
|
|
1678
|
+
cls.OPTIMISTIC_CONTRACT_RECURSION, cls.STRUCT_LINK, cls.DYNAMIC_BOUND, cls.DYNAMIC_DISPATCH,
|
|
1679
|
+
cls.PROTOTYPE, cls.METHOD]
|
|
1680
|
+
|
|
1681
|
+
|
|
1729
1682
|
class RangerAttributes(EvmProverAttributes):
|
|
1730
1683
|
@classmethod
|
|
1731
|
-
def
|
|
1684
|
+
def unsupported_attributes(cls) -> List[AttrUtil.AttributeDefinition]:
|
|
1732
1685
|
return [cls.PROJECT_SANITY, cls.RULE_SANITY, cls.COVERAGE_INFO, cls.FOUNDRY, cls.INDEPENDENT_SATISFY,
|
|
1733
1686
|
cls.MULTI_ASSERT_CHECK, cls.MULTI_EXAMPLE, cls.VYPER]
|
|
1734
1687
|
|
|
1735
1688
|
@classmethod
|
|
1736
|
-
def
|
|
1689
|
+
def true_by_default_attributes(cls) -> List[AttrUtil.AttributeDefinition]:
|
|
1737
1690
|
return [cls.OPTIMISTIC_LOOP, cls.OPTIMISTIC_FALLBACK, cls.AUTO_DISPATCHER, cls.OPTIMISTIC_HASHING]
|
|
1738
1691
|
|
|
1739
1692
|
@classmethod
|
|
1740
1693
|
def hide_attributes(cls) -> List[str]:
|
|
1741
1694
|
# do not show these attributes in the help message
|
|
1742
|
-
combined_list = cls.
|
|
1695
|
+
combined_list = cls.unsupported_attributes() + cls.true_by_default_attributes()
|
|
1743
1696
|
return [attr.name for attr in combined_list] + [cls.LOOP_ITER.name, cls.RANGER_FAILURE_LIMIT.name]
|
|
1744
1697
|
|
|
1698
|
+
|
|
1745
1699
|
class SorobanProverAttributes(CommonAttributes, InternalUseAttributes, BackendAttributes, RustAttributes):
|
|
1746
1700
|
FILES = AttrUtil.AttributeDefinition(
|
|
1747
1701
|
attr_validation_func=Vf.validate_soroban_extension,
|
|
@@ -1759,6 +1713,36 @@ class SorobanProverAttributes(CommonAttributes, InternalUseAttributes, BackendAt
|
|
|
1759
1713
|
)
|
|
1760
1714
|
|
|
1761
1715
|
|
|
1716
|
+
class SuiProverAttributes(CommonAttributes, InternalUseAttributes, BackendAttributes):
|
|
1717
|
+
FILES = AttrUtil.AttributeDefinition(
|
|
1718
|
+
attr_validation_func=Vf.validate_dir,
|
|
1719
|
+
arg_type=AttrUtil.AttrArgType.LIST,
|
|
1720
|
+
argparse_args={
|
|
1721
|
+
'nargs': AttrUtil.MULTIPLE_OCCURRENCES
|
|
1722
|
+
},
|
|
1723
|
+
affects_build_cache_key=True,
|
|
1724
|
+
disables_build_cache=False,
|
|
1725
|
+
config_data=AttributeJobConfigData(
|
|
1726
|
+
main_section=MainSection.NEW_SECTION
|
|
1727
|
+
)
|
|
1728
|
+
)
|
|
1729
|
+
|
|
1730
|
+
MOVE_PATH = AttrUtil.AttributeDefinition(
|
|
1731
|
+
attr_validation_func=Vf.validate_dir,
|
|
1732
|
+
arg_type=AttrUtil.AttrArgType.STRING,
|
|
1733
|
+
help_msg="path to a directory which includes all binary .mv files for the Prover",
|
|
1734
|
+
default_desc="",
|
|
1735
|
+
argparse_args={
|
|
1736
|
+
'action': AttrUtil.UniqueStore
|
|
1737
|
+
},
|
|
1738
|
+
affects_build_cache_key=True,
|
|
1739
|
+
disables_build_cache=False,
|
|
1740
|
+
config_data=AttributeJobConfigData(
|
|
1741
|
+
main_section=MainSection.NEW_SECTION
|
|
1742
|
+
)
|
|
1743
|
+
)
|
|
1744
|
+
|
|
1745
|
+
|
|
1762
1746
|
class SolanaProverAttributes(CommonAttributes, InternalUseAttributes, BackendAttributes, RustAttributes):
|
|
1763
1747
|
FILES = AttrUtil.AttributeDefinition(
|
|
1764
1748
|
attr_validation_func=Vf.validate_solana_extension,
|
|
@@ -1817,70 +1801,6 @@ def set_attribute_class(cls: Type[AttrUtil.Attributes]) -> None:
|
|
|
1817
1801
|
cls.set_attribute_list()
|
|
1818
1802
|
|
|
1819
1803
|
|
|
1820
|
-
def detect_application_class(args: List[str]) -> Type[AttrUtil.Attributes]:
|
|
1821
|
-
|
|
1822
|
-
attributes_logger.debug("calling detect_application_class")
|
|
1823
|
-
|
|
1824
|
-
def application_by_suffix(file: str) -> Type[AttrUtil.Attributes]:
|
|
1825
|
-
if file.endswith(Util.EVM_EXTENSIONS):
|
|
1826
|
-
return EvmProverAttributes
|
|
1827
|
-
elif file.endswith(Util.SOROBAN_EXEC_EXTENSION):
|
|
1828
|
-
return SorobanProverAttributes
|
|
1829
|
-
elif file.endswith(Util.SOLANA_EXEC_EXTENSION):
|
|
1830
|
-
return SolanaProverAttributes
|
|
1831
|
-
elif file.endswith('.conf'):
|
|
1832
|
-
raise Util.CertoraUserInputError(f"Cannot use conf files inside a conf file: {file}")
|
|
1833
|
-
else:
|
|
1834
|
-
raise Util.CertoraUserInputError(f"Unsupported file type: {file}")
|
|
1835
|
-
|
|
1836
|
-
cli_files = []
|
|
1837
|
-
cli_conf_files = []
|
|
1838
|
-
files = []
|
|
1839
|
-
build_script = None
|
|
1840
|
-
for arg in args:
|
|
1841
|
-
if arg.startswith('-'):
|
|
1842
|
-
break # Stop processing when a flag is detected
|
|
1843
|
-
cli_files.append(arg)
|
|
1844
|
-
if arg.endswith('.conf'):
|
|
1845
|
-
cli_conf_files.append(arg)
|
|
1846
|
-
|
|
1847
|
-
if len(cli_conf_files) == 1:
|
|
1848
|
-
conf_file_path = Path(cli_conf_files[0])
|
|
1849
|
-
|
|
1850
|
-
with conf_file_path.open() as conf_file:
|
|
1851
|
-
configuration = json5.load(conf_file, allow_duplicate_keys=False)
|
|
1852
|
-
files = configuration.get('files', [])
|
|
1853
|
-
build_script = configuration.get('build_script')
|
|
1854
|
-
|
|
1855
|
-
if build_script:
|
|
1856
|
-
return SorobanProverAttributes
|
|
1857
|
-
|
|
1858
|
-
if len(cli_conf_files) == 0:
|
|
1859
|
-
files = cli_files
|
|
1860
|
-
|
|
1861
|
-
if len(cli_conf_files) > 1:
|
|
1862
|
-
raise Util.CertoraUserInputError(f"multiple conf files: {cli_conf_files})")
|
|
1863
|
-
|
|
1864
|
-
candidate = None
|
|
1865
|
-
|
|
1866
|
-
for file in files:
|
|
1867
|
-
file = file.split(':')[0] # remove contract part if exist
|
|
1868
|
-
app = application_by_suffix(file)
|
|
1869
|
-
if not candidate:
|
|
1870
|
-
candidate = app
|
|
1871
|
-
elif candidate == app:
|
|
1872
|
-
continue
|
|
1873
|
-
else:
|
|
1874
|
-
raise Util.CertoraUserInputError(f"Illegal files combination: {files})")
|
|
1875
|
-
|
|
1876
|
-
if candidate:
|
|
1877
|
-
attributes_logger.debug(f"detect_application_class returns {candidate}")
|
|
1878
|
-
return candidate
|
|
1879
|
-
else:
|
|
1880
|
-
attributes_logger.debug(f"detect_application_class returns {EvmProverAttributes}")
|
|
1881
|
-
return EvmProverAttributes
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
1804
|
def is_solana_app() -> bool:
|
|
1885
1805
|
return get_attribute_class() == SolanaProverAttributes
|
|
1886
1806
|
|
|
@@ -1892,12 +1812,19 @@ def is_soroban_app() -> bool:
|
|
|
1892
1812
|
def is_rust_app() -> bool:
|
|
1893
1813
|
return is_soroban_app() or is_solana_app()
|
|
1894
1814
|
|
|
1895
|
-
|
|
1815
|
+
|
|
1816
|
+
# Ranger and Concord will also return true for this function
|
|
1896
1817
|
def is_evm_app() -> bool:
|
|
1897
1818
|
return issubclass(get_attribute_class(), EvmProverAttributes)
|
|
1898
1819
|
|
|
1820
|
+
|
|
1899
1821
|
def is_ranger_app() -> bool:
|
|
1900
1822
|
return get_attribute_class() == RangerAttributes
|
|
1901
1823
|
|
|
1902
|
-
|
|
1903
|
-
|
|
1824
|
+
|
|
1825
|
+
def is_concord_app() -> bool:
|
|
1826
|
+
return get_attribute_class() == ConcordAttributes
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
def is_sui_app() -> bool:
|
|
1830
|
+
return get_attribute_class() == SuiProverAttributes
|