Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

validators/v0 package

Overview

Package validators implements on-chain validator set management through Proof of Authority. The realm exposes a public proposal constructor for GovDAO; on approval, the proposal callback applies the captured deltas to the chain's effective valset and publishes the new full set via gno.land/r/sys/params. The chain's EndBlocker reads the result on the next block and propagates to consensus.

No in-realm validator state. All reads go through sysparams.GetValsetEffective (proposed-if-dirty, else current).

Function

RotateValoperSigningKey

func RotateValoperSigningKey(cur realm, op address, oldPubKey, newPubKey string)
Ask AI Claude ChatGPT

RotateValoperSigningKey applies a signing-key rotation to the effective valset and publishes the new full set via sysparams. Auth: caller realm must be r/gnops/valopers.

Body is read-modify-write against sysparams.GetValsetEffective so concurrent same-block writers (other rotations or GovDAO executors) accumulate instead of clobbering. Mirrors the executor pattern in validators.gno.

Idempotent: if the rotating operator's old signing address is not currently in the effective valset (e.g., they were removed), the rotation is a no-op at the sysparams level — valopers' profile and signingRegistry already record the new key. Either replays cleanly.

Emits ValoperRotated event with op + old/new addresses + height.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/sys/validators/v0" -func "RotateValoperSigningKey" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/sys/validators/v0" -func "RotateValoperSigningKey" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/sys/validators/v0, for example a function call with arguments.