-
Notifications
You must be signed in to change notification settings - Fork 203
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
updated core enums in state changes. #6495
Conversation
This PR should be taken into consideration too: multiversx/mx-chain-core-go#324 |
errors/errors.go
Outdated
@@ -601,3 +601,6 @@ var ErrNilEpochSystemSCProcessor = errors.New("nil epoch system SC processor") | |||
|
|||
// ErrNilRelayedTxV3Processor signals that a nil relayed tx v3 processor has been provided | |||
var ErrNilRelayedTxV3Processor = errors.New("nil relayed tx v3 processor") | |||
|
|||
// ErrOnlyReadStateChangesToCollect signals that only read state changes to collect have been configured to be collected. | |||
var ErrOnlyReadStateChangesToCollect = errors.New("cannot collect only read state changes") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. will remove it
config/config.go
Outdated
SnapshotsEnabled bool | ||
AccountsStatePruningEnabled bool | ||
PeerStatePruningEnabled bool | ||
StateChangesDataAnalysis bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change needs to be reflected also in config.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStateComponents_ParseStateChangesTypesToCollect(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add tests for error cases?
// Publish will export state changes | ||
func (scc *dataAnalysisCollector) Publish() error { | ||
// Publish will retrieve the state changes linked with the tx hash. | ||
func (scc *dataAnalysisCollector) Publish() (map[string]*data.StateChanges, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct? this is the same as for normal collector.
my suggestion was to store into levelDB on this Publish, and avoid having Store
function, since this component is used only for data analysis, not for the production flow, at least currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will also save normal state changes to outport driver when running in data analysis mode, which i don't think we want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but in the current implementation if you don't have the outport driver configured you will never publish
, hence the store
function. If you have data analysis enabled and the host driver off, you will still have them persisted in leveldb.
@@ -122,34 +125,48 @@ func (scf *stateComponentsFactory) Create() (*stateComponents, error) { | |||
} | |||
|
|||
func (scf *stateComponentsFactory) createStateChangesCollector() (state.StateChangesCollector, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state changes collector is created 2 times in this file, it should be creating only once for main accounts db and then passed to peer accounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR, but please fix this here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a different collector for PeerAccounts that can be disabled separately from config.
@@ -122,34 +125,48 @@ func (scf *stateComponentsFactory) Create() (*stateComponents, error) { | |||
} | |||
|
|||
func (scf *stateComponentsFactory) createStateChangesCollector() (state.StateChangesCollector, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a different collector for PeerAccounts that can be disabled separately from config.
factory/state/stateComponents.go
Outdated
opts = append(opts, stateChanges.WithCollectRead()) | ||
} | ||
if collectWrite { | ||
opts = append(opts, stateChanges.WithCollectRead()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.WithCollectWrite()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?