multiversx-sdk-cli 11.2.2__tar.gz → 11.3.0__tar.gz

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.
Files changed (84) hide show
  1. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/PKG-INFO +2 -2
  2. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_default.py +3 -0
  3. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_general.py +10 -4
  4. multiversx_sdk_cli-11.3.0/multiversx_sdk_cli/localnet/constants.py +13 -0
  5. multiversx_sdk_cli-11.3.0/multiversx_sdk_cli/localnet/node_config_toml.py +129 -0
  6. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/nodes_setup_json.py +0 -9
  7. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/step_config.py +19 -15
  8. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/pyproject.toml +2 -2
  9. multiversx_sdk_cli-11.2.2/multiversx_sdk_cli/localnet/constants.py +0 -8
  10. multiversx_sdk_cli-11.2.2/multiversx_sdk_cli/localnet/node_config_toml.py +0 -83
  11. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/.gitignore +0 -0
  12. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/LICENSE +0 -0
  13. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/README.md +0 -0
  14. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/__init__.py +0 -0
  15. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/args_converter.py +0 -0
  16. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/args_validation.py +0 -0
  17. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli.py +0 -0
  18. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_config.py +0 -0
  19. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_config_env.py +0 -0
  20. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_config_wallet.py +0 -0
  21. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_contracts.py +0 -0
  22. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_data.py +0 -0
  23. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_delegation.py +0 -0
  24. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_deps.py +0 -0
  25. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_dns.py +0 -0
  26. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_faucet.py +0 -0
  27. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_get.py +0 -0
  28. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_governance.py +0 -0
  29. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_ledger.py +0 -0
  30. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_localnet.py +0 -0
  31. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_multisig.py +0 -0
  32. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_output.py +0 -0
  33. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_password.py +0 -0
  34. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_shared.py +0 -0
  35. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_tokens.py +0 -0
  36. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_transactions.py +0 -0
  37. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_validator_wallet.py +0 -0
  38. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_validators.py +0 -0
  39. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cli_wallet.py +0 -0
  40. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/config.py +0 -0
  41. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/config_env.py +0 -0
  42. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/config_wallet.py +0 -0
  43. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/constants.py +0 -0
  44. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/contract_verification.py +0 -0
  45. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/cosign_transaction.py +0 -0
  46. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/dependencies/__init__.py +0 -0
  47. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/dependencies/install.py +0 -0
  48. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/dependencies/modules.py +0 -0
  49. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/dependencies/resolution.py +0 -0
  50. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/dns.py +0 -0
  51. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/docker.py +0 -0
  52. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/downloader.py +0 -0
  53. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/errors.py +0 -0
  54. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/guardian_relayer_data.py +0 -0
  55. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/guards.py +0 -0
  56. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/interfaces.py +0 -0
  57. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/__init__.py +0 -0
  58. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_networking.py +0 -0
  59. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_part.py +0 -0
  60. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_root.py +0 -0
  61. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_sharding.py +0 -0
  62. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/config_software.py +0 -0
  63. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/genesis.py +0 -0
  64. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/genesis_json.py +0 -0
  65. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/genesis_smart_contracts_json.py +0 -0
  66. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/libraries.py +0 -0
  67. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/node.py +0 -0
  68. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/p2p_toml.py +0 -0
  69. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/seednode_p2pKey.pem +0 -0
  70. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/step_build_software.py +0 -0
  71. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/step_clean.py +0 -0
  72. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/step_new.py +0 -0
  73. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/step_prerequisites.py +0 -0
  74. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/step_start.py +0 -0
  75. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/localnet/wallets.py +0 -0
  76. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/myprocess.py +0 -0
  77. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/sign_verify.py +0 -0
  78. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/signing_wrapper.py +0 -0
  79. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/simulation.py +0 -0
  80. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/transactions.py +0 -0
  81. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/utils.py +0 -0
  82. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/ux.py +0 -0
  83. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/version.py +0 -0
  84. {multiversx_sdk_cli-11.2.2 → multiversx_sdk_cli-11.3.0}/multiversx_sdk_cli/workstation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiversx-sdk-cli
3
- Version: 11.2.2
3
+ Version: 11.3.0
4
4
  Summary: MultiversX Smart Contracts Tools
5
5
  Project-URL: Homepage, https://github.com/multiversx/mx-sdk-py-cli
6
6
  Author: MultiversX
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Requires-Python: >=3.10
14
14
  Requires-Dist: argcomplete==3.2.2
15
15
  Requires-Dist: ledgercomm[hid]
16
- Requires-Dist: multiversx-sdk[ledger]==2.3.1
16
+ Requires-Dist: multiversx-sdk[ledger]==2.3.2
17
17
  Requires-Dist: requests<3.0.0,>=2.32.0
18
18
  Requires-Dist: rich==13.3.4
19
19
  Requires-Dist: toml>=0.10.2
@@ -15,6 +15,9 @@ general = General(
15
15
  genesis_delay_seconds=10,
16
16
  rounds_per_epoch=100,
17
17
  round_duration_milliseconds=6000,
18
+ # For the purpose of the localnet, we'll have 3x for Supernova (by default).
19
+ rounds_per_epoch_in_supernova=300,
20
+ round_duration_milliseconds_in_supernova=2000,
18
21
  )
19
22
 
20
23
  software = Software(
@@ -10,11 +10,15 @@ class General(ConfigPart):
10
10
  genesis_delay_seconds: int,
11
11
  rounds_per_epoch: int,
12
12
  round_duration_milliseconds: int,
13
+ rounds_per_epoch_in_supernova: int,
14
+ round_duration_milliseconds_in_supernova: int
13
15
  ):
14
- self.log_level: str = log_level
15
- self.genesis_delay_seconds: int = genesis_delay_seconds
16
- self.rounds_per_epoch: int = rounds_per_epoch
17
- self.round_duration_milliseconds: int = round_duration_milliseconds
16
+ self.log_level = log_level
17
+ self.genesis_delay_seconds = genesis_delay_seconds
18
+ self.rounds_per_epoch = rounds_per_epoch
19
+ self.round_duration_milliseconds = round_duration_milliseconds
20
+ self.rounds_per_epoch_in_supernova = rounds_per_epoch_in_supernova
21
+ self.round_duration_milliseconds_in_supernova = round_duration_milliseconds_in_supernova
18
22
 
19
23
  def get_name(self) -> str:
20
24
  return "general"
@@ -24,3 +28,5 @@ class General(ConfigPart):
24
28
  self.genesis_delay_seconds = other.get("genesis_delay_seconds", self.genesis_delay_seconds)
25
29
  self.rounds_per_epoch = other.get("rounds_per_epoch", self.rounds_per_epoch)
26
30
  self.round_duration_milliseconds = other.get("round_duration_milliseconds", self.round_duration_milliseconds)
31
+ self.rounds_per_epoch_in_supernova = other.get("rounds_per_epoch_in_supernova", self.rounds_per_epoch_in_supernova)
32
+ self.round_duration_milliseconds_in_supernova = other.get("round_duration_milliseconds_in_supernova", self.round_duration_milliseconds_in_supernova)
@@ -0,0 +1,13 @@
1
+ import stat
2
+
3
+ METACHAIN_ID = 4294967295
4
+ NETWORK_MONITORING_INTERVAL_IN_SECONDS = 1
5
+ # Read, write and execute by owner, read and execute by group and others
6
+ FILE_MODE_EXECUTABLE = (
7
+ stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH
8
+ )
9
+
10
+ # See https://github.com/multiversx/mx-chain-go/blob/master/cmd/node/config/config.toml.
11
+ ROUNDS_PER_EPOCH_TO_MIN_ROUNDS_BETWEEN_EPOCHS_RATIO = 4
12
+ # See https://github.com/multiversx/mx-chain-go/blob/master/cmd/node/config/enableRounds.toml.
13
+ NUM_ROUNDS_BETWEEN_SUPERNOVA_ACTIVATION_EPOCH_AND_ACTIVATION_ROUND = 20
@@ -0,0 +1,129 @@
1
+ from typing import Any, Dict
2
+
3
+ from multiversx_sdk_cli.localnet.config_root import ConfigRoot
4
+ from multiversx_sdk_cli.localnet.constants import (
5
+ NUM_ROUNDS_BETWEEN_SUPERNOVA_ACTIVATION_EPOCH_AND_ACTIVATION_ROUND,
6
+ ROUNDS_PER_EPOCH_TO_MIN_ROUNDS_BETWEEN_EPOCHS_RATIO,
7
+ )
8
+ from multiversx_sdk_cli.localnet.nodes_setup_json import CHAIN_ID
9
+
10
+ ConfigDict = Dict[str, Any]
11
+
12
+
13
+ def patch_config(data: ConfigDict, config: ConfigRoot, enable_epochs_config: ConfigDict):
14
+ supernova_activation_epoch = enable_epochs_config["EnableEpochs"].get("SupernovaEnableEpoch", None)
15
+
16
+ data["GeneralSettings"]["ChainID"] = CHAIN_ID
17
+
18
+ # "--operation-mode=historical-balances" is not available for nodes,
19
+ # since << validator cannot be a full archive node >>,
20
+ # but we attempt to set the "deep-history" mode as follows:
21
+ data["DbLookupExtensions"]["Enabled"] = True
22
+ data["GeneralSettings"]["StartInEpochEnabled"] = False
23
+ data["StateTriesConfig"]["AccountsStatePruningEnabled"] = False
24
+ data["StoragePruning"]["ObserverCleanOldEpochsData"] = False
25
+ data["StoragePruning"]["AccountsTrieCleanOldEpochsData"] = False
26
+
27
+ # Some time after the release of Supernova, we should drop this custom (and somewhat cumbersome) logic.
28
+ if supernova_activation_epoch is None:
29
+ # Before Supernova (as software version, not as "era after activation"),
30
+ # we alter epoch duration by adjusting "RoundsPerEpoch" and "MinRoundsBetweenEpochs" in section "EpochStartConfig".
31
+ # In a Supernova-aware node configuration, these entries do not exist anymore (see "ChainParametersByEpoch").
32
+ epoch_start_config: ConfigDict = dict()
33
+ epoch_start_config["RoundsPerEpoch"] = config.general.rounds_per_epoch
34
+ epoch_start_config["MinRoundsBetweenEpochs"] = int(
35
+ config.general.rounds_per_epoch / ROUNDS_PER_EPOCH_TO_MIN_ROUNDS_BETWEEN_EPOCHS_RATIO
36
+ )
37
+
38
+ data["EpochStartConfig"].update(epoch_start_config)
39
+
40
+ data["WebServerAntiflood"]["VmQueryDelayAfterStartInSec"] = 30
41
+
42
+ # Always use the latest VM
43
+ data["VirtualMachine"]["Execution"]["WasmVMVersions"] = [{"StartEpoch": 0, "Version": "*"}]
44
+ data["VirtualMachine"]["Querying"]["WasmVMVersions"] = [{"StartEpoch": 0, "Version": "*"}]
45
+
46
+ # Adjust "ChainParametersByEpoch"
47
+ chain_parameters_by_epoch = data["GeneralSettings"].get("ChainParametersByEpoch", [])
48
+
49
+ for item in chain_parameters_by_epoch:
50
+ enable_epoch = item["EnableEpoch"]
51
+
52
+ is_supernova_enabled = supernova_activation_epoch is not None and enable_epoch >= supernova_activation_epoch
53
+ if is_supernova_enabled:
54
+ item["RoundDuration"] = config.general.round_duration_milliseconds_in_supernova
55
+ item["RoundsPerEpoch"] = config.general.rounds_per_epoch_in_supernova
56
+ item["MinRoundsBetweenEpochs"] = int(
57
+ config.general.rounds_per_epoch_in_supernova / ROUNDS_PER_EPOCH_TO_MIN_ROUNDS_BETWEEN_EPOCHS_RATIO
58
+ )
59
+ else:
60
+ item["RoundDuration"] = config.general.round_duration_milliseconds
61
+ item["RoundsPerEpoch"] = config.general.rounds_per_epoch
62
+ item["MinRoundsBetweenEpochs"] = int(
63
+ config.general.rounds_per_epoch / ROUNDS_PER_EPOCH_TO_MIN_ROUNDS_BETWEEN_EPOCHS_RATIO
64
+ )
65
+
66
+ item["ShardConsensusGroupSize"] = config.shards.consensus_size
67
+ item["ShardMinNumNodes"] = config.shards.num_validators_per_shard
68
+ item["MetachainConsensusGroupSize"] = config.metashard.consensus_size
69
+ item["MetachainMinNumNodes"] = config.metashard.num_validators
70
+
71
+ # Adjust "Versions" (of blocks)
72
+ versions_by_epoch = data["Versions"].get("VersionsByEpochs", [])
73
+
74
+ for item in versions_by_epoch:
75
+ enable_epoch = item["StartEpoch"]
76
+
77
+ if enable_epoch == supernova_activation_epoch:
78
+ item["StartRound"] = _compute_supernova_activation_round(config, supernova_activation_epoch)
79
+
80
+
81
+ def patch_api(data: ConfigDict, config: ConfigRoot):
82
+ routes = data["APIPackages"]["transaction"]["Routes"]
83
+ for route in routes:
84
+ route["Open"] = True
85
+
86
+
87
+ def patch_enable_epochs(data: ConfigDict, config: ConfigRoot):
88
+ enable_epochs = data["EnableEpochs"]
89
+ enable_epochs["AheadOfTimeGasUsageEnableEpoch"] = 0
90
+ enable_epochs["GasPriceModifierEnableEpoch"] = 0
91
+ enable_epochs["RepairCallbackEnableEpoch"] = 0
92
+ enable_epochs["ReturnDataToLastTransferEnableEpoch"] = 0
93
+ enable_epochs["SenderInOutTransferEnableEpoch"] = 0
94
+ enable_epochs["ESDTEnableEpoch"] = 0
95
+ enable_epochs["IncrementSCRNonceInMultiTransferEnableEpoch"] = 0
96
+ enable_epochs["ESDTMultiTransferEnableEpoch"] = 0
97
+ enable_epochs["GlobalMintBurnDisableEpoch"] = 0
98
+ enable_epochs["ESDTTransferRoleEnableEpoch"] = 0
99
+ enable_epochs["MultiESDTTransferFixOnCallBackOnEnableEpoch"] = 0
100
+ enable_epochs["ESDTNFTCreateOnMultiShard"] = 0
101
+ enable_epochs["MetaESDTSetEnableEpoch"] = 0
102
+ enable_epochs["DelegationManagerEnableEpoch"] = 0
103
+
104
+ # Adjust "MaxNumNodes":
105
+ max_nodes_change_enable_epoch = enable_epochs["MaxNodesChangeEnableEpoch"]
106
+ last_entry = max_nodes_change_enable_epoch[-1]
107
+ penultimate_entry = max_nodes_change_enable_epoch[-2]
108
+ last_entry["MaxNumNodes"] = (
109
+ penultimate_entry["MaxNumNodes"] - (config.shards.num_shards + 1) * penultimate_entry["NodesToShufflePerShard"]
110
+ )
111
+
112
+
113
+ def patch_enable_rounds(data: ConfigDict, config: ConfigRoot, enable_epochs_config: ConfigDict):
114
+ supernova_activation_epoch = enable_epochs_config["EnableEpochs"].get("SupernovaEnableEpoch", None)
115
+
116
+ activations = data["RoundActivations"]
117
+ supernova_entry = activations.get("SupernovaEnableRound")
118
+
119
+ if supernova_entry and supernova_activation_epoch is not None:
120
+ supernova_computed_activation_round = _compute_supernova_activation_round(config, supernova_activation_epoch)
121
+ supernova_entry["Round"] = str(supernova_computed_activation_round)
122
+
123
+
124
+ def _compute_supernova_activation_round(config: ConfigRoot, supernova_activation_epoch: int) -> int:
125
+ # Epochs are zero-indexed.
126
+ return (
127
+ config.general.rounds_per_epoch * supernova_activation_epoch
128
+ + NUM_ROUNDS_BETWEEN_SUPERNOVA_ACTIVATION_EPOCH_AND_ACTIVATION_ROUND
129
+ )
@@ -26,14 +26,5 @@ def build(config: ConfigRoot) -> Any:
26
26
 
27
27
  return {
28
28
  "startTime": config.genesis_time(),
29
- "roundDuration": config.general.round_duration_milliseconds,
30
- "consensusGroupSize": config.shards.consensus_size,
31
- "minNodesPerShard": config.shards.consensus_size,
32
- "metaChainConsensusGroupSize": config.metashard.consensus_size,
33
- "metaChainMinNodes": config.metashard.num_validators,
34
- "hysteresis": 0,
35
- "adaptivity": False,
36
- "chainID": CHAIN_ID,
37
- "minTransactionVersion": 1,
38
29
  "initialNodes": initial_nodes,
39
30
  }
@@ -101,24 +101,28 @@ def copy_validator_keys(config: ConfigRoot):
101
101
  def patch_node_config(config: ConfigRoot):
102
102
  for node_config in config.all_nodes_config_folders():
103
103
  node_config_file = node_config / "config.toml"
104
- data = utils.read_toml_file(node_config_file)
105
- node_config_toml.patch_config(data, config)
106
- utils.write_toml_file(node_config_file, data)
107
-
108
104
  api_config_file = node_config / "api.toml"
109
- data = utils.read_toml_file(api_config_file)
110
- node_config_toml.patch_api(data, config)
111
- utils.write_toml_file(api_config_file, data)
112
-
113
105
  enable_epochs_config_file = node_config / "enableEpochs.toml"
