diff --git a/cmd/node/config/enableEpochs.toml b/cmd/node/config/enableEpochs.toml index 5632fb74459..62950084e1c 100644 --- a/cmd/node/config/enableEpochs.toml +++ b/cmd/node/config/enableEpochs.toml @@ -221,6 +221,9 @@ # 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 = 2 + # MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch MaxNodesChangeEnableEpoch = [ { EpochEnable = 0, MaxNumNodes = 36, NodesToShufflePerShard = 4 }, diff --git a/config/epochConfig.go b/config/epochConfig.go index d61e3675617..27ea02a0b54 100644 --- a/config/epochConfig.go +++ b/config/epochConfig.go @@ -86,6 +86,7 @@ type EnableEpochs struct { MiniBlockPartialExecutionEnableEpoch uint32 ESDTMetadataContinuousCleanupEnableEpoch uint32 FixAsyncCallBackArgsListEnableEpoch uint32 + FixOldTokenLiquidityEnableEpoch uint32 } // GasScheduleByEpochs represents a gas schedule toml entry that will be applied from the provided epoch diff --git a/config/tomlConfig_test.go b/config/tomlConfig_test.go index 7d679bd828b..4993ab2ceb1 100644 --- a/config/tomlConfig_test.go +++ b/config/tomlConfig_test.go @@ -668,6 +668,9 @@ func TestEnableEpochConfig(t *testing.T) { # FixAsyncCallBackArgsListEnableEpoch represents the epoch when the async callback arguments lists fix will be enabled FixAsyncCallBackArgsListEnableEpoch = 57 + # FixOldTokenLiquidityEnableEpoch represents the epoch when the fix for old token liquidity is enabled + FixOldTokenLiquidityEnableEpoch = 58 + # MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch MaxNodesChangeEnableEpoch = [ { EpochEnable = 44, MaxNumNodes = 2169, NodesToShufflePerShard = 80 }, @@ -752,6 +755,7 @@ func TestEnableEpochConfig(t *testing.T) { HeartbeatDisableEpoch: 55, ESDTMetadataContinuousCleanupEnableEpoch: 56, FixAsyncCallBackArgsListEnableEpoch: 57, + FixOldTokenLiquidityEnableEpoch: 58, }, GasSchedule: GasScheduleConfig{ GasScheduleByEpochs: []GasScheduleByEpochs{ diff --git a/factory/apiResolverFactory.go b/factory/apiResolverFactory.go index e7e823a645a..3c10ee029e3 100644 --- a/factory/apiResolverFactory.go +++ b/factory/apiResolverFactory.go @@ -128,6 +128,7 @@ func CreateApiResolver(args *ApiResolverArgs) (facade.ApiResolver, error) { args.Configs.EpochConfig.EnableEpochs.CheckCorrectTokenIDForTransferRoleEnableEpoch, args.Configs.EpochConfig.EnableEpochs.CheckFunctionArgumentEnableEpoch, args.Configs.EpochConfig.EnableEpochs.ESDTMetadataContinuousCleanupEnableEpoch, + args.Configs.EpochConfig.EnableEpochs.FixOldTokenLiquidityEnableEpoch, convertedAddresses, args.Configs.GeneralConfig.BuiltInFunctions.MaxNumAddressesInTransferRole, ) @@ -348,6 +349,7 @@ func createScQueryElement( args.epochConfig.EnableEpochs.CheckCorrectTokenIDForTransferRoleEnableEpoch, args.epochConfig.EnableEpochs.CheckFunctionArgumentEnableEpoch, args.epochConfig.EnableEpochs.ESDTMetadataContinuousCleanupEnableEpoch, + args.epochConfig.EnableEpochs.FixOldTokenLiquidityEnableEpoch, convertedAddresses, args.generalConfig.BuiltInFunctions.MaxNumAddressesInTransferRole, ) @@ -486,6 +488,7 @@ func createBuiltinFuncs( checkCorrectTokenIDEnableEpoch uint32, checkFunctionArgumentEnableEpoch uint32, esdtMetadataContinuousCleanupEnableEpoch uint32, + fixOldTokenLiquidityEnableEpoch uint32, automaticCrawlerAddresses [][]byte, maxNumAddressesInTransferRole uint32, ) (vmcommon.BuiltInFunctionFactory, error) { @@ -504,6 +507,7 @@ func createBuiltinFuncs( CheckCorrectTokenIDEnableEpoch: checkCorrectTokenIDEnableEpoch, CheckFunctionArgumentEnableEpoch: checkFunctionArgumentEnableEpoch, ESDTMetadataContinuousCleanupEnableEpoch: esdtMetadataContinuousCleanupEnableEpoch, + FixOldTokenLiquidityEnableEpoch: fixOldTokenLiquidityEnableEpoch, AutomaticCrawlerAddresses: automaticCrawlerAddresses, MaxNumNodesInTransferRole: maxNumAddressesInTransferRole, } diff --git a/factory/blockProcessorCreator.go b/factory/blockProcessorCreator.go index 0a30ff0f1c4..32ae2f0c95a 100644 --- a/factory/blockProcessorCreator.go +++ b/factory/blockProcessorCreator.go @@ -1213,6 +1213,7 @@ func (pcf *processComponentsFactory) createBuiltInFunctionContainer( CheckCorrectTokenIDEnableEpoch: pcf.epochConfig.EnableEpochs.CheckCorrectTokenIDForTransferRoleEnableEpoch, CheckFunctionArgumentEnableEpoch: pcf.epochConfig.EnableEpochs.CheckFunctionArgumentEnableEpoch, ESDTMetadataContinuousCleanupEnableEpoch: pcf.epochConfig.EnableEpochs.ESDTMetadataContinuousCleanupEnableEpoch, + FixOldTokenLiquidityEnableEpoch: pcf.epochConfig.EnableEpochs.FixOldTokenLiquidityEnableEpoch, AutomaticCrawlerAddresses: convertedAddresses, MaxNumNodesInTransferRole: pcf.config.BuiltInFunctions.MaxNumAddressesInTransferRole, } diff --git a/genesis/process/shardGenesisBlockCreator.go b/genesis/process/shardGenesisBlockCreator.go index 3a3f87ca602..81f8cf522f6 100644 --- a/genesis/process/shardGenesisBlockCreator.go +++ b/genesis/process/shardGenesisBlockCreator.go @@ -122,6 +122,7 @@ func createGenesisConfig() config.EnableEpochs { HeartbeatDisableEpoch: unreachableEpoch, MiniBlockPartialExecutionEnableEpoch: unreachableEpoch, ESDTMetadataContinuousCleanupEnableEpoch: unreachableEpoch, + FixOldTokenLiquidityEnableEpoch: unreachableEpoch, } } @@ -380,6 +381,7 @@ func createProcessorsForShardGenesisBlock(arg ArgsGenesisBlockCreator, enableEpo OptimizeNFTStoreEnableEpoch: enableEpochs.OptimizeNFTStoreEnableEpoch, CheckCorrectTokenIDEnableEpoch: enableEpochs.CheckCorrectTokenIDForTransferRoleEnableEpoch, ESDTMetadataContinuousCleanupEnableEpoch: enableEpochs.ESDTMetadataContinuousCleanupEnableEpoch, + FixOldTokenLiquidityEnableEpoch: enableEpochs.FixOldTokenLiquidityEnableEpoch, AutomaticCrawlerAddresses: [][]byte{make([]byte, 32)}, MaxNumNodesInTransferRole: math.MaxUint32, } diff --git a/go.mod b/go.mod index de847dbc9e2..a60b56be32c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/ElrondNetwork/elrond-go-core v1.1.19 github.com/ElrondNetwork/elrond-go-crypto v1.0.1 github.com/ElrondNetwork/elrond-go-logger v1.0.7 - github.com/ElrondNetwork/elrond-vm-common v1.3.15-rc1 + github.com/ElrondNetwork/elrond-vm-common v1.3.15-rc2 github.com/ElrondNetwork/go-libp2p-pubsub v0.6.1-rc1 github.com/beevik/ntp v0.3.0 github.com/btcsuite/btcd v0.22.0-beta diff --git a/go.sum b/go.sum index e7b1843567e..1d23246db7f 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/ElrondNetwork/elrond-vm-common v1.1.0/go.mod h1:w3i6f8uiuRkE68Ie/gebR github.com/ElrondNetwork/elrond-vm-common v1.2.9/go.mod h1:B/Y8WiqHyDd7xsjNYsaYbVMp1jQgQ+z4jTJkFvj/EWI= github.com/ElrondNetwork/elrond-vm-common v1.3.7/go.mod h1:seROQuR7RJCoCS7mgRXVAlvjztltY1c+UroAgWr/USE= github.com/ElrondNetwork/elrond-vm-common v1.3.14/go.mod h1:seROQuR7RJCoCS7mgRXVAlvjztltY1c+UroAgWr/USE= -github.com/ElrondNetwork/elrond-vm-common v1.3.15-rc1 h1:Qzf+n8xFMdwf1xIP4V4HNSX/lOU2fBZ46imqI6WUV0w= -github.com/ElrondNetwork/elrond-vm-common v1.3.15-rc1/go.mod h1:seROQuR7RJCoCS7mgRXVAlvjztltY1c+UroAgWr/USE= +github.com/ElrondNetwork/elrond-vm-common v1.3.15-rc2 h1:i4Q76IKC0ivg+UcwFY2C3euSlTiiNtvDjmYGgQ6H+AI= +github.com/ElrondNetwork/elrond-vm-common v1.3.15-rc2/go.mod h1:seROQuR7RJCoCS7mgRXVAlvjztltY1c+UroAgWr/USE= github.com/ElrondNetwork/go-libp2p-pubsub v0.6.1-rc1 h1:Nu/uwYQg/QbfoQ0uD6GahYTwgtAkAwtzsB0HVfSP58I= github.com/ElrondNetwork/go-libp2p-pubsub v0.6.1-rc1/go.mod h1:pJfaShe+i5aWZx8NhSkQjvOYQYLoqPztmFUlKjToOzM= github.com/ElrondNetwork/protobuf v1.3.2 h1:qoCSYiO+8GtXBEZWEjw0WPcZfM3g7QuuJrwpN+y6Mvg= diff --git a/node/nodeRunner.go b/node/nodeRunner.go index 3ab174b9251..5387e5f774a 100644 --- a/node/nodeRunner.go +++ b/node/nodeRunner.go @@ -183,6 +183,8 @@ func printEnableEpochs(configs *config.Configs) { log.Debug(readEpochFor("disable heartbeat v1"), "epoch", enableEpochs.HeartbeatDisableEpoch) log.Debug(readEpochFor("mini block partial execution"), "epoch", enableEpochs.MiniBlockPartialExecutionEnableEpoch) log.Debug(readEpochFor("fix async callback arguments list"), "epoch", enableEpochs.FixAsyncCallBackArgsListEnableEpoch) + log.Debug(readEpochFor("fix old token liquidity"), "epoch", enableEpochs.FixOldTokenLiquidityEnableEpoch) + gasSchedule := configs.EpochConfig.GasSchedule log.Debug(readEpochFor("gas schedule directories paths"), "epoch", gasSchedule.GasScheduleByEpochs) diff --git a/process/smartContract/builtInFunctions/factory.go b/process/smartContract/builtInFunctions/factory.go index 23223362dea..c8e4822f6b3 100644 --- a/process/smartContract/builtInFunctions/factory.go +++ b/process/smartContract/builtInFunctions/factory.go @@ -32,6 +32,7 @@ type ArgsCreateBuiltInFunctionContainer struct { CheckCorrectTokenIDEnableEpoch uint32 CheckFunctionArgumentEnableEpoch uint32 ESDTMetadataContinuousCleanupEnableEpoch uint32 + FixOldTokenLiquidityEnableEpoch uint32 MaxNumNodesInTransferRole uint32 AutomaticCrawlerAddresses [][]byte } @@ -92,6 +93,7 @@ func CreateBuiltInFunctionsFactory(args ArgsCreateBuiltInFunctionContainer) (vmc SendESDTMetadataAlwaysEnableEpoch: args.ESDTMetadataContinuousCleanupEnableEpoch, MaxNumOfAddressesForTransferRole: args.MaxNumNodesInTransferRole, FixAsyncCallbackCheckEnableEpoch: args.ESDTMetadataContinuousCleanupEnableEpoch, + FixOldTokenLiquidityEnableEpoch: args.FixOldTokenLiquidityEnableEpoch, ConfigAddress: crawlerAllowedAddress, }