Add IsNearUpgrade

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-12-19 21:51:07 +01:00
parent 420888aeae
commit c7e3e9fa7f
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 3 additions and 7 deletions

View File

@ -28,9 +28,7 @@ func New(dstore ds.Batching) *SlashFilter {
}
func (f *SlashFilter) MinedBlock(bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error {
if bh.Height > build.UpgradeOrangeHeight-build.Finality &&
bh.Height < build.UpgradeOrangeHeight+build.Finality {
// consenssus faults disabled during Upgrade Orange
if build.IsNearUpgrade(bh.Height, build.UpgradeOrangeHeight) {
return nil
}

View File

@ -109,12 +109,10 @@ func (ss *syscallShim) VerifyConsensusFault(a, b, extra []byte) (*runtime2.Conse
}
// workaround chain halt
if blockA.Height > build.UpgradeOrangeHeight-build.Finality &&
blockA.Height < build.UpgradeOrangeHeight+build.Finality {
if build.IsNearUpgrade(blockA.Height, build.UpgradeOrangeHeight) {
return nil, xerrors.Errorf("consensus reporting disabled around Upgrade Orange")
}
if blockB.Height > build.UpgradeOrangeHeight-build.Finality &&
blockB.Height < build.UpgradeOrangeHeight+build.Finality {
if build.IsNearUpgrade(blockB.Height, build.UpgradeOrangeHeight) {
return nil, xerrors.Errorf("consensus reporting disabled around Upgrade Orange")
}