Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--client-type teku ==> --client-type old-teku #64

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions eth_validator_watcher/beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion eth_validator_watcher/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class BeaconType(str, Enum):
LIGHTHOUSE = "lighthouse"
NIMBUS = "nimbus"
PRYSM = "prysm"
TEKU = "teku"
OLD_TEKU = "old-teku"
OTHER = "other"


Expand Down
4 changes: 3 additions & 1 deletion tests/beacon/test_get_validators_liveness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
12 changes: 6 additions & 6 deletions tests/entrypoint/test__handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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"),
)
Expand Down
8 changes: 4 additions & 4 deletions tests/missed_attestations/test_process_missed_attestations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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,
)
Expand All @@ -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}

Expand All @@ -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,
)
Expand Down