Skip to content

Commit

Permalink
Add help message in case of bad --beacon-type configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nalepae committed Oct 25, 2023
1 parent d27d916 commit 9d703a1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ You did not had ideal target rewards. | ```🎯 Our validator 0x8000118f, 0x80a2
You did not had ideal head rewards. | ```🗣️ Our validator 0x8005f5e8, 0x801910e5, 0x80193dd5, 0x801a26e9, 0x80285258 and 0 more had not ideal rewards on head at epoch 215200```
The chain is not yet started. | ```⏱️ The chain will start in 1 days, 1 hours, 3 minutes and 48 seconds.```

If you see this kind of message:
```
❓ Missed attestations detection is disabled for epoch 238030.
❓ You can ignore this message if the watcher just started lessthan one epoch ago. Otherwise, please check that you used the correct --beacon-type option (currently set to `other`).
❓ Use `--help` for more details.
```

If you just started the watcher less than one epoch ago (and especially, if you started the watcher in during the few last slots of the epoch), then you can safely ignore this message.
Else, please check you use the correct `--beacon-type` option.

Slack messages
--------------
If a Slack channel is specified, the slack messages are sent according to the following events:
Expand Down
11 changes: 9 additions & 2 deletions eth_validator_watcher/beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,17 @@ def get_validators_liveness(
# If we are here, it means the requested epoch is too old, which
# could be normal if the watcher just started
print(
f"👵 Liveness requested epoch is too old: {epoch}. "
"This message should be displayed only at the watcher start."
f"❓ Missed attestations detection is disabled for epoch {epoch}. "
)

print(
"❓ You can ignore this message if the watcher just started less "
"than one epoch ago. Otherwise, please check that you used the correct "
f"`--beacon-type` option (currently set to `{beacon_type}`). "
)

print("❓ Use `--help` for more details.")

return {index: True for index in validators_index}

validators_liveness_dict = response.json()
Expand Down
16 changes: 7 additions & 9 deletions eth_validator_watcher/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,23 @@
def handler(
beacon_url: str = Option(..., help="URL of beacon node", show_default=False),
execution_url: str = Option(None, help="URL of execution node", show_default=False),
pubkeys_file_path: Path
| None = Option(
pubkeys_file_path: Optional[Path] = Option(
None,
help="File containing the list of public keys to watch",
exists=True,
file_okay=True,
dir_okay=False,
show_default=False,
),
web3signer_url: str
| None = Option(
web3signer_url: Optional[str] = Option(
None, help="URL to web3signer managing keys to watch", show_default=False
),
fee_recipient: str
| None = Option(
fee_recipient: Optional[str] = Option(
None,
help="Fee recipient address - --execution-url must be set",
show_default=False,
),
slack_channel: str
| None = Option(
slack_channel: Optional[str] = Option(
None,
help="Slack channel to send alerts - SLACK_TOKEN env var must be set",
show_default=False,
Expand All @@ -120,7 +116,9 @@ def handler(
relay_url: List[str] = Option(
[], help="URL of allow listed relay", show_default=False
),
liveness_file: Path | None = Option(None, help="Liveness file", show_default=False),
liveness_file: Optional[Path] = Option(
None, help="Liveness file", show_default=False
),
) -> None:
"""
🚨 Ethereum Validator Watcher 🚨
Expand Down

0 comments on commit 9d703a1

Please sign in to comment.