Skip to content

Commit

Permalink
Fix get validators (#167)
Browse files Browse the repository at this point in the history
* Get available validator by deposit data index

Signed-off-by: cyc60 <[email protected]>

* Fix deposit data index error

Signed-off-by: cyc60 <[email protected]>

* Markdown fixes

Signed-off-by: cyc60 <[email protected]>

---------

Signed-off-by: cyc60 <[email protected]>
Co-authored-by: cyc60 <[email protected]>
  • Loading branch information
tsudmi and cyc60 authored Sep 18, 2023
1 parent 8f6fa03 commit d86f9d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ then imported to the remote signer. Local keystores are removed
as a result of this command since they no longer need to be present.
Notes:
- You will need to run this command every time the oracle set
changes, or the threshold needed to recover exit signatures
(`exit_signature_recover_threshold`) changes.
Expand All @@ -308,7 +309,7 @@ Notes:
--remote-signer-url=http://signer:9000
```
```
``` text
Successfully generated 11 key shares for 1 private key(s)!
Successfully imported 11 key shares into remote signer.
Removed keystores from local filesystem.
Expand All @@ -318,7 +319,7 @@ Done. Successfully configured operator to use remote signer for 1 public key(s)!
#### `remote-signer-setup` options
- `--vault` - The vault address.
- `--remote-signer-url` - The base URL of the remote signer, e.g. http://signer:9000
- `--remote-signer-url` - The base URL of the remote signer, e.g. <http://signer:9000>
- `--remove-existing-keys` - Include this flag to remove any keys present in the signer that are not needed by the operator.
Can be used to remove outdated keyshares from the remote signer when the set of oracles changes,
see note above.
Expand All @@ -338,11 +339,10 @@ using the `--remote-signer-url` flag:
You should see a message similar to this one after starting the operator:
```
``` text
Using remote signer at http://remote-signer:9000 for 10 public keys
```
## Misc commands
### Validators voluntary exit
Expand Down
5 changes: 4 additions & 1 deletion src/validators/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ async def get_available_validators(
remote_signer_pubkeys = list(remote_signer_config.pubkeys_to_shares.keys())

for i in range(start_index, start_index + count):
validator = deposit_data.validators[i]
try:
validator = deposit_data.validators[i]
except IndexError:
break
if len(keystores) > 0 and validator.public_key not in keystores:
logger.warning(
'Cannot find validator with public key %s in imported keystores.',
Expand Down
3 changes: 2 additions & 1 deletion src/validators/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ async def register_validators(
deposit_data=deposit_data,
count=validators_count,
)
if not validators:
if len(validators) < validators_count:
logger.warning(
'There are not enough available validators in the current deposit data '
'to proceed with registration. '
'To register additional validators, you must upload new deposit data.'
)
if not validators:
return

tx_validators, multi_proof = get_validators_proof(
Expand Down

0 comments on commit d86f9d6

Please sign in to comment.