Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes coordinator with staking v4 #3883

Merged
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
479692d
FEAT: Add first version
mariusmihaic Mar 7, 2022
8c1ed21
FEAT: ihnc with auction
mariusmihaic Mar 7, 2022
40805f9
Merge branch 'move-waiting-list-from-staking' into EN-11664-nodes-coo…
mariusmihaic Mar 7, 2022
d87f063
FEAT: Use flag to save with auction list
mariusmihaic Mar 7, 2022
fe9db50
FEAT: Use interface instead of *NodesCoordinatorRegistry
mariusmihaic Mar 8, 2022
34b4f01
FIX: Build
mariusmihaic Mar 8, 2022
9664050
FIX: Build 2
mariusmihaic Mar 8, 2022
54087d9
FEAT: Refactor LoadState to use interface
mariusmihaic Mar 8, 2022
55e09b3
FEAT: Use proto structs
mariusmihaic Mar 8, 2022
337a353
FEAT: Add generated proto file
mariusmihaic Mar 8, 2022
6e7b730
FIX: Refactor code structure
mariusmihaic Mar 8, 2022
d6cf445
FIX: Remove SetEpochsConfig interface func
mariusmihaic Mar 8, 2022
e63f85b
FEAT: Extract common code to getMinAndLastEpoch
mariusmihaic Mar 8, 2022
82bf91e
FEAT: Add CreateNodesCoordinatorRegistry
mariusmihaic Mar 8, 2022
3ca3f89
FEAT: Use CreateNodesCoordinatorRegistry in nodesCoord
mariusmihaic Mar 9, 2022
be3bc70
Merge branch 'move-waiting-list-from-staking' into EN-11664-nodes-coo…
mariusmihaic Mar 9, 2022
b4993df
FIX: Use SelectedFromAuctionList instead of AuctionList
mariusmihaic Mar 10, 2022
e306d99
FEAT: Add tmp test
mariusmihaic Mar 10, 2022
0c6ae5e
FEAT: Add nodes coord tests
mariusmihaic Mar 11, 2022
9815093
FEAT: Add node shuffler tests
mariusmihaic Mar 11, 2022
0807341
FIX: Small test refactor
mariusmihaic Mar 11, 2022
4fddf7b
Merge branch 'move-waiting-list-from-staking' into EN-11664-nodes-coo…
mariusmihaic Mar 11, 2022
044e8e7
Merge branch 'move-waiting-list-from-staking' into EN-11664-nodes-coo…
mariusmihaic Mar 17, 2022
8dbcf97
FIX: Merge conflicts
mariusmihaic Mar 17, 2022
068c23a
FEAT: Create nodesCoordinatorRegistryFactory.go
mariusmihaic Mar 22, 2022
ccea211
FIX: Test
mariusmihaic Mar 22, 2022
04b6888
FIX: CreateNodesCoordinator
mariusmihaic Mar 22, 2022
eca5854
FIX: Review findings
mariusmihaic Mar 22, 2022
09d6a4a
Merge branch 'feat/liquid-staking' into EN-11664-nodes-coordinator-st…
mariusmihaic Mar 22, 2022
fb6a3b9
FIX: Tests
mariusmihaic Mar 23, 2022
9f32944
FEAT: Save shuffled out in auction list + test
mariusmihaic Mar 23, 2022
8f17265
FIX: Test
mariusmihaic Mar 23, 2022
d58e550
FIX: Another test + typo
mariusmihaic Mar 23, 2022
7dd0593
FIX: Findings + tests
mariusmihaic Mar 23, 2022
6092f80
FIX: Review findings
mariusmihaic Mar 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion epochStart/bootstrap/baseStorageHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (bsh *baseStorageHandler) groupMiniBlocksByShard(miniBlocks map[string]*blo

func (bsh *baseStorageHandler) saveNodesCoordinatorRegistry(
metaBlock data.HeaderHandler,
nodesConfig *nodesCoordinator.NodesCoordinatorRegistry,
nodesConfig nodesCoordinator.NodesCoordinatorRegistryHandler,
) ([]byte, error) {
key := append([]byte(common.NodesCoordinatorRegistryKeyPrefix), metaBlock.GetPrevRandSeed()...)

Expand Down
4 changes: 4 additions & 0 deletions epochStart/bootstrap/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/ElrondNetwork/elrond-go-core/core/check"
"github.com/ElrondNetwork/elrond-go/epochStart"
"github.com/ElrondNetwork/elrond-go/sharding/nodesCoordinator"
)

const baseErrorMessage = "error with epoch start bootstrapper arguments"
Expand Down Expand Up @@ -106,6 +107,9 @@ func checkArguments(args ArgsEpochStartBootstrap) error {
if args.GeneralConfig.TrieSync.NumConcurrentTrieSyncers < 1 {
return fmt.Errorf("%s: %w", baseErrorMessage, epochStart.ErrInvalidNumConcurrentTrieSyncers)
}
if check.IfNil(args.NodesCoordinatorRegistryFactory) {
return fmt.Errorf("%s: %w", baseErrorMessage, nodesCoordinator.ErrNilNodesCoordinatorRegistryFactory)
}

return nil
}
14 changes: 6 additions & 8 deletions epochStart/bootstrap/fromLocalStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package bootstrap

import (
"bytes"
"encoding/json"
"fmt"
"strconv"

Expand Down Expand Up @@ -192,19 +191,19 @@ func (e *epochStartBootstrap) prepareEpochFromStorage() (Parameters, error) {

func (e *epochStartBootstrap) checkIfShuffledOut(
pubKey []byte,
nodesConfig *nodesCoordinator.NodesCoordinatorRegistry,
nodesConfig nodesCoordinator.NodesCoordinatorRegistryHandler,
) (uint32, bool) {
epochIDasString := fmt.Sprint(e.baseData.lastEpoch)
epochConfig := nodesConfig.EpochsConfig[epochIDasString]
epochConfig := nodesConfig.GetEpochsConfig()[epochIDasString]

newShardId, isWaitingForShard := checkIfPubkeyIsInMap(pubKey, epochConfig.WaitingValidators)
newShardId, isWaitingForShard := checkIfPubkeyIsInMap(pubKey, epochConfig.GetWaitingValidators())
if isWaitingForShard {
isShuffledOut := newShardId != e.baseData.shardId
e.nodeType = core.NodeTypeValidator
return newShardId, isShuffledOut
}

newShardId, isEligibleForShard := checkIfPubkeyIsInMap(pubKey, epochConfig.EligibleValidators)
newShardId, isEligibleForShard := checkIfPubkeyIsInMap(pubKey, epochConfig.GetEligibleValidators())
if isEligibleForShard {
isShuffledOut := newShardId != e.baseData.shardId
e.nodeType = core.NodeTypeValidator
Expand Down Expand Up @@ -245,7 +244,7 @@ func checkIfValidatorIsInList(
return false
}

func (e *epochStartBootstrap) getLastBootstrapData(storer storage.Storer) (*bootstrapStorage.BootstrapData, *nodesCoordinator.NodesCoordinatorRegistry, error) {
func (e *epochStartBootstrap) getLastBootstrapData(storer storage.Storer) (*bootstrapStorage.BootstrapData, nodesCoordinator.NodesCoordinatorRegistryHandler, error) {
bootStorer, err := bootstrapStorage.NewBootstrapStorer(e.coreComponentsHolder.InternalMarshalizer(), storer)
if err != nil {
return nil, nil, err
Expand All @@ -264,8 +263,7 @@ func (e *epochStartBootstrap) getLastBootstrapData(storer storage.Storer) (*boot
return nil, nil, err
}

config := &nodesCoordinator.NodesCoordinatorRegistry{}
err = json.Unmarshal(d, config)
config, err := e.nodesCoordinatorRegistryFactory.CreateNodesCoordinatorRegistry(d)
if err != nil {
return nil, nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions epochStart/bootstrap/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// StartOfEpochNodesConfigHandler defines the methods to process nodesConfig from epoch start metablocks
type StartOfEpochNodesConfigHandler interface {
NodesConfigFromMetaBlock(currMetaBlock data.HeaderHandler, prevMetaBlock data.HeaderHandler) (*nodesCoordinator.NodesCoordinatorRegistry, uint32, error)
NodesConfigFromMetaBlock(currMetaBlock data.HeaderHandler, prevMetaBlock data.HeaderHandler) (nodesCoordinator.NodesCoordinatorRegistryHandler, uint32, error)
IsInterfaceNil() bool
}

Expand All @@ -25,7 +25,7 @@ type EpochStartMetaBlockInterceptorProcessor interface {
// StartInEpochNodesCoordinator defines the methods to process and save nodesCoordinator information to storage
type StartInEpochNodesCoordinator interface {
EpochStartPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
NodesCoordinatorToRegistry() *nodesCoordinator.NodesCoordinatorRegistry
NodesCoordinatorToRegistry() nodesCoordinator.NodesCoordinatorRegistryHandler
ShardIdForEpoch(epoch uint32) (uint32, error)
IsInterfaceNil() bool
}
Expand Down
138 changes: 71 additions & 67 deletions epochStart/bootstrap/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ type Parameters struct {
Epoch uint32
SelfShardId uint32
NumOfShards uint32
NodesConfig *nodesCoordinator.NodesCoordinatorRegistry
NodesConfig nodesCoordinator.NodesCoordinatorRegistryHandler
}

// ComponentsNeededForBootstrap holds the components which need to be initialized from network
type ComponentsNeededForBootstrap struct {
EpochStartMetaBlock data.MetaHeaderHandler
PreviousEpochStart data.MetaHeaderHandler
ShardHeader data.HeaderHandler
NodesConfig *nodesCoordinator.NodesCoordinatorRegistry
NodesConfig nodesCoordinator.NodesCoordinatorRegistryHandler
Headers map[string]data.HeaderHandler
ShardCoordinator sharding.Coordinator
PendingMiniBlocks map[string]*block.MiniBlock
Expand Down Expand Up @@ -104,29 +104,30 @@ type epochStartBootstrap struct {
trieSyncerVersion int

// created components
requestHandler process.RequestHandler
interceptorContainer process.InterceptorsContainer
dataPool dataRetriever.PoolsHolder
miniBlocksSyncer epochStart.PendingMiniBlocksSyncHandler
headersSyncer epochStart.HeadersByHashSyncer
txSyncerForScheduled update.TransactionsSyncHandler
epochStartMetaBlockSyncer epochStart.StartOfEpochMetaSyncer
nodesConfigHandler StartOfEpochNodesConfigHandler
whiteListHandler update.WhiteListHandler
whiteListerVerifiedTxs update.WhiteListHandler
storageOpenerHandler storage.UnitOpenerHandler
latestStorageDataProvider storage.LatestStorageDataProviderHandler
argumentsParser process.ArgumentsParser
enableEpochs config.EnableEpochs
dataSyncerFactory types.ScheduledDataSyncerCreator
dataSyncerWithScheduled types.ScheduledDataSyncer
storageService dataRetriever.StorageService
requestHandler process.RequestHandler
interceptorContainer process.InterceptorsContainer
dataPool dataRetriever.PoolsHolder
miniBlocksSyncer epochStart.PendingMiniBlocksSyncHandler
headersSyncer epochStart.HeadersByHashSyncer
txSyncerForScheduled update.TransactionsSyncHandler
epochStartMetaBlockSyncer epochStart.StartOfEpochMetaSyncer
nodesConfigHandler StartOfEpochNodesConfigHandler
whiteListHandler update.WhiteListHandler
whiteListerVerifiedTxs update.WhiteListHandler
storageOpenerHandler storage.UnitOpenerHandler
latestStorageDataProvider storage.LatestStorageDataProviderHandler
argumentsParser process.ArgumentsParser
enableEpochs config.EnableEpochs
dataSyncerFactory types.ScheduledDataSyncerCreator
dataSyncerWithScheduled types.ScheduledDataSyncer
storageService dataRetriever.StorageService
nodesCoordinatorRegistryFactory nodesCoordinator.NodesCoordinatorRegistryFactory

// gathered data
epochStartMeta data.MetaHeaderHandler
prevEpochStartMeta data.MetaHeaderHandler
syncedHeaders map[string]data.HeaderHandler
nodesConfig *nodesCoordinator.NodesCoordinatorRegistry
nodesConfig nodesCoordinator.NodesCoordinatorRegistryHandler
baseData baseDataInStorage
startRound int64
nodeType core.NodeType
Expand All @@ -145,26 +146,27 @@ type baseDataInStorage struct {

// ArgsEpochStartBootstrap holds the arguments needed for creating an epoch start data provider component
type ArgsEpochStartBootstrap struct {
CoreComponentsHolder process.CoreComponentsHolder
CryptoComponentsHolder process.CryptoComponentsHolder
DestinationShardAsObserver uint32
Messenger Messenger
GeneralConfig config.Config
PrefsConfig config.PreferencesConfig
EnableEpochs config.EnableEpochs
EconomicsData process.EconomicsDataHandler
GenesisNodesConfig sharding.GenesisNodesSetupHandler
GenesisShardCoordinator sharding.Coordinator
StorageUnitOpener storage.UnitOpenerHandler
LatestStorageDataProvider storage.LatestStorageDataProviderHandler
Rater nodesCoordinator.ChanceComputer
NodeShuffler nodesCoordinator.NodesShuffler
RoundHandler epochStart.RoundHandler
ArgumentsParser process.ArgumentsParser
StatusHandler core.AppStatusHandler
HeaderIntegrityVerifier process.HeaderIntegrityVerifier
DataSyncerCreator types.ScheduledDataSyncerCreator
ScheduledSCRsStorer storage.Storer
CoreComponentsHolder process.CoreComponentsHolder
CryptoComponentsHolder process.CryptoComponentsHolder
DestinationShardAsObserver uint32
Messenger Messenger
GeneralConfig config.Config
PrefsConfig config.PreferencesConfig
EnableEpochs config.EnableEpochs
EconomicsData process.EconomicsDataHandler
GenesisNodesConfig sharding.GenesisNodesSetupHandler
GenesisShardCoordinator sharding.Coordinator
StorageUnitOpener storage.UnitOpenerHandler
LatestStorageDataProvider storage.LatestStorageDataProviderHandler
Rater nodesCoordinator.ChanceComputer
NodeShuffler nodesCoordinator.NodesShuffler
RoundHandler epochStart.RoundHandler
ArgumentsParser process.ArgumentsParser
StatusHandler core.AppStatusHandler
HeaderIntegrityVerifier process.HeaderIntegrityVerifier
DataSyncerCreator types.ScheduledDataSyncerCreator
ScheduledSCRsStorer storage.Storer
NodesCoordinatorRegistryFactory nodesCoordinator.NodesCoordinatorRegistryFactory
}

type dataToSync struct {
Expand All @@ -182,33 +184,34 @@ func NewEpochStartBootstrap(args ArgsEpochStartBootstrap) (*epochStartBootstrap,
}

epochStartProvider := &epochStartBootstrap{
coreComponentsHolder: args.CoreComponentsHolder,
cryptoComponentsHolder: args.CryptoComponentsHolder,
messenger: args.Messenger,
generalConfig: args.GeneralConfig,
prefsConfig: args.PrefsConfig,
economicsData: args.EconomicsData,
genesisNodesConfig: args.GenesisNodesConfig,
genesisShardCoordinator: args.GenesisShardCoordinator,
rater: args.Rater,
destinationShardAsObserver: args.DestinationShardAsObserver,
nodeShuffler: args.NodeShuffler,
roundHandler: args.RoundHandler,
storageOpenerHandler: args.StorageUnitOpener,
latestStorageDataProvider: args.LatestStorageDataProvider,
shuffledOut: false,
statusHandler: args.StatusHandler,
nodeType: core.NodeTypeObserver,
argumentsParser: args.ArgumentsParser,
headerIntegrityVerifier: args.HeaderIntegrityVerifier,
epochNotifier: args.CoreComponentsHolder.EpochNotifier(),
numConcurrentTrieSyncers: args.GeneralConfig.TrieSync.NumConcurrentTrieSyncers,
maxHardCapForMissingNodes: args.GeneralConfig.TrieSync.MaxHardCapForMissingNodes,
trieSyncerVersion: args.GeneralConfig.TrieSync.TrieSyncerVersion,
enableEpochs: args.EnableEpochs,
dataSyncerFactory: args.DataSyncerCreator,
storerScheduledSCRs: args.ScheduledSCRsStorer,
shardCoordinator: args.GenesisShardCoordinator,
coreComponentsHolder: args.CoreComponentsHolder,
cryptoComponentsHolder: args.CryptoComponentsHolder,
messenger: args.Messenger,
generalConfig: args.GeneralConfig,
prefsConfig: args.PrefsConfig,
economicsData: args.EconomicsData,
genesisNodesConfig: args.GenesisNodesConfig,
genesisShardCoordinator: args.GenesisShardCoordinator,
rater: args.Rater,
destinationShardAsObserver: args.DestinationShardAsObserver,
nodeShuffler: args.NodeShuffler,
roundHandler: args.RoundHandler,
storageOpenerHandler: args.StorageUnitOpener,
latestStorageDataProvider: args.LatestStorageDataProvider,
shuffledOut: false,
statusHandler: args.StatusHandler,
nodeType: core.NodeTypeObserver,
argumentsParser: args.ArgumentsParser,
headerIntegrityVerifier: args.HeaderIntegrityVerifier,
epochNotifier: args.CoreComponentsHolder.EpochNotifier(),
numConcurrentTrieSyncers: args.GeneralConfig.TrieSync.NumConcurrentTrieSyncers,
maxHardCapForMissingNodes: args.GeneralConfig.TrieSync.MaxHardCapForMissingNodes,
trieSyncerVersion: args.GeneralConfig.TrieSync.TrieSyncerVersion,
enableEpochs: args.EnableEpochs,
dataSyncerFactory: args.DataSyncerCreator,
storerScheduledSCRs: args.ScheduledSCRsStorer,
shardCoordinator: args.GenesisShardCoordinator,
nodesCoordinatorRegistryFactory: args.NodesCoordinatorRegistryFactory,
}

log.Debug("process: enable epoch for transaction signed with tx hash", "epoch", epochStartProvider.enableEpochs.TransactionSignedWithTxHashEnableEpoch)
Expand Down Expand Up @@ -710,6 +713,7 @@ func (e *epochStartBootstrap) processNodesConfig(pubKey []byte) error {
ChanNodeStop: e.coreComponentsHolder.ChanStopNodeProcess(),
NodeTypeProvider: e.coreComponentsHolder.NodeTypeProvider(),
IsFullArchive: e.prefsConfig.FullArchive,
StakingV4EnableEpoch: e.enableEpochs.StakingV4EnableEpoch,
}

e.nodesConfigHandler, err = NewSyncValidatorStatus(argsNewValidatorStatusSyncers)
Expand Down
10 changes: 6 additions & 4 deletions epochStart/bootstrap/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ func createMockEpochStartBootstrapArgs(
cryptoMock *mock.CryptoComponentsMock,
) ArgsEpochStartBootstrap {
generalCfg := testscommon.GetGeneralConfig()
ncr, _ := nodesCoordinator.NewNodesCoordinatorRegistryFactory(&testscommon.MarshalizerMock{}, 444)
return ArgsEpochStartBootstrap{
ScheduledSCRsStorer: genericMocks.NewStorerMock("path", 0),
CoreComponentsHolder: coreMock,
CryptoComponentsHolder: cryptoMock,
Messenger: &mock.MessengerStub{},
ScheduledSCRsStorer: genericMocks.NewStorerMock("path", 0),
CoreComponentsHolder: coreMock,
CryptoComponentsHolder: cryptoMock,
Messenger: &mock.MessengerStub{},
NodesCoordinatorRegistryFactory: ncr,
GeneralConfig: config.Config{
MiniBlocksStorage: generalCfg.MiniBlocksStorage,
PeerBlockBodyStorage: generalCfg.PeerBlockBodyStorage,
Expand Down
2 changes: 1 addition & 1 deletion epochStart/bootstrap/shardStorageHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (ssh *shardStorageHandler) SaveDataToStorage(components *ComponentsNeededFo
return err
}

components.NodesConfig.CurrentEpoch = components.ShardHeader.GetEpoch()
components.NodesConfig.SetCurrentEpoch(components.ShardHeader.GetEpoch())
nodesCoordinatorConfigKey, err := ssh.saveNodesCoordinatorRegistry(components.EpochStartMetaBlock, components.NodesConfig)
if err != nil {
return err
Expand Down
48 changes: 28 additions & 20 deletions epochStart/bootstrap/syncValidatorStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type ArgsNewSyncValidatorStatus struct {
PubKey []byte
ShardIdAsObserver uint32
WaitingListFixEnableEpoch uint32
StakingV4EnableEpoch uint32
ChanNodeStop chan endProcess.ArgEndProcess
NodeTypeProvider NodeTypeProviderHandler
IsFullArchive bool
Expand Down Expand Up @@ -92,25 +93,32 @@ func NewSyncValidatorStatus(args ArgsNewSyncValidatorStatus) (*syncValidatorStat

s.memDB = disabled.CreateMemUnit()

ncf, err := nodesCoordinator.NewNodesCoordinatorRegistryFactory(args.Marshalizer, args.StakingV4EnableEpoch)
if err != nil {
return nil, err
}

argsNodesCoordinator := nodesCoordinator.ArgNodesCoordinator{
ShardConsensusGroupSize: int(args.GenesisNodesConfig.GetShardConsensusGroupSize()),
MetaConsensusGroupSize: int(args.GenesisNodesConfig.GetMetaConsensusGroupSize()),
Marshalizer: args.Marshalizer,
Hasher: args.Hasher,
Shuffler: args.NodeShuffler,
EpochStartNotifier: &disabled.EpochStartNotifier{},
BootStorer: s.memDB,
ShardIDAsObserver: args.ShardIdAsObserver,
NbShards: args.GenesisNodesConfig.NumberOfShards(),
EligibleNodes: eligibleValidators,
WaitingNodes: waitingValidators,
SelfPublicKey: args.PubKey,
ConsensusGroupCache: consensusGroupCache,
ShuffledOutHandler: disabled.NewShuffledOutHandler(),
WaitingListFixEnabledEpoch: args.WaitingListFixEnableEpoch,
ChanStopNode: args.ChanNodeStop,
NodeTypeProvider: args.NodeTypeProvider,
IsFullArchive: args.IsFullArchive,
ShardConsensusGroupSize: int(args.GenesisNodesConfig.GetShardConsensusGroupSize()),
MetaConsensusGroupSize: int(args.GenesisNodesConfig.GetMetaConsensusGroupSize()),
Marshalizer: args.Marshalizer,
Hasher: args.Hasher,
Shuffler: args.NodeShuffler,
EpochStartNotifier: &disabled.EpochStartNotifier{},
BootStorer: s.memDB,
ShardIDAsObserver: args.ShardIdAsObserver,
NbShards: args.GenesisNodesConfig.NumberOfShards(),
EligibleNodes: eligibleValidators,
WaitingNodes: waitingValidators,
SelfPublicKey: args.PubKey,
ConsensusGroupCache: consensusGroupCache,
ShuffledOutHandler: disabled.NewShuffledOutHandler(),
WaitingListFixEnabledEpoch: args.WaitingListFixEnableEpoch,
ChanStopNode: args.ChanNodeStop,
NodeTypeProvider: args.NodeTypeProvider,
IsFullArchive: args.IsFullArchive,
StakingV4EnableEpoch: args.StakingV4EnableEpoch,
NodesCoordinatorRegistryFactory: ncf,
}
baseNodesCoordinator, err := nodesCoordinator.NewIndexHashedNodesCoordinator(argsNodesCoordinator)
if err != nil {
Expand All @@ -131,7 +139,7 @@ func NewSyncValidatorStatus(args ArgsNewSyncValidatorStatus) (*syncValidatorStat
func (s *syncValidatorStatus) NodesConfigFromMetaBlock(
currMetaBlock data.HeaderHandler,
prevMetaBlock data.HeaderHandler,
) (*nodesCoordinator.NodesCoordinatorRegistry, uint32, error) {
) (nodesCoordinator.NodesCoordinatorRegistryHandler, uint32, error) {
if currMetaBlock.GetNonce() > 1 && !currMetaBlock.IsStartOfEpochBlock() {
return nil, 0, epochStart.ErrNotEpochStartBlock
}
Expand All @@ -155,7 +163,7 @@ func (s *syncValidatorStatus) NodesConfigFromMetaBlock(
}

nodesConfig := s.nodeCoordinator.NodesCoordinatorToRegistry()
nodesConfig.CurrentEpoch = currMetaBlock.GetEpoch()
nodesConfig.SetCurrentEpoch(currMetaBlock.GetEpoch())
return nodesConfig, selfShardId, nil
}

Expand Down