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

Windows client does not create baker credential file #81

Open
concordium-cl opened this issue Sep 22, 2021 · 6 comments
Open

Windows client does not create baker credential file #81

concordium-cl opened this issue Sep 22, 2021 · 6 comments
Labels
[Sev] Low Non-essential capability is affected. [Type] Bug Something isn't working

Comments

@concordium-cl
Copy link

Description

When registering as baker via the Windows client with baker add, the baker credential file is not created. However, a bakerID is assigned, the account is marked as baking in the mobile wallet, and the stake is locked (which makes this issue even worse).

The workaround is to manually add the bakerID to the key file and configure the node with that.

Steps to Reproduce

client_add_baker

Expected Result
Baker credential file is created.

Actual Result
Baker credential file is not created.

Versions

  • Windows client 1.1.1-0
  • Windows node 1.1.2
@concordium-cl concordium-cl transferred this issue from Concordium/concordium-node Sep 22, 2021
@concordium-cl concordium-cl added [Sev] High Essential capability is affected. Workaround not available. [Type] Bug Something isn't working labels Sep 22, 2021
@abizjak
Copy link
Contributor

abizjak commented Sep 23, 2021

This is because you did not wait for finalization. I can see that it is not clear from help or documentation, so we should improve.

Note that this is a recoverable situation since the baker-credentials file is just the baker-keys (caro-keys.json) + baker-id.

@abizjak
Copy link
Contributor

abizjak commented Sep 23, 2021

The help text already states "File to write the baker credentials to, in case of succesful transaction. These can be used to start the node." so the client technically behaves as it claims.

What do you propose the behaviour should be? Should the "baker-credentials.json" be output immediately, before sending the transaction (and ignoring whether it will succeed or fail?).

For context, if your caro-keys.json is

{
    "signatureVerifyKey": "da709327329b38546775c98f175fa74a98a24a685eca8fbc497492d3b45f0817",
    "aggregationSignKey": "5e4f82239b6cc5274e6c4c654be6db93f3abaa0929ab822e0afd1636aa7eaa0e",
    "electionPrivateKey": "b190fdf621df909cbe6a3302c43844843b319adbd37de5d5abe6f3f1cf608a4a",
    "aggregationVerifyKey": "88bd02ef71e6b232f7ea4944017ef37245f7da6e4a9692c45b362a386d3eea2420fc08383445fef57d0db818c464091f05b8b2ff87918f59ab78840bc1b97272c494c88f70fa6ac868d17a9b29087fae1dc1bbaabbd02824b5c725147720ddd1",
    "signatureSignKey": "2ca6e081c960f9583a72b3c3fcc1af4ff17edef85c1401fbe7dcbd74d0b2f2d6",
    "electionVerifyKey": "498d7824e994d60a49525a7b28fed5981fab1269d352335a4a98b1ab50e70b69"
}

then baker-credentials.json is

{
    "signatureVerifyKey": "da709327329b38546775c98f175fa74a98a24a685eca8fbc497492d3b45f0817",
    "aggregationSignKey": "5e4f82239b6cc5274e6c4c654be6db93f3abaa0929ab822e0afd1636aa7eaa0e",
    "electionPrivateKey": "b190fdf621df909cbe6a3302c43844843b319adbd37de5d5abe6f3f1cf608a4a",
    "aggregationVerifyKey": "88bd02ef71e6b232f7ea4944017ef37245f7da6e4a9692c45b362a386d3eea2420fc08383445fef57d0db818c464091f05b8b2ff87918f59ab78840bc1b97272c494c88f70fa6ac868d17a9b29087fae1dc1bbaabbd02824b5c725147720ddd1",
    "signatureSignKey": "2ca6e081c960f9583a72b3c3fcc1af4ff17edef85c1401fbe7dcbd74d0b2f2d6",
    "electionVerifyKey": "498d7824e994d60a49525a7b28fed5981fab1269d352335a4a98b1ab50e70b69",
    "bakerId": 17
}

so no information is lost by not writing to the file, it is only inconvenient.

@concordium-cl
Copy link
Author

But the transaction was finalized eventually and I still didn't get the file?

I did the workaround with writing the bakerID manually in my key file to configure the node with. I am not sure though that we state that anywhere in the documentation.

@abizjak
Copy link
Contributor

abizjak commented Sep 23, 2021

But the transaction was finalized eventually and I still didn't get the file?

Yes, but that is because of a fundamental limitation of the command-line tool like this. You killed the program before it got to that stage. Each time you invoke concordium-client it is a separate program run, with no state being kept in between apart from account keys.

The client does not support "sessions" so that it would remember that it has sent the transaction so that when later querying it would complete the initial action and write the file. Each program

Maybe the best thing to do would be to change the behaviour so that the baker-credentials file is output immediately, before the transaction is sent.

Alternatively document better and warn the user that the file will not be output if they terminate the program.

@concordium-cl
Copy link
Author

Tested more patiently again. @abizjak is right, if you let client finish, the credentials are created. You are also asked if you want to encrypt the credential file, which does not happen when you use ctrl-c.

@concordium-cl
Copy link
Author

Create the file in any case, don't wait for transaction to be finalized.

@concordium-cl concordium-cl added [Sev] Low Non-essential capability is affected. and removed [Sev] High Essential capability is affected. Workaround not available. labels Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Sev] Low Non-essential capability is affected. [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants