PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/sys/validators/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
sys / validators
Files
7 (gnomod.toml)
Exported functions
9
Module
gno.land/r/sys/validators/v0
gno
0.9

Files (7)

  • gnomod.tomltoml
  • cache.gnogno
  • proposal.gnogno
  • validators.gnogno
  • cache_test.gnogno
  • proposal_test.gnogno
  • validators_test.gnogno
validators.gnogno
1// Package validators implements on-chain validator set management2// through Proof of Authority. The realm exposes a public proposal3// constructor for GovDAO; on approval, the proposal callback applies4// the captured deltas to the chain's effective valset and publishes5// the new full set via gno.land/r/sys/params. The chain's EndBlocker6// reads the result on the next block and propagates to consensus.7//8// No in-realm validator state. All reads go through9// sysparams.GetValsetEffective (proposed-if-dirty, else current).10package validators1112import (13	"chain/runtime"14	"strings"1516	"gno.land/p/nt/ufmt/v0"17	"gno.land/p/sys/validators/v0"18	sysparams "gno.land/r/sys/params"19)2021// Operator-keyed proposal builder lives in proposal.gno22// (NewValidatorProposalRequest + newValoperChangeExecutor). The legacy23// signing-keyed NewProposalRequest was removed: every valid24// signing-keyed input is also a valid operator-keyed input under25// always-on valoper enforcement.2627// IsValidator returns true if addr is part of the effective validator28// set (proposed if a v0 proposal is awaiting EndBlocker, else29// current).30func IsValidator(addr address) bool {31	for _, v := range sysparams.GetValsetEffective() {32		if v.Address == addr {33			return true34		}35	}36	return false37}3839// GetValidator returns the validator with the given address from the40// effective set; panics if absent.41func GetValidator(addr address) validators.Validator {42	for _, v := range sysparams.GetValsetEffective() {43		if v.Address == addr {44			return v45		}46	}47	panic("validator not found")48}4950// GetValidators returns the effective validator set.51func GetValidators() []validators.Validator {52	return sysparams.GetValsetEffective()53}5455// Render displays the effective validator set.56func Render(string) string {57	var sb strings.Builder58	h := runtime.ChainHeight()59	set := sysparams.GetValsetEffective()60	sb.WriteString(ufmt.Sprintf("## Valset at height %d\n\n", h))61	if len(set) == 0 {62		sb.WriteString("Valset is empty.\n")63		return sb.String()64	}65	for i, v := range set {66		sb.WriteString(ufmt.Sprintf("- #%d: %s (%d)\n", i, v.Address.String(), v.VotingPower))67	}68	return sb.String()69}70

Functions

  • AssertGenesisValopersConsistent(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})

  • GetValidator(addr string) struct{Address .uverse.address; PubKey string; VotingPower uint64}

  • GetValidators() []gno.land/p/sys/validators/v0.Validator

  • IsValidator(addr string) bool

  • NewValidatorProposalRequest(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, changes []gno.land/r/sys/validators/v0.ValoperChange, title string, description string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

  • NewValoperChange(operatorAddress string, power uint64) struct{OperatorAddress .uverse.address; Power uint64}

  • NotifyValoperChanged(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, op string, signingPubKey string, signingAddress string, keepRunning bool)

  • Render(string) string

  • RotateValoperSigningKey(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, op string, oldPubKey string, newPubKey string)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.