Skip to content

Commit

Permalink
Merge branch 'master' into fix-preferred-peers
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau authored Oct 5, 2022
2 parents ee8481d + 3dfa1db commit 7e81716
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
1 change: 1 addition & 0 deletions config/epochConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions config/tomlConfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -752,6 +755,7 @@ func TestEnableEpochConfig(t *testing.T) {
HeartbeatDisableEpoch: 55,
ESDTMetadataContinuousCleanupEnableEpoch: 56,
FixAsyncCallBackArgsListEnableEpoch: 57,
FixOldTokenLiquidityEnableEpoch: 58,
},
GasSchedule: GasScheduleConfig{
GasScheduleByEpochs: []GasScheduleByEpochs{
Expand Down
4 changes: 4 additions & 0 deletions factory/apiResolverFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -486,6 +488,7 @@ func createBuiltinFuncs(
checkCorrectTokenIDEnableEpoch uint32,
checkFunctionArgumentEnableEpoch uint32,
esdtMetadataContinuousCleanupEnableEpoch uint32,
fixOldTokenLiquidityEnableEpoch uint32,
automaticCrawlerAddresses [][]byte,
maxNumAddressesInTransferRole uint32,
) (vmcommon.BuiltInFunctionFactory, error) {
Expand All @@ -504,6 +507,7 @@ func createBuiltinFuncs(
CheckCorrectTokenIDEnableEpoch: checkCorrectTokenIDEnableEpoch,
CheckFunctionArgumentEnableEpoch: checkFunctionArgumentEnableEpoch,
ESDTMetadataContinuousCleanupEnableEpoch: esdtMetadataContinuousCleanupEnableEpoch,
FixOldTokenLiquidityEnableEpoch: fixOldTokenLiquidityEnableEpoch,
AutomaticCrawlerAddresses: automaticCrawlerAddresses,
MaxNumNodesInTransferRole: maxNumAddressesInTransferRole,
}
Expand Down
1 change: 1 addition & 0 deletions factory/blockProcessorCreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 2 additions & 0 deletions genesis/process/shardGenesisBlockCreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func createGenesisConfig() config.EnableEpochs {
HeartbeatDisableEpoch: unreachableEpoch,
MiniBlockPartialExecutionEnableEpoch: unreachableEpoch,
ESDTMetadataContinuousCleanupEnableEpoch: unreachableEpoch,
FixOldTokenLiquidityEnableEpoch: unreachableEpoch,
}
}

Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions node/nodeRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions process/smartContract/builtInFunctions/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ArgsCreateBuiltInFunctionContainer struct {
CheckCorrectTokenIDEnableEpoch uint32
CheckFunctionArgumentEnableEpoch uint32
ESDTMetadataContinuousCleanupEnableEpoch uint32
FixOldTokenLiquidityEnableEpoch uint32
MaxNumNodesInTransferRole uint32
AutomaticCrawlerAddresses [][]byte
}
Expand Down Expand Up @@ -92,6 +93,7 @@ func CreateBuiltInFunctionsFactory(args ArgsCreateBuiltInFunctionContainer) (vmc
SendESDTMetadataAlwaysEnableEpoch: args.ESDTMetadataContinuousCleanupEnableEpoch,
MaxNumOfAddressesForTransferRole: args.MaxNumNodesInTransferRole,
FixAsyncCallbackCheckEnableEpoch: args.ESDTMetadataContinuousCleanupEnableEpoch,
FixOldTokenLiquidityEnableEpoch: args.FixOldTokenLiquidityEnableEpoch,
ConfigAddress: crawlerAllowedAddress,
}

Expand Down

0 comments on commit 7e81716

Please sign in to comment.