Skip to content

feat(govdao-scripts): normalize v2 scripts + add v3/namereg/valoper-register#5658

Merged
moul merged 2 commits into
gnolang:masterfrom
moul:chore/govdao-scripts-normalize
May 13, 2026
Merged

feat(govdao-scripts): normalize v2 scripts + add v3/namereg/valoper-register#5658
moul merged 2 commits into
gnolang:masterfrom
moul:chore/govdao-scripts-normalize

Conversation

@moul
Copy link
Copy Markdown
Member

@moul moul commented May 12, 2026

Two batches of changes to misc/govdao-scripts/, extracted from the test-13 hardfork stack (#5653) so they can land independently and shrink that PR's diff against master.

h/t @aeddi

1. Normalize existing v2 scripts

  • Replace inline Environment blocks with # Environment: see README.md. Each script already validates its required env vars at the top via ${VAR:?...}; the README is the single source of truth. Removes ~5 lines of duplication per script.
  • Align echo formatting (Key: / Chain: / Remote: ) so per-deployment output reads cleanly across all scripts.
  • add-validator.sh: add Power=0 input guard. Tendermint treats Power=0 as a remove operation, so an operator running ./govdao add-validator ADDR PUBKEY 0 by mistake would silently remove the validator instead of adding it. The guard catches the input early and points at rm-validator.sh.

2. Add 4 new shared scripts

  • add-validator-v3.sh / rm-validator-v3.sh — route through r/sys/validators/v3 (operator-keyed, post-VALOPLAN2). Use them on chains running v3 (test-13 onward). The v2 unsuffixed scripts stay canonical for gnoland1 pre-hardfork.
  • register-user.shr/sys/users.ProposeRegisterUser govDAO proposal granting a custom username for an address (bypasses the controller whitelist; canonical-collision warning auto-injected into the proposal description if relevant).
  • register-valoper.shNOT govDAO-signed — operator self-registration via r/gnops/valopers.Register. The runtime squat guard enforces caller == operator address, so this is signed by the operator's local key, not T1. Prerequisite for add-validator-v3.sh.

README updated with the 4 new entries and a v2-vs-v3 picking note.

Test plan

  • Wrapper smoke-test: ./govdao from misc/deployments/gnoland1/ lists all commands.
  • Individual scripts: ./govdao add-validator (no args) shows usage.
  • Power guard: ./govdao add-validator ADDR PUBKEY 0 errors with the new message.

…0 guard

Backports improvements from the v3 test-13 scripts to the shared v2
scripts (and applies them to the rest of the shared set):

- Replace inline Environment blocks with single-line "see README.md."
  pointer. Required env vars are already validated at the top of each
  script via ${VAR:?...}; the README is the single source of truth.
- Align echo formatting (Key:    / Chain:  / Remote:) so per-deployment
  output reads cleanly.
- add-validator.sh: add Power=0 input guard mirroring add-validator-v3.
  Tendermint treats Power=0 as a remove, which would silently turn the
  add into a remove if a user passes 0 by mistake. Catch it explicitly
  and point them at rm-validator.sh.
@Gno2D2
Copy link
Copy Markdown
Collaborator

Gno2D2 commented May 12, 2026

🛠 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):

🟢 Maintainers must be able to edit this pull request (more info)

☑️ 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
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: moul/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

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

Four new shared scripts that complement the v2 set:

- add-validator-v3.sh / rm-validator-v3.sh: route through
  r/sys/validators/v3 (operator-keyed, post-VALOPLAN2). Use them on
  chains running v3; v2 add-validator/rm-validator stay canonical for
  chains still on v2 (gnoland1 pre-hardfork).
- register-user.sh: r/sys/users.ProposeRegisterUser govDAO proposal
  that grants a custom username for an address (bypasses the
  controller whitelist; canonical-collision warning auto-injected).
- register-valoper.sh: NOT govDAO-signed — operator self-registration
  via r/gnops/valopers.Register. The runtime squat guard enforces
  caller == operator address, so the operator's local key signs.
  Prerequisite for add-validator-v3.

README.md updated to list the 4 new commands with a note clarifying
v2 vs v3 picking by chain.
@moul moul requested a review from aeddi May 12, 2026 19:43
@moul moul changed the title chore(govdao-scripts): normalize env-block + echo formatting + Power=0 guard chore+feat(govdao-scripts): normalize v2 scripts + add v3/namereg/valoper-register May 12, 2026
@moul moul changed the title chore+feat(govdao-scripts): normalize v2 scripts + add v3/namereg/valoper-register feat(govdao-scripts): normalize v2 scripts + add v3/namereg/valoper-register May 12, 2026
@moul moul merged commit eb9f519 into gnolang:master May 13, 2026
76 of 77 checks passed
@moul moul deleted the chore/govdao-scripts-normalize branch May 13, 2026 12:19
@github-project-automation github-project-automation Bot moved this from 📥 Inbox to ✅ Done in 😎 Manfred's Board May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants