Skip to content

Commit

Permalink
fixed sync issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Jan 28, 2025
1 parent b6f7617 commit b1d120d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epochStart/bootstrap/epochStartMetaBlockProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (e *epochStartMetaBlockProcessor) waitForConfMetaBlock(ctx context.Context,
return epochStart.ErrNilMetaBlock
}

err := e.requestConfirmationMetaBlock(metaBlock.GetNonce())
err := e.requestConfirmationMetaBlock(metaBlock.GetNonce() + 1)
if err != nil {
return err
}
Expand All @@ -278,7 +278,7 @@ func (e *epochStartMetaBlockProcessor) waitForConfMetaBlock(ctx context.Context,
case <-ctx.Done():
return epochStart.ErrTimeoutWaitingForMetaBlock
case <-chanRequests:
err = e.requestConfirmationMetaBlock(metaBlock.GetNonce())
err = e.requestConfirmationMetaBlock(metaBlock.GetNonce() + 1)
if err != nil {
return err
}
Expand Down
9 changes: 9 additions & 0 deletions factory/bootstrap/bootstrapComponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package bootstrap
import (
"fmt"
"path/filepath"
"time"

"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/core/check"
interceptorFactory "github.com/multiversx/mx-chain-go/process/interceptors/factory"
logger "github.com/multiversx/mx-chain-logger-go"

nodeFactory "github.com/multiversx/mx-chain-go/cmd/node/factory"
Expand Down Expand Up @@ -200,6 +202,12 @@ func (bcf *bootstrapComponentsFactory) Create() (*bootstrapComponents, error) {
return nil, err
}

// create a new instance of interceptedDataVerifier which will be used for bootstrap only
interceptedDataVerifierFactory := interceptorFactory.NewInterceptedDataVerifierFactory(interceptorFactory.InterceptedDataVerifierFactoryArgs{
CacheSpan: time.Duration(bcf.config.InterceptedDataVerifier.CacheSpanInSec) * time.Second,
CacheExpiry: time.Duration(bcf.config.InterceptedDataVerifier.CacheExpiryInSec) * time.Second,
})

epochStartBootstrapArgs := bootstrap.ArgsEpochStartBootstrap{
CoreComponentsHolder: bcf.coreComponents,
CryptoComponentsHolder: bcf.cryptoComponents,
Expand Down Expand Up @@ -227,6 +235,7 @@ func (bcf *bootstrapComponentsFactory) Create() (*bootstrapComponents, error) {
StateStatsHandler: bcf.statusCoreComponents.StateStatsHandler(),
NodesCoordinatorRegistryFactory: nodesCoordinatorRegistryFactory,
EnableEpochsHandler: bcf.coreComponents.EnableEpochsHandler(),
InterceptedDataVerifierFactory: interceptedDataVerifierFactory,
}

var epochStartBootstrapper factory.EpochStartBootstrapper
Expand Down

0 comments on commit b1d120d

Please sign in to comment.