114
- data = utils.read_toml_file(enable_epochs_config_file)
115
- node_config_toml.patch_enable_epochs(data, config)
116
- utils.write_toml_file(enable_epochs_config_file, data)
117
-
106
+ enable_rounds_config_file = node_config / "enableRounds.toml"
118
107
  genesis_smart_contracts_file = node_config / "genesisSmartContracts.json"
119
- data = utils.read_json_file(genesis_smart_contracts_file)
120
- genesis_smart_contracts_json.patch(data, config)
121
- utils.write_json_file(genesis_smart_contracts_file, data)
108
+
109
+ node_config_data = utils.read_toml_file(node_config_file)
110
+ api_config_data = utils.read_toml_file(api_config_file)
111
+ enable_epochs_config_data = utils.read_toml_file(enable_epochs_config_file)
112
+ enable_rounds_config_data = utils.read_toml_file(enable_rounds_config_file)
113
+ genesis_smart_contracts_data = utils.read_json_file(genesis_smart_contracts_file)
114
+
115
+ node_config_toml.patch_config(node_config_data, config, enable_epochs_config_data)
116
+ node_config_toml.patch_api(api_config_data, config)
117
+ node_config_toml.patch_enable_epochs(enable_epochs_config_data, config)
118
+ node_config_toml.patch_enable_rounds(enable_rounds_config_data, config, enable_epochs_config_data)
119
+ genesis_smart_contracts_json.patch(genesis_smart_contracts_data, config)
120
+
121
+ utils.write_toml_file(node_config_file, node_config_data)
122
+ utils.write_toml_file(api_config_file, api_config_data)
123
+ utils.write_toml_file(enable_epochs_config_file, enable_epochs_config_data)
124
+ utils.write_toml_file(enable_rounds_config_file, enable_rounds_config_data)
125
+ utils.write_json_file(genesis_smart_contracts_file, genesis_smart_contracts_data)
122
126
 
123
127
 
124
128
  def copy_config_to_seednode(config: ConfigRoot):
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "multiversx-sdk-cli"
7
- version = "11.2.2"
7
+ version = "11.3.0"
8
8
  authors = [
9
9
  { name="MultiversX" },
10
10
  ]
@@ -25,7 +25,7 @@ dependencies = [
25
25
  "ledgercomm[hid]",
26
26
  "rich==13.3.4",
27
27
  "argcomplete==3.2.2",
28
- "multiversx-sdk[ledger]==2.3.1"
28
+ "multiversx-sdk[ledger]==2.3.2"
29
29
  ]
30
30
 
31
31
  [project.scripts]
