Skip to content

Commit

Permalink
go/oasis-test-runner/fixture: support configuring runtime messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed May 30, 2022
1 parent 6709e4b commit 97ad8d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/4769.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/oasis-test-runner/fixture: support configuring runtime messages
4 changes: 2 additions & 2 deletions go/oasis-node/cmd/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions go/oasis-test-runner/oasis/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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"`

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 97ad8d6

Please sign in to comment.