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/params

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
params
Namespace
sys
Files
14 (gnomod.toml)
Exported functions
33
Module
gno.land/r/sys/params
gno
0.9

Files (14)

  • gnomod.tomltoml
  • delegate.gnogno
  • fee_collector.gnogno
  • halt.gnogno
  • params.gnogno
  • render.gnogno
  • run_submitters.gnogno
  • unlock.gnogno
  • valoper.gnogno
  • valset.gnogno
  • delegate_test.gnogno
  • fee_collector_test.gnogno
  • params_test.gnogno
  • unlock_test.gnogno
  • valset.gnogno
    1package params23import (4	"chain"5	"errors"6	"strconv"7	"strings"8

    Functions

    • AddRunSubmitters(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}, addrs []string)

    • GetRunSubmitters() []string

    • GetValoperRegisterFee() uint64

    • GetValoperRotationFee() uint64

    • GetValoperRotationPeriodBlocks() int64

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

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

    • GetValsetPubKeyTypes() []string

    • IsRunSubmittersDelegate(pkgpath string) bool

    • NewSetFeeCollectorRequest(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}, addr string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSetHaltRequest(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}, height int64, minVersion string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamBoolPropRequest(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}, module string, submodule string, name string, value bool) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamBytesPropRequest(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}, module string, submodule string, name string, value []uint8) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamInt64PropRequest(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}, module string, submodule string, name string, value int64) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamStringPropRequest(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}, module string, submodule string, name string, value string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamStringsPropRequest(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}, module string, submodule string, name string, value []string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamStringsPropRequestAddWithTitle(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}, module string, submodule string, name string, title string, value []string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamStringsPropRequestRemoveWithTitle(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}, module string, submodule string, name string, title string, value []string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamStringsPropRequestWithTitle(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}, module string, submodule string, name string, title string, value []string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • NewSysParamUint64PropRequest(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}, module string, submodule string, name string, value uint64) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeAddUnrestrictedAcctsRequest(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}, addrs ....uverse.address) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeClearRunSubmittersManager(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}) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeLockTransferRequest(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}) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeRemoveUnrestrictedAcctsRequest(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}, addrs ....uverse.address) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeSetRunSubmitters(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}, addrs []string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeSetRunSubmittersManager(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}, pkgpath string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • ProposeUnlockTransferRequest(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}) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}

    • RemoveRunSubmitters(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}, addrs []string)

    • Render(path string) string

    • RunSubmittersGrantedBy(addr string) bool

    • RunSubmittersManager() string

    • SetValsetProposal(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}, entries []string)

    • ValsetDirty() bool

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

    Rendered

    RenderedRawgnoweb ↗
    9 prms "sys/params"
    10
    11 "gno.land/p/sys/validators/v0"
    12)
    13
    14// Param keys read by gno.land/pkg/gnoland (EndBlocker).
    15// Keep in sync with gno.land/pkg/gnoland/node_params.go.
    16// nodeModulePrefix is declared in halt.gno (same package).
    17const (
    18 valsetSubmodule = "valset"
    19
    20 // dirty signals the chain that the proposed valset differs from the
    21 // current applied one. Realm sets true; EndBlocker clears.
    22 valsetDirtyKey = "dirty"
    23
    24 // One []string per slot; each entry has the form "<pubkey>:<power>"
    25 // (bech32 pubkey + decimal power). Address is derived from pubkey
    26 // on the chain side and not stored.
    27 //
    28 // proposed = v0's full target valset
    29 // current = chain-managed: the set that becomes ACTIVE AT H+2
    30 // once the most recent EndBlock's updates apply.
    31 // NOT necessarily the set actively signing the current
    32 // block — see ABCI H+2 sequencing.
    33 valsetProposedKey = "proposed"
    34 valsetCurrentKey = "current"
    35
    36 // pubkey_types: chain-mirrored validator pubkey-type allow-list (read-only here).
    37 valsetPubKeyTypesKey = "pubkey_types"
    38
    39 // Only this realm may write valset:proposed and valset:dirty.
    40 // valset:current is chain-managed (see ctx-sentinel in node_params.go).
    41 valsetAuthorizedRealm = "gno.land/r/sys/validators/v0"
    42)
    43
    44// SetValsetProposal publishes the realm's desired valset. Each entry is
    45// "<bech32-pubkey>:<decimal-power>"; power=0 removes the validator.
    46// The chain reads this on the next EndBlocker, diffs it against
    47// valset:current, and propagates the changes to consensus.
    48func SetValsetProposal(cur realm, entries []string) {
    49 assertValsetCaller(0, cur)
    50 prms.SetSysParamStrings(nodeModulePrefix, valsetSubmodule, valsetProposedKey, entries)
    51 prms.SetSysParamBool(nodeModulePrefix, valsetSubmodule, valsetDirtyKey, true)
    52}
    53
    54// GetValsetEntries returns the chain's authoritative committed
    55// validator set (the contents of valset:current). This is the
    56// V_{H+2} view — the set that will be active at H+2 once the most
    57// recent EndBlock's updates apply, NOT the set signing the current
    58// block. Callers that want "what v0 reports as the current
    59// validator set" — including the in-flight proposed set during
    60// the dirty window — should call GetValsetEffective instead.
    61func GetValsetEntries() []validators.Validator {
    62 return parseValsetSlot(valsetCurrentKey)
    63}
    64
    65// ValsetDirty reports whether valset:proposed is awaiting EndBlocker.
    66// Realm callers MUST treat this as transient: the dirty flag is set
    67// by SetValsetProposal and cleared by the chain's EndBlocker (every
    68// block where dirty=true on entry exits with dirty=false).
    69func ValsetDirty() bool {
    70 d, _ := prms.GetSysParamBool(nodeModulePrefix, valsetSubmodule, valsetDirtyKey)
    71 return d
    72}
    73
    74// GetValsetEffective returns the set that WILL be active at H+2:
    75// valset:proposed if dirty, else valset:current. Used by v0 so that
    76// (a) reads after a same-block proposal callback see that proposal's
    77// effects, and (b) sequential same-block proposals accumulate
    78// correctly on top of each other.
    79//
    80// Misuse warning: this exists for r/sys/validators/v0's internal
    81// reads. Other realms making "is X a validator" decisions should
    82// call v0.IsValidator, not this directly, so future changes to v0's
    83// read semantics propagate uniformly.
    84func GetValsetEffective() []validators.Validator {
    85 key := valsetCurrentKey
    86 if ValsetDirty() {
    87 key = valsetProposedKey
    88 }
    89 return parseValsetSlot(key)
    90}
    91
    92func parseValsetSlot(key string) []validators.Validator {
    93 raw, _ := prms.GetSysParamStrings(nodeModulePrefix, valsetSubmodule, key)
    94 out := make([]validators.Validator, 0, len(raw))
    95 for _, e := range raw {
    96 v, err := parseEntry(e)
    97 if err != nil {
    98 panic("valset:" + key + " corrupted: " + err.Error())
    99 }
    100 out = append(out, v)
    101 }
    102 return out
    103}
    104
    105// parseEntry splits "<bech32-pubkey>:<decimal-power>" and derives the
    106// validator address via the chain.PubKeyAddress native helper.
    107func parseEntry(entry string) (validators.Validator, error) {
    108 pkStr, pStr, ok := strings.Cut(entry, ":")
    109 if !ok {
    110 return validators.Validator{}, errors.New("missing ':' separator in " + entry)
    111 }
    112 addr, err := chain.PubKeyAddress(pkStr)
    113 if err != nil {
    114 return validators.Validator{}, err
    115 }
    116 power, err := strconv.ParseUint(pStr, 10, 64)
    117 if err != nil {
    118 return validators.Validator{}, err
    119 }
    120 return validators.Validator{
    121 Address: addr,
    122 PubKey: pkStr,
    123 VotingPower: power,
    124 }, nil
    125}
    126
    127// GetValsetPubKeyTypes returns the validator pubkey-type allow-list mirrored from consensus params (empty means accept any).
    128func GetValsetPubKeyTypes() []string {
    129 types, _ := prms.GetSysParamStrings(nodeModulePrefix, valsetSubmodule, valsetPubKeyTypesKey)
    130 return types
    131}
    132
    133// assertValsetCaller authorizes the one realm permitted to write valset params.
    134//
    135// Delegates to assertDelegate (see delegate.gno) so this realm has exactly one
    136// authorized-caller gate rather than two that can drift. The distinction that
    137// remains is deliberate and is NOT expressible through a delegation slot: this
    138// authorization is a compile-time const, so re-pointing it requires a chain
    139// relaunch, and assertNotValsetKey locks GovDAO out of the key family entirely.
    140// A vote-settable slot would let one supermajority re-point the valset writer at
    141// an arbitrary realm and bypass v0's valoper-existence check, its KeepRunning
    142// opt-out, and execution-time pubkey re-resolution.
    143func assertValsetCaller(_ int, rlm realm) {
    144 assertDelegate(0, rlm, valsetAuthorizedRealm, "valset params")
    145}
    146

    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.