Skip to content

Commit d1c11f7

Browse files
Merge pull request #159 from ElrondNetwork/eei-checks-24
Bypass EEI checks, by default.
2 parents 9710ea3 + a639306 commit d1c11f7

9 files changed

Lines changed: 28 additions & 243 deletions

File tree

erdpy/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
77
## [Unreleased]
88
- TBD
99

10+
## [2.1.0]
11+
- [Bypass EEI checks, by default](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/159)
12+
1013
## [2.0.4]
1114
- Fix resolving latest release of Github repositories
1215

erdpy/CLI.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ optional arguments:
132132
False)
133133
--wasm-name WASM_NAME for rust projects, optionally specify the name of the wasm bytecode output file
134134
--wasm-suffix WASM_SUFFIX for rust projects, optionally specify the suffix of the wasm bytecode output file
135-
--skip-eei-checks skip EEI compatibility checks (default: False)
136-
--ignore-eei-checks ignore EEI compatibility errors (default: False)
135+
--eei-checks run EEI compatibility checks (default: False)
136+
--skip-eei-checks deprecated flag
137+
--ignore-eei-checks deprecated flag
137138
138139
```
139140
### Contract.Clean
@@ -430,8 +431,9 @@ optional arguments:
430431
output file
431432
--wasm-suffix WASM_SUFFIX for rust projects, optionally specify the suffix of the wasm bytecode
432433
output file
433-
--skip-eei-checks skip EEI compatibility checks (default: False)
434-
--ignore-eei-checks ignore EEI compatibility errors (default: False)
434+
--eei-checks run EEI compatibility checks (default: False)
435+
--skip-eei-checks deprecated flag
436+
--ignore-eei-checks deprecated flag
435437
436438
```
437439
## Group **Transactions**

erdpy/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.4"
1+
__version__ = "2.1.0"

erdpy/cli_contracts.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import logging
22
import os
3-
from typing import Any, Dict, List
4-
53
from pathlib import Path
4+
from typing import Any, Dict, List
65

76
from erdpy import cli_shared, errors, projects, utils
87
from erdpy.accounts import Account, Address, LedgerAccount
@@ -144,8 +143,11 @@ def _add_build_options_args(sub: Any):
144143
help="for rust projects, optionally specify the name of the wasm bytecode output file")
145144
sub.add_argument("--wasm-suffix", type=str,
146145
help="for rust projects, optionally specify the suffix of the wasm bytecode output file")
147-
sub.add_argument("--skip-eei-checks", action="store_true", default=False, help="skip EEI compatibility checks (default: %(default)s)")
148-
sub.add_argument("--ignore-eei-checks", action="store_true", default=False, help="ignore EEI compatibility errors (default: %(default)s)")
146+
147+
sub.add_argument("--eei-checks", action="store_true", default=False, help="run EEI compatibility checks (default: %(default)s)")
148+
# Flags are kept in order to avoid breaking changes, for the moment - we might completely remove them in the future.
149+
sub.add_argument("--skip-eei-checks", action="store_true", default=True, help="deprecated flag")
150+
sub.add_argument("--ignore-eei-checks", action="store_true", default=True, help="deprecated flag")
149151

150152

151153
def _add_recursive_arg(sub: Any):
@@ -230,7 +232,10 @@ def _prepare_build_options(args: Any) -> Dict[str, Any]:
230232
"wasm-symbols": args.wasm_symbols,
231233
"wasm-name": args.wasm_name,
232234
"wasm-suffix": args.wasm_suffix,
235+
"eei-checks": args.eei_checks,
236+
# TODO: Remove this, in the future
233237
"skip-eei-checks": args.skip_eei_checks,
238+
# TODO: Remove this, in the future
234239
"ignore-eei-checks": args.ignore_eei_checks
235240
}
236241

erdpy/errors.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ def __init__(self, directory: str):
6969
super().__init__(f"Directory is not a supported project: {directory}")
7070

7171

72-
class NotSupportedProjectFeature(KnownError):
73-
def __init__(self):
74-
super().__init__(f"Project feature not yet supported.")
75-
76-
7772
class PlatformNotSupported(KnownError):
7873
def __init__(self, action_or_item: str, platform: str):
7974
super().__init__(f"[{action_or_item}] is not supported on platform [{platform}].")

erdpy/projects/eei_checks.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
from typing import List
3+
34
from erdpy import utils
4-
from erdpy.errors import NotSupportedProjectFeature
55
from erdpy.projects.eei_activation import ActivationEpochsInfo
66
from erdpy.projects.eei_registry import EEIRegistry
77
from erdpy.projects.interfaces import IProject
@@ -29,19 +29,12 @@ def check_compatibility(project: IProject):
2929
compatible_with_mainnet = _check_imports_compatibility(imports, activation_info_on_mainnet)
3030
compatible_with_devnet = _check_imports_compatibility(imports, activation_info_on_devnet)
3131

32-
if _should_ignore_checks(project):
33-
return
34-
3532
if not compatible_with_mainnet or not compatible_with_devnet:
36-
raise NotSupportedProjectFeature()
33+
logger.warn("Some features used by the project are not yet completely supported.")
3734

3835

3936
def _should_skip_checks(project: IProject):
40-
return project.get_option("skip-eei-checks") is True
41-
42-
43-
def _should_ignore_checks(project: IProject):
44-
return project.get_option("ignore-eei-checks") is True
37+
return not project.get_option("eei-checks")
4538

4639

4740
def _check_imports_compatibility(imports: List[str], activation_info: ActivationEpochsInfo) -> bool:

erdpy/projects/eei_registry.py

Lines changed: 4 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -7,225 +7,10 @@
77
class EEIRegistry:
88
def __init__(self, activation_info: ActivationEpochsInfo) -> None:
99
self.activation_info = activation_info
10-
11-
storageAPICostOptimizationEnableEpoch = FeatureFlag("StorageAPICostOptimizationEnableEpoch")
12-
13-
self.flags = [
14-
storageAPICostOptimizationEnableEpoch
15-
]
16-
10+
self.flags: List[FeatureFlag] = []
1711
self.functions: List[EEIFunction] = [
18-
# big int
19-
EEIFunction("bigIntNew", None, []),
20-
EEIFunction("bigIntUnsignedByteLength", None, []),
21-
EEIFunction("bigIntSignedByteLength", None, []),
22-
EEIFunction("bigIntGetUnsignedBytes", None, []),
23-
EEIFunction("bigIntGetSignedBytes", None, []),
24-
EEIFunction("bigIntSetUnsignedBytes", None, []),
25-
EEIFunction("bigIntSetSignedBytes", None, []),
26-
EEIFunction("bigIntIsInt64", None, []),
27-
EEIFunction("bigIntGetInt64", None, []),
28-
EEIFunction("bigIntSetInt64", None, []),
29-
EEIFunction("bigIntAdd", None, []),
30-
EEIFunction("bigIntSub", None, []),
31-
EEIFunction("bigIntMul", None, []),
32-
EEIFunction("bigIntTDiv", None, []),
33-
EEIFunction("bigIntTMod", None, []),
34-
EEIFunction("bigIntEDiv", None, []),
35-
EEIFunction("bigIntEMod", None, []),
36-
EEIFunction("bigIntPow", None, []),
37-
EEIFunction("bigIntLog2", None, []),
38-
EEIFunction("bigIntSqrt", None, []),
39-
EEIFunction("bigIntAbs", None, []),
40-
EEIFunction("bigIntNeg", None, []),
41-
EEIFunction("bigIntSign", None, []),
42-
EEIFunction("bigIntCmp", None, []),
43-
EEIFunction("bigIntNot", None, []),
44-
EEIFunction("bigIntAnd", None, []),
45-
EEIFunction("bigIntOr", None, []),
46-
EEIFunction("bigIntXor", None, []),
47-
EEIFunction("bigIntShr", None, []),
48-
EEIFunction("bigIntShl", None, []),
49-
EEIFunction("bigIntFinishUnsigned", None, []),
50-
EEIFunction("bigIntFinishSigned", None, []),
51-
EEIFunction("bigIntStorageStoreUnsigned", None, []),
52-
EEIFunction("bigIntStorageLoadUnsigned", None, []),
53-
EEIFunction("bigIntGetUnsignedArgument", None, []),
54-
EEIFunction("bigIntGetSignedArgument", None, []),
55-
EEIFunction("bigIntGetCallValue", None, []),
56-
EEIFunction("bigIntGetESDTCallValue", None, []),
57-
EEIFunction("bigIntGetESDTCallValueByIndex", None, []),
58-
EEIFunction("bigIntGetESDTExternalBalance", None, []),
59-
EEIFunction("bigIntGetExternalBalance", None, []),
60-
61-
# small int
62-
EEIFunction("smallIntGetUnsignedArgument", None, []),
63-
EEIFunction("smallIntGetSignedArgument", None, []),
64-
EEIFunction("smallIntFinishUnsigned", None, []),
65-
EEIFunction("smallIntFinishSigned", None, []),
66-
EEIFunction("smallIntStorageStoreUnsigned", None, []),
67-
EEIFunction("smallIntStorageStoreSigned", None, []),
68-
EEIFunction("smallIntStorageLoadUnsigned", None, []),
69-
EEIFunction("smallIntStorageLoadSigned", None, []),
70-
EEIFunction("int64getArgument", None, []),
71-
EEIFunction("int64storageStore", None, []),
72-
EEIFunction("int64storageLoad", None, []),
73-
EEIFunction("int64finish", None, []),
74-
75-
# buffers
76-
EEIFunction("mBufferNew", None, []),
77-
EEIFunction("mBufferNewFromBytes", None, []),
78-
EEIFunction("mBufferGetLength", None, []),
79-
EEIFunction("mBufferGetBytes", None, []),
80-
EEIFunction("mBufferGetByteSlice", None, []),
81-
EEIFunction("mBufferCopyByteSlice", None, []),
82-
EEIFunction("mBufferEq", None, []),
83-
EEIFunction("mBufferSetBytes", None, []),
84-
EEIFunction("mBufferSetByteSlice", storageAPICostOptimizationEnableEpoch, []),
85-
EEIFunction("mBufferAppend", None, []),
86-
EEIFunction("mBufferAppendBytes", None, []),
87-
EEIFunction("mBufferToBigIntUnsigned", None, []),
88-
EEIFunction("mBufferToBigIntSigned", None, []),
89-
EEIFunction("mBufferFromBigIntUnsigned", None, []),
90-
EEIFunction("mBufferFromBigIntSigned", None, []),
91-
EEIFunction("mBufferStorageStore", None, []),
92-
EEIFunction("mBufferStorageLoad", None, []),
93-
EEIFunction("mBufferStorageLoadFromAddress", storageAPICostOptimizationEnableEpoch, []),
94-
EEIFunction("mBufferGetArgument", None, []),
95-
EEIFunction("mBufferFinish", None, []),
96-
EEIFunction("mBufferSetRandom", None, []),
97-
98-
# eei core
99-
EEIFunction("getSCAddress", None, []),
100-
EEIFunction("getOwnerAddress", None, []),
101-
EEIFunction("getShardOfAddress", None, []),
102-
EEIFunction("isSmartContract", None, []),
103-
EEIFunction("getExternalBalance", None, []),
104-
EEIFunction("getBlockHash", None, []),
105-
EEIFunction("transferValue", None, []),
106-
EEIFunction("transferESDTExecute", None, []),
107-
EEIFunction("transferESDTNFTExecute", None, []),
108-
EEIFunction("multiTransferESDTNFTExecute", None, []),
109-
EEIFunction("transferValueExecute", None, []),
110-
EEIFunction("getArgumentLength", None, []),
111-
EEIFunction("getArgument", None, []),
112-
EEIFunction("getFunction", None, []),
113-
EEIFunction("getNumArguments", None, []),
114-
EEIFunction("storageStore", None, []),
115-
EEIFunction("storageLoadLength", None, []),
116-
EEIFunction("storageLoad", None, []),
117-
EEIFunction("storageLoadFromAddress", None, []),
118-
EEIFunction("getCaller", None, []),
119-
EEIFunction("checkNoPayment", None, []),
120-
EEIFunction("getCallValue", None, []),
121-
EEIFunction("getESDTValue", None, []),
122-
EEIFunction("getESDTTokenName", None, []),
123-
EEIFunction("getESDTTokenNonce", None, []),
124-
EEIFunction("getESDTTokenType", None, []),
125-
EEIFunction("getCallValueTokenName", None, []),
126-
EEIFunction("getESDTValueByIndex", None, []),
127-
EEIFunction("getESDTTokenNameByIndex", None, []),
128-
EEIFunction("getESDTTokenNonceByIndex", None, []),
129-
EEIFunction("getESDTTokenTypeByIndex", None, []),
130-
EEIFunction("getCallValueTokenNameByIndex", None, []),
131-
EEIFunction("getNumESDTTransfers", None, []),
132-
EEIFunction("getCurrentESDTNFTNonce", None, []),
133-
EEIFunction("writeLog", None, ["deprecated"]),
134-
EEIFunction("writeEventLog", None, []),
135-
EEIFunction("finish", None, []),
136-
EEIFunction("signalError", None, []),
137-
EEIFunction("getGasLeft", None, []),
138-
EEIFunction("getESDTBalance", None, []),
139-
EEIFunction("getESDTNFTNameLength", None, []),
140-
EEIFunction("getESDTNFTAttributeLength", None, []),
141-
EEIFunction("getESDTNFTURILength", None, []),
142-
EEIFunction("getESDTTokenData", None, []),
143-
EEIFunction("getESDTLocalRoles", storageAPICostOptimizationEnableEpoch, []),
144-
EEIFunction("validateTokenIdentifier", storageAPICostOptimizationEnableEpoch, []),
145-
EEIFunction("executeOnDestContext", None, []),
146-
EEIFunction("executeOnDestContextByCaller", None, []),
147-
EEIFunction("executeOnSameContext", None, []),
148-
EEIFunction("executeReadOnly", None, []),
149-
EEIFunction("createContract", None, []),
150-
EEIFunction("deployFromSourceContract", None, []),
151-
EEIFunction("upgradeContract", None, []),
152-
EEIFunction("upgradeFromSourceContract", None, []),
153-
EEIFunction("asyncCall", None, []),
154-
EEIFunction("getNumReturnData", None, []),
155-
EEIFunction("getReturnDataSize", None, []),
156-
EEIFunction("getReturnData", None, []),
157-
EEIFunction("cleanReturnData", storageAPICostOptimizationEnableEpoch, []),
158-
EEIFunction("deleteFromReturnData", storageAPICostOptimizationEnableEpoch, []),
159-
EEIFunction("setStorageLock", None, []),
160-
EEIFunction("getStorageLock", None, []),
161-
EEIFunction("isStorageLocked", None, []),
162-
EEIFunction("clearStorageLock", None, []),
163-
EEIFunction("getBlockTimestamp", None, []),
164-
EEIFunction("getBlockNonce", None, []),
165-
EEIFunction("getBlockRound", None, []),
166-
EEIFunction("getBlockEpoch", None, []),
167-
EEIFunction("getBlockRandomSeed", None, []),
168-
EEIFunction("getStateRootHash", None, []),
169-
EEIFunction("getPrevBlockTimestamp", None, []),
170-
EEIFunction("getPrevBlockNonce", None, []),
171-
EEIFunction("getPrevBlockRound", None, []),
172-
EEIFunction("getPrevBlockEpoch", None, []),
173-
EEIFunction("getPrevBlockRandomSeed", None, []),
174-
EEIFunction("getOriginalTxHash", None, []),
175-
176-
# eei core (managed)
177-
EEIFunction("managedSCAddress", None, []),
178-
EEIFunction("managedOwnerAddress", None, []),
179-
EEIFunction("managedCaller", None, []),
180-
EEIFunction("managedSignalError", None, []),
181-
EEIFunction("managedWriteLog", None, []),
182-
EEIFunction("managedMultiTransferESDTNFTExecute", None, []),
183-
EEIFunction("managedTransferValueExecute", None, []),
184-
EEIFunction("managedExecuteOnDestContext", None, []),
185-
EEIFunction("managedExecuteOnDestContextByCaller", None, []),
186-
EEIFunction("managedExecuteOnSameContext", None, []),
187-
EEIFunction("managedExecuteReadOnly", None, []),
188-
EEIFunction("managedCreateContract", None, []),
189-
EEIFunction("managedDeployFromSourceContract", None, []),
190-
EEIFunction("managedUpgradeContract", None, []),
191-
EEIFunction("managedUpgradeFromSourceContract", None, []),
192-
EEIFunction("managedAsyncCall", None, []),
193-
EEIFunction("managedGetMultiESDTCallValue", None, []),
194-
EEIFunction("managedGetESDTBalance", None, []),
195-
EEIFunction("managedGetESDTTokenData", None, []),
196-
EEIFunction("managedGetReturnData", None, []),
197-
EEIFunction("managedGetPrevBlockRandomSeed", None, []),
198-
EEIFunction("managedGetBlockRandomSeed", None, []),
199-
EEIFunction("managedGetStateRootHash", None, []),
200-
EEIFunction("managedGetOriginalTxHash", None, []),
201-
202-
# crypto
203-
EEIFunction("sha256", None, []),
204-
EEIFunction("managedSha256", storageAPICostOptimizationEnableEpoch, []),
205-
EEIFunction("keccak256", None, []),
206-
EEIFunction("managedKeccak256", storageAPICostOptimizationEnableEpoch, []),
207-
EEIFunction("ripemd160", None, []),
208-
EEIFunction("verifyBLS", None, []),
209-
EEIFunction("verifyEd25519", None, []),
210-
EEIFunction("verifySecp256k1", None, []),
211-
EEIFunction("verifyCustomSecp256k1", None, []),
212-
EEIFunction("encodeSecp256k1DerSignature", None, []),
213-
EEIFunction("addEC", None, []),
214-
EEIFunction("doubleEC", None, []),
215-
EEIFunction("isOnCurveEC", None, []),
216-
EEIFunction("scalarBaseMultEC", None, []),
217-
EEIFunction("scalarMultEC", None, []),
218-
EEIFunction("marshalEC", None, []),
219-
EEIFunction("unmarshalEC", None, []),
220-
EEIFunction("marshalCompressedEC", None, []),
221-
EEIFunction("unmarshalCompressedEC", None, []),
222-
EEIFunction("generateKeyEC", None, []),
223-
EEIFunction("createEC", None, []),
224-
EEIFunction("getCurveLengthEC", None, []),
225-
EEIFunction("getPrivKeyByteLengthEC", None, []),
226-
EEIFunction("ellipticCurveGetValues", None, [])
12+
# e.g. EEIFunction("foobar", FeatureFlag("fooFeature"), []),
22713
]
228-
22914
self.functions_dict = {function.name: function for function in self.functions}
23015

23116
def sync_flags(self):
@@ -235,7 +20,8 @@ def sync_flags(self):
23520
def is_function_active(self, function_name: str) -> Union[bool, None]:
23621
function = self.functions_dict.get(function_name, None)
23722
if function is None:
238-
return False
23+
# If function is not found in this registry, assume it is <active> on all known networks.
24+
return True
23925
if function.activated_by is None:
24026
return True
24127
return function.activated_by.is_active

erdpy/projects/project_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def _do_after_build_custom(self) -> List[Path]:
8383
@final
8484
def _do_after_build_core(self):
8585
wabt.generate_artifacts(self)
86+
# TODO: Remove this, in the future
8687
eei_checks.check_compatibility(self)
8788

8889
def _copy_to_output(self, source: Path, destination: Union[str, None] = None) -> Path:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
with open("README.md", "r") as fh:
44
long_description = "https://github.com/ElrondNetwork/elrond-sdk-erdpy"
55

6-
VERSION = "2.0.4"
6+
VERSION = "2.1.0"
77

88
try:
99
with open('./erdpy/_version.py', 'wt') as versionfile:

0 commit comments

Comments
 (0)