Skip to content

Commit

Permalink
Merge branch 'rc/v1.6.0' into merge-master-rc-v1.6.0-2023.08.04
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
iulianpascalau committed Aug 11, 2023
2 parents f761733 + 46fb465 commit c68397d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 11 deletions.
7 changes: 5 additions & 2 deletions consensus/spos/bls/subroundStartRound.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ func (sr *subroundStartRound) indexRoundIfNeeded(pubKeys []string) {
Epoch: epoch,
Timestamp: uint64(sr.RoundTimeStamp.Unix()),
}

sr.outportHandler.SaveRoundsInfo(&outportcore.RoundsInfo{RoundsInfo: []*outportcore.RoundInfo{roundInfo}})
roundsInfo := &outportcore.RoundsInfo{
ShardID: shardId,
RoundsInfo: []*outportcore.RoundInfo{roundInfo},
}
sr.outportHandler.SaveRoundsInfo(roundsInfo)
}

func (sr *subroundStartRound) generateNextConsensusGroup(roundIndex int64) error {
Expand Down
1 change: 1 addition & 0 deletions factory/processing/processComponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ func (pcf *processComponentsFactory) indexGenesisBlocks(

arg := &outport.OutportBlockWithHeaderAndBody{
OutportBlock: &outport.OutportBlock{
ShardID: currentShardID,
BlockData: nil, // this will be filled by outport handler
HeaderGasConsumption: &outport.HeaderGasConsumption{
GasProvided: 0,
Expand Down
2 changes: 2 additions & 0 deletions factory/status/statusComponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func (pc *statusComponents) epochStartEventHandler() epochStart.ActionHandler {
}

pc.outportHandler.SaveValidatorsPubKeys(&outportCore.ValidatorsPubKeys{
ShardID: hdr.GetShardID(),
ShardValidatorsPubKeys: outportCore.ConvertPubKeys(validatorsPubKeys),
Epoch: currentEpoch,
})
Expand Down Expand Up @@ -221,6 +222,7 @@ func (scf *statusComponentsFactory) createOutportDriver() (outport.OutportHandle
}

outportFactoryArgs := &outportDriverFactory.OutportFactoryArgs{
ShardID: scf.shardCoordinator.SelfId(),
RetrialInterval: common.RetrialIntervalForOutportDriver,
ElasticIndexerFactoryArgs: scf.makeElasticIndexerArgs(),
EventNotifierFactoryArgs: eventNotifierArgs,
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ require (
github.com/gorilla/websocket v1.5.0
github.com/mitchellh/mapstructure v1.5.0
github.com/multiversx/mx-chain-communication-go v1.0.5-0.20230805090807-4ef0f099265d
github.com/multiversx/mx-chain-core-go v1.2.11
github.com/multiversx/mx-chain-core-go v1.2.12
github.com/multiversx/mx-chain-crypto-go v1.2.7
github.com/multiversx/mx-chain-es-indexer-go v1.4.7
github.com/multiversx/mx-chain-es-indexer-go v1.4.8
github.com/multiversx/mx-chain-logger-go v1.0.11
github.com/multiversx/mx-chain-scenario-go v1.1.2
github.com/multiversx/mx-chain-storage-go v1.0.11
Expand Down Expand Up @@ -57,6 +57,7 @@ require (
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand Down
17 changes: 13 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g=
github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs=
Expand Down Expand Up @@ -282,6 +284,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg=
github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c=
Expand Down Expand Up @@ -378,12 +382,12 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY
github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
github.com/multiversx/mx-chain-communication-go v1.0.5-0.20230805090807-4ef0f099265d h1:6jCUZ7yykgBPF2im65TGsy6rqCzbcRTTQgovOUV6DP0=
github.com/multiversx/mx-chain-communication-go v1.0.5-0.20230805090807-4ef0f099265d/go.mod h1:8Tx9QFaDYcdBgIeMSSWEpD/YKa2gtjCz8aFDi+XqImU=
github.com/multiversx/mx-chain-core-go v1.2.11 h1:C5W6P696SwTb8H0wvCUGX/+Ix5hhF4iDAmFXnDM0Jdo=
github.com/multiversx/mx-chain-core-go v1.2.11/go.mod h1:jzYFSiYBuO0dGpGFXnZWSwcwcKP7Flyn/X41y4zIQrQ=
github.com/multiversx/mx-chain-core-go v1.2.12 h1:k8hS/Mu+t8VxP2ynF28ZkGu5qDZmhN8i5gXxqWUI8JM=
github.com/multiversx/mx-chain-core-go v1.2.12/go.mod h1:jzYFSiYBuO0dGpGFXnZWSwcwcKP7Flyn/X41y4zIQrQ=
github.com/multiversx/mx-chain-crypto-go v1.2.7 h1:7OAINQ+zmnuUelJ2G1ETt5vLtBHn46tXmQO+hFXRrmw=
github.com/multiversx/mx-chain-crypto-go v1.2.7/go.mod h1:YVTxFG1OwtJW3jGOuRewvJKqyqrUzXzR5p/7/+jKlYM=
github.com/multiversx/mx-chain-es-indexer-go v1.4.7 h1:G7EKyJB0NE4hGiIFh5GHglW/Iyh9aMLKUWuKXKUCPso=
github.com/multiversx/mx-chain-es-indexer-go v1.4.7/go.mod h1:35HNdhfFbQogZ4tm0MdqobDsgM9uLdRpLJC2YzXujUs=
github.com/multiversx/mx-chain-es-indexer-go v1.4.8 h1:Fi1pN1/p+0/lTeEt0VsqfLyTetPphzJvR2YxvBzfDi0=
github.com/multiversx/mx-chain-es-indexer-go v1.4.8/go.mod h1:uxsdcnodJN4Joiv8ZeYQjU80167u00YeFJV9YyoLNpA=
github.com/multiversx/mx-chain-logger-go v1.0.11 h1:DFsHa+sc5fKwhDR50I8uBM99RTDTEW68ESyr5ALRDwE=
github.com/multiversx/mx-chain-logger-go v1.0.11/go.mod h1:1srDkP0DQucWQ+rYfaq0BX2qLnULsUdRPADpYUTM6dA=
github.com/multiversx/mx-chain-scenario-go v1.1.2 h1:6Mok/W48r5lBlqJfriFFhDO5UiYUU1Em+0n0oB0NNGs=
Expand Down Expand Up @@ -527,6 +531,9 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
Expand Down Expand Up @@ -682,6 +689,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
3 changes: 3 additions & 0 deletions node/nodeRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ func (nr *nodeRunner) executeOneComponentCreationCycle(
if managedBootstrapComponents.ShardCoordinator().SelfId() == core.MetachainShardId {
log.Debug("activating nodesCoordinator's validators indexing")
indexValidatorsListIfNeeded(
managedProcessComponents.ShardCoordinator().SelfId(),
managedStatusComponents.OutportHandler(),
nodesCoordinatorInstance,
managedProcessComponents.EpochStartTrigger().Epoch(),
Expand Down Expand Up @@ -1663,6 +1664,7 @@ func copySingleFile(destinationDirectory string, sourceFile string) {
}

func indexValidatorsListIfNeeded(
shardID uint32,
outportHandler outport.OutportHandler,
coordinator nodesCoordinator.NodesCoordinator,
epoch uint32,
Expand All @@ -1678,6 +1680,7 @@ func indexValidatorsListIfNeeded(

if len(validatorsPubKeys) > 0 {
outportHandler.SaveValidatorsPubKeys(&outportCore.ValidatorsPubKeys{
ShardID: shardID,
ShardValidatorsPubKeys: outportCore.ConvertPubKeys(validatorsPubKeys),
Epoch: epoch,
})
Expand Down
2 changes: 2 additions & 0 deletions outport/factory/outportFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
// OutportFactoryArgs holds the factory arguments of different outport drivers
type OutportFactoryArgs struct {
IsImportDB bool
ShardID uint32
RetrialInterval time.Duration
ElasticIndexerFactoryArgs indexerFactory.ArgsIndexerFactory
EventNotifierFactoryArgs *EventNotifierFactoryArgs
Expand All @@ -26,6 +27,7 @@ func CreateOutport(args *OutportFactoryArgs) (outport.OutportHandler, error) {
}

cfg := outportcore.OutportConfig{
ShardID: args.ShardID,
IsInImportDBMode: args.IsImportDB,
}

Expand Down
1 change: 1 addition & 0 deletions outport/outport.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func prepareBlockData(
}

return &outportcore.BlockData{
ShardID: headerBodyData.Header.GetShardID(),
HeaderBytes: headerBytes,
HeaderType: string(headerType),
HeaderHash: headerBodyData.HeaderHash,
Expand Down
1 change: 1 addition & 0 deletions outport/process/outportDataProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (odp *outportDataProvider) PrepareOutportSaveBlockData(arg ArgPrepareOutpor

return &outportcore.OutportBlockWithHeaderAndBody{
OutportBlock: &outportcore.OutportBlock{
ShardID: odp.shardID,
BlockData: nil, // this will be filled with specific data for each driver
TransactionPool: pool,
HeaderGasConsumption: &outportcore.HeaderGasConsumption{
Expand Down
2 changes: 1 addition & 1 deletion process/block/baseProcess.go
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ func getLastSelfNotarizedHeaderByItself(chainHandler data.ChainHandler) (data.He
func (bp *baseProcessor) setFinalizedHeaderHashInIndexer(hdrHash []byte) {
log.Debug("baseProcessor.setFinalizedHeaderHashInIndexer", "finalized header hash", hdrHash)

bp.outportHandler.FinalizedBlock(&outportcore.FinalizedBlock{HeaderHash: hdrHash})
bp.outportHandler.FinalizedBlock(&outportcore.FinalizedBlock{ShardID: bp.shardCoordinator.SelfId(), HeaderHash: hdrHash})
}

func (bp *baseProcessor) updateStateStorage(
Expand Down
4 changes: 2 additions & 2 deletions process/block/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func indexRoundInfo(
}

if check.IfNil(lastHeader) {
outportHandler.SaveRoundsInfo(&outportcore.RoundsInfo{RoundsInfo: []*outportcore.RoundInfo{roundInfo}})
outportHandler.SaveRoundsInfo(&outportcore.RoundsInfo{ShardID: shardId, RoundsInfo: []*outportcore.RoundInfo{roundInfo}})
return
}

Expand Down Expand Up @@ -206,7 +206,7 @@ func indexRoundInfo(
roundsInfo = append(roundsInfo, roundInfo)
}

outportHandler.SaveRoundsInfo(&outportcore.RoundsInfo{RoundsInfo: roundsInfo})
outportHandler.SaveRoundsInfo(&outportcore.RoundsInfo{ShardID: shardId, RoundsInfo: roundsInfo})
}

func indexValidatorsRating(
Expand Down

0 comments on commit c68397d

Please sign in to comment.