diff --git a/README.md b/README.md index 14dce22..bd44865 100644 --- a/README.md +++ b/README.md @@ -61,33 +61,35 @@ 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|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. │ -╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─ 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|old-prysm|old-teku|other] Use this option if connected to a Teku < 23.6.0, Prysm < 4.0.8, 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 < 4.0.8, │ +│ 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. │ +│ [default: BeaconType.OTHER] │ +│ --relay-url TEXT URL of allow listed relay │ +│ --liveness-file PATH Liveness file │ +│ --help Show this message and exit. │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` Beacon nodes compatibility -------------------------- Beacon type | Compatibility -----------------|---------------------------------------------------------------------------------------------------------- -Prysm | Partial with `--beacon-type=prysm` - Rewards computation disabled. See https://github.com/prysmaticlabs/prysm/issues/11581 for more details. +Lighthouse | Full with `--beacon-type=lighthouse`. See https://github.com/sigp/lighthouse/issues/4243 for more details. +Prysm `>= 4.0.8` | Full. +Prysm `< 4.0.8 ` | Partial with `--beacon-type=old-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=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 2e031e2..55e7827 100644 --- a/eth_validator_watcher/beacon.py +++ b/eth_validator_watcher/beacon.py @@ -202,13 +202,14 @@ def get_rewards( # https://github.com/status-im/nimbus-eth2/issues/5138, # we just assume there is no rewards at all - if beacon_type in {BeaconType.NIMBUS, BeaconType.PRYSM}: + if beacon_type in {BeaconType.NIMBUS, BeaconType.OLD_PRYSM}: if self.__first_rewards_call: self.__first_rewards_call = False print( ( - "⚠️ You are using Prysm or Nimbus. Rewards will be ignored. " - "See https://github.com/prysmaticlabs/prysm/issues/11581 " + "⚠️ You are using Prysm < 4.0.8 or Nimbus. Rewards will be " + "ignored. See " + "https://github.com/prysmaticlabs/prysm/issues/11581 " "(Prysm) & https://github.com/status-im/nimbus-eth2/issues/5138 " "(Nimbus) for more information." ) @@ -261,7 +262,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.OLD_PRYSM: self.__get_validators_liveness_beacon_api, BeaconType.OLD_TEKU: self.__get_validators_liveness_old_teku, BeaconType.OTHER: self.__get_validators_liveness_beacon_api, } diff --git a/eth_validator_watcher/entrypoint.py b/eth_validator_watcher/entrypoint.py index c6e44da..025e013 100644 --- a/eth_validator_watcher/entrypoint.py +++ b/eth_validator_watcher/entrypoint.py @@ -103,15 +103,15 @@ def handler( BeaconType.OTHER, case_sensitive=False, help=( - "Use this option if connected to a Teku < 23.6.0, Prysm, Lighthouse or " - "Nimbus beacon node. " + "Use this option if connected to a Teku < 23.6.0, Prysm < 4.0.8, " + "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/prysmaticlabs/prysm/issues/11581 for Prysm < 4.0.8, " "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." ), - show_default=False, + show_default=True, ), relay_url: List[str] = Option( [], help="URL of allow listed relay", show_default=False diff --git a/eth_validator_watcher/models.py b/eth_validator_watcher/models.py index 1703c45..4f5dd5f 100644 --- a/eth_validator_watcher/models.py +++ b/eth_validator_watcher/models.py @@ -119,7 +119,7 @@ class CoinbaseTrade(BaseModel): class BeaconType(str, Enum): LIGHTHOUSE = "lighthouse" NIMBUS = "nimbus" - PRYSM = "prysm" + OLD_PRYSM = "old-prysm" OLD_TEKU = "old-teku" OTHER = "other" diff --git a/tests/beacon/test_get_rewards.py b/tests/beacon/test_get_rewards.py index 9f874f4..bb4beb6 100644 --- a/tests/beacon/test_get_rewards.py +++ b/tests/beacon/test_get_rewards.py @@ -13,7 +13,7 @@ def test_get_rewards_not_supported() -> None: expected = Rewards(data=Rewards.Data(ideal_rewards=[], total_rewards=[])) - actual = beacon.get_rewards(BeaconType.PRYSM, 42, {8499, 8500}) + actual = beacon.get_rewards(BeaconType.OLD_PRYSM, 42, {8499, 8500}) assert expected == actual actual = beacon.get_rewards(BeaconType.NIMBUS, 42, {8499, 8500}) diff --git a/tests/rewards/test_process_rewards_net.py b/tests/rewards/test_process_rewards_net.py index 0b6004d..43019ca 100644 --- a/tests/rewards/test_process_rewards_net.py +++ b/tests/rewards/test_process_rewards_net.py @@ -3,17 +3,17 @@ from eth_validator_watcher.models import BeaconType, Rewards, Validators from eth_validator_watcher.rewards import ( - net_ideal_sources_count, - net_ideal_targets_count, - net_ideal_heads_count, + net_actual_heads_count, net_actual_neg_sources_count, - net_actual_pos_sources_count, net_actual_neg_targets_count, + net_actual_pos_sources_count, net_actual_pos_targets_count, - net_actual_heads_count, + net_ideal_heads_count, + net_ideal_sources_count, + net_ideal_targets_count, + net_suboptimal_heads_rate_gauge, net_suboptimal_sources_rate_gauge, net_suboptimal_targets_rate_gauge, - net_suboptimal_heads_rate_gauge, process_rewards, ) from eth_validator_watcher.utils import LimitedDict diff --git a/tests/rewards/test_process_rewards_our.py b/tests/rewards/test_process_rewards_our.py index 4f7f235..b096967 100644 --- a/tests/rewards/test_process_rewards_our.py +++ b/tests/rewards/test_process_rewards_our.py @@ -3,17 +3,17 @@ from eth_validator_watcher.models import BeaconType, Rewards, Validators from eth_validator_watcher.rewards import ( - our_ideal_sources_count, - our_ideal_targets_count, - our_ideal_heads_count, + our_actual_heads_count, our_actual_neg_sources_count, - our_actual_pos_sources_count, our_actual_neg_targets_count, + our_actual_pos_sources_count, our_actual_pos_targets_count, - our_actual_heads_count, + our_ideal_heads_count, + our_ideal_sources_count, + our_ideal_targets_count, + our_suboptimal_heads_rate_gauge, our_suboptimal_sources_rate_gauge, our_suboptimal_targets_rate_gauge, - our_suboptimal_heads_rate_gauge, process_rewards, ) from eth_validator_watcher.utils import LimitedDict