Skip to content

feat(r/sys/validators/v3): draft Phase B automated validator freeze#5887

Draft
moul wants to merge 1 commit into
claude/reverent-visvesvaraya-0f1688from
claude/phase-b-autofreeze
Draft

feat(r/sys/validators/v3): draft Phase B automated validator freeze#5887
moul wants to merge 1 commit into
claude/reverent-visvesvaraya-0f1688from
claude/phase-b-autofreeze

Conversation

@moul

@moul moul commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

Phase B of the validator freeze mechanism. Builds on Phase A (#5886) by adding an automated freeze path driven by registered off-chain monitors.

Draft — same intent as Phase A: open a design discussion before settling on anything.

What's added

  • AutoFreezeValidator(cur, addr, reason, evidence) — callable by any registered monitor. Enforces four on-chain invariants before applying the freeze.
  • ExpireAutoFrozen(cur) — sweeps auto-frozen entries whose TTL has elapsed and restores them to the effective valset. Callable by anyone.
  • RegisterMonitor / DeregisterMonitor — GovDAO manages the monitor set.
  • AddProtected / RemoveProtected — GovDAO manages a protected validator set that monitors cannot touch.
  • autofreeze_test.gno — unit tests for state helpers and invariant arithmetic.
  • Render extended with monitor list and auto-frozen validator table.

On-chain safety invariants (the monitor is untrusted)

# Invariant Value
1 Power floor post-freeze live power ≥ 80% of total
2 Auto-frozen cap at most 12% of total power auto-frozen at once
3 Protected set GovDAO-designated validators immune to monitor freezes
4 Auto-expiry auto-frozen entries expire after ~86400 blocks (~1 day)

A compromised monitor's worst case is bounded and time-limited by these invariants.

Open questions

  1. Phase C: require N-of-M monitor attestation before a freeze fires (eliminates single-monitor risk entirely).
  2. Per-monitor rate limiting: currently any registered monitor can fire unlimited freezes (invariant 2 caps total damage, but a single monitor could exhaust the cap quickly).
  3. Auto-unfreeze on expiry: is automatic restore always safe, or should some cases require a human confirmation step?
  4. Evidence format: currently a free-form string; should it be structured (e.g. signed double-sign proof)?

Files changed

  • examples/gno.land/r/sys/validators/v3/autofreeze.gno — new, Phase B implementation
  • examples/gno.land/r/sys/validators/v3/autofreeze_test.gno — new, unit tests
  • examples/gno.land/r/sys/validators/v3/validators.gnoRender extended

Adds autofreeze.gno — an automated freeze path driven by registered
off-chain monitors, building on the manual freeze mechanism from Phase A.

Key additions:
- AutoFreezeValidator: called by any registered monitor; guarded by four
  on-chain invariants (power floor 80%, auto-frozen cap 12%, protected set,
  auto-expiry after ~1 day)
- ExpireAutoFrozen: anyone can sweep expired auto-frozen entries and restore
  them to the effective valset
- RegisterMonitor / DeregisterMonitor: GovDAO manages the monitor set
- AddProtected / RemoveProtected: GovDAO manages the protected validator set
- autofreeze_test.gno: unit tests for state helpers and invariant arithmetic
- Render extended with monitor list and auto-frozen validator table

The monitor is untrusted for safety: every invariant is enforced on-chain.
A compromised monitor's worst case is bounded and time-limited.
@Gno2D2

Gno2D2 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

No automated checks match this pull request.

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧾 package/realm Tag used for new Realms or Packages.

Projects

Status: 📥 Inbox

Development

Successfully merging this pull request may close these issues.

2 participants