Skip to content

Commit 22cd7e4

Browse files
committed
Only split stake when there are non participating nodes.
Revert total non participating wallets to 400 as before.
1 parent d3a27a5 commit 22cd7e4

File tree

4 files changed

+2039
-235
lines changed

4 files changed

+2039
-235
lines changed

cmd/netgoal/generate.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,19 @@ func saveGoalTemplateToDisk(template netdeploy.NetworkTemplate, filename string)
466466
}
467467

468468
func generateWalletGenesisData(wallets, npnHosts int) gen.GenesisData {
469+
ratZero := big.NewRat(int64(0), int64(1))
470+
ratHundred := big.NewRat(int64(100), int64(1))
469471
data := gen.DefaultGenesis
470472
totalWallets := wallets + npnHosts
471473
data.Wallets = make([]gen.WalletData, totalWallets)
472-
// split participating an non participating stake evenly
473-
participatingNodeStake := big.NewRat(int64(50), int64(wallets))
474-
nonParticipatingNodeStake := big.NewRat(int64(50), int64(npnHosts))
474+
participatingNodeStake := big.NewRat(int64(100), int64(wallets))
475+
nonParticipatingNodeStake := ratZero
476+
if npnHosts > 0 {
477+
// split participating an non participating stake evenly
478+
participatingNodeStake = big.NewRat(int64(50), int64(wallets))
479+
nonParticipatingNodeStake = big.NewRat(int64(50), int64(npnHosts))
480+
}
475481

476-
ratZero := big.NewRat(int64(0), int64(1))
477-
ratHundred := big.NewRat(int64(100), int64(1))
478482
stake := ratZero
479483
stakeSum := new(big.Rat).Set(ratZero)
480484
for i := 0; i < totalWallets; i++ {

test/testdata/deployednettemplates/recipes/scenario2/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PARAMS=-w 200 -R 20 -N 40 -n 200 -H 15 --node-template node.json --relay-template relay.json --non-participating-node-template nonPartNode.json
1+
PARAMS=-w 400 -R 20 -N 40 -n 200 -H 15 --node-template node.json --relay-template relay.json --non-participating-node-template nonPartNode.json
22

33
all: net.json genesis.json
44

0 commit comments

Comments
 (0)