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

Regen and save historical states as default #5544

Merged
merged 12 commits into from
Apr 20, 2020
Merged

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Apr 20, 2020

This fixes #5537

Change list:

  • Removed interaction menu. Set regenerating and saving of historical states as default once --disable-new-state-mgmt flag is off
  • Fixed issue Regen and save historical state is broken #5537 by correctly feed in parent state and not last state

Tested it ~10 times using the DBs in Minio. Can confirm this implementation is reliably working
Screen Shot 2020-04-20 at 11 46 50 AM

@terencechain terencechain added Ready For Review A pull request ready for code review Priority: High High priority item labels Apr 20, 2020
@terencechain terencechain requested a review from a team as a code owner April 20, 2020 18:58
@terencechain terencechain self-assigned this Apr 20, 2020
rauljordan
rauljordan previously approved these changes Apr 20, 2020
return err
// For whatever reason if node is unable to delete a state due to
// state is finalized, it is more reasonable to continue than to exit.
continue
Copy link
Member

Choose a reason for hiding this comment

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

Want to log a warning?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

@@ -54,6 +56,10 @@ func (kv *Store) regenHistoricalStates(ctx context.Context) error {
if err != nil {
return err
}
cacheState, err := lru.New(int(params.BeaconConfig().SlotsPerEpoch) * 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

can this cache size be at the top of the file as a const

Copy link
Member

Choose a reason for hiding this comment

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

It's never used again so we should let this be GC'd after this method returns

@@ -54,6 +56,10 @@ func (kv *Store) regenHistoricalStates(ctx context.Context) error {
if err != nil {
return err
}
cacheState, err := lru.New(int(params.BeaconConfig().SlotsPerEpoch) * 2)
Copy link
Member

Choose a reason for hiding this comment

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

It's never used again so we should let this be GC'd after this method returns

@prylabs-bulldozer prylabs-bulldozer bot merged commit 2a0711a into master Apr 20, 2020
@delete-merged-branch delete-merged-branch bot deleted the regen-default branch April 20, 2020 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High High priority item Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regen and save historical state is broken
3 participants