Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

params source realm

Package params provides functions for creating parameter executors that interface with the Params Keeper.

Overview

Package params provides functions for creating parameter executors that interface with the Params Keeper.

This package enables setting various parameter types (such as strings, integers, booleans, and byte slices) through the GovDAO proposal mechanism. Each function returns an executor that, when called, sets the specified parameter in the Params Keeper.

The executors are designed to be used within governance proposals to modify parameters dynamically. The integration with the GovDAO allows for parameter changes to be proposed and executed in a controlled manner, ensuring that modifications are subject to governance processes.

Example usage:

Example
1// This executor can be used in a governance proposal to set the parameter.
2pr := params.NewSysParamStringPropExecutor("bank", "p", "restricted_denoms")

Constants 1

const DelegateSetEvent, DelegateClearedEvent, DelegateWriteEvent

1const (
2	DelegateSetEvent     = "ParamDelegateSet"
3	DelegateClearedEvent = "ParamDelegateCleared"
4	DelegateWriteEvent   = "ParamDelegateWrite"
5)
source

Event names. PascalCase with a named const is the house style across r/sys and r/gov; the bare lowercase "set" elsewhere in this realm predates it.

Functions 33

func AddRunSubmitters

crossing Action
1func AddRunSubmitters(cur realm, addrs []string)
source

AddRunSubmitters adds addresses to the run_submitters allowlist.

Callable only by the delegated manager. Addresses already present are a no-op (UpdateSysParamStrings dedupes), and the chain still validates every entry and enforces the list-length cap, because the update re-sets the whole list.

func GetValoperRegisterFee

Action
1func GetValoperRegisterFee() uint64
source

GetValoperRegisterFee returns the fee (in ugnot) required to call valopers.Register. Defaults to 0 if governance hasn't set it.

func GetValoperRotationFee

Action
1func GetValoperRotationFee() uint64
source

GetValoperRotationFee returns the fee (in ugnot) required to call valopers.UpdateSigningKey. Defaults to 0.

func GetValoperRotationPeriodBlocks

Action
1func GetValoperRotationPeriodBlocks() int64
source

GetValoperRotationPeriodBlocks returns the per-operator rotation throttle (in blocks). Defaults to ~1h worth at 6s/block (600). This is the primary anti-spam defense pre-fee while rotation_fee stays at 0; tightens further once non-zero fees become enforceable.

func GetValsetEffective

Action
1func GetValsetEffective() []validators.Validator
source

GetValsetEffective returns the set that WILL be active at H+2: valset:proposed if dirty, else valset:current. Used by v3 so that (a) reads after a same-block proposal callback see that proposal's effects, and (b) sequential same-block proposals accumulate correctly on top of each other.

Misuse warning: this exists for r/sys/validators/v3's internal reads. Other realms making "is X a validator" decisions should call v3.IsValidator, not this directly, so future changes to v3's read semantics propagate uniformly.

func GetValsetEntries

Action
1func GetValsetEntries() []validators.Validator
source

GetValsetEntries returns the chain's authoritative committed validator set (the contents of valset:current). This is the V_{H+2} view — the set that will be active at H+2 once the most recent EndBlock's updates apply, NOT the set signing the current block. Callers that want "what v3 reports as the current validator set" — including the in-flight proposed set during the dirty window — should call GetValsetEffective instead.

func GetValsetPubKeyTypes

Action
1func GetValsetPubKeyTypes() []string
source

GetValsetPubKeyTypes returns the validator pubkey-type allow-list mirrored from consensus params (empty means accept any).

func IsRunSubmittersDelegate

Action
1func IsRunSubmittersDelegate(pkgpath string) bool
source

IsRunSubmittersDelegate reports whether pkgpath currently holds the capability. Pure predicate, for a caller that wants to fail cleanly rather than be panicked at.

func NewSetHaltRequest

crossing Action
1func NewSetHaltRequest(cur realm, height int64, minVersion string) dao.ProposalRequest
source

NewSetHaltRequest creates a GovDAO proposal to halt all chain nodes at the given block height. Once approved and executed, nodes will gracefully stop after committing the specified block, enabling coordinated chain upgrades.

minVersion, if non-empty, sets the minimum binary version required to resume after the halt. Nodes will refuse to restart unless their version satisfies the minimum requirement, preventing old binaries from accidentally resuming a chain halted for an upgrade. Example: minVersion="chain/gnoland1.1" prevents gnoland1.0 from resuming.

Use height=0 to cancel a previously scheduled halt.

func ProposeClearRunSubmittersManager

crossing Action
1func ProposeClearRunSubmittersManager(cur realm) dao.ProposalRequest
source

ProposeClearRunSubmittersManager creates a GovDAO proposal revoking the delegation.

Revocation is immediate on execution because the slot is consulted on every call. It deliberately does NOT remove addresses the delegate added: sweeping them would make the executed effect invisible at vote time, and would silently remove nothing whenever the grant record had drifted. Use the existing whole-list setter to reset the list to a reviewed value.

func ProposeSetRunSubmitters

crossing Action
1func ProposeSetRunSubmitters(cur realm, addrs []string) dao.ProposalRequest
source

ProposeSetRunSubmitters creates a GovDAO proposal replacing the whole run_submitters allowlist.

This is the only way to set the list by vote: the generic factories refuse the key (see assertNotRunSubmittersKey), so every whole-list write comes through here and carries the rule below.

The proposer must be on the list they propose.

An empty run_submitters means the gate is off and anyone may MsgRun. A non-empty one therefore decides who may run code at all -- and a list naming nobody who can create a GovDAO proposal cannot be undone, because creating a proposal needs MsgRun: a ProposalRequest carries an Executor, and MsgCall cannot build one from string arguments. The vote would end governance.

Requiring the proposer's own address is a cheap way to prove the list is usable rather than merely plausible. GovDAO refuses a proposal from a non-member (PreCreateProposal, "only members can create new proposals"), so if this proposal exists at all its author is a member -- and they just signed the transaction that created it, so the address demonstrably holds a key. A list that merely NAMES a member proves neither: the address may belong to nobody, since any member can enroll an arbitrary address.

Checked here, at proposal creation, rather than inside the executor. Nothing in r/gov/dao recovers from an executor panic, so a check that fires at execution turns a passed proposal into one that can never be executed. Here the refusal reaches a person who can still fix the list and propose again.

This is a floor, not an invariant. The proposer may resign from GovDAO later, and the list is not re-checked when they do. It rules out arriving at a dead list in one vote; it cannot rule out drifting into one.

func ProposeSetRunSubmittersManager

crossing Action
1func ProposeSetRunSubmittersManager(cur realm, pkgpath string) dao.ProposalRequest
source

ProposeSetRunSubmittersManager creates a GovDAO proposal handing management of run_submitters to pkgpath.

pkgpath may be a sub-realm identity such as "gno.land/r/nt/commondao/v0#dao/42", which is how a single DAO hosted by a multi-tenant realm is named. Matching is exact, so naming the bare host would authorize the host itself and none of its DAOs.

func RemoveRunSubmitters

crossing Action
1func RemoveRunSubmitters(cur realm, addrs []string)
source

RemoveRunSubmitters removes addresses from the run_submitters allowlist.

Callable only by the delegated manager, and only for addresses that manager added. Refusing rather than silently skipping is deliberate: a partial removal that reported success would leave the caller believing an address was de-listed when it was not.

func Render

1func Render(path string) string
source

Render shows who, other than GovDAO, may currently write a chain parameter.

This realm had no Render, so the only way to see a delegation was to know it existed and query for it by name. That is the wrong shape for state that grants a capability: someone auditing the chain should be able to see, in one place, whether any parameter is delegated and to whom.

Values are rendered without escaping, which is safe here because none of them is free-form. A delegate path has passed assertDelegatePath, which permits only lowercase letters, digits and a few separators; the addresses come from the parameter itself, which the chain validates as bech32; and the valset realm is a compile-time constant.

func RunSubmittersGrantedBy

Action
1func RunSubmittersGrantedBy(addr address) bool
source

RunSubmittersGrantedBy reports whether the current delegate added addr, i.e. whether it may remove it.

Exposed so a delegate can check before acting. A delegate that discovers a refusal by panicking mid-proposal-execution is in a bad place: the panic aborts the transaction, and for a DAO whose proposal has already passed, every retry aborts the same way.

func RunSubmittersManager

Action
1func RunSubmittersManager() string
source

RunSubmittersManager returns the package path currently authorized to manage run_submitters, or "" when the capability is not delegated.

func SetValsetProposal

crossing Action
1func SetValsetProposal(cur realm, entries []string)
source

SetValsetProposal publishes the realm's desired valset. Each entry is "<bech32-pubkey>:<decimal-power>"; power=0 removes the validator. The chain reads this on the next EndBlocker, diffs it against valset:current, and propagates the changes to consensus.

func ValsetDirty

Action
1func ValsetDirty() bool
source

ValsetDirty reports whether valset:proposed is awaiting EndBlocker. Realm callers MUST treat this as transient: the dirty flag is set by SetValsetProposal and cleared by the chain's EndBlocker (every block where dirty=true on entry exits with dirty=false).

Imports 11

Source Files 14