@ -36,250 +36,250 @@ var once sync.Once
var (
var (
// MainnetChainConfig is the chain parameters to run a node on the main network.
// MainnetChainConfig is the chain parameters to run a node on the main network.
MainnetChainConfig = & ChainConfig {
MainnetChainConfig = & ChainConfig {
ChainID : MainnetChainID ,
ChainID : MainnetChainID ,
EthCompatibleChainID : EthMainnetShard0ChainID ,
EthCompatibleChainID : EthMainnetShard0ChainID ,
EthCompatibleShard0ChainID : EthMainnetShard0ChainID ,
EthCompatibleShard0ChainID : EthMainnetShard0ChainID ,
EthCompatibleEpoch : big . NewInt ( 442 ) , // Around Thursday Feb 4th 2020, 10AM PST
EthCompatibleEpoch : big . NewInt ( 442 ) , // Around Thursday Feb 4th 2020, 10AM PST
CrossTxEpoch : big . NewInt ( 28 ) ,
CrossTxEpoch : big . NewInt ( 28 ) ,
CrossLinkEpoch : big . NewInt ( 186 ) ,
CrossLinkEpoch : big . NewInt ( 186 ) ,
AggregatedRewardEpoch : big . NewInt ( 689 ) , // Around Wed Sept 15th 2021 with 3.5s block time
AggregatedRewardEpoch : big . NewInt ( 689 ) , // Around Wed Sept 15th 2021 with 3.5s block time
StakingEpoch : big . NewInt ( 186 ) ,
StakingEpoch : big . NewInt ( 186 ) ,
PreStakingEpoch : big . NewInt ( 185 ) ,
PreStakingEpoch : big . NewInt ( 185 ) ,
QuickUnlockEpoch : big . NewInt ( 191 ) ,
QuickUnlockEpoch : big . NewInt ( 191 ) ,
FiveSecondsEpoch : big . NewInt ( 230 ) ,
FiveSecondsEpoch : big . NewInt ( 230 ) ,
TwoSecondsEpoch : big . NewInt ( 366 ) , // Around Tuesday Dec 8th 2020, 8AM PST
TwoSecondsEpoch : big . NewInt ( 366 ) , // Around Tuesday Dec 8th 2020, 8AM PST
SixtyPercentEpoch : big . NewInt ( 530 ) , // Around Monday Apr 12th 2021, 22:30 UTC
SixtyPercentEpoch : big . NewInt ( 530 ) , // Around Monday Apr 12th 2021, 22:30 UTC
RedelegationEpoch : big . NewInt ( 290 ) ,
RedelegationEpoch : big . NewInt ( 290 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 530 ) , // Around Monday Apr 12th 2021, 22:30 UTC
NoEarlyUnlockEpoch : big . NewInt ( 530 ) , // Around Monday Apr 12th 2021, 22:30 UTC
VRFEpoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
VRFEpoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
PrevVRFEpoch : big . NewInt ( 689 ) , // Around Wed Sept 15th 2021 with 3.5s block time
PrevVRFEpoch : big . NewInt ( 689 ) , // Around Wed Sept 15th 2021 with 3.5s block time
MinDelegation100Epoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
MinDelegation100Epoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
MinCommissionRateEpoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
MinCommissionRateEpoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
MinCommissionPromoPeriod : big . NewInt ( 100 ) ,
MinCommissionPromoPeriod : big . NewInt ( 100 ) ,
EPoSBound35Epoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
EPoSBound35Epoch : big . NewInt ( 631 ) , // Around Wed July 7th 2021
EIP155Epoch : big . NewInt ( 28 ) ,
EIP155Epoch : big . NewInt ( 28 ) ,
S3Epoch : big . NewInt ( 28 ) ,
S3Epoch : big . NewInt ( 28 ) ,
DataCopyFixEpoch : big . NewInt ( 689 ) , // Around Wed Sept 15th 2021 with 3.5s block time
DataCopyFixEpoch : big . NewInt ( 689 ) , // Around Wed Sept 15th 2021 with 3.5s block time
IstanbulEpoch : big . NewInt ( 314 ) ,
IstanbulEpoch : big . NewInt ( 314 ) ,
ReceiptLogEpoch : big . NewInt ( 101 ) ,
ReceiptLogEpoch : big . NewInt ( 101 ) ,
SHA3Epoch : big . NewInt ( 725 ) , // Around Mon Oct 11 2021, 19:00 UTC
SHA3Epoch : big . NewInt ( 725 ) , // Around Mon Oct 11 2021, 19:00 UTC
HIP6And8Epoch : big . NewInt ( 725 ) , // Around Mon Oct 11 2021, 19:00 UTC
HIP6And8Epoch : big . NewInt ( 725 ) , // Around Mon Oct 11 2021, 19:00 UTC
StakingPrecompileEpoch : big . NewInt ( 871 ) , // Around Tue Feb 11 2022
StakingPrecompileEpoch : big . NewInt ( 871 ) , // Around Tue Feb 11 2022
ChainIdFixEpoch : big . NewInt ( 1323 ) , // Around Wed 8 Feb 11:30PM UTC
ChainIdFixEpoch : big . NewInt ( 1323 ) , // Around Wed 8 Feb 11:30PM UTC
SlotsLimitedEpoch : big . NewInt ( 999 ) , // Around Fri, 27 May 2022 09:41:02 UTC with 2s block time
SlotsLimitedEpoch : big . NewInt ( 999 ) , // Around Fri, 27 May 2022 09:41:02 UTC with 2s block time
CrossShardXferPrecompileEpoch : big . NewInt ( 1323 ) , // Around Wed 8 Feb 11:30PM UTC
CrossShardXferPrecompileEpoch : big . NewInt ( 1323 ) , // Around Wed 8 Feb 11:30PM UTC
AllowlistEpoch : EpochTBD ,
AllowlistEpoch : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
LeaderRotationEpoch : EpochTBD ,
LeaderRotationExternalNonBeaconLeaders : EpochTBD ,
LeaderRotationBlocksCount : 64 ,
LeaderRotationExternalBeaconLeaders : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
}
}
// TestnetChainConfig contains the chain parameters to run a node on the harmony test network.
// TestnetChainConfig contains the chain parameters to run a node on the harmony test network.
TestnetChainConfig = & ChainConfig {
TestnetChainConfig = & ChainConfig {
ChainID : TestnetChainID ,
ChainID : TestnetChainID ,
EthCompatibleChainID : EthTestnetShard0ChainID ,
EthCompatibleChainID : EthTestnetShard0ChainID ,
EthCompatibleShard0ChainID : EthTestnetShard0ChainID ,
EthCompatibleShard0ChainID : EthTestnetShard0ChainID ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
AggregatedRewardEpoch : big . NewInt ( 2 ) ,
AggregatedRewardEpoch : big . NewInt ( 2 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 2 ) ,
TwoSecondsEpoch : big . NewInt ( 2 ) ,
SixtyPercentEpoch : big . NewInt ( 2 ) ,
SixtyPercentEpoch : big . NewInt ( 2 ) ,
RedelegationEpoch : big . NewInt ( 2 ) ,
RedelegationEpoch : big . NewInt ( 2 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 2 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 2 ) ,
VRFEpoch : big . NewInt ( 2 ) ,
VRFEpoch : big . NewInt ( 2 ) ,
PrevVRFEpoch : big . NewInt ( 2 ) ,
PrevVRFEpoch : big . NewInt ( 2 ) ,
MinDelegation100Epoch : big . NewInt ( 2 ) ,
MinDelegation100Epoch : big . NewInt ( 2 ) ,
MinCommissionRateEpoch : big . NewInt ( 2 ) ,
MinCommissionRateEpoch : big . NewInt ( 2 ) ,
MinCommissionPromoPeriod : big . NewInt ( 2 ) ,
MinCommissionPromoPeriod : big . NewInt ( 2 ) ,
EPoSBound35Epoch : big . NewInt ( 2 ) ,
EPoSBound35Epoch : big . NewInt ( 2 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 2 ) ,
HIP6And8Epoch : big . NewInt ( 2 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
SlotsLimitedEpoch : big . NewInt ( 2 ) ,
SlotsLimitedEpoch : big . NewInt ( 2 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
CrossShardXferPrecompileEpoch : big . NewInt ( 2 ) ,
CrossShardXferPrecompileEpoch : big . NewInt ( 2 ) ,
AllowlistEpoch : big . NewInt ( 2 ) ,
AllowlistEpoch : big . NewInt ( 2 ) ,
LeaderRotationEpoch : EpochTBD ,
LeaderRotationExternalNonBeaconLeaders : EpochTBD ,
LeaderRotationBlocksCount : 64 ,
LeaderRotationExternalBeaconLeaders : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
}
}
// PangaeaChainConfig contains the chain parameters for the Pangaea network.
// PangaeaChainConfig contains the chain parameters for the Pangaea network.
// All features except for CrossLink are enabled at launch.
// All features except for CrossLink are enabled at launch.
PangaeaChainConfig = & ChainConfig {
PangaeaChainConfig = & ChainConfig {
ChainID : PangaeaChainID ,
ChainID : PangaeaChainID ,
EthCompatibleChainID : EthPangaeaShard0ChainID ,
EthCompatibleChainID : EthPangaeaShard0ChainID ,
EthCompatibleShard0ChainID : EthPangaeaShard0ChainID ,
EthCompatibleShard0ChainID : EthPangaeaShard0ChainID ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
SixtyPercentEpoch : big . NewInt ( 0 ) ,
SixtyPercentEpoch : big . NewInt ( 0 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 0 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) , // same as staking
StakingPrecompileEpoch : big . NewInt ( 2 ) , // same as staking
ChainIdFixEpoch : big . NewInt ( 0 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
AllowlistEpoch : EpochTBD ,
AllowlistEpoch : EpochTBD ,
LeaderRotationEpoch : EpochTBD ,
LeaderRotationExternalNonBeaconLeaders : EpochTBD ,
LeaderRotationBlocksCount : 64 ,
LeaderRotationExternalBeaconLeaders : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
}
}
// PartnerChainConfig contains the chain parameters for the Partner network.
// PartnerChainConfig contains the chain parameters for the Partner network.
// This is the Devnet config
// This is the Devnet config
PartnerChainConfig = & ChainConfig {
PartnerChainConfig = & ChainConfig {
ChainID : PartnerChainID ,
ChainID : PartnerChainID ,
EthCompatibleChainID : EthPartnerShard0ChainID ,
EthCompatibleChainID : EthPartnerShard0ChainID ,
EthCompatibleShard0ChainID : EthPartnerShard0ChainID ,
EthCompatibleShard0ChainID : EthPartnerShard0ChainID ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
SixtyPercentEpoch : big . NewInt ( 4 ) ,
SixtyPercentEpoch : big . NewInt ( 4 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 0 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
AllowlistEpoch : EpochTBD ,
AllowlistEpoch : EpochTBD ,
FeeCollectEpoch : big . NewInt ( 574 ) ,
FeeCollectEpoch : big . NewInt ( 574 ) ,
LeaderRotationEpoch : EpochTBD ,
LeaderRotationExternalNonBeaconLeaders : EpochTBD ,
LeaderRotationBlocksCount : 64 ,
LeaderRotationExternalBeaconLeaders : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
}
}
// StressnetChainConfig contains the chain parameters for the Stress test network.
// StressnetChainConfig contains the chain parameters for the Stress test network.
// All features except for CrossLink are enabled at launch.
// All features except for CrossLink are enabled at launch.
StressnetChainConfig = & ChainConfig {
StressnetChainConfig = & ChainConfig {
ChainID : StressnetChainID ,
ChainID : StressnetChainID ,
EthCompatibleChainID : EthStressnetShard0ChainID ,
EthCompatibleChainID : EthStressnetShard0ChainID ,
EthCompatibleShard0ChainID : EthStressnetShard0ChainID ,
EthCompatibleShard0ChainID : EthStressnetShard0ChainID ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
PreStakingEpoch : big . NewInt ( 1 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
SixtyPercentEpoch : big . NewInt ( 10 ) ,
SixtyPercentEpoch : big . NewInt ( 10 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : big . NewInt ( 0 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
AllowlistEpoch : EpochTBD ,
AllowlistEpoch : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
FeeCollectEpoch : EpochTBD ,
LeaderRotationEpoch : EpochTBD ,
LeaderRotationExternalNonBeaconLeaders : EpochTBD ,
LeaderRotationBlocksCount : 64 ,
LeaderRotationExternalBeaconLeaders : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
}
}
// LocalnetChainConfig contains the chain parameters to run for local development.
// LocalnetChainConfig contains the chain parameters to run for local development.
LocalnetChainConfig = & ChainConfig {
LocalnetChainConfig = & ChainConfig {
ChainID : TestnetChainID ,
ChainID : TestnetChainID ,
EthCompatibleChainID : EthTestnetShard0ChainID ,
EthCompatibleChainID : EthTestnetShard0ChainID ,
EthCompatibleShard0ChainID : EthTestnetShard0ChainID ,
EthCompatibleShard0ChainID : EthTestnetShard0ChainID ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
EthCompatibleEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossTxEpoch : big . NewInt ( 0 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
CrossLinkEpoch : big . NewInt ( 2 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
AggregatedRewardEpoch : big . NewInt ( 3 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
StakingEpoch : big . NewInt ( 2 ) ,
PreStakingEpoch : big . NewInt ( 0 ) ,
PreStakingEpoch : big . NewInt ( 0 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
QuickUnlockEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
FiveSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
TwoSecondsEpoch : big . NewInt ( 0 ) ,
SixtyPercentEpoch : EpochTBD , // Never enable it for localnet as localnet has no external validator setup
SixtyPercentEpoch : EpochTBD , // Never enable it for localnet as localnet has no external validator setup
RedelegationEpoch : big . NewInt ( 0 ) ,
RedelegationEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
NoEarlyUnlockEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
VRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
PrevVRFEpoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinDelegation100Epoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionRateEpoch : big . NewInt ( 0 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
MinCommissionPromoPeriod : big . NewInt ( 10 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EPoSBound35Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
EIP155Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
S3Epoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
DataCopyFixEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
IstanbulEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
ReceiptLogEpoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
SHA3Epoch : big . NewInt ( 0 ) ,
HIP6And8Epoch : EpochTBD , // Never enable it for localnet as localnet has no external validator setup
HIP6And8Epoch : EpochTBD , // Never enable it for localnet as localnet has no external validator setup
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
StakingPrecompileEpoch : big . NewInt ( 2 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
ChainIdFixEpoch : big . NewInt ( 0 ) ,
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
SlotsLimitedEpoch : EpochTBD , // epoch to enable HIP-16
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
CrossShardXferPrecompileEpoch : big . NewInt ( 1 ) ,
AllowlistEpoch : EpochTBD ,
AllowlistEpoch : EpochTBD ,
LeaderRotationEpoch : EpochTBD ,
LeaderRotationExternalNonBeaconLeaders : big . NewInt ( 5 ) ,
LeaderRotationBlocksCount : 5 ,
LeaderRotationExternalBeaconLeaders : big . NewInt ( 6 ) ,
FeeCollectEpoch : big . NewInt ( 5 ) ,
FeeCollectEpoch : big . NewInt ( 5 ) ,
ValidatorCodeFixEpoch : EpochTBD ,
ValidatorCodeFixEpoch : EpochTBD ,
}
}
// AllProtocolChanges ...
// AllProtocolChanges ...
@ -319,8 +319,8 @@ var (
big . NewInt ( 0 ) , // SlotsLimitedEpoch
big . NewInt ( 0 ) , // SlotsLimitedEpoch
big . NewInt ( 1 ) , // CrossShardXferPrecompileEpoch
big . NewInt ( 1 ) , // CrossShardXferPrecompileEpoch
big . NewInt ( 0 ) , // AllowlistEpoch
big . NewInt ( 0 ) , // AllowlistEpoch
big . NewInt ( 1 ) , // LeaderRotationEpoch
big . NewInt ( 1 ) , // LeaderRotationExternalNonBeaconLeaders
64 , // LeaderRotationBlocksCount
big . NewInt ( 1 ) , // LeaderRotationExternalBeaconLeaders
big . NewInt ( 0 ) , // FeeCollectEpoch
big . NewInt ( 0 ) , // FeeCollectEpoch
big . NewInt ( 0 ) , // ValidatorCodeFixEpoch
big . NewInt ( 0 ) , // ValidatorCodeFixEpoch
}
}
@ -362,8 +362,8 @@ var (
big . NewInt ( 0 ) , // SlotsLimitedEpoch
big . NewInt ( 0 ) , // SlotsLimitedEpoch
big . NewInt ( 1 ) , // CrossShardXferPrecompileEpoch
big . NewInt ( 1 ) , // CrossShardXferPrecompileEpoch
big . NewInt ( 0 ) , // AllowlistEpoch
big . NewInt ( 0 ) , // AllowlistEpoch
big . NewInt ( 1 ) , // LeaderRotationEpoch
big . NewInt ( 1 ) , // LeaderRotationExternalNonBeaconLeaders
64 , // LeaderRotationBlocksCount
big . NewInt ( 1 ) , // LeaderRotationExternalBeaconLeaders
big . NewInt ( 0 ) , // FeeCollectEpoch
big . NewInt ( 0 ) , // FeeCollectEpoch
big . NewInt ( 0 ) , // ValidatorCodeFixEpoch
big . NewInt ( 0 ) , // ValidatorCodeFixEpoch
}
}
@ -505,9 +505,9 @@ type ChainConfig struct {
// AllowlistEpoch is the first epoch to support allowlist of HIP18
// AllowlistEpoch is the first epoch to support allowlist of HIP18
AllowlistEpoch * big . Int
AllowlistEpoch * big . Int
LeaderRotationEpoch * big . Int ` json:"leader-rotation-epoch ,omitempty" `
LeaderRotationExternalNonBeaconLeaders * big . Int ` json:"leader-rotation-external-non-beacon-leaders ,omitempty" `
LeaderRotationBlocksCount int ` json:"leader-rotation-blocks-count ,omitempty" `
LeaderRotationExternalBeaconLeaders * big . Int ` json:"leader-rotation-external-beacon-leaders ,omitempty" `
// FeeCollectEpoch is the first epoch that enables txn fees to be collected into the community-managed account.
// FeeCollectEpoch is the first epoch that enables txn fees to be collected into the community-managed account.
// It should >= StakingEpoch.
// It should >= StakingEpoch.
@ -725,7 +725,17 @@ func (c *ChainConfig) IsAllowlistEpoch(epoch *big.Int) bool {
}
}
func ( c * ChainConfig ) IsLeaderRotation ( epoch * big . Int ) bool {
func ( c * ChainConfig ) IsLeaderRotation ( epoch * big . Int ) bool {
return isForked ( c . LeaderRotationEpoch , epoch )
return isForked ( c . LeaderRotationExternalNonBeaconLeaders , epoch )
}
func ( c * ChainConfig ) IsLeaderRotationExternalValidatorsAllowed ( epoch * big . Int , shardID uint32 ) bool {
if ! c . IsLeaderRotation ( epoch ) {
return false
}
if shardID == 0 {
return isForked ( c . LeaderRotationExternalBeaconLeaders , epoch )
}
return true
}
}
// IsFeeCollectEpoch determines whether Txn Fees will be collected into the community-managed account.
// IsFeeCollectEpoch determines whether Txn Fees will be collected into the community-managed account.