diff --git a/internal/configs/sharding/testnet.go b/internal/configs/sharding/testnet.go index 7c2994071c..f640857537 100644 --- a/internal/configs/sharding/testnet.go +++ b/internal/configs/sharding/testnet.go @@ -42,6 +42,8 @@ const ( func (ts testnetSchedule) InstanceForEpoch(epoch *big.Int) Instance { switch { + case params.TestnetChainConfig.IsTestnetExternalEpoch(epoch): + return testnetV6 case params.TestnetChainConfig.IsHIP30(epoch): return testnetV5 case params.TestnetChainConfig.IsFeeCollectEpoch(epoch): @@ -169,4 +171,12 @@ var ( hip30CollectionAddressTestnet, testnetReshardingEpoch, TestnetSchedule.BlocksPerEpoch(), ) + testnetV6 = MustNewInstance( + 2, 30, 0, 0, + numeric.MustNewDecFromStr("0.0"), genesis.TNHarmonyAccountsV1, + genesis.TNFoundationalAccounts, emptyAllowlist, + feeCollectorsTestnet, numeric.MustNewDecFromStr("0.25"), + hip30CollectionAddressTestnet, testnetReshardingEpoch, + TestnetSchedule.BlocksPerEpoch(), + ) ) diff --git a/internal/params/config.go b/internal/params/config.go index b0c6c70d11..99c846b69a 100644 --- a/internal/params/config.go +++ b/internal/params/config.go @@ -77,6 +77,7 @@ var ( BlockGas30MEpoch: big.NewInt(1673), // 2023-11-02 17:30:00+00:00 MaxRateEpoch: EpochTBD, DevnetExternalEpoch: EpochTBD, + TestnetExternalEpoch: EpochTBD, } // TestnetChainConfig contains the chain parameters to run a node on the harmony test network. @@ -122,6 +123,7 @@ var ( BlockGas30MEpoch: big.NewInt(2176), // 2023-10-12 10:00:00+00:00 MaxRateEpoch: EpochTBD, DevnetExternalEpoch: EpochTBD, + TestnetExternalEpoch: EpochTBD, } // PangaeaChainConfig contains the chain parameters for the Pangaea network. // All features except for CrossLink are enabled at launch. @@ -167,6 +169,7 @@ var ( BlockGas30MEpoch: big.NewInt(0), MaxRateEpoch: EpochTBD, DevnetExternalEpoch: EpochTBD, + TestnetExternalEpoch: EpochTBD, } // PartnerChainConfig contains the chain parameters for the Partner network. @@ -212,6 +215,7 @@ var ( HIP30Epoch: big.NewInt(7), BlockGas30MEpoch: big.NewInt(7), MaxRateEpoch: EpochTBD, + TestnetExternalEpoch: EpochTBD, DevnetExternalEpoch: big.NewInt(144), } @@ -259,6 +263,7 @@ var ( BlockGas30MEpoch: big.NewInt(0), MaxRateEpoch: EpochTBD, DevnetExternalEpoch: EpochTBD, + TestnetExternalEpoch: EpochTBD, } // LocalnetChainConfig contains the chain parameters to run for local development. @@ -304,6 +309,7 @@ var ( BlockGas30MEpoch: big.NewInt(0), MaxRateEpoch: EpochTBD, DevnetExternalEpoch: EpochTBD, + TestnetExternalEpoch: EpochTBD, } // AllProtocolChanges ... @@ -350,6 +356,7 @@ var ( big.NewInt(0), // BlockGas30M big.NewInt(0), // BlockGas30M big.NewInt(0), // MaxRateEpoch + big.NewInt(0), // MaxRateEpoch big.NewInt(0), } @@ -397,6 +404,7 @@ var ( big.NewInt(0), // HIP30Epoch big.NewInt(0), // BlockGas30M big.NewInt(0), // MaxRateEpoch + big.NewInt(0), // MaxRateEpoch big.NewInt(0), } @@ -564,6 +572,8 @@ type ChainConfig struct { DevnetExternalEpoch *big.Int `json:"devnet-external-epoch,omitempty"` + TestnetExternalEpoch *big.Int `json:"testnet-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 @@ -831,6 +841,10 @@ func (c *ChainConfig) IsDevnetExternalEpoch(epoch *big.Int) bool { return isForked(c.DevnetExternalEpoch, epoch) } +func (c *ChainConfig) IsTestnetExternalEpoch(epoch *big.Int) bool { + return isForked(c.TestnetExternalEpoch, epoch) +} + func (c *ChainConfig) IsMaxRate(epoch *big.Int) bool { return isForked(c.MaxRateEpoch, epoch) }