Skip to content

Commit

Permalink
reduce internal voting power to 10% devnet (#4599)
Browse files Browse the repository at this point in the history
  • Loading branch information
diego1q2w authored Jan 9, 2024
1 parent e68b44f commit 5443bf7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/configs/sharding/partner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const (

func (ps partnerSchedule) InstanceForEpoch(epoch *big.Int) Instance {
switch {
case params.PartnerChainConfig.IsDevnetExternalEpoch(epoch):
return partnerV3
case params.PartnerChainConfig.IsHIP30(epoch):
return partnerV2
case epoch.Cmp(params.PartnerChainConfig.StakingEpoch) >= 0:
Expand Down Expand Up @@ -111,3 +113,11 @@ var partnerV2 = MustNewInstance(
hip30CollectionAddressTestnet, partnerReshardingEpoch,
PartnerSchedule.BlocksPerEpoch(),
)
var partnerV3 = MustNewInstance(
2, 5, 1, 0,
numeric.MustNewDecFromStr("0.1"), genesis.TNHarmonyAccounts,
genesis.TNFoundationalAccounts, emptyAllowlist,
feeCollectorsDevnet[1], numeric.MustNewDecFromStr("0.25"),
hip30CollectionAddressTestnet, partnerReshardingEpoch,
PartnerSchedule.BlocksPerEpoch(),
)
14 changes: 14 additions & 0 deletions internal/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var (
HIP30Epoch: big.NewInt(1673), // 2023-11-02 17:30:00+00:00
BlockGas30MEpoch: big.NewInt(1673), // 2023-11-02 17:30:00+00:00
MaxRateEpoch: EpochTBD,
DevnetExternalEpoch: EpochTBD,
}

// TestnetChainConfig contains the chain parameters to run a node on the harmony test network.
Expand Down Expand Up @@ -120,6 +121,7 @@ var (
HIP30Epoch: big.NewInt(2176), // 2023-10-12 10:00:00+00:00
BlockGas30MEpoch: big.NewInt(2176), // 2023-10-12 10:00:00+00:00
MaxRateEpoch: EpochTBD,
DevnetExternalEpoch: EpochTBD,
}
// PangaeaChainConfig contains the chain parameters for the Pangaea network.
// All features except for CrossLink are enabled at launch.
Expand Down Expand Up @@ -164,6 +166,7 @@ var (
HIP30Epoch: EpochTBD,
BlockGas30MEpoch: big.NewInt(0),
MaxRateEpoch: EpochTBD,
DevnetExternalEpoch: EpochTBD,
}

// PartnerChainConfig contains the chain parameters for the Partner network.
Expand Down Expand Up @@ -209,6 +212,7 @@ var (
HIP30Epoch: big.NewInt(7),
BlockGas30MEpoch: big.NewInt(7),
MaxRateEpoch: EpochTBD,
DevnetExternalEpoch: EpochTBD,
}

// StressnetChainConfig contains the chain parameters for the Stress test network.
Expand Down Expand Up @@ -254,6 +258,7 @@ var (
HIP30Epoch: EpochTBD,
BlockGas30MEpoch: big.NewInt(0),
MaxRateEpoch: EpochTBD,
DevnetExternalEpoch: EpochTBD,
}

// LocalnetChainConfig contains the chain parameters to run for local development.
Expand Down Expand Up @@ -298,6 +303,7 @@ var (
HIP30Epoch: EpochTBD,
BlockGas30MEpoch: big.NewInt(0),
MaxRateEpoch: EpochTBD,
DevnetExternalEpoch: EpochTBD,
}

// AllProtocolChanges ...
Expand Down Expand Up @@ -344,6 +350,7 @@ var (
big.NewInt(0), // BlockGas30M
big.NewInt(0), // BlockGas30M
big.NewInt(0), // MaxRateEpoch
big.NewInt(0),
}

// TestChainConfig ...
Expand Down Expand Up @@ -390,6 +397,7 @@ var (
big.NewInt(0), // HIP30Epoch
big.NewInt(0), // BlockGas30M
big.NewInt(0), // MaxRateEpoch
big.NewInt(0),
}

// TestRules ...
Expand Down Expand Up @@ -554,6 +562,8 @@ type ChainConfig struct {
// 4. Change the minimum validator commission from 5 to 7% (all nets)
HIP30Epoch *big.Int `json:"hip30-epoch,omitempty"`

DevnetExternalEpoch *big.Int `json:"devnet-external-epoch,omitempty"`

BlockGas30MEpoch *big.Int `json:"block-gas-30m-epoch,omitempty"`

// MaxRateEpoch will make sure the validator max-rate is at least equal to the minRate + the validator max-rate-increase
Expand Down Expand Up @@ -814,6 +824,10 @@ func (c *ChainConfig) IsHIP30(epoch *big.Int) bool {
return isForked(c.HIP30Epoch, epoch)
}

func (c *ChainConfig) IsDevnetExternalEpoch(epoch *big.Int) bool {
return isForked(c.DevnetExternalEpoch, epoch)
}

func (c *ChainConfig) IsMaxRate(epoch *big.Int) bool {
return isForked(c.MaxRateEpoch, epoch)
}
Expand Down

0 comments on commit 5443bf7

Please sign in to comment.