diff --git a/containers/api/Dockerfile b/containers/api/Dockerfile index 5a4c0cb..925a704 100644 --- a/containers/api/Dockerfile +++ b/containers/api/Dockerfile @@ -19,8 +19,8 @@ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && sudo ap RUN sudo apt install git -y RUN sudo apt install ffmpeg -y RUN sudo npm install -g @nestjs/cli -RUN git clone https://github.com/multiversx/mx-api-service.git -b development -RUN cd mx-api-service && git checkout 8cc3910 +RUN git clone https://github.com/multiversx/mx-api-service.git -b main +RUN cd mx-api-service && git checkout 93a9abd0033050e46242836c6cf12e7b396e294c RUN cd mx-api-service && npm install RUN rm -rf mx-api-service/config/config.devnet.json COPY api-config.devnet.yaml mx-api-service/config/config.devnet.yaml diff --git a/containers/api/api-config.devnet.yaml b/containers/api/api-config.devnet.yaml index 505d99c..d41444e 100644 --- a/containers/api/api-config.devnet.yaml +++ b/containers/api/api-config.devnet.yaml @@ -3,7 +3,6 @@ metaChainShardId: 4294967295 api: public: true private: false - auth: false cron: transactionProcessor: true transactionProcessorMaxLookBehind: 100 @@ -15,21 +14,52 @@ cron: fastWarm: true queueWorker: true elasticUpdater: false + statusChecker: false flags: useRequestCaching: true useKeepAliveAgent: true - useTracing: true - useRequestLogging: true - useVmQueryTracing: true + useTracing: false + useRequestLogging: false + useVmQueryTracing: false processNfts: false indexer-v3: true + collectionPropertiesFromGateway: false features: eventsNotifier: enabled: false port: 5674 - url: 'amqp://guest:guest@127.0.0.1:5672' + url: 'amqp://guest:guest@127.0.0.1:5673' exchange: 'all_events' queue: 'api-process-logs-and-events' + guestCaching: + enabled: false + hitsThreshold: 100 + ttl: 12 + transactionPool: + enabled: true + transactionPoolWarmer: + enabled: true + cronExpression: '*/5 * * * * *' + ttlInSeconds: 60 + updateCollectionExtraDetails: + enabled: false + marketplace: + enabled: false + serviceUrl: 'https://devnet-nfts-graph.multiversx.com/graphql' + exchange: + enabled: false + serviceUrl: 'https://devnet-graph.xexchange.com/graphql' + dataApi: + enabled: false + serviceUrl: 'https://devnet-data-api.multiversx.com' + auth: + enabled: false + maxExpirySeconds: 86400 + acceptedOrigins: + - '' + admins: + - '' + jwtSecret: '' image: width: 600 height: 600 @@ -40,12 +70,12 @@ aws: s3Bucket: 'devnet-media.elrond.com' s3Region: '' urls: - api: - - 'http://localhost:3001' + self: 'http://localhost:3001' elastic: - 'http://elastic:9200' gateway: - 'http://localnet:7950' + verifier: 'https://play-api.multiversx.com' redis: 'redis' rabbitmq: 'amqp://rabbitmq:5672' providers: 'https://devnet-delegation-api.multiversx.com/providers' @@ -90,12 +120,6 @@ inflation: - 1130177 - 924690 - 719203 -security: - admins: - jwtSecret: nftProcess: parallelism: 1 maxRetries: 3 -transaction-action: - mex: - microServiceUrl: '' diff --git a/containers/localnet/Dockerfile b/containers/localnet/Dockerfile index 8d9f072..5b7ea9e 100644 --- a/containers/localnet/Dockerfile +++ b/containers/localnet/Dockerfile @@ -15,7 +15,6 @@ COPY replace_localnet_toml.py replace_localnet_toml.py COPY genesis.json genesis.json COPY create_wallet.py create_wallet.py COPY change_genesis.py change_genesis.py -COPY temp_copy_libs.py temp_copy_libs.py COPY economics.toml economics.toml COPY replace_economics.py replace_economics.py COPY add_result.py add_result.py @@ -26,6 +25,9 @@ COPY pause.sh pause.sh COPY handle_signal.sh handle_signal.sh COPY mxops-init mxops-init COPY run_mxops.py run_mxops.py +COPY temp_replace_enable_epochs.py temp_replace_enable_epochs.py +COPY temp_replace_genesis_smart_contracts.py temp_replace_genesis_smart_contracts.py +COPY tempGenesisContracts genesisContracts RUN sudo chmod +x pause.sh RUN sudo chmod +x handle_signal.sh diff --git a/containers/localnet/change_prefs.py b/containers/localnet/change_prefs.py index 8d52eab..0c8e91a 100644 --- a/containers/localnet/change_prefs.py +++ b/containers/localnet/change_prefs.py @@ -5,6 +5,7 @@ should_use_elastic = sys.argv[1] == 'true' prefs_to_add = f""" +[Preferences] OverridableConfigTomlValues = [ {{ File = "external.toml", Path = "ElasticSearchConnector.Enabled", Value = "{should_use_elastic}" }}, {{ File = "external.toml", Path = "ElasticSearchConnector.URL", Value = "http://elastic:9200" }}, @@ -21,7 +22,7 @@ def replace_in_files(): if os.path.exists(external_toml_path): with open(external_toml_path, 'r') as file: contents = file.read() - contents = contents + prefs_to_add + contents = prefs_to_add + contents.replace("[Preferences]", "") with open(external_toml_path, 'w') as file: file.write(contents) diff --git a/containers/localnet/replace_localnet_toml.py b/containers/localnet/replace_localnet_toml.py index f88b9ee..59aa839 100644 --- a/containers/localnet/replace_localnet_toml.py +++ b/containers/localnet/replace_localnet_toml.py @@ -8,7 +8,7 @@ port_proxy = 7950 [shards] -num_shards = 3 +num_shards = {num_shards} [software.mx_chain_go] resolution = "local" diff --git a/containers/localnet/run.sh b/containers/localnet/run.sh index be2320f..018a130 100644 --- a/containers/localnet/run.sh +++ b/containers/localnet/run.sh @@ -37,6 +37,10 @@ setup() { cp systemSmartContractsConfig.toml localnet/systemSmartContractsConfig.toml cp replace_system_contracts_config.py localnet/replace_system_contracts_config.py + cp temp_replace_enable_epochs.py localnet/temp_replace_enable_epochs.py # Workaround while mxpy doesn't support v1.7.0 localnet + cp temp_replace_genesis_smart_contracts.py localnet/temp_replace_genesis_smart_contracts.py # Workaround while mxpy doesn't support v1.7.0 localnet + cp -R genesisContracts localnet/genesisContracts # Workaround while mxpy doesn't support v1.7.0 localnet + echo "Changing nodes system contracts config..." cd localnet && sudo python3 replace_system_contracts_config.py && cd .. @@ -48,6 +52,12 @@ setup() { echo "Changing nodes economics..." cd localnet && sudo python3 replace_economics.py "$MX_RESULT_TOTAL_SUPPLY" && cd .. + + echo "Applying workaround for enableEpochs..." + cd localnet && sudo python3 temp_replace_enable_epochs.py && cd .. + + echo "Applying workaround for genesisContracts..." + cd localnet && sudo python3 temp_replace_genesis_smart_contracts.py && cd .. } if [ "$(python3 read_result.py "state")" != "paused" ]; then diff --git a/containers/localnet/systemSmartContractsConfig.toml b/containers/localnet/systemSmartContractsConfig.toml index 781abbd..72503e1 100644 --- a/containers/localnet/systemSmartContractsConfig.toml +++ b/containers/localnet/systemSmartContractsConfig.toml @@ -2,24 +2,24 @@ GenesisNodePrice = "2500000000000000000000" #2.5K eGLD MinStakeValue = "100000000000000000000" #100 eGLD MinUnstakeTokensValue = "10000000000000000000" #10eGLD -UnBondPeriod = 144000 -UnBondPeriodInEpochs = 10 +UnBondPeriod = 250 +UnBondPeriodInEpochs = 1 MinStepValue = "100000000000000000000" NumRoundsWithoutBleed = 100 MaximumPercentageToBleed = 0.5 BleedPercentagePerRound = 0.00001 -MaxNumberOfNodesForStake = 2169 +MaxNumberOfNodesForStake = 64 UnJailValue = "2500000000000000000" #0.1% of genesis node price -ActivateBLSPubKeyMessageVerification = true +ActivateBLSPubKeyMessageVerification = false StakeLimitPercentage = 1.0 #fraction of value 1 - 100%, for the time being no stake limit NodeLimitPercentage = 0.1 #fraction of value 0.1 - 10% [ESDTSystemSCConfig] BaseIssuingCost = "50000000000000000" #0.05 eGLD -OwnerAddress = "erd1ze6pgefwc7mdx0rhje3h50kkgt26ut3gx8ytezndkz8fjcf96gsqsd7ugw" +OwnerAddress = "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c" [GovernanceSystemSCConfig] -OwnerAddress = "erd1qqqqqqqqqqqqqpgq0gq09608js3gje72v0yzc56k6glc852gl94sgtahk2" +OwnerAddress = "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80" #should use a multisign contract instead of a wallet address [GovernanceSystemSCConfig.V1] NumNodes = 500 ProposalCost = "5000000000000000000" #5 eGLD @@ -29,14 +29,14 @@ MinVetoThreshold = 50 [GovernanceSystemSCConfig.Active] ProposalCost = "1000000000000000000000" #1000 eGLD LostProposalFee = "10000000000000000000" #10 eGLD -MinQuorum = 0.2 #fraction of value 0.2 - 20% +MinQuorum = 0.2 #fraction of value 0.2 - 20% MinPassThreshold = 0.5 #fraction of value 0.5 - 50% MinVetoThreshold = 0.33 #fraction of value 0.33 - 33% [DelegationManagerSystemSCConfig] MinCreationDeposit = "1250000000000000000000" #1.25K eGLD -MinStakeAmount = "1000000000000000000" #1 eGLD -ConfigChangeAddress = "erd1qqqqqqqqqqqqqpgq0gq09608js3gje72v0yzc56k6glc852gl94sgtahk2" +MinStakeAmount = "10000000000000000000" #10 eGLD +ConfigChangeAddress = "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80" #should use a multisign contract instead of a wallet address [DelegationSystemSCConfig] MinServiceFee = 0 diff --git a/containers/localnet/tempGenesisContracts/delegation.wasm b/containers/localnet/tempGenesisContracts/delegation.wasm new file mode 100644 index 0000000..d00f3f7 Binary files /dev/null and b/containers/localnet/tempGenesisContracts/delegation.wasm differ diff --git a/containers/localnet/tempGenesisContracts/dns.wasm b/containers/localnet/tempGenesisContracts/dns.wasm new file mode 100644 index 0000000..ce692a1 Binary files /dev/null and b/containers/localnet/tempGenesisContracts/dns.wasm differ diff --git a/containers/localnet/temp_copy_libs.py b/containers/localnet/temp_copy_libs.py deleted file mode 100644 index d93888a..0000000 --- a/containers/localnet/temp_copy_libs.py +++ /dev/null @@ -1,23 +0,0 @@ -import os -import re -import subprocess - -def temp_copy_libs(): - cwd = os.getcwd() - - wasmer2_lib_files = [ - "libvmexeccapi.so", - "libvmexeccapi_arm.so", - "libvmexeccapi_arm.dylib", - ] - - validator_dirs = [dir_name for dir_name in os.listdir(cwd) if re.match(r'validator\d\d', dir_name)] - for validator_dir in validator_dirs: - for wasmer2_lib_file in wasmer2_lib_files: - source_path = os.path.join("/home/ubuntu/mx-chain-vm-go/wasmer2", wasmer2_lib_file) - dest_path = os.path.join(cwd, validator_dir, wasmer2_lib_file) - subprocess.run(f"cp {source_path} {dest_path}", shell=True) - - - -temp_copy_libs() diff --git a/containers/localnet/temp_replace_enable_epochs.py b/containers/localnet/temp_replace_enable_epochs.py new file mode 100644 index 0000000..2b1fda5 --- /dev/null +++ b/containers/localnet/temp_replace_enable_epochs.py @@ -0,0 +1,343 @@ +import os +import re +import subprocess + + +enable_epochs_content = """ + [EnableEpochs] + # SCDeployEnableEpoch represents the epoch when the deployment of smart contracts will be enabled + SCDeployEnableEpoch = 1 + + # BuiltInFunctionsEnableEpoch represents the epoch when the built in functions will be enabled + BuiltInFunctionsEnableEpoch = 1 + + # RelayedTransactionsEnableEpoch represents the epoch when the relayed transactions will be enabled + RelayedTransactionsEnableEpoch = 1 + + # PenalizedTooMuchGasEnableEpoch represents the epoch when the penalization for using too much gas will be enabled + PenalizedTooMuchGasEnableEpoch = 0 + + # SwitchJailWaitingEnableEpoch represents the epoch when the system smart contract processing at end of epoch is enabled + SwitchJailWaitingEnableEpoch = 0 + + # BelowSignedThresholdEnableEpoch represents the epoch when the change for computing rating for validators below signed rating is enabled + BelowSignedThresholdEnableEpoch = 0 + + # SwitchHysteresisForMinNodesEnableEpoch represents the epoch when the system smart contract changes its config to consider + # also (minimum) hysteresis nodes for the minimum number of nodes + SwitchHysteresisForMinNodesEnableEpoch = 1 + + # TransactionSignedWithTxHashEnableEpoch represents the epoch when the node will also accept transactions that are + # signed with the hash of transaction + TransactionSignedWithTxHashEnableEpoch = 1 + + # MetaProtectionEnableEpoch represents the epoch when the transactions to the metachain are checked to have enough gas + MetaProtectionEnableEpoch = 1 + + # AheadOfTimeGasUsageEnableEpoch represents the epoch when the cost of smart contract prepare changes from compiler per byte to ahead of time prepare per byte + AheadOfTimeGasUsageEnableEpoch = 1 + + # GasPriceModifierEnableEpoch represents the epoch when the gas price modifier in fee computation is enabled + GasPriceModifierEnableEpoch = 1 + + # RepairCallbackEnableEpoch represents the epoch when the callback repair is activated for scrs + RepairCallbackEnableEpoch = 1 + + # BlockGasAndFeesReCheckEnableEpoch represents the epoch when gas and fees used in each created or processed block are re-checked + BlockGasAndFeesReCheckEnableEpoch = 1 + + # BalanceWaitingListsEnableEpoch represents the epoch when the shard waiting lists are balanced at the start of an epoch + BalanceWaitingListsEnableEpoch = 1 + + # ReturnDataToLastTransferEnableEpoch represents the epoch when returned data is added to last output transfer for callbacks + ReturnDataToLastTransferEnableEpoch = 1 + + # SenderInOutTransferEnableEpoch represents the epoch when the feature of having different senders in output transfer is enabled + SenderInOutTransferEnableEpoch = 1 + + # StakeEnableEpoch represents the epoch when staking is enabled + StakeEnableEpoch = 0 + + # StakingV2EnableEpoch represents the epoch when staking v2 is enabled + StakingV2EnableEpoch = 1 + + # DoubleKeyProtectionEnableEpoch represents the epoch when the double key protection will be enabled + DoubleKeyProtectionEnableEpoch = 1 + + # ESDTEnableEpoch represents the epoch when ESDT is enabled + ESDTEnableEpoch = 1 + + # GovernanceEnableEpoch represents the epoch when governance is enabled + GovernanceEnableEpoch = 1 + + # DelegationManagerEnableEpoch represents the epoch when the delegation manager is enabled + # epoch should not be 0 + DelegationManagerEnableEpoch = 1 + + # DelegationSmartContractEnableEpoch represents the epoch when delegation smart contract is enabled + # epoch should not be 0 + DelegationSmartContractEnableEpoch = 1 + + # CorrectLastUnjailedEnableEpoch represents the epoch when the fix regaring the last unjailed node should apply + CorrectLastUnjailedEnableEpoch = 1 + + # RelayedTransactionsV2EnableEpoch represents the epoch when the relayed transactions V2 will be enabled + RelayedTransactionsV2EnableEpoch = 1 + + # UnbondTokensV2EnableEpoch represents the epoch when the new implementation of the unbond tokens function is available + UnbondTokensV2EnableEpoch = 1 + + # SaveJailedAlwaysEnableEpoch represents the epoch when saving jailed status at end of epoch will happen in all cases + SaveJailedAlwaysEnableEpoch = 1 + + # ReDelegateBelowMinCheckEnableEpoch represents the epoch when the check for the re-delegated value will be enabled + ReDelegateBelowMinCheckEnableEpoch = 1 + + # ValidatorToDelegationEnableEpoch represents the epoch when the validator-to-delegation feature will be enabled + ValidatorToDelegationEnableEpoch = 1 + + # IncrementSCRNonceInMultiTransferEnableEpoch represents the epoch when the fix for preventing the generation of the same SCRs + # is enabled. The fix is done by adding an extra increment. + IncrementSCRNonceInMultiTransferEnableEpoch = 1 + + # ESDTMultiTransferEnableEpoch represents the epoch when esdt multitransfer built in function is enabled + ESDTMultiTransferEnableEpoch = 1 + + # GlobalMintBurnDisableEpoch represents the epoch when the global mint and burn functions are disabled + GlobalMintBurnDisableEpoch = 1 + + # ESDTTransferRoleEnableEpoch represents the epoch when esdt transfer role set is enabled + ESDTTransferRoleEnableEpoch = 1 + + # ComputeRewardCheckpointEnableEpoch represents the epoch when compute rewards checkpoint epoch is enabled + ComputeRewardCheckpointEnableEpoch = 1 + + # SCRSizeInvariantCheckEnableEpoch represents the epoch when the scr size invariant check is enabled + SCRSizeInvariantCheckEnableEpoch = 1 + + # BackwardCompSaveKeyValueEnableEpoch represents the epoch when the backward compatibility for save key value error is enabled + BackwardCompSaveKeyValueEnableEpoch = 1 + + # ESDTNFTCreateOnMultiShardEnableEpoch represents the epoch when esdt nft creation is enabled on multiple shards + ESDTNFTCreateOnMultiShardEnableEpoch = 1 + + # MetaESDTSetEnableEpoch represents the epoch when the backward compatibility for save key value error is enabled + MetaESDTSetEnableEpoch = 1 + + # AddTokensToDelegationEnableEpoch represents the epoch when adding tokens to delegation is enabled for whitelisted address + AddTokensToDelegationEnableEpoch = 1 + + # MultiESDTTransferFixOnCallBackOnEnableEpoch represents the epoch when multi esdt transfer on callback fix is enabled + MultiESDTTransferFixOnCallBackOnEnableEpoch = 1 + + # OptimizeGasUsedInCrossMiniBlocksEnableEpoch represents the epoch when gas used in cross shard mini blocks will be optimized + OptimizeGasUsedInCrossMiniBlocksEnableEpoch = 1 + + # CorrectFirstQueuedEpoch represents the epoch when the backward compatibility for setting the first queued node is enabled + CorrectFirstQueuedEpoch = 1 + + # DeleteDelegatorAfterClaimRewardsEnableEpoch represents the epoch when the delegators data is deleted for delegators that have to claim rewards after they withdraw all funds + DeleteDelegatorAfterClaimRewardsEnableEpoch = 1 + + # FixOOGReturnCodeEnableEpoch represents the epoch when the backward compatibility returning out of gas error is enabled + FixOOGReturnCodeEnableEpoch = 1 + + # RemoveNonUpdatedStorageEnableEpoch represents the epoch when the backward compatibility for removing non updated storage is enabled + RemoveNonUpdatedStorageEnableEpoch = 1 + + # OptimizeNFTStoreEnableEpoch represents the epoch when optimizations on NFT metadata store and send are enabled + OptimizeNFTStoreEnableEpoch = 1 + + # CreateNFTThroughExecByCallerEnableEpoch represents the epoch when nft creation through execution on destination by caller is enabled + CreateNFTThroughExecByCallerEnableEpoch = 1 + + # StopDecreasingValidatorRatingWhenStuckEnableEpoch represents the epoch when we should stop decreasing validator's rating if, for instance, a shard gets stuck + StopDecreasingValidatorRatingWhenStuckEnableEpoch = 1 + + # FrontRunningProtectionEnableEpoch represents the epoch when the first version of protection against front running is enabled + FrontRunningProtectionEnableEpoch = 1 + + # IsPayableBySCEnableEpoch represents the epoch when a new flag isPayable by SC is enabled + IsPayableBySCEnableEpoch = 1 + + # CleanUpInformativeSCRsEnableEpoch represents the epoch when the informative-only scrs are cleaned from miniblocks and logs are created from them + CleanUpInformativeSCRsEnableEpoch = 1 + + # StorageAPICostOptimizationEnableEpoch represents the epoch when new storage helper functions are enabled and cost is reduced in Wasm VM + StorageAPICostOptimizationEnableEpoch = 1 + + # TransformToMultiShardCreateEnableEpoch represents the epoch when the new function on esdt system sc is enabled to transfer create role into multishard + TransformToMultiShardCreateEnableEpoch = 1 + + # ESDTRegisterAndSetAllRolesEnableEpoch represents the epoch when new function to register tickerID and set all roles is enabled + ESDTRegisterAndSetAllRolesEnableEpoch = 1 + + # ScheduledMiniBlocksEnableEpoch represents the epoch when scheduled mini blocks would be created if needed + ScheduledMiniBlocksEnableEpoch = 1 + + # CorrectJailedNotUnstakedEpoch represents the epoch when the jailed validators will also be unstaked if the queue is empty + CorrectJailedNotUnstakedEmptyQueueEpoch = 1 + + # DoNotReturnOldBlockInBlockchainHookEnableEpoch represents the epoch when the fetch old block operation is + # disabled in the blockchain hook component + DoNotReturnOldBlockInBlockchainHookEnableEpoch = 1 + + # AddFailedRelayedTxToInvalidMBsDisableEpoch represents the epoch when adding the failed relayed txs to invalid miniblocks is disabled + AddFailedRelayedTxToInvalidMBsDisableEpoch = 1 + + # SCRSizeInvariantOnBuiltInResultEnableEpoch represents the epoch when scr size invariant on built in result is enabled + SCRSizeInvariantOnBuiltInResultEnableEpoch = 1 + + # CheckCorrectTokenIDForTransferRoleEnableEpoch represents the epoch when the correct token ID check is applied for transfer role verification + CheckCorrectTokenIDForTransferRoleEnableEpoch = 1 + + # DisableExecByCallerEnableEpoch represents the epoch when the check on value is disabled on exec by caller + DisableExecByCallerEnableEpoch = 1 + + # RefactorContextEnableEpoch represents the epoch when refactoring/simplifying is enabled in contexts + RefactorContextEnableEpoch = 1 + + # FailExecutionOnEveryAPIErrorEnableEpoch represent the epoch when new protection in VM is enabled to fail all wrong API calls + FailExecutionOnEveryAPIErrorEnableEpoch = 1 + + # ManagedCryptoAPIsEnableEpoch represents the epoch when new managed crypto APIs are enabled in the wasm VM + ManagedCryptoAPIsEnableEpoch = 1 + + # CheckFunctionArgumentEnableEpoch represents the epoch when the extra argument check is enabled in vm-common + CheckFunctionArgumentEnableEpoch = 1 + + # CheckExecuteOnReadOnlyEnableEpoch represents the epoch when the extra checks are enabled for execution on read only + CheckExecuteOnReadOnlyEnableEpoch = 1 + + # ESDTMetadataContinuousCleanupEnableEpoch represents the epoch when esdt metadata is automatically deleted according to inshard liquidity + ESDTMetadataContinuousCleanupEnableEpoch = 1 + + # MiniBlockPartialExecutionEnableEpoch represents the epoch when mini block partial execution will be enabled + MiniBlockPartialExecutionEnableEpoch = 1 + + # FixAsyncCallBackArgsListEnableEpoch represents the epoch when the async callback arguments lists fix will be enabled + FixAsyncCallBackArgsListEnableEpoch = 1 + + # FixOldTokenLiquidityEnableEpoch represents the epoch when the fix for old token liquidity is enabled + FixOldTokenLiquidityEnableEpoch = 1 + + # RuntimeMemStoreLimitEnableEpoch represents the epoch when the condition for Runtime MemStore is enabled + RuntimeMemStoreLimitEnableEpoch = 1 + + # SetSenderInEeiOutputTransferEnableEpoch represents the epoch when setting the sender in eei output transfers will be enabled + SetSenderInEeiOutputTransferEnableEpoch = 1 + + # RefactorPeersMiniBlocksEnableEpoch represents the epoch when refactor of the peers mini blocks will be enabled + RefactorPeersMiniBlocksEnableEpoch = 1 + + # MaxBlockchainHookCountersEnableEpoch represents the epoch when the max blockchainhook counters are enabled + MaxBlockchainHookCountersEnableEpoch = 1 + + # WipeSingleNFTLiquidityDecreaseEnableEpoch represents the epoch when the system account liquidity is decreased for wipeSingleNFT as well + WipeSingleNFTLiquidityDecreaseEnableEpoch = 1 + + # AlwaysSaveTokenMetaDataEnableEpoch represents the epoch when the token metadata is always saved + AlwaysSaveTokenMetaDataEnableEpoch = 1 + + # RuntimeCodeSizeFixEnableEpoch represents the epoch when the code size fix in the VM is enabled + RuntimeCodeSizeFixEnableEpoch = 1 + + # RelayedNonceFixEnableEpoch represents the epoch when the nonce fix for relayed txs is enabled + RelayedNonceFixEnableEpoch = 1 + + # SetGuardianEnableEpoch represents the epoch when the guard account feature is enabled in the protocol + SetGuardianEnableEpoch = 1 + + # DeterministicSortOnValidatorsInfoEnableEpoch represents the epoch when the deterministic sorting on validators info is enabled + DeterministicSortOnValidatorsInfoEnableEpoch = 1 + + # SCProcessorV2EnableEpoch represents the epoch when SC processor V2 will be used + SCProcessorV2EnableEpoch = 1 + + # AutoBalanceDataTriesEnableEpoch represents the epoch when the data tries are automatically balanced by inserting at the hashed key instead of the normal key + AutoBalanceDataTriesEnableEpoch = 1 + + # MigrateDataTrieEnableEpoch represents the epoch when the data tries migration is enabled + MigrateDataTrieEnableEpoch = 1 + + # KeepExecOrderOnCreatedSCRsEnableEpoch represents the epoch when the execution order of created SCRs is ensured + KeepExecOrderOnCreatedSCRsEnableEpoch = 1 + + # MultiClaimOnDelegationEnableEpoch represents the epoch when the multi claim on delegation is enabled + MultiClaimOnDelegationEnableEpoch = 1 + + # ChangeUsernameEnableEpoch represents the epoch when changing username is enabled + ChangeUsernameEnableEpoch = 4 + + # ConsistentTokensValuesLengthCheckEnableEpoch represents the epoch when the consistent tokens values length check is enabled + ConsistentTokensValuesLengthCheckEnableEpoch = 1 + + # FixDelegationChangeOwnerOnAccountEnableEpoch represents the epoch when the fix for the delegation system smart contract is enabled + FixDelegationChangeOwnerOnAccountEnableEpoch = 1 + + # DynamicGasCostForDataTrieStorageLoadEnableEpoch represents the epoch when dynamic gas cost for data trie storage load will be enabled + DynamicGasCostForDataTrieStorageLoadEnableEpoch = 1 + + # ScToScLogEventEnableEpoch represents the epoch when the sc to sc log event feature is enabled + ScToScLogEventEnableEpoch = 1 + + # NFTStopCreateEnableEpoch represents the epoch when NFT stop create feature is enabled + NFTStopCreateEnableEpoch = 1 + + # ChangeOwnerAddressCrossShardThroughSCEnableEpoch represents the epoch when the change owner address built in function will work also through a smart contract call cross shard + ChangeOwnerAddressCrossShardThroughSCEnableEpoch = 1 + + # FixGasRemainingForSaveKeyValueBuiltinFunctionEnableEpoch represents the epoch when the fix for the remaining gas in the SaveKeyValue builtin function is enabled + FixGasRemainingForSaveKeyValueBuiltinFunctionEnableEpoch = 1 + + # CurrentRandomnessOnSortingEnableEpoch represents the epoch when the current randomness on sorting is enabled + CurrentRandomnessOnSortingEnableEpoch = 4 + + # BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers + BLSMultiSignerEnableEpoch = [ + { EnableEpoch = 0, Type = "no-KOSK" }, + { EnableEpoch = 1, Type = "KOSK" } + ] + + # StakeLimitsEnableEpoch represents the epoch when stake limits on validators are enabled + StakeLimitsEnableEpoch = 5 + + # StakingV4Step1EnableEpoch represents the epoch when staking v4 is initialized. This is the epoch in which + # all nodes from staking queue are moved in the auction list + StakingV4Step1EnableEpoch = 4 + + # StakingV4Step2EnableEpoch represents the epoch when staking v4 is enabled. Should have a greater value than StakingV4Step1EnableEpoch. + # From this epoch, all shuffled out nodes are moved to auction nodes. No auction nodes selection is done yet. + StakingV4Step2EnableEpoch = 5 + + # StakingV4Step3EnableEpoch represents the epoch in which selected nodes from auction will be distributed to waiting list + StakingV4Step3EnableEpoch = 6 + + # MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch + MaxNodesChangeEnableEpoch = [ + { EpochEnable = 0, MaxNumNodes = 48, NodesToShufflePerShard = 4 }, # 4 shuffled out keys / shard will not be reached normally + { EpochEnable = 1, MaxNumNodes = 64, NodesToShufflePerShard = 2 }, + # Staking v4 configuration, where: + # - Enable epoch = StakingV4Step3EnableEpoch + # - NodesToShufflePerShard = same as previous entry in MaxNodesChangeEnableEpoch + # - MaxNumNodes = (MaxNumNodesFromPreviousEpochEnable - (numOfShards+1)*NodesToShufflePerShard) + { EpochEnable = 6, MaxNumNodes = 60, NodesToShufflePerShard = 2 }, + ] + + [GasSchedule] + # GasScheduleByEpochs holds the configuration for the gas schedule that will be applied from specific epochs + GasScheduleByEpochs = [ + { StartEpoch = 0, FileName = "gasScheduleV7.toml" }, + ] +""" + +def temp_replace_enable_epochs(): + cwd = os.getcwd() + + validator_dirs = [dir_name for dir_name in os.listdir(cwd) if re.match(r'validator\d\d', dir_name)] + for validator_dir in validator_dirs: + enable_epochs_path = os.path.join(cwd, validator_dir, 'config', 'enableEpochs.toml') + with open(enable_epochs_path, 'w') as file: + file.write(enable_epochs_content) + +temp_replace_enable_epochs() diff --git a/containers/localnet/temp_replace_genesis_smart_contracts.py b/containers/localnet/temp_replace_genesis_smart_contracts.py new file mode 100644 index 0000000..1757f5d --- /dev/null +++ b/containers/localnet/temp_replace_genesis_smart_contracts.py @@ -0,0 +1,45 @@ +import os +import re +import subprocess +import shutil + +genesis_smart_contracts_content = """ +[ + { + "owner": "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th", + "filename": "./config/genesisContracts/delegation.wasm", + "vm-type": "0500", + "init-parameters": "%validator_sc_address%@03E8@00@030D40@030D40", + "type": "delegation", + "version": "0.4.*" + }, + { + "owner": "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th", + "filename": "./config/genesisContracts/dns.wasm", + "vm-type": "0500", + "init-parameters": "00", + "type": "dns", + "version": "0.2.*" + } +] +""" + +def temp_replace_genesis_smart_contracts(): + cwd = os.getcwd() + + genesis_contracts_dir_path = os.path.join(cwd, 'genesisContracts') + + validator_dirs = [dir_name for dir_name in os.listdir(cwd) if re.match(r'validator\d\d', dir_name)] + for validator_dir in validator_dirs: + genesis_smart_contracts_json_path = os.path.join(cwd, validator_dir, 'config', 'genesisSmartContracts.json') + with open(genesis_smart_contracts_json_path, 'w') as file: + file.write(genesis_smart_contracts_content) + + validator_genesis_contracts_dir_path = os.path.join(cwd, validator_dir, 'config', 'genesisContracts') + + if os.path.exists(validator_genesis_contracts_dir_path): + shutil.rmtree(validator_genesis_contracts_dir_path) + + shutil.copytree(genesis_contracts_dir_path, validator_genesis_contracts_dir_path) + +temp_replace_genesis_smart_contracts()