|
|
@ -30,6 +30,7 @@ var ( |
|
|
|
CrossLinkEpoch: big.NewInt(186), |
|
|
|
CrossLinkEpoch: big.NewInt(186), |
|
|
|
StakingEpoch: big.NewInt(186), |
|
|
|
StakingEpoch: big.NewInt(186), |
|
|
|
PreStakingEpoch: big.NewInt(185), |
|
|
|
PreStakingEpoch: big.NewInt(185), |
|
|
|
|
|
|
|
QuickUnlockEpoch: big.NewInt(191), |
|
|
|
EIP155Epoch: big.NewInt(28), |
|
|
|
EIP155Epoch: big.NewInt(28), |
|
|
|
S3Epoch: big.NewInt(28), |
|
|
|
S3Epoch: big.NewInt(28), |
|
|
|
ReceiptLogEpoch: big.NewInt(101), |
|
|
|
ReceiptLogEpoch: big.NewInt(101), |
|
|
@ -42,6 +43,7 @@ var ( |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
|
|
|
|
QuickUnlockEpoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
@ -55,6 +57,7 @@ var ( |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
|
|
|
|
QuickUnlockEpoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
@ -68,6 +71,7 @@ var ( |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
|
|
|
|
QuickUnlockEpoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
@ -81,6 +85,7 @@ var ( |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
PreStakingEpoch: big.NewInt(1), |
|
|
|
|
|
|
|
QuickUnlockEpoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
@ -93,6 +98,7 @@ var ( |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
CrossLinkEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
StakingEpoch: big.NewInt(2), |
|
|
|
PreStakingEpoch: big.NewInt(0), |
|
|
|
PreStakingEpoch: big.NewInt(0), |
|
|
|
|
|
|
|
QuickUnlockEpoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
EIP155Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
S3Epoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
|
ReceiptLogEpoch: big.NewInt(0), |
|
|
@ -107,6 +113,7 @@ var ( |
|
|
|
big.NewInt(0), // CrossLinkEpoch
|
|
|
|
big.NewInt(0), // CrossLinkEpoch
|
|
|
|
big.NewInt(0), // StakingEpoch
|
|
|
|
big.NewInt(0), // StakingEpoch
|
|
|
|
big.NewInt(0), // PreStakingEpoch
|
|
|
|
big.NewInt(0), // PreStakingEpoch
|
|
|
|
|
|
|
|
big.NewInt(0), // QuickUnlockEpoch
|
|
|
|
big.NewInt(0), // EIP155Epoch
|
|
|
|
big.NewInt(0), // EIP155Epoch
|
|
|
|
big.NewInt(0), // S3Epoch
|
|
|
|
big.NewInt(0), // S3Epoch
|
|
|
|
big.NewInt(0), // ReceiptLogEpoch
|
|
|
|
big.NewInt(0), // ReceiptLogEpoch
|
|
|
@ -121,6 +128,7 @@ var ( |
|
|
|
big.NewInt(0), // CrossLinkEpoch
|
|
|
|
big.NewInt(0), // CrossLinkEpoch
|
|
|
|
big.NewInt(0), // StakingEpoch
|
|
|
|
big.NewInt(0), // StakingEpoch
|
|
|
|
big.NewInt(0), // PreStakingEpoch
|
|
|
|
big.NewInt(0), // PreStakingEpoch
|
|
|
|
|
|
|
|
big.NewInt(0), // QuickUnlockEpoch
|
|
|
|
big.NewInt(0), // EIP155Epoch
|
|
|
|
big.NewInt(0), // EIP155Epoch
|
|
|
|
big.NewInt(0), // S3Epoch
|
|
|
|
big.NewInt(0), // S3Epoch
|
|
|
|
big.NewInt(0), // ReceiptLogEpoch
|
|
|
|
big.NewInt(0), // ReceiptLogEpoch
|
|
|
@ -165,6 +173,9 @@ type ChainConfig struct { |
|
|
|
// PreStakingEpoch is the epoch we allow staking transactions
|
|
|
|
// PreStakingEpoch is the epoch we allow staking transactions
|
|
|
|
PreStakingEpoch *big.Int `json:"prestaking-epoch,omitempty"` |
|
|
|
PreStakingEpoch *big.Int `json:"prestaking-epoch,omitempty"` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// QuickUnlockEpoch is the epoch when undelegation will be unlocked at the current epoch
|
|
|
|
|
|
|
|
QuickUnlockEpoch *big.Int `json:"quick-unlock-epoch,omitempty"` |
|
|
|
|
|
|
|
|
|
|
|
// EIP155 hard fork epoch (include EIP158 too)
|
|
|
|
// EIP155 hard fork epoch (include EIP158 too)
|
|
|
|
EIP155Epoch *big.Int `json:"eip155-epoch,omitempty"` |
|
|
|
EIP155Epoch *big.Int `json:"eip155-epoch,omitempty"` |
|
|
|
|
|
|
|
|
|
|
@ -222,6 +233,11 @@ func (c *ChainConfig) IsPreStaking(epoch *big.Int) bool { |
|
|
|
return isForked(c.PreStakingEpoch, epoch) |
|
|
|
return isForked(c.PreStakingEpoch, epoch) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// IsQuickUnlock determines whether it's the epoch when the undelegation should be unlocked at end of current epoch
|
|
|
|
|
|
|
|
func (c *ChainConfig) IsQuickUnlock(epoch *big.Int) bool { |
|
|
|
|
|
|
|
return isForked(c.QuickUnlockEpoch, epoch) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// IsCrossLink returns whether epoch is either equal to the CrossLink fork epoch or greater.
|
|
|
|
// IsCrossLink returns whether epoch is either equal to the CrossLink fork epoch or greater.
|
|
|
|
func (c *ChainConfig) IsCrossLink(epoch *big.Int) bool { |
|
|
|
func (c *ChainConfig) IsCrossLink(epoch *big.Int) bool { |
|
|
|
return isForked(c.CrossLinkEpoch, epoch) |
|
|
|
return isForked(c.CrossLinkEpoch, epoch) |
|
|
|