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

Remote Key Manager API(web3signer) #10302

Merged
merged 78 commits into from
Apr 11, 2022
Merged

Remote Key Manager API(web3signer) #10302

merged 78 commits into from
Apr 11, 2022

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Mar 2, 2022

What type of PR is this?

Uncomment one line below and remove others.

Feature

What does this PR do? Why is it needed?

As a node operator, I would like to be able to list, import, and delete public keys defined for Prysm's Web3Signer feature.
The definitions of these APIs are consistent across all client teams and listed here. This will enable institutions to migrate keys from clients via web3signer as well as

Which issues(s) does this PR fix?

Fixes #10293

@james-prysm james-prysm added Enhancement New feature or request API Api related tasks Web3Signer Web3Signer related tasks Keymanager-API keymanager-api-standards labels Mar 2, 2022
providedPublicKeys, err := km.client.GetPublicKeys(ctx, km.publicKeysURL)
if err != nil {
erroredResponsesTotal.Inc()
return nil, errors.Wrap(err, fmt.Sprintf("could not get public keys from remote server url: %v", km.publicKeysURL))
}
// makes sure that if the public keys are deleted the validator does not call URL again.
km.publicKeysUrlCalled = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no scenario where we should revert the value back to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not after it starts, this is to avoid it from calling the URL endpoint accidentally after removing the last key ( when there are 0 keys)

validator/keymanager/remote-web3signer/keymanager.go Outdated Show resolved Hide resolved
if found {
importedRemoteKeysStatuses[i] = &ethpbservice.ImportedRemoteKeysStatus{
Status: ethpbservice.ImportedRemoteKeysStatus_DUPLICATE,
Message: fmt.Sprintf("Duplicate pubkey: %v, already in use", hexutil.Encode(pubKey[:])),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Message: fmt.Sprintf("Duplicate pubkey: %v, already in use", hexutil.Encode(pubKey[:])),
Message: fmt.Sprintf("Duplicate pubkey: %#x, already in use", pubKey[:]),

I think this should also work. If it does, you can make similar changes in other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried doing this but it displays in the weird byte version not the 0x.....

validator/keymanager/remote-web3signer/keymanager.go Outdated Show resolved Hide resolved
validator/keymanager/remote-web3signer/keymanager.go Outdated Show resolved Hide resolved
validator/rpc/standard_api.go Outdated Show resolved Hide resolved
validator/rpc/standard_api.go Outdated Show resolved Hide resolved
validator/rpc/standard_api.go Outdated Show resolved Hide resolved
validator/rpc/standard_api.go Outdated Show resolved Hide resolved
validator/rpc/standard_api.go Outdated Show resolved Hide resolved
james-prysm and others added 21 commits April 8, 2022 13:43
@james-prysm james-prysm changed the title Remote Key Manager API(web3signer) Remote Key Manager API(web3signer)- WIP Apr 11, 2022
@james-prysm james-prysm changed the title Remote Key Manager API(web3signer)- WIP Remote Key Manager API(web3signer) Apr 11, 2022
@rauljordan rauljordan merged commit 64f64f0 into develop Apr 11, 2022
@rauljordan rauljordan deleted the remote-keymanager-api branch April 11, 2022 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Enhancement New feature or request Keymanager-API keymanager-api-standards Web3Signer Web3Signer related tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remote Keymanager API (Web3Signer): List,Import, and Delete
5 participants