Search Apps Documentation Source Content File Folder Download Copy Actions Download

params package

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")

Functions

GetValoperRegisterFee

func GetValoperRegisterFee() uint64

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

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.GetValoperRegisterFee()"

Result

GetValoperRotationFee

func GetValoperRotationFee() uint64

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

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.GetValoperRotationFee()"

Result

GetValoperRotationPeriodBlocks

func GetValoperRotationPeriodBlocks() int64

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.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.GetValoperRotationPeriodBlocks()"

Result

GetValsetEffective

func GetValsetEffective() []validators.Validator

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.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.GetValsetEffective()"

Result

GetValsetEntries

func GetValsetEntries() []validators.Validator

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.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.GetValsetEntries()"

Result

NewSetFeeCollectorRequest

func NewSetFeeCollectorRequest(addr address) dao.ProposalRequest

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSetFeeCollectorRequest()"

Result

NewSetHaltRequest

func NewSetHaltRequest(height int64, minVersion string) dao.ProposalRequest

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.

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSetHaltRequest(,)"

Result

NewSysParamBoolPropRequest

func NewSysParamBoolPropRequest(module, submodule, name string, value bool) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamBoolPropRequest(,,,)"

Result

NewSysParamBytesPropRequest

func NewSysParamBytesPropRequest(module, submodule, name string, value []byte) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamBytesPropRequest(,,,)"

Result

NewSysParamInt64PropRequest

func NewSysParamInt64PropRequest(module, submodule, name string, value int64) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamInt64PropRequest(,,,)"

Result

NewSysParamStringPropRequest

func NewSysParamStringPropRequest(module, submodule, name, value string) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamStringPropRequest(,,,)"

Result

NewSysParamStringsPropRequest

func NewSysParamStringsPropRequest(module, submodule, name string, value []string) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamStringsPropRequest(,,,)"

Result

NewSysParamStringsPropRequestAddWithTitle

func NewSysParamStringsPropRequestAddWithTitle(module, submodule, name, title string, value []string) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamStringsPropRequestAddWithTitle(,,,,)"

Result

NewSysParamStringsPropRequestRemoveWithTitle

func NewSysParamStringsPropRequestRemoveWithTitle(module, submodule, name, title string, value []string) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamStringsPropRequestRemoveWithTitle(,,,,)"

Result

NewSysParamStringsPropRequestWithTitle

func NewSysParamStringsPropRequestWithTitle(module, submodule, name, title string, value []string) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamStringsPropRequestWithTitle(,,,,)"

Result

NewSysParamUint64PropRequest

func NewSysParamUint64PropRequest(module, submodule, name string, value uint64) dao.ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.NewSysParamUint64PropRequest(,,,)"

Result

ProposeAddUnrestrictedAcctsRequest

func ProposeAddUnrestrictedAcctsRequest(addrs ...address) dao.ProposalRequest

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.ProposeAddUnrestrictedAcctsRequest()"

Result

ProposeLockTransferRequest

func ProposeLockTransferRequest() dao.ProposalRequest

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.ProposeLockTransferRequest()"

Result

ProposeRemoveUnrestrictedAcctsRequest

func ProposeRemoveUnrestrictedAcctsRequest(addrs ...address) dao.ProposalRequest

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.ProposeRemoveUnrestrictedAcctsRequest()"

Result

ProposeUnlockTransferRequest

func ProposeUnlockTransferRequest() dao.ProposalRequest

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.ProposeUnlockTransferRequest()"

Result

SetValsetProposal

func SetValsetProposal(cur realm, entries []string)

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.

Param

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/params" -func "SetValsetProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/sys/params" -func "SetValsetProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx
  

ValsetDirty

func ValsetDirty() bool

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).

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/sys/params.ValsetDirty()"

Result