-
Notifications
You must be signed in to change notification settings - Fork 678
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
remove state commit on disconnect #3385
base: master
Are you sure you want to change the base?
Conversation
if err := vm.state.Commit(); err != nil { | ||
return err | ||
} |
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.
if we want to we can move this to SetPreference
(or some periodic go routine like mempool pruning etc). I'd imagine block acceptance should be sufficient enough though.
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.
Another thing you can do is to check when was the last time you committed the disconnected nodes. If it's less than, say, 1 second ago, then not commit.
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.
yea good idea we could do that instead. but I slightly think that state should be commited with respect to chain progress.
This PR has become stale because it has been open for 30 days with no activity. Adding the |
This PR has become stale because it has been open for 30 days with no activity. Adding the |
Why this should be merged
Committing state adds an overhead on peer disconnects
How this works
Removes state commit from disconnect. Block acceptance/Shutdown should be sufficient for writing disk to the state.
How this was tested
existing UTs should cover this