Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIP-30 Boilerplate #4495

Merged
merged 5 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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/harmony/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,13 @@ func nodeconfigSetShardSchedule(config harmonyconfig.HarmonyConfig) {
}

devnetConfig, err := shardingconfig.NewInstance(
uint32(dnConfig.NumShards), dnConfig.ShardSize, dnConfig.HmyNodeSize, dnConfig.SlotsLimit, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccounts, shardingconfig.Allowlist{}, nil, nil, shardingconfig.VLBPE)
uint32(dnConfig.NumShards), dnConfig.ShardSize,
dnConfig.HmyNodeSize, dnConfig.SlotsLimit,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccounts, shardingconfig.Allowlist{},
nil, numeric.ZeroDec(), ethCommon.Address{},
nil, shardingconfig.VLBPE,
)
if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "ERROR invalid devnet sharding config: %s",
err)
Expand Down
2 changes: 1 addition & 1 deletion consensus/quorum/quorom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ func TestNthNextHmyExt(test *testing.T) {
allLeaders := append(blsKeys[:numHmyNodes], allowlistLeaders...)

decider := NewDecider(SuperMajorityVote, shard.BeaconChainShardID)
fakeInstance := shardingconfig.MustNewInstance(2, 20, numHmyNodes, 0, numeric.OneDec(), nil, nil, allowlist, nil, nil, 0)
fakeInstance := shardingconfig.MustNewInstance(2, 20, numHmyNodes, 0, numeric.OneDec(), nil, nil, allowlist, nil, numeric.ZeroDec(), common.Address{}, nil, 0)

decider.UpdateParticipants(blsKeys, allowlistLeaders)
for i := 0; i < len(allLeaders); i++ {
Expand Down
12 changes: 8 additions & 4 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1222,9 +1222,9 @@ var (

// ValidatorWrapper retrieves the existing validator in the cache, if sendOriginal
// else it will return a copy of the wrapper - which needs to be explicitly committed
// with UpdateValidatorWrapper
// to conserve memory, the copy can optionally avoid deep copying delegations
// Revert in UpdateValidatorWrapper does not work if sendOriginal == true
// with UpdateValidatorWrapper.
// To conserve memory, the copy can optionally avoid deep copying delegations.
// Revert in UpdateValidatorWrapper does not work if sendOriginal == true.
func (db *DB) ValidatorWrapper(
addr common.Address,
sendOriginal bool,
Expand Down Expand Up @@ -1362,7 +1362,11 @@ var (
)

// AddReward distributes the reward to all the delegators based on stake percentage.
func (db *DB) AddReward(snapshot *stk.ValidatorWrapper, reward *big.Int, shareLookup map[common.Address]numeric.Dec) error {
func (db *DB) AddReward(
snapshot *stk.ValidatorWrapper,
reward *big.Int,
shareLookup map[common.Address]numeric.Dec,
) error {
if reward.Cmp(common.Big0) == 0 {
utils.Logger().Info().RawJSON("validator", []byte(snapshot.String())).
Msg("0 given as reward")
Expand Down
34 changes: 31 additions & 3 deletions internal/configs/sharding/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,26 @@ type instance struct {
slotsLimit int // HIP-16: The absolute number of maximum effective slots per shard limit for each validator. 0 means no limit.
allowlist Allowlist
feeCollectors FeeCollectors
emissionFraction numeric.Dec
recoveryAddress ethCommon.Address
}

type FeeCollectors map[ethCommon.Address]numeric.Dec

// NewInstance creates and validates a new sharding configuration based
// upon given parameters.
func NewInstance(
numShards uint32, numNodesPerShard, numHarmonyOperatedNodesPerShard, slotsLimit int, harmonyVotePercent numeric.Dec,
numShards uint32,
numNodesPerShard,
numHarmonyOperatedNodesPerShard,
slotsLimit int,
harmonyVotePercent numeric.Dec,
hmyAccounts []genesis.DeployAccount,
fnAccounts []genesis.DeployAccount,
allowlist Allowlist,
feeCollectors FeeCollectors,
emissionFractionToRecovery numeric.Dec,
recoveryAddress ethCommon.Address,
sophoah marked this conversation as resolved.
Show resolved Hide resolved
reshardingEpoch []*big.Int, blocksE uint64,
) (Instance, error) {
if numShards < 1 {
Expand Down Expand Up @@ -94,6 +102,12 @@ func NewInstance(
)
}
}
if emissionFractionToRecovery.LT(numeric.ZeroDec()) ||
emissionFractionToRecovery.GT(numeric.OneDec()) {
return nil, errors.Errorf(
"emission split must be within [0, 1]",
)
}

return instance{
numShards: numShards,
Expand All @@ -108,6 +122,8 @@ func NewInstance(
blocksPerEpoch: blocksE,
slotsLimit: slotsLimit,
feeCollectors: feeCollectors,
recoveryAddress: recoveryAddress,
emissionFraction: emissionFractionToRecovery,
}, nil
}

Expand All @@ -122,12 +138,16 @@ func MustNewInstance(
fnAccounts []genesis.DeployAccount,
allowlist Allowlist,
feeCollectors FeeCollectors,
emissionFractionToRecovery numeric.Dec,
recoveryAddress ethCommon.Address,
reshardingEpoch []*big.Int, blocksPerEpoch uint64,
) Instance {
slotsLimit := int(float32(numNodesPerShard-numHarmonyOperatedNodesPerShard) * slotsLimitPercent)
sc, err := NewInstance(
numShards, numNodesPerShard, numHarmonyOperatedNodesPerShard, slotsLimit, harmonyVotePercent,
hmyAccounts, fnAccounts, allowlist, feeCollectors, reshardingEpoch, blocksPerEpoch,
numShards, numNodesPerShard, numHarmonyOperatedNodesPerShard,
slotsLimit, harmonyVotePercent, hmyAccounts, fnAccounts,
allowlist, feeCollectors, emissionFractionToRecovery,
recoveryAddress, reshardingEpoch, blocksPerEpoch,
)
if err != nil {
panic(err)
Expand Down Expand Up @@ -223,3 +243,11 @@ func (sc instance) ExternalAllowlist() []bls.PublicKeyWrapper {
func (sc instance) ExternalAllowlistLimit() int {
return sc.allowlist.MaxLimitPerShard
}

func (sc instance) HIP30RecoveryAddress() ethCommon.Address {
return sc.recoveryAddress
}

func (sc instance) HIP30EmissionFraction() numeric.Dec {
return sc.emissionFraction
}
53 changes: 47 additions & 6 deletions internal/configs/sharding/localnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"math/big"

ethCommon "github.com/ethereum/go-ethereum/common"
"github.com/harmony-one/harmony/internal/params"
"github.com/harmony-one/harmony/numeric"

Expand Down Expand Up @@ -156,10 +157,50 @@ var (
big.NewInt(0), big.NewInt(localnetV1Epoch), params.LocalnetChainConfig.StakingEpoch, params.LocalnetChainConfig.TwoSecondsEpoch,
}
// Number of shards, how many slots on each , how many slots owned by Harmony
localnetV0 = MustNewInstance(2, 7, 5, 0, numeric.OneDec(), genesis.LocalHarmonyAccounts, genesis.LocalFnAccounts, emptyAllowlist, nil, localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpochOld())
localnetV1 = MustNewInstance(2, 8, 5, 0, numeric.OneDec(), genesis.LocalHarmonyAccountsV1, genesis.LocalFnAccountsV1, emptyAllowlist, nil, localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpochOld())
localnetV2 = MustNewInstance(2, 9, 6, 0, numeric.MustNewDecFromStr("0.68"), genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2, emptyAllowlist, nil, localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpochOld())
localnetV3 = MustNewInstance(2, 9, 6, 0, numeric.MustNewDecFromStr("0.68"), genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2, emptyAllowlist, nil, localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpoch())
localnetV3_1 = MustNewInstance(2, 9, 6, 0, numeric.MustNewDecFromStr("0.68"), genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2, emptyAllowlist, nil, localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpoch())
localnetV3_2 = MustNewInstance(2, 9, 6, 0, numeric.MustNewDecFromStr("0.68"), genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2, emptyAllowlist, feeCollectorsLocalnet, localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpoch())
localnetV0 = MustNewInstance(
2, 7, 5, 0,
numeric.OneDec(), genesis.LocalHarmonyAccounts,
genesis.LocalFnAccounts, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpochOld(),
)
localnetV1 = MustNewInstance(
2, 8, 5, 0,
numeric.OneDec(), genesis.LocalHarmonyAccountsV1,
genesis.LocalFnAccountsV1, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpochOld(),
)
localnetV2 = MustNewInstance(
2, 9, 6, 0,
numeric.MustNewDecFromStr("0.68"),
genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2,
emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpochOld(),
)
localnetV3 = MustNewInstance(
2, 9, 6, 0,
numeric.MustNewDecFromStr("0.68"),
genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2,
emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpoch(),
)
localnetV3_1 = MustNewInstance(
2, 9, 6, 0,
numeric.MustNewDecFromStr("0.68"),
genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2,
emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpoch(),
)
localnetV3_2 = MustNewInstance(
2, 9, 6, 0,
numeric.MustNewDecFromStr("0.68"),
genesis.LocalHarmonyAccountsV2, genesis.LocalFnAccountsV2,
emptyAllowlist, feeCollectorsLocalnet,
numeric.ZeroDec(), ethCommon.Address{},
localnetReshardingEpoch, LocalnetSchedule.BlocksPerEpoch(),
)
)
167 changes: 148 additions & 19 deletions internal/configs/sharding/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ var (
// Community
mustAddress("0xbdFeE8587d347Cd8df002E6154763325265Fa84c"): numeric.MustNewDecFromStr("0.5"),
}

hip30CollectionAddress = ethCommon.Address{}
// hip30CollectionAddress = mustAddress("0xMustAddress")
)

func mustAddress(addrStr string) ethCommon.Address {
Expand All @@ -70,6 +73,8 @@ type mainnetSchedule struct{}

func (ms mainnetSchedule) InstanceForEpoch(epoch *big.Int) Instance {
switch {
case params.MainnetChainConfig.IsHIP30(epoch):
return mainnetV4
case params.MainnetChainConfig.IsFeeCollectEpoch(epoch):
return mainnetV3_4
case params.MainnetChainConfig.IsSlotsLimited(epoch):
Expand Down Expand Up @@ -223,23 +228,147 @@ func (ms mainnetSchedule) IsSkippedEpoch(shardID uint32, epoch *big.Int) bool {
var mainnetReshardingEpoch = []*big.Int{big.NewInt(0), big.NewInt(mainnetV0_1Epoch), big.NewInt(mainnetV0_2Epoch), big.NewInt(mainnetV0_3Epoch), big.NewInt(mainnetV0_4Epoch), big.NewInt(mainnetV1Epoch), big.NewInt(mainnetV1_1Epoch), big.NewInt(mainnetV1_2Epoch), big.NewInt(mainnetV1_3Epoch), big.NewInt(mainnetV1_4Epoch), big.NewInt(mainnetV1_5Epoch), big.NewInt(mainnetV2_0Epoch), big.NewInt(mainnetV2_1Epoch), big.NewInt(mainnetV2_2Epoch), params.MainnetChainConfig.TwoSecondsEpoch, params.MainnetChainConfig.SixtyPercentEpoch, params.MainnetChainConfig.HIP6And8Epoch}

var (
mainnetV0 = MustNewInstance(4, 150, 112, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccounts, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV0_1 = MustNewInstance(4, 152, 112, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV0_1, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV0_2 = MustNewInstance(4, 200, 148, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV0_2, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV0_3 = MustNewInstance(4, 210, 148, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV0_3, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV0_4 = MustNewInstance(4, 216, 148, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV0_4, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV1 = MustNewInstance(4, 250, 170, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV1_1 = MustNewInstance(4, 250, 170, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_1, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV1_2 = MustNewInstance(4, 250, 170, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_2, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV1_3 = MustNewInstance(4, 250, 170, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_3, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV1_4 = MustNewInstance(4, 250, 170, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_4, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV1_5 = MustNewInstance(4, 250, 170, 0, numeric.OneDec(), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV2_0 = MustNewInstance(4, 250, 170, 0, numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV2_1 = MustNewInstance(4, 250, 130, 0, numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV2_2 = MustNewInstance(4, 250, 90, 0, numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld())
mainnetV3 = MustNewInstance(4, 250, 90, 0, numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch())
mainnetV3_1 = MustNewInstance(4, 250, 50, 0, numeric.MustNewDecFromStr("0.60"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch())
mainnetV3_2 = MustNewInstance(4, 250, 25, 0, numeric.MustNewDecFromStr("0.49"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch())
mainnetV3_3 = MustNewInstance(4, 250, 25, 0.06, numeric.MustNewDecFromStr("0.49"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch())
mainnetV3_4 = MustNewInstance(4, 250, 25, 0.06, numeric.MustNewDecFromStr("0.49"), genesis.HarmonyAccounts, genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, feeCollectorsMainnet, mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch())
mainnetV0 = MustNewInstance(
4, 150, 112, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccounts, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV0_1 = MustNewInstance(
4, 152, 112, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV0_1, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV0_2 = MustNewInstance(
4, 200, 148, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV0_2, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV0_3 = MustNewInstance(
4, 210, 148, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV0_3, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV0_4 = MustNewInstance(
4, 216, 148, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV0_4, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV1 = MustNewInstance(
4, 250, 170, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV1_1 = MustNewInstance(
4, 250, 170, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_1, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV1_2 = MustNewInstance(
4, 250, 170, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_2, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV1_3 = MustNewInstance(
4, 250, 170, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_3, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV1_4 = MustNewInstance(
4, 250, 170, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_4, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV1_5 = MustNewInstance(
4, 250, 170, 0,
numeric.OneDec(), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV2_0 = MustNewInstance(
4, 250, 170, 0,
numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV2_1 = MustNewInstance(
4, 250, 130, 0,
numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV2_2 = MustNewInstance(
4, 250, 90, 0,
numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpochOld(),
)
mainnetV3 = MustNewInstance(
4, 250, 90, 0,
numeric.MustNewDecFromStr("0.68"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch(),
)
mainnetV3_1 = MustNewInstance(
4, 250, 50, 0,
numeric.MustNewDecFromStr("0.60"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch(),
)
mainnetV3_2 = MustNewInstance(
4, 250, 25, 0,
numeric.MustNewDecFromStr("0.49"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch(),
)
mainnetV3_3 = MustNewInstance(
4, 250, 25, 0.06,
numeric.MustNewDecFromStr("0.49"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist, nil,
numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch(),
)
mainnetV3_4 = MustNewInstance(
4, 250, 25, 0.06,
numeric.MustNewDecFromStr("0.49"), genesis.HarmonyAccounts,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist,
feeCollectorsMainnet, numeric.ZeroDec(), ethCommon.Address{},
mainnetReshardingEpoch, MainnetSchedule.BlocksPerEpoch(),
)
mainnetV4 = MustNewInstance(
// internal slots are 10% of total slots
2, 200, 20, 0.06,
numeric.MustNewDecFromStr("0.49"),
genesis.HarmonyAccountsPostHIP30,
genesis.FoundationalNodeAccountsV1_5, emptyAllowlist,
feeCollectorsMainnet, numeric.MustNewDecFromStr("0.25"),
hip30CollectionAddress, mainnetReshardingEpoch,
MainnetSchedule.BlocksPerEpoch(),
)
)
Loading