|
|
@ -139,21 +139,26 @@ func (c *ChainConfig) IsEIP155(epoch *big.Int) bool { |
|
|
|
return isForked(c.EIP155Epoch, epoch) |
|
|
|
return isForked(c.EIP155Epoch, epoch) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// IsCrossTx returns whether cross-shard transaction is enabled in the given
|
|
|
|
// AcceptsCrossTx returns whether cross-shard transaction is accepted in the
|
|
|
|
// epoch.
|
|
|
|
// given epoch.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Note that this is different from comparing epoch against CrossTxEpoch.
|
|
|
|
// Note that this is different from comparing epoch against CrossTxEpoch.
|
|
|
|
// Cross-shard transaction is enabled from CrossTxEpoch+1 and on, in order to
|
|
|
|
// Cross-shard transaction is accepted from CrossTxEpoch+1 and on, in order to
|
|
|
|
// allow for all shards to roll into CrossTxEpoch and become able to handle
|
|
|
|
// allow for all shards to roll into CrossTxEpoch and become able to handle
|
|
|
|
// ingress receipts. In other words, cross-shard transaction fields are
|
|
|
|
// ingress receipts. In other words, cross-shard transaction fields are
|
|
|
|
// introduced at CrossTxEpoch, but these fields are not used until
|
|
|
|
// introduced and ingress receipts are processed at CrossTxEpoch, but the shard
|
|
|
|
// CrossTxEpoch+1, when cross-shard transactions are actually accepted by the
|
|
|
|
// does not accept cross-shard transactions from clients until CrossTxEpoch+1.
|
|
|
|
// network.
|
|
|
|
func (c *ChainConfig) AcceptsCrossTx(epoch *big.Int) bool { |
|
|
|
func (c *ChainConfig) IsCrossTx(epoch *big.Int) bool { |
|
|
|
|
|
|
|
crossTxEpoch := new(big.Int).Add(c.CrossTxEpoch, common.Big1) |
|
|
|
crossTxEpoch := new(big.Int).Add(c.CrossTxEpoch, common.Big1) |
|
|
|
return isForked(crossTxEpoch, epoch) |
|
|
|
return isForked(crossTxEpoch, epoch) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// HasCrossTxFields returns whether blocks in the given epoch includes
|
|
|
|
|
|
|
|
// cross-shard transaction fields.
|
|
|
|
|
|
|
|
func (c *ChainConfig) HasCrossTxFields(epoch *big.Int) bool { |
|
|
|
|
|
|
|
return isForked(c.CrossTxEpoch, epoch) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// IsStaking determines whether it is staking epoch
|
|
|
|
// IsStaking determines whether it is staking epoch
|
|
|
|
func (c *ChainConfig) IsStaking(epoch *big.Int) bool { |
|
|
|
func (c *ChainConfig) IsStaking(epoch *big.Int) bool { |
|
|
|
return isForked(c.StakingEpoch, epoch) |
|
|
|
return isForked(c.StakingEpoch, epoch) |
|
|
|