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

Use validator protection datadir #7355

Merged
merged 79 commits into from Oct 22, 2020
Merged

Conversation

shayzluf
Copy link
Contributor

@shayzluf shayzluf commented Sep 27, 2020

What type of PR is this?

Bug fix

why?
two reasons:

  • extra protection layer
    missing db file is a slashing protection problem. warn users and allow them to copy the db file if its empty
  • allowing users to define their custom protection db location
    some users reported they don't have write permissions to wallet dir and need to configure a different location for it

What does this PR do? Why is it needed?

  • use wallet dir flag as default protection db dir
  • if datadir flag is set use it for protection db (we introduced a breaking change)
  • if file doesn't exist warn user and ask him to give the path to the latest copy
  • Copy existing db from old path to datadir

Which issues(s) does this PR fix?

Fixes #7331

@codecov
Copy link

codecov bot commented Sep 27, 2020

Codecov Report

Merging #7355 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #7355   +/-   ##
=======================================
  Coverage   61.81%   61.81%           
=======================================
  Files         422      422           
  Lines       29866    29866           
=======================================
  Hits        18461    18461           
  Misses       8453     8453           
  Partials     2952     2952           

@shayzluf shayzluf self-assigned this Sep 29, 2020
@shayzluf shayzluf added the Ready For Review A pull request ready for code review label Sep 29, 2020
Copy link
Member

@nisdas nisdas left a comment

Choose a reason for hiding this comment

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

lets reuse our old flag, adding a new flag would just be confusing

@shayzluf
Copy link
Contributor Author

@nisdas reused the same flag

validator/node/node.go Outdated Show resolved Hide resolved
validator/node/node.go Outdated Show resolved Hide resolved
@rauljordan
Copy link
Contributor

PTAL @prestonvanloon and @nisdas

Copy link
Member

@nisdas nisdas left a comment

Choose a reason for hiding this comment

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

PR looks good, had some minor cosmetic comments

validator/accounts/prompt/prompt.go Outdated Show resolved Hide resolved
validator/accounts/prompt/prompt.go Outdated Show resolved Hide resolved
validator/node/node.go Outdated Show resolved Hide resolved
…ection_db_flag

# Conflicts:
#	validator/flags/flags.go
#	validator/main.go
#	validator/node/BUILD.bazel
#	validator/usage.go
Copy link
Member

@nisdas nisdas left a comment

Choose a reason for hiding this comment

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

Please remove the checked in site data

nisdas
nisdas previously approved these changes Oct 22, 2020
@rauljordan
Copy link
Contributor

PTAL @prestonvanloon

@prylabs-bulldozer prylabs-bulldozer bot merged commit ab76bda into master Oct 22, 2020
@delete-merged-branch delete-merged-branch bot deleted the add_protection_db_flag branch October 22, 2020 21:05
rauljordan added a commit that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot initialize validator.db: permission denied
4 participants