From 97ad8d6f20924d008a394ad065617f92548c78f1 Mon Sep 17 00:00:00 2001 From: ptrus Date: Mon, 30 May 2022 17:09:36 +0200 Subject: [PATCH] go/oasis-test-runner/fixture: support configuring runtime messages --- .changelog/4769.internal.md | 1 + go/oasis-node/cmd/genesis/genesis.go | 4 ++-- go/oasis-test-runner/oasis/network.go | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .changelog/4769.internal.md diff --git a/.changelog/4769.internal.md b/.changelog/4769.internal.md new file mode 100644 index 00000000000..0a986fecf3a --- /dev/null +++ b/.changelog/4769.internal.md @@ -0,0 +1 @@ +go/oasis-test-runner/fixture: support configuring runtime messages diff --git a/go/oasis-node/cmd/genesis/genesis.go b/go/oasis-node/cmd/genesis/genesis.go index bb06a71e63a..ca60cc6552d 100644 --- a/go/oasis-node/cmd/genesis/genesis.go +++ b/go/oasis-node/cmd/genesis/genesis.go @@ -90,8 +90,8 @@ const ( // Roothash config flags. cfgRoothashDebugDoNotSuspendRuntimes = "roothash.debug.do_not_suspend_runtimes" cfgRoothashDebugBypassStake = "roothash.debug.bypass_stake" // nolint: gosec - cfgRoothashMaxRuntimeMessages = "roothash.max_runtime_messages" - cfgRoothashMaxInRuntimeMessages = "roothash.max_in_runtime_messages" + CfgRoothashMaxRuntimeMessages = "roothash.max_runtime_messages" + CfgRoothashMaxInRuntimeMessages = "roothash.max_in_runtime_messages" // Staking config flags. CfgStakingTokenSymbol = "staking.token_symbol" diff --git a/go/oasis-test-runner/oasis/network.go b/go/oasis-test-runner/oasis/network.go index bb54f7b33a9..4a77523547c 100644 --- a/go/oasis-test-runner/oasis/network.go +++ b/go/oasis-test-runner/oasis/network.go @@ -38,6 +38,7 @@ import ( "github.com/oasisprotocol/oasis-core/go/oasis-test-runner/env" "github.com/oasisprotocol/oasis-core/go/oasis-test-runner/log" "github.com/oasisprotocol/oasis-core/go/oasis-test-runner/oasis/cli" + roothash "github.com/oasisprotocol/oasis-core/go/roothash/api" scheduler "github.com/oasisprotocol/oasis-core/go/scheduler/api" staking "github.com/oasisprotocol/oasis-core/go/staking/api" ) @@ -124,6 +125,9 @@ type NetworkCfg struct { // nolint: maligned // GovernanceParameters are the governance consensus parameters. GovernanceParameters *governance.ConsensusParameters `json:"governance_parameters,omitempty"` + // RoothashParameters are the roothash consensus parameters. + RoothashParameters *roothash.ConsensusParameters `json:"roothash_parameters,omitempty"` + // SchedulerWeakAlpkaOk is for disabling the VRF alpha entropy requirement. SchedulerWeakAlphaOk bool `json:"scheduler_weak_alpha_ok,omitempty"` @@ -741,6 +745,12 @@ func (net *Network) MakeGenesis() error { "--" + genesis.CfgGovernanceVotingPeriod, strconv.FormatUint(uint64(cfg.VotingPeriod), 10), }...) } + if cfg := net.cfg.RoothashParameters; cfg != nil { + args = append(args, []string{ + "--" + genesis.CfgRoothashMaxRuntimeMessages, strconv.FormatUint(uint64(cfg.MaxRuntimeMessages), 10), + "--" + genesis.CfgRoothashMaxInRuntimeMessages, strconv.FormatUint(uint64(cfg.MaxInRuntimeMessages), 10), + }...) + } if cfg := net.cfg.SchedulerForceElect; cfg != nil { for rt, pkMap := range cfg { for pk, ri := range pkMap {