Skip to content

Monitor Governance Vote OutcomesΒ #148

Description

@mijinummi

πŸ“Š Monitor Governance Vote Outcomes

Issue: #148
Type: Feature
Priority: High
Estimated Effort: 1–2 days


🧠 Concept

Implement a governance vote monitoring service that continuously tracks proposals across supported governance protocols, detects when voting concludes, records the final outcome, and notifies relevant components whenever an approved or rejected proposal may impact monitored contracts, protocols, or system behavior.

This enables the platform to proactively respond to governance decisions that could introduce operational, security, or protocol-level changes.


⚠️ Problem

Governance proposals can significantly alter the behavior of blockchain protocols through:

  • Smart contract upgrades
  • Parameter changes
  • Treasury allocations
  • Validator configuration changes
  • Network feature activation
  • Emergency governance actions

Currently, there is no automated process to monitor proposal outcomes, persist governance history, or notify downstream systems when important decisions are finalized.

Without governance monitoring:

  • Critical protocol changes may go unnoticed.
  • Analysts must manually track governance portals.
  • Security teams may react too late to impactful governance decisions.
  • Historical governance outcomes are unavailable for analysis.

πŸ“ Implementation Scope

src/modules/governance/votes/

Suggested structure:

votes/
β”œβ”€β”€ governance-vote.service.ts
β”œβ”€β”€ governance-vote.processor.ts
β”œβ”€β”€ governance-vote.scheduler.ts
β”œβ”€β”€ governance-vote.repository.ts
β”œβ”€β”€ dto/
β”œβ”€β”€ entities/
β”œβ”€β”€ interfaces/
β”œβ”€β”€ enums/
β”œβ”€β”€ alerts/
└── utils/

βœ… Requirements

Vote Monitoring

Implement a service that periodically checks governance proposals from supported protocols.

The service should:

  • Discover active proposals
  • Track proposal status throughout its lifecycle
  • Detect when voting has concluded
  • Retrieve final voting statistics
  • Identify newly completed proposals without duplication

Polling intervals should be configurable.


Proposal Tracking

Capture proposal metadata including:

  • Proposal ID
  • Proposal title
  • Description (where available)
  • Protocol/network
  • Proposal type
  • Current status
  • Voting start time
  • Voting end time

Maintain the latest proposal state.


Result Tracking

When voting concludes, record:

  • Final status
  • Passed / Failed
  • Executed (if applicable)
  • Total votes
  • Yes votes
  • No votes
  • Abstain votes
  • Veto votes (if supported)
  • Participation percentage
  • Execution timestamp (if applicable)

Store results for historical analysis.


Outcome Detection

Automatically detect transitions such as:

  • Active β†’ Passed
  • Active β†’ Rejected
  • Passed β†’ Executed
  • Active β†’ Expired
  • Active β†’ Cancelled

State changes should only be processed once.


Outcome Alerts

Generate alerts for governance events such as:

  • Proposal passed
  • Proposal rejected
  • Proposal executed
  • Emergency proposal approved
  • High-impact protocol upgrade
  • Treasury proposal approval

Alerts should include:

  • Proposal ID
  • Proposal title
  • Network
  • Outcome
  • Timestamp
  • Severity
  • Link/reference to proposal (if available)

Impact Assessment

Prepare the architecture to classify proposal impact, for example:

  • Protocol upgrade
  • Validator changes
  • Treasury changes
  • Governance parameter changes
  • Contract migration
  • Security-related proposal

This can initially use simple classifications and be expanded later.


Persistence

Persist governance outcomes to enable:

  • Historical reporting
  • Audit trails
  • Timeline reconstruction
  • Future analytics

Avoid duplicate records when proposals are revisited.


Error Handling

The monitoring service should:

  • Retry transient failures
  • Log polling errors
  • Continue monitoring remaining proposals if one request fails
  • Handle unavailable governance endpoints gracefully

πŸ”’ Non-Functional Requirements

  • Idempotent vote processing
  • Configurable polling interval
  • Efficient database updates
  • Structured logging
  • Type-safe DTOs and entities
  • Unit-testable monitoring logic
  • Minimal duplicate processing

🎯 Acceptance Criteria

  • Governance proposals are monitored automatically
  • Proposal lifecycle changes are detected correctly
  • Final vote outcomes are stored in the database
  • Duplicate processing of completed proposals is prevented
  • Alerts are generated for significant governance outcomes
  • Historical proposal results can be queried
  • Monitoring continues gracefully after transient failures
  • Code passes linting, type checking, and existing tests

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions