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

Complex ways to manage validator client database path #13391

Open
nalepae opened this issue Dec 29, 2023 · 2 comments · Fixed by #13392
Open

Complex ways to manage validator client database path #13391

nalepae opened this issue Dec 29, 2023 · 2 comments · Fixed by #13392
Labels
Bug Something isn't working

Comments

@nalepae
Copy link
Contributor

nalepae commented Dec 29, 2023

Describe the bug

This ticket discuss the way how validator client database path is managed.
I'm on MacOS.

Here are the interesting corresponding lines when running: ./prysm.sh validator --help:

cmd OPTIONS:
...
--datadir value.      Data directory for the databases (default: "/Users/manu/Library/Eth2")
...

validator OPTIONS:
...
  --wallet-dir value      Path to a wallet directory on-disk for Prysm validator accounts (default: "/Users/manu/Library/Eth2Validators/prysm-wallet-v2")
...

Without specifying --datadir

1. Running this command: ./prysm.sh validator --goerli
VC DB is stored at /Users/manu/Library/Eth2Validators/prysm-wallet-v2/direct/validator.db.
==> validator.dbis stored in the default value of --wallet-dir/direct. (direct subdirectory is added.)

2. Running this command: ./prysm.sh validator --goerli --validators-external-signer-url http://localhost:9000
VC DB is stored at /Users/manu/Library/Eth2Validators/prysm-wallet-v2/validator.db.
==> validator.db is stored in the default value of --wallet-dir. (Compared to 1., there is no direct subdirectory added.)

3. Running this command: ./prysm.sh validator --goerli --wallet-dir /tmp/wd
VC DB is stored at /tmp/wd/direct/validator.db.
==> validator.db is stored in the specified value of --wallet-dir/direct (direct subdirectory is added.)

4. Running this command: ./prysm.sh validator --goerli --validators-external-signer-url http://localhost:9000 --wallet-dir /tmp/wd
VC DB is stored at /tmp/wd/validator.db.
==> validator.db is stored in the specified value of --wallet-dir. (Compared to 3., there is no direct subdirectory added.)

With specifying --datadir

1. Running this command: ./prysm.sh validator --goerli --datadir /tmp/dd
VC DB is stored at /tmp/dd/validator.db.
==> validator.dbis stored in the specified value of --datadir. (there is no direct subdirectory added.)

2. Running this command: ./prysm.sh validator --goerli --validators-external-signer-url http://localhost:9000 --datadir /tmp/dd
VC DB is stored at /tmp/dd/validator.db.
==> validator.dbis stored in the specified value of --datadir. (there is no direct subdirectory added.)

3. Running this command: ./prysm.sh validator --goerli --wallet-dir /tmp/wd --datadir /tmp/dd
VC DB is stored at /tmp/dd/validator.db.
==> validator.dbis stored in the specified value of --datadir. (there is no direct subdirectory added.) --datadir supersedes --wallet-dir.

4. Running this command: ./prysm.sh validator --goerli --validators-external-signer-url http://localhost:9000 --wallet-dir /tmp/wd
VC DB is stored at /tmp/dd/validator.db.
==> validator.dbis stored in the specified value of --datadir. (there is no direct subdirectory added.) --datadir supersedes --wallet-dir.

Summary

  • Default --datadir value is never used. If no --datadir is specified, VC DB is stored in the (default or not) value of --wallet-dir. If no --validators-external-signer-url is specified, a /direct subdirectory is added.
  • If --datadir is specified, the value of --wallet-dir is discarded. VC DB is always stored under the value specified under --datadir, whatever the use of --validators-external-signer-url (No direct subdirectory added).

Current issues

  • In my opinion, there is no really reason to ever store the DB under --wallet-dir (default or specified value). The DB should always be stored under --datadir (default or specified value), as mentioned in the --datadir help message.
  • If a user do not specify --datadir and switch the --validators-external-signer-url flag, then the previous validator.db file won't be used any more. (Because of the /direct subdirectory)
  • Tools like Migrate Up, Migrate Down, EIP-3976 export or EIP-3076 import rely on --dadatir, and not on --wallet-dir

Proposed solution

  • Always store the DB under the value of --datadir, and never add /direct subdirectory.
@nalepae nalepae added the Bug Something isn't working label Dec 29, 2023
@nalepae
Copy link
Contributor Author

nalepae commented Dec 29, 2023

Also, if --interop-num-validators is used, the behaviour differs.

@james-prysm
Copy link
Contributor

reopening this issue for web3signer pathing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants