Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/mycelo/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"math/big"
"math/rand"

"github.com/celo-org/celo-blockchain/common"
"github.com/celo-org/celo-blockchain/common/decimal/fixed"
"github.com/celo-org/celo-blockchain/mycelo/env"
"github.com/celo-org/celo-blockchain/mycelo/genesis"
Expand Down Expand Up @@ -115,7 +116,7 @@ func (e monorepoEnv) createEnv(workdir string) (*env.Environment, error) {
Accounts: env.AccountsConfig{
Mnemonic: env.MustNewMnemonic(),
NumValidators: 3,
ValidatorsPerGroup: 1,
ValidatorsPerGroup: 5, // monorepo uses a single validator group, max group size is 5
NumDeveloperAccounts: 0,
UseValidatorAsAdmin: true, // monorepo doesn't use the admin account type, uses first validator instead
},
Expand All @@ -137,6 +138,11 @@ func (e monorepoEnv) createGenesisConfig(env *env.Environment) (*genesis.Config,
BlockPeriod: 1,
RequestTimeout: 3000,
})
// To match the 'testing' config in monorepo
genesisConfig.EpochRewards.TargetVotingYieldInitial = fixed.MustNew("0.00016")
genesisConfig.EpochRewards.TargetVotingYieldMax = fixed.MustNew("0.0005")
genesisConfig.EpochRewards.TargetVotingYieldAdjustmentFactor = fixed.MustNew("0.1")
genesisConfig.Reserve.InitialBalance = common.MustBigInt("100000000000000000000000000") // 100M CELO

// Add balances to validator accounts instead of developer accounts
genesis.FundAccounts(genesisConfig, env.Accounts().ValidatorAccounts())
Expand Down
2 changes: 1 addition & 1 deletion mycelo/genesis/base_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func BaseConfig() *Config {
DowntimeSlasher: DowntimeSlasherParameters{
Reward: bigIntStr("10000000000000000000"), // 10 cGLD
Penalty: bigIntStr("100000000000000000000"), // 100 cGLD
SlashableDowntime: 60, // Should be overridden on public testnets
SlashableDowntime: 4, // make it small so it works with small epoch sizes, e.g. 10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this desirable for every network template or only for monorepo one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. The default epoch size (i.e. the epoch size of the default template) is 10, so the former slashable downtime of 60 doesn't make sense with that.

The only template that has a different epoch size is the load test (1000). If we wanted to avoid slashable downtime of 4 with epoch size 1000 it would make sense to override it on the loadtest template rather than have 60 be the default. But the low slashable downtime makes no difference if nobody does the slashing, so I don't see it as mattering for the load test template anyway.

},
Governance: GovernanceParameters{
UseMultiSig: true,
Expand Down