-
Notifications
You must be signed in to change notification settings - Fork 90
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
charon create enr
overwrites an existing one on disk
#893
Comments
I think that was an issue with the previous versions but not with the latest version |
I'm curious as to why you had this issue since you are on |
The current behaviour is as follows:
|
The current behaviour for
NOTE: No warning is logged when overwriting an existing key when |
@xenowits just error in |
For Note that From https://enr-viewer.com/: Example output:
can add a |
Suggest also updating the From: |
- `charon create enr` now errors when `charon-enr-private-key` already exists. - `charon enr` now also outputs`secp256k1 pubkey`, `signature` and `seq` in addition to the `enr` when the `--verbose` flag is provided. category: refactor ticket: #893
Problem to be solved
I wanted to reassure people that calling
charon enr
again on the same private key will make an ENR that looks different, but has the same private key in it under the hood. While testing I rancharon enr
, copied it into enr-viewer.com, then rancharon create enr
, got an enr that looked different, so I put it int enr-viewer.com in another tab to assert that the public keys would be the same until I realised they didn't match.Investigating further I saw that
charon create enr
seemed happy to silently overwrite an existing private key found there.Note, this was with a local
go install
charon version:v0.7.0 [git_commit_hash=dd47136,git_commit_time=2022-07-07T15:39:53Z]
so this may be fixed in later versions.Proposed solution
If there is a file at
.charon/charon-enr-private-key
or wherever directed, log something likecharon-enr-private-key already present, using it
and generate an ENR from that, rather than creating a new one and overwriting it.If what's present doesn't work as a private key (can't open/read file, not an integer parsed out of it etc.) the command should fail with
Unrecognised charon-enr-private-key file present, failed to issue an ENR from it
.Out of Scope
If there is anything to highlight as out of scope for this issue, please outline it here.
The text was updated successfully, but these errors were encountered: