feat(alerts): yearn multisig/timelock alert routing#251
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
disable_notification=True).Non-Yearn protocols (EULER, PENDLE, …) are unaffected.
2. Timelock internal-chat mirror (
timelock/timelock_alerts.py)YEARN_TIMELOCKalerts 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_INTERNALinstead of the publicYEARN_TIMELOCKtopic.Config
New optional env vars (documented in
.env.example):Testing
ruff format+ruff checkpass on all changed files.🤖 Generated with Claude Code