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

Wrong filepath for priv_validator_key.json #340

Open
MattKetmo opened this issue Nov 5, 2024 · 0 comments
Open

Wrong filepath for priv_validator_key.json #340

MattKetmo opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MattKetmo
Copy link

Hello, I'm an operator running a validator node

Description and context

I notice the story app tries to always look for the ~/.story/story/config/priv_validator_key.json even if I specify a different path in the config.toml.

Steps to reproduce

In my example, I securely mount the validator key using Hashicorp Vault in an in-memory folder located at /vault/secrets, but story appears unable to access it.

$ ls -l ~/.story/story/config/priv_validator_key.json
ls: /home/app/.story/story/config/priv_validator_key.json: No such file or directory

$ grep priv_validator_key ~/.story/story/config/config.toml
priv_validator_key_file = '/vault/secrets/priv_validator_key.json'

$ story validator export
24-11-05 07:49:01.173 ERRO !! Fatal error occurred, app died️ unexpectedly !! 
err="failed to load validator key file: failed to read validator key file: open /home/app/.story/story/config/priv_validator_key.json: no such file or directory" 
stacktrace="[errors.go:39 key_utils.go:36 validator.go:394 validator.go:349 validator.go:389 command.go:985 command.go:1117 command.go:1041 command.go:1034 cmd.go:34 main.go:10 proc.go:272 asm_amd64.s:1700]"

Copying the file from the vault mount point to the home directory works, but this defeats the purpose of the secure vault mount point.

# not wanted
cp /vault/secrets/priv_validator_key.json /home/app/.story/story/config/priv_validator_key.json

Expected behavior

The story app should not read the ~/.story/story/config/priv_validator_key.json file if another path is specified.

Solution recommendation

I've experienced in simalar issue with berachain berachain/beacon-kit#1671 (which also uses a modified version of the cosmos sdk).

Although not exactly identical since berachain was prefixing the path in config.toml with the app home directory.

Here the path in config.toml seems not read at all (at least for the export command).

@MattKetmo MattKetmo added the bug Something isn't working label Nov 5, 2024
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

No branches or pull requests

1 participant