Skip to content

Commit

Permalink
feat(val-1404): more danger emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
dputko committed Jan 28, 2025
1 parent 4f14298 commit 042808c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/handlers/consolidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ def handle(self, watcher, head: FullBlockInfo):

def _send_withdrawals_address(self, watcher, slot, consolidations: list[ConsolidationRequest]):
alert = CommonAlert(name="HeadWatcherConsolidationSourceWithdrawalAddress", severity="critical")
summary = "‼️⛔️Validator consolidation was requested from Withdrawal Vault source address"
summary = "🚨🚨🚨 Validator consolidation was requested from Withdrawal Vault source address"
self._send_alert(watcher, slot, alert, summary, consolidations)

def _send_source_pubkey(self, watcher, slot, consolidations: list[ConsolidationRequest]):
alert = CommonAlert(name="HeadWatcherConsolidationUserSourcePubkey", severity="info")
summary = "⚠️Consolidation was requested for our validators"
summary = "⚠️⚠️⚠️ Consolidation was requested for our validators"
self._send_alert(watcher, slot, alert, summary, consolidations)

def _send_target_pubkey(self, watcher, slot, consolidations: list[ConsolidationRequest]):
alert = CommonAlert(name="HeadWatcherConsolidationUserTargetPubkey", severity="info")
summary = "⚠️Someone attempts to consolidate their validators to our validators"
summary = "⚠️⚠️⚠️ Someone attempts to consolidate their validators to our validators"
self._send_alert(watcher, slot, alert, summary, consolidations)

def _send_alert(self, watcher, slot: str, alert: CommonAlert, summary: str,
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/el_triggered_exit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def handle(self, watcher, head: FullBlockInfo):

def _send_withdrawal_address_alerts(self, watcher, slot: str, withdrawals: list[WithdrawalRequest]):
alert = CommonAlert(name="HeadWatcherELWithdrawalFromUserWithdrawalAddress", severity="critical")
summary = "🔗‍🏃🚪Our validator triggered withdrawal was requested from our Withdrawal Vault address"
summary = "🚨🚨🚨 Our validator triggered withdrawal was requested from our Withdrawal Vault address"
description = '\n\n'.join(map(lambda w: self._describe_withdrawal(w, watcher.user_keys), withdrawals))
self._send_alert(watcher, alert, summary, description, slot)

def _send_our_validators_alert(self, watcher, slot: str, withdrawals: list[WithdrawalRequest]):
alert = CommonAlert(name="HeadWatcherUserELWithdrawal", severity="info")
summary = "🔗‍🏃🚪Our validator triggered withdrawal was requested"
summary = "⚠️⚠️⚠️ Our validator triggered withdrawal was requested"
description = '\n\n'.join(map(lambda w: self._describe_withdrawal(w, watcher.user_keys), withdrawals))
self._send_alert(watcher, alert, summary, description, slot)

Expand Down
8 changes: 4 additions & 4 deletions tests/execution_requests/test_consolidations.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_source_is_valid_withdrawal_address(withdrawal_address: str, watcher: Wa
alert = watcher.alertmanager.sent_alerts[0]
assert alert.labels.alertname.startswith('HeadWatcherConsolidationSourceWithdrawalAddress')
assert alert.labels.severity == 'critical'
assert alert.annotations.summary == "‼️⛔️Validator consolidation was requested from Withdrawal Vault source address"
assert alert.annotations.summary == "🚨🚨🚨 Validator consolidation was requested from Withdrawal Vault source address"
assert random_source_pubkey in alert.annotations.description
assert random_target_pubkey in alert.annotations.description
assert withdrawal_address in alert.annotations.description
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_consolidate_user_validator(user_validator: TestValidator, watcher: Watc
alert = watcher.alertmanager.sent_alerts[0]
assert alert.labels.alertname.startswith('HeadWatcherConsolidationUserSourcePubkey')
assert alert.labels.severity == 'info'
assert alert.annotations.summary == "⚠️Consolidation was requested for our validators"
assert alert.annotations.summary == "⚠️⚠️⚠️ Consolidation was requested for our validators"
assert random_source_address in alert.annotations.description
assert random_target_pubkey in alert.annotations.description
assert user_validator.pubkey in alert.annotations.description
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_donation(user_validator: TestValidator, watcher: WatcherStub):
alert = watcher.alertmanager.sent_alerts[0]
assert alert.labels.alertname.startswith('HeadWatcherConsolidationUserTargetPubkey')
assert alert.labels.severity == 'info'
assert alert.annotations.summary == "⚠️Someone attempts to consolidate their validators to our validators"
assert alert.annotations.summary == "⚠️⚠️⚠️ Someone attempts to consolidate their validators to our validators"
assert random_source_address in alert.annotations.description
assert random_source_pubkey in alert.annotations.description
assert user_validator.pubkey in alert.annotations.description
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_group_similar_alerts(user_validator: TestValidator, watcher: WatcherStu
alert = watcher.alertmanager.sent_alerts[0]
assert alert.labels.alertname.startswith('HeadWatcherConsolidationUserSourcePubkey')
assert alert.labels.severity == 'info'
assert alert.annotations.summary == "⚠️Consolidation was requested for our validators"
assert alert.annotations.summary == "⚠️⚠️⚠️ Consolidation was requested for our validators"
assert random_source_address in alert.annotations.description
assert random_target_pubkey1 in alert.annotations.description
assert random_target_pubkey2 in alert.annotations.description
Expand Down
6 changes: 3 additions & 3 deletions tests/execution_requests/test_withdrawals.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_user_validator(user_validator: TestValidator, watcher: WatcherStub):
alert = watcher.alertmanager.sent_alerts[0]
assert alert.labels.alertname.startswith('HeadWatcherUserELWithdrawal')
assert alert.labels.severity == 'info'
assert alert.annotations.summary == "🔗‍🏃🚪Our validator triggered withdrawal was requested"
assert alert.annotations.summary == "⚠️⚠️⚠️ Our validator triggered withdrawal was requested"
assert user_validator.pubkey in alert.annotations.description
assert random_address in alert.annotations.description
assert '32' in alert.annotations.description
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_from_user_withdrawal_address(validator: TestValidator, withdrawal_addre
assert alert.labels.severity == 'critical'
assert (
alert.annotations.summary
== "🔗‍🏃🚪Our validator triggered withdrawal was requested from our Withdrawal Vault address"
== "🚨🚨🚨 Our validator triggered withdrawal was requested from our Withdrawal Vault address"
)
assert validator.pubkey in alert.annotations.description
assert withdrawal_address in alert.annotations.description
Expand Down Expand Up @@ -144,7 +144,7 @@ def test_group_similar_alerts():
assert alert.labels.severity == 'critical'
assert (
alert.annotations.summary
== "🔗‍🏃🚪Our validator triggered withdrawal was requested from our Withdrawal Vault address"
== "🚨🚨🚨 Our validator triggered withdrawal was requested from our Withdrawal Vault address"
)
assert validator1.pubkey in alert.annotations.description
assert validator2.pubkey in alert.annotations.description
Expand Down

0 comments on commit 042808c

Please sign in to comment.