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

Can't import account with name null #59

Closed
samlaf opened this issue Feb 1, 2023 · 3 comments
Closed

Can't import account with name null #59

samlaf opened this issue Feb 1, 2023 · 3 comments

Comments

@samlaf
Copy link

samlaf commented Feb 1, 2023

I'm using the lighthouse local_testnet scripts, which create local keystores for the validators on the launched beacon chain.

They create keystores like this, with "name": null

{
    "crypto": {
        "kdf": {
            "function": "scrypt",
            "params": {
                "dklen": 32,
                "n": 2,
                "r": 8,
                "p": 1,
                "salt": "0101010101010101010101010101010101010101010101010101010101010101"
            },
            "message": ""
        },
        "checksum": {
            "function": "sha256",
            "params": {},
            "message": "0535d31da8c72792ec6e706064c4cad942a93b1a39a340d2df8949206fad14e0"
        },
        "cipher": {
            "function": "aes-128-ctr",
            "params": {
                "iv": "c729eabe2fa5855e957da700f7f24255"
            },
            "message": "7af5f565c0c36ea7d249f97074087d25d6ccd10fc6b4dd0407824c7b58be5ddb"
        }
    },
    "uuid": "d1dd0dcb-1e70-4d56-94a1-5e7f861f145b",
    "path": "",
    "pubkey": "8f467e5723deac7659e1ca273e28410cbaa6d495ab66ae77014f4cd21c64b6b5ab9987c9b5537fe0279bd063fe609be7",
    "version": 4,
    "description": "",
    "name": null
}

I can't find a way to import such a file (without removing the name field, which works but is tedious). I tried

  1. ethdo account import --account "Test/whatever" (even tried "Test/null" in case)
    • Error: failed to process: failed to import wallet: account name invalid
  2. ethdo account import --account "Test/"
    • Error: failed to obtain input: account name is required
@mcdee
Copy link
Collaborator

mcdee commented Feb 5, 2023

The name property in the imported JSON needs to be present, so not null. so for example this would work if the data read:

{
  ...
  "name": "import"
}

for example.

@samlaf
Copy link
Author

samlaf commented Feb 5, 2023

It’s been 5 days so I forgot but I’m pretty sure it worked when the name was not present, in which case I could set the imported account name in ethdo to be whatever I like. If that is the case, I think having the name set to null in the file should have the same behavior (let me import it with the name of my choosing).

@mcdee
Copy link
Collaborator

mcdee commented Feb 18, 2023

The issue was in handling the fact that there was a "name" key already present in the keystore explicitly set to null. This situation is now handled and the fix will be available in the next release.

@mcdee mcdee closed this as completed in 5c907bb Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@mcdee @samlaf and others