Skip to content

Commit

Permalink
Return readonly: false for local keystores (#3490)
Browse files Browse the repository at this point in the history
## Issue Addressed

NA

## Proposed Changes

Indicate that local keystores are `readonly: Some(false)` rather than `None` via the `/eth/v1/keystores` method on the VC API.

I'll mark this as backwards-incompat so we remember to mention it in the release notes. There aren't any type-level incompatibilities here, just a change in how Lighthouse responds to responses.

## Additional Info

- Blocked on #3464
  • Loading branch information
paulhauner committed Aug 24, 2022
1 parent ebd6617 commit c64e17b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion validator_client/src/http_api/keystores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn list<T: SlotClock + 'static, E: EthSpec>(
SigningMethod::LocalKeystore {
ref voting_keystore,
..
} => (voting_keystore.path(), None),
} => (voting_keystore.path(), Some(false)),
SigningMethod::Web3Signer { .. } => (None, Some(true)),
});

Expand Down
4 changes: 2 additions & 2 deletions validator_client/src/http_api/tests/keystores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ fn get_web3_signer_keystores() {
.map(|local_keystore| SingleKeystoreResponse {
validating_pubkey: keystore_pubkey(local_keystore),
derivation_path: local_keystore.path(),
readonly: None,
readonly: Some(false),
})
.chain(remote_vals.iter().map(|remote_val| SingleKeystoreResponse {
validating_pubkey: remote_val.voting_public_key.compress(),
Expand Down Expand Up @@ -1775,7 +1775,7 @@ fn import_same_local_and_remote_keys() {
.map(|local_keystore| SingleKeystoreResponse {
validating_pubkey: keystore_pubkey(local_keystore),
derivation_path: local_keystore.path(),
readonly: None,
readonly: Some(false),
})
.collect::<Vec<_>>();
for response in expected_responses {
Expand Down

0 comments on commit c64e17b

Please sign in to comment.