diff --git a/README.md b/README.md index afeb358..5689553 100644 --- a/README.md +++ b/README.md @@ -56,23 +56,23 @@ Command line options -------------------- ``` -╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ -│ * --beacon-url TEXT URL of beacon node [required] │ -│ --execution-url TEXT URL of execution node │ -│ --pubkeys-file-path FILE File containing the list of public keys to watch │ -│ --web3signer-url TEXT URL to web3signer managing keys to watch │ -│ --fee-recipient TEXT Fee recipient address - --execution-url must be set │ -│ --slack-channel TEXT Slack channel to send alerts - SLACK_TOKEN env var must be set │ -│ --beacon-type [lighthouse|nimbus|prysm|teku|other] Use this option if connected to a Teku < 23.6.0, Prysm, Lighthouse or Nimbus │ -│ beacon node. See https://github.com/ConsenSys/teku/issues/7204 for Teku < 23.6.0, │ -│ https://github.com/prysmaticlabs/prysm/issues/11581 for Prysm, │ -│ https://github.com/sigp/lighthouse/issues/4243 for Lighthouse, │ -│ https://github.com/status-im/nimbus-eth2/issues/5019 and │ -│ https://github.com/status-im/nimbus-eth2/issues/5138 for Nimbus. │ -│ --relay-url TEXT URL of allow listed relay │ -│ --liveness-file PATH Liveness file │ -│ --help Show this message and exit. │ -╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ * --beacon-url TEXT URL of beacon node [required] │ +│ --execution-url TEXT URL of execution node │ +│ --pubkeys-file-path FILE File containing the list of public keys to watch │ +│ --web3signer-url TEXT URL to web3signer managing keys to watch │ +│ --fee-recipient TEXT Fee recipient address - --execution-url must be set │ +│ --slack-channel TEXT Slack channel to send alerts - SLACK_TOKEN env var must be set │ +│ --beacon-type [lighthouse|nimbus|prysm|old-teku|other] Use this option if connected to a Teku < 23.6.0, Prysm, Lighthouse or Nimbus │ +│ beacon node. See https://github.com/ConsenSys/teku/issues/7204 for Teku < │ +│ 23.6.0, https://github.com/prysmaticlabs/prysm/issues/11581 for Prysm, │ +│ https://github.com/sigp/lighthouse/issues/4243 for Lighthouse, │ +│ https://github.com/status-im/nimbus-eth2/issues/5019 and │ +│ https://github.com/status-im/nimbus-eth2/issues/5138 for Nimbus. │ +│ --relay-url TEXT URL of allow listed relay │ +│ --liveness-file PATH Liveness file │ +│ --help Show this message and exit. │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` Beacon nodes compatibility @@ -81,7 +81,7 @@ Beacon type | Compatibility -----------------|---------------------------------------------------------------------------------------------------------- Prysm | Partial with `--beacon-type=prysm` - Rewards computation disabled. See https://github.com/prysmaticlabs/prysm/issues/11581 for more details. Teku `>= 23.6.0` | Full. You need to activate the [beacon-liveness-tracking-enabled](https://docs.teku.consensys.net/reference/cli#options) flag on your beacon node. -Teku `< 23.6.0 ` | Full with `--beacon-type=teku`. See https://github.com/ConsenSys/teku/pull/7212 for more details. You need to activate the [beacon-liveness-tracking-enabled](https://docs.teku.consensys.net/reference/cli#options) flag on your beacon node. +Teku `< 23.6.0 ` | Full with `--beacon-type=old-teku`. See https://github.com/ConsenSys/teku/pull/7212 for more details. You need to activate the [beacon-liveness-tracking-enabled](https://docs.teku.consensys.net/reference/cli#options) flag on your beacon node. Lighthouse | Full with `--beacon-type=lighthouse`. See https://github.com/sigp/lighthouse/issues/4243 for more details. Nimbus | Partial with `--beacon-type=nimbus` - Missed attestations detection and rewards computation disabled. See https://github.com/status-im/nimbus-eth2/issues/5019 and https://github.com/status-im/nimbus-eth2/issues/5138 for more details. Lodestar | Not (yet) tested. diff --git a/eth_validator_watcher/beacon.py b/eth_validator_watcher/beacon.py index 41d7bbe..2a5a083 100644 --- a/eth_validator_watcher/beacon.py +++ b/eth_validator_watcher/beacon.py @@ -254,7 +254,7 @@ def get_validators_liveness( beacon_type_to_function = { BeaconType.LIGHTHOUSE: self.__get_validators_liveness_lighthouse, BeaconType.PRYSM: self.__get_validators_liveness_beacon_api, - BeaconType.TEKU: self.__get_validators_liveness_teku, + BeaconType.OLD_TEKU: self.__get_validators_liveness_old_teku, BeaconType.OTHER: self.__get_validators_liveness_beacon_api, } @@ -300,7 +300,7 @@ def __get_validators_liveness_lighthouse( timeout=10, ) - def __get_validators_liveness_teku( + def __get_validators_liveness_old_teku( self, epoch: int, validators_index: set[int] ) -> Response: """Get validators liveness from Teku. diff --git a/eth_validator_watcher/models.py b/eth_validator_watcher/models.py index 88bd26b..1703c45 100644 --- a/eth_validator_watcher/models.py +++ b/eth_validator_watcher/models.py @@ -120,7 +120,7 @@ class BeaconType(str, Enum): LIGHTHOUSE = "lighthouse" NIMBUS = "nimbus" PRYSM = "prysm" - TEKU = "teku" + OLD_TEKU = "old-teku" OTHER = "other" diff --git a/tests/beacon/test_get_validators_liveness.py b/tests/beacon/test_get_validators_liveness.py index 0f397b4..b66858a 100644 --- a/tests/beacon/test_get_validators_liveness.py +++ b/tests/beacon/test_get_validators_liveness.py @@ -80,7 +80,9 @@ def match_request(request) -> bool: assert ( beacon.get_validators_liveness( - beacon_type=BeaconType.TEKU, epoch=1664, validators_index={42, 44, 46} + beacon_type=BeaconType.OLD_TEKU, + epoch=1664, + validators_index={42, 44, 46}, ) == expected ) diff --git a/tests/entrypoint/test__handler.py b/tests/entrypoint/test__handler.py index bfdccdf..77f526d 100644 --- a/tests/entrypoint/test__handler.py +++ b/tests/entrypoint/test__handler.py @@ -24,7 +24,7 @@ def test_fee_recipient_set_while_execution_url_not_set() -> None: web3signer_url=None, fee_recipient="something", slack_channel="MY SLACK CHANNEL", - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, relays_url=[], liveness_file=None, ) @@ -39,7 +39,7 @@ def test_fee_recipient_not_valid() -> None: web3signer_url=None, fee_recipient="something", slack_channel="MY SLACK CHANNEL", - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, relays_url=[], liveness_file=None, ) @@ -54,7 +54,7 @@ def test_slack_token_not_defined() -> None: web3signer_url=None, fee_recipient=None, slack_channel="MY SLACK CHANNEL", - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, relays_url=[], liveness_file=None, ) @@ -97,7 +97,7 @@ def start_http_server(_: int) -> None: web3signer_url=None, fee_recipient=None, slack_channel=None, - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, relays_url=[], liveness_file=None, ) @@ -189,7 +189,7 @@ def process_missed_attestations( epoch: int, ) -> set[int]: assert isinstance(beacon, Beacon) - assert beacon_type is BeaconType.TEKU + assert beacon_type is BeaconType.OLD_TEKU assert epoch_to_index_to_validator_index[1] == { 0: Validator(pubkey="0xaaa", effective_balance=32000000000, slashed=False), 2: Validator(pubkey="0xccc", effective_balance=32000000000, slashed=False), @@ -305,7 +305,7 @@ def write_liveness_file(liveness_file: Path) -> None: web3signer_url="http://localhost:9000", fee_recipient=None, slack_channel="my slack channel", - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, relays_url=["http://my-awesome-relay.com"], liveness_file=Path("/path/to/liveness"), ) diff --git a/tests/missed_attestations/test_process_missed_attestations.py b/tests/missed_attestations/test_process_missed_attestations.py index 1d5cb39..0c9ad94 100644 --- a/tests/missed_attestations/test_process_missed_attestations.py +++ b/tests/missed_attestations/test_process_missed_attestations.py @@ -13,7 +13,7 @@ class Beacon: def get_validators_liveness( beacon_type: BeaconType, epoch: int, validators_index: set[int] ) -> dict[int, bool]: - assert beacon_type is BeaconType.TEKU + assert beacon_type is BeaconType.OLD_TEKU assert epoch == 0 assert validators_index == {42, 43, 44} @@ -30,7 +30,7 @@ def get_validators_liveness( actual = process_missed_attestations( beacon=Beacon(), # type: ignore - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, epoch_to_index_to_validator_index=epoch_to_index_to_validator_client, epoch=1, ) @@ -44,7 +44,7 @@ class Beacon: def get_validators_liveness( beacon_type: BeaconType, epoch: int, validators_index: set[int] ) -> dict[int, bool]: - assert beacon_type is BeaconType.TEKU + assert beacon_type is BeaconType.OLD_TEKU assert epoch == 0 assert validators_index == {42, 43, 44} @@ -61,7 +61,7 @@ def get_validators_liveness( actual = process_missed_attestations( beacon=Beacon(), # type: ignore - beacon_type=BeaconType.TEKU, + beacon_type=BeaconType.OLD_TEKU, epoch_to_index_to_validator_index=epoch_to_index_to_validator_client, epoch=1, )