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

Mx 15702 sovereign enable epochs handler #6626

Open
wants to merge 31 commits into
base: feat/chain-go-sdk
Choose a base branch
from

Conversation

axenteoctavian
Copy link
Contributor

@axenteoctavian axenteoctavian commented Nov 22, 2024

Reasoning behind the pull request

  • need sovereign enable epochs handler

Proposed changes

  • enable epochs handler in run type core components

Testing procedure

  • sovereign chain simulator tests passed
    image

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@axenteoctavian axenteoctavian self-assigned this Nov 22, 2024
@axenteoctavian axenteoctavian marked this pull request as ready for review November 28, 2024 14:56
@mariusmihaic mariusmihaic self-requested a review December 4, 2024 11:36
common/enablers/errors.go Outdated Show resolved Hide resolved
config/epochConfig.go Outdated Show resolved Hide resolved
factory/runType/sovereignRunTypeCoreComponents.go Outdated Show resolved Hide resolved
genesis/process/genesisBlockCreator.go Outdated Show resolved Hide resolved
integrationTests/realcomponents/processorRunner.go Outdated Show resolved Hide resolved
integrationTests/realcomponents/processorRunner.go Outdated Show resolved Hide resolved
integrationTests/testProcessorNode.go Show resolved Hide resolved
node/chainSimulator/components/coreComponents.go Outdated Show resolved Hide resolved
…s-handler

# Conflicts:
#	factory/processing/processComponents.go
#	factory/processing/processComponents_test.go
@@ -23,26 +22,12 @@ func TestNewCoreComponentsFactory(t *testing.T) {
require.NotNil(t, ccf)
require.Nil(t, err)
})
t.Run("nil genesis nodes setup factory, should return error", func(t *testing.T) {
t.Run("nil run type core components, should return error", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need nil pointer checks for other subcomponents inside RunType

}
if check.IfNil(args.EnableEpochsFactory) {
return nil, enablers.ErrNilEnableEpochsFactory
if check.IfNil(args.RunTypeCoreComponents) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to check those subcomps not to be nil.

@@ -239,6 +240,13 @@ func readConfigs(ctx *cli.Context, log logger.Logger) (*sovereignConfig.Sovereig
}
log.Debug("config", "file", sovereignExtraConfigPath)

configurationPaths.Epoch = ctx.GlobalString(epochConfigurationFile.Name)
sovereignEpochConfig, err := sovereignConfig.LoadSovereignEpochConfig(configurationPaths.Epoch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add these?
These are already loaded within enableEpochs file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is different. It's loading SovereignEpochConfig struct, not the EpochConfig

@@ -15,3 +16,14 @@ func LoadSovereignGeneralConfig(filepath string) (*config.SovereignConfig, error

return cfg, nil
}

// LoadSovereignEpochConfig returns the epoch config necessary by sovereign by reading it from the provided file
func LoadSovereignEpochConfig(filepath string) (*config.SovereignEpochConfig, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this. These flags are already in an existing file that is being loaded anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is loading the SovereignEpochConfig struct

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 86.33094% with 19 lines in your changes missing coverage. Please review.

Project coverage is 77.69%. Comparing base (000cff6) to head (2c0776e).
Report is 1235 commits behind head on feat/chain-go-sdk.

Files with missing lines Patch % Lines
node/nodeRunner.go 0.00% 13 Missing ⚠️
factory/runType/runTypeCoreComponentsHandler.go 75.00% 1 Missing and 1 partial ⚠️
genesis/process/genesisBlockCreator.go 33.33% 1 Missing and 1 partial ⚠️
...ode/chainSimulator/components/processComponents.go 0.00% 1 Missing ⚠️
...hainSimulator/components/testOnlyProcessingNode.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           feat/chain-go-sdk    #6626      +/-   ##
=====================================================
+ Coverage              77.68%   77.69%   +0.01%     
=====================================================
  Files                    928      963      +35     
  Lines                 106315   108696    +2381     
=====================================================
+ Hits                   82593    84456    +1863     
- Misses                 18035    18416     +381     
- Partials                5687     5824     +137     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…s-handler

# Conflicts:
#	factory/processing/processComponents.go
#	genesis/process/genesisBlockCreator.go
#	integrationTests/realcomponents/processorRunner.go
#	node/nodeRunner.go
@multiversx multiversx deleted a comment from github-actions bot Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants