Add on-chain reward pipeline observability#940
Open
srt0422 wants to merge 2 commits into
Open
Conversation
Add EventRewardRedirectedToEcosystem proto message and emitter for visibility when topic rewards are redirected to the ecosystem bucket. Escalate redirect log from Info to Warn. Track redirected_topic_ids in EventTopicRewardsSet. Supports monitoring the reward pipeline to detect outages like the 30-hour mainnet incident. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dev refactored MoveCoinsFromAlloraRewardsToEcosystem to go through GetBankingKeeper(). Our branch captures rewardAmount before the call for logging/events. Resolution: keep both — the local variable capture and the new GetBankingKeeper() call path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest Buf updates on your PR. Results from workflow Buf Linter / buf (pull_request).
|
There was a problem hiding this comment.
No issues found across 6 files
Architecture diagram
sequenceDiagram
participant RM as Rewards Module
participant TK as Topic Keeper
participant BK as Banking Keeper
participant EM as Event Manager
participant M as Metrics
participant L as Logger
participant OM as Off-chain Monitor
Note over RM, OM: On-chain Reward Distribution Flow (per Topic)
RM->>TK: GetTopicRewardNonce(topicId)
TK-->>RM: nonce
alt topicRewardNonce == 0 OR error
Note right of RM: Trigger Redirection
RM->>BK: MoveCoinsFromAlloraRewardsToEcosystem(amount)
RM->>M: NEW: Incr(REWARD_REDIRECTED_TO_ECOSYSTEM_EVENT)
RM->>L: CHANGED: Log.Warn("redirecting reward", topicId)
RM->>EM: NEW: Emit EventRewardRedirectedToEcosystem(topicId, amount, reason, height)
else ProcessRewards logic fails
RM->>RM: ProcessRewards(topicId)
Note right of RM: Logic Error or State Inconsistency
RM->>BK: MoveCoinsFromAlloraRewardsToEcosystem(amount)
RM->>M: NEW: Incr(REWARD_REDIRECTED_TO_ECOSYSTEM_EVENT)
RM->>L: CHANGED: Log.Error("redirecting to ecosystem", topicId, error)
RM->>EM: NEW: Emit EventRewardRedirectedToEcosystem(topicId, amount, reason, height)
end
Note over RM, EM: Final Epoch Summary
RM->>EM: CHANGED: Emit EventTopicRewardsSet(rewards, redirectedTopicIds)
Note over EM, OM: Block Finalized
EM-->>OM: Read Block Events
opt NEW: Redirected topics detected in events
OM->>OM: Trigger Alert (e.g. PagerDuty)
end
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
EventRewardRedirectedToEcosystemproto message emitted when topic rewards are redirected to the ecosystem bucketredirected_topic_idsinEventTopicRewardsSetfor downstream monitoringREWARD_REDIRECTED_TO_ECOSYSTEM_EVENTmetric labelContext
Supports detecting reward pipeline outages like the 30-hour mainnet incident (2026-03-25) by making reward redirections visible as chain events. These events can be consumed by off-chain monitors (e.g. prodexer-monitor) to trigger PagerDuty alerts when rewards stop flowing.
Test plan
make proto-gen) to generate pb.go/pulsar.go files🤖 Generated with Claude Code
Summary by cubic
Expose reward redirections on-chain and via metrics to make reward pipeline outages visible and alertable. Adds a new event, tags redirected topics, and escalates logs so off-chain monitors can trigger alerts when rewards stop flowing.
New Features
Migration
Written for commit 7b69b0f. Summary will update on new commits.