@@ -1,8 +0,0 @@
1
- import stat
2
-
3
- METACHAIN_ID = 4294967295
4
- NETWORK_MONITORING_INTERVAL_IN_SECONDS = 1
5
- # Read, write and execute by owner, read and execute by group and others
6
- FILE_MODE_EXECUTABLE = (
7
- stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH
8
- )
@@ -1,83 +0,0 @@
1
- from typing import Any, Dict
2
-
3
- from multiversx_sdk_cli.localnet.config_root import ConfigRoot
4
- from multiversx_sdk_cli.localnet.nodes_setup_json import CHAIN_ID
5
-
6
- ConfigDict = Dict[str, Any]
7
-
8
-
9
- def patch_config(data: ConfigDict, config: ConfigRoot):
10
- data["GeneralSettings"]["ChainID"] = CHAIN_ID
11
-
12
- # "--operation-mode=historical-balances" is not available for nodes,
13
- # since << validator cannot be a full archive node >>,
14
- # but we attempt to set the "deep-history" mode as follows:
15
- data["DbLookupExtensions"]["Enabled"] = True
16
- data["GeneralSettings"]["StartInEpochEnabled"] = False
17
- data["StateTriesConfig"]["AccountsStatePruningEnabled"] = False
18
- data["StoragePruning"]["ObserverCleanOldEpochsData"] = False
19
- data["StoragePruning"]["AccountsTrieCleanOldEpochsData"] = False
20
-
21
- # Make epochs shorter
22
- epoch_start_config: ConfigDict = dict()
23
- epoch_start_config["RoundsPerEpoch"] = config.general.rounds_per_epoch
24
- epoch_start_config["MinRoundsBetweenEpochs"] = int(config.general.rounds_per_epoch / 4)
25
-
26
- data["EpochStartConfig"].update(epoch_start_config)
27
- data["WebServerAntiflood"]["VmQueryDelayAfterStartInSec"] = 30
28
-
29
- # Always use the latest VM
30
- data["VirtualMachine"]["Execution"]["WasmVMVersions"] = [{"StartEpoch": 0, "Version": "*"}]
31
- data["VirtualMachine"]["Querying"]["WasmVMVersions"] = [{"StartEpoch": 0, "Version": "*"}]
32
-
33
- # Adjust "ChainParametersByEpoch" (for Andromeda)
34
- chain_parameters_by_epoch = data["GeneralSettings"].get("ChainParametersByEpoch", [])
35
-
36
- if chain_parameters_by_epoch:
37
- # For convenience, keep a single entry ...
38
- chain_parameters_by_epoch.clear()
39
- chain_parameters_by_epoch.append({})
40
-
41
- # ... and set the activation epoch to 0
42
- chain_parameters_by_epoch[0]["EnableEpoch"] = 0
43
- chain_parameters_by_epoch[0]["RoundDuration"] = config.general.round_duration_milliseconds
44
- chain_parameters_by_epoch[0]["ShardConsensusGroupSize"] = config.shards.consensus_size
45
- chain_parameters_by_epoch[0]["ShardMinNumNodes"] = config.shards.num_validators_per_shard
46
- chain_parameters_by_epoch[0]["MetachainConsensusGroupSize"] = config.metashard.consensus_size
47
- chain_parameters_by_epoch[0]["MetachainMinNumNodes"] = config.metashard.num_validators
48
-
49
-
50
- def patch_api(data: ConfigDict, config: ConfigRoot):
51
- routes = data["APIPackages"]["transaction"]["Routes"]
52
- for route in routes:
53
- route["Open"] = True
54
-
55
-
56
- def patch_enable_epochs(data: ConfigDict, config: ConfigRoot):
57
- enable_epochs = data["EnableEpochs"]
58
- enable_epochs["SCDeployEnableEpoch"] = 0
59
- enable_epochs["BuiltInFunctionsEnableEpoch"] = 0
60
- enable_epochs["RelayedTransactionsEnableEpoch"] = 0
61
- enable_epochs["PenalizedTooMuchGasEnableEpoch"] = 0
62
- enable_epochs["AheadOfTimeGasUsageEnableEpoch"] = 0
63
- enable_epochs["GasPriceModifierEnableEpoch"] = 0
64
- enable_epochs["RepairCallbackEnableEpoch"] = 0
65
- enable_epochs["ReturnDataToLastTransferEnableEpoch"] = 0
66
- enable_epochs["SenderInOutTransferEnableEpoch"] = 0
67
- enable_epochs["ESDTEnableEpoch"] = 0
68
- enable_epochs["IncrementSCRNonceInMultiTransferEnableEpoch"] = 0
69
- enable_epochs["ESDTMultiTransferEnableEpoch"] = 0
70
- enable_epochs["GlobalMintBurnDisableEpoch"] = 0
71
- enable_epochs["ESDTTransferRoleEnableEpoch"] = 0
72
- enable_epochs["BuiltInFunctionOnMetaEnableEpoch"] = 0
73
- enable_epochs["MultiESDTTransferFixOnCallBackOnEnableEpoch"] = 0
74
- enable_epochs["ESDTNFTCreateOnMultiShard"] = 0
75
- enable_epochs["MetaESDTSetEnableEpoch"] = 0
76
- enable_epochs["DelegationManagerEnableEpoch"] = 0
77
-
78
- max_nodes_change_enable_epoch = enable_epochs["MaxNodesChangeEnableEpoch"]
79
- last_entry = max_nodes_change_enable_epoch[-1]
80
- penultimate_entry = max_nodes_change_enable_epoch[-2]
81
- last_entry["MaxNumNodes"] = (
82
- penultimate_entry["MaxNumNodes"] - (config.shards.num_shards + 1) * penultimate_entry["NodesToShufflePerShard"]
83
- )