Skip to content

feat(alerts): yearn multisig/timelock alert routing#251

Merged
spalen0 merged 6 commits into
mainfrom
feat/yearn-timelock-internal-chat
May 29, 2026
Merged

feat(alerts): yearn multisig/timelock alert routing#251
spalen0 merged 6 commits into
mainfrom
feat/yearn-timelock-internal-chat

Conversation

@spalen0
Copy link
Copy Markdown
Collaborator

@spalen0 spalen0 commented May 29, 2026

Summary

Three related changes to Yearn alert routing.

1. Safe queued-tx alerts (safe/main.py)

Previously, Yearn multisig txs proposed by an expected bot were silently skipped — no record at all — and only unexpected proposers triggered an alert indistinguishable from any other.

Now every queued Yearn multisig tx alerts:

  • Expected proposer → silent, low-importance alert (disable_notification=True).
  • Unexpected proposer → loud critical alert with a prepended header flagging the problem and showing the actual proposer/delegate addresses.

Non-Yearn protocols (EULER, PENDLE, …) are unaffected.

2. Timelock internal-chat mirror (timelock/timelock_alerts.py)

YEARN_TIMELOCK alerts are now mirrored to a new internal-only chat (YEARN_TIMELOCK_INTERNAL), in lockstep with the public topic. Mirror sends are best-effort: a failure is logged but never blocks the primary send or cache advancement, and the mirror only fires after a successful primary send (no duplicates on retry).

3. Delay check no longer hits the public topic (yearn/check_timelock_delay.py)

Delay-violation (and crash) alerts now route to YEARN_TIMELOCK_INTERNAL instead of the public YEARN_TIMELOCK topic.

Config

New optional env vars (documented in .env.example):

TELEGRAM_BOT_TOKEN_YEARN_TIMELOCK_INTERNAL=...   # optional; falls back to DEFAULT
TELEGRAM_CHAT_ID_YEARN_TIMELOCK_INTERNAL=...     # required for internal chat to receive alerts

Testing

  • ruff format + ruff check pass on all changed files.

🤖 Generated with Claude Code

spalen0 and others added 6 commits May 29, 2026 11:46
- safe: alert on every queued Yearn multisig tx (silent for expected
  proposers, loud critical header for unexpected proposers) instead of
  silently skipping expected ones
- timelock: mirror YEARN_TIMELOCK alerts to a new internal-only chat
  (YEARN_TIMELOCK_INTERNAL), best-effort and in lockstep with the topic
- check_timelock_delay: route delay-violation and crash alerts to the
  internal chat instead of the public timelock topic

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rets

- replace the MIRROR_PROTOCOLS dict with a direct YEARN_TIMELOCK check
- add TELEGRAM_BOT_TOKEN_YEARN_TIMELOCK_INTERNAL and
  TELEGRAM_CHAT_ID_YEARN_TIMELOCK_INTERNAL to the monitoring workflow env

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Queue YEARN_TIMELOCK alerts under YEARN_TIMELOCK_INTERNAL in
messages_by_protocol so the existing per-protocol send loop delivers both
with a plain send_telegram_message call — no dedicated mirror helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy the YEARN_TIMELOCK message list to YEARN_TIMELOCK_INTERNAL once after
the operation loop instead of checking the protocol on every iteration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
symbol()/decimals() on a non-ERC20 address returns empty data, which web3
surfaces as "Could not decode contract function call". That's a contract-
shape mismatch — deterministic across providers — but the retry decorator
only recognized "execution reverted", so it rotated through every RPC with
backoff sleeps, spamming WARNINGs. Add the decode-failure marker so it
fails fast and lets fetch_erc20_metadata catch it and return None.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@spalen0 spalen0 marked this pull request as ready for review May 29, 2026 10:45
@spalen0 spalen0 merged commit 2c26955 into main May 29, 2026
2 checks passed
@spalen0 spalen0 deleted the feat/yearn-timelock-internal-chat branch May 29, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant