Intro to Params
Parameters
Adding new Parameters
Visit this page for implementation details on how to add new parameters.
MsgUpdateParams vs MsgUpdateParam
READ THIS
This is a critical distinction that can impact all onchain parameters.
This is a critical distinction that can impact all onchain parameters.
When submitting changes using MsgUpdateParams (note the s), you must specify all parameters in the module even if just modifying one.
Cosmos SDK
✅ (All params)
❌ (Not available)
✅ (All params)
✅ (Single param)
Summary of Key Differences:
Cosmos SDK uses
MsgUpdateParams(with s) which requires specifying all parameters in the module, even when modifying just oneThis repo implemented
MsgUpdateParam(no s) allowing updates to one parameter at a timeMore details on the Cosmos SDK
MsgUpdateParamscan be found here.More details on poktroll's
MsgUpdateParamcan be found here.
This distinction is critical when making on-chain parameter changes in either system.
Examples
Example: Changing Num Suppliers Per Session
To query the number of suppliers per session, use the following command:
pocketd query session params --network=<networ> #e.g. local, alpha, beta, mainTo update the number of suppliers per session, you need to create a new file with the transaction like so:
cat << 🚀 > /tmp/update_suppliers_per_session
{
"body": {
"messages": [\
{\
"@type": "/pocket.session.MsgUpdateParam",\
"authority": "pokt18808wvw0h4t450t06uvauny8lvscsxjfyua7vh",\
"name": "num_suppliers_per_session",\
"as_uint64": "15"\
}\
]
}
}
🚀Followed by running:
pocketd tx authz exec /tmp/update_suppliers_per_session --from grove_mainnet_genesis --yes --network=<network> #e.g. local, alpha, beta, mainExample: Block Size Change
For example, here's a transaction that will increase the block size (a parameter in the consensus module):
note
For convenience, we have put it in tools/scripts/params/consensus_block_size_6mb.json.
{
"body": {
"messages": [\
{\
"@type": "/cosmos.consensus.v1.MsgUpdateParams",\
"authority": "pokt18808wvw0h4t450t06uvauny8lvscsxjfyua7vh",\
"abci": {},\
"block": {\
"max_bytes": "66060288",\
"max_gas": "-1"\
},\
"evidence": {\
"max_age_duration": "48h0m0s",\
"max_age_num_blocks": "100000",\
"max_bytes": "1048576"\
},\
"validator": {\
"pub_key_types": ["ed25519"]\
}\
}\
]
}
}To check the current consensus parameters (before and after the change), use this command:
pocketd query consensus params --network=<network> #e.g. local, alpha, beta, mainBefore the upgrade:
params:
block:
max_bytes: "22020096"
# ... the rest of the responseTo submit the transaction that increases the block size:
pocketd tx authz exec tools/scripts/params/consensus_block_size_6mb.json --from pnf --yes --network=<network> #e.g. local, alpha, beta, mainAfter the upgrade:
params:
block:
max_bytes: "66060288"
# ... the rest of the responseWas this helpful?
