From c8c7547e93e53ef7315628d0b1d718afb8d7bf0d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 8 Nov 2023 11:54:54 -0800 Subject: [PATCH 1/2] fix: build: an epoch is near an upgrade iff the upgrade is enabled This isn't a huge deal, but we'd otherwise consider the first finality epochs (or so) to be "near" any disabled upgrade. --- build/isnearupgrade.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/isnearupgrade.go b/build/isnearupgrade.go index 4273f0e9e3f..bd6e664efa6 100644 --- a/build/isnearupgrade.go +++ b/build/isnearupgrade.go @@ -5,5 +5,5 @@ import ( ) func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool { - return epoch > upgradeEpoch-Finality && epoch < upgradeEpoch+Finality + return upgradeEpoch >= 0 && epoch > upgradeEpoch-Finality && epoch < upgradeEpoch+Finality } From 383d3e03f2b4f9d7c84f9c2059f2d4fbc1aa622c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 29 Nov 2023 16:21:00 +0400 Subject: [PATCH 2/2] Update build/isnearupgrade.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Friðrik Ásmundsson --- build/isnearupgrade.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/isnearupgrade.go b/build/isnearupgrade.go index bd6e664efa6..74975780fe1 100644 --- a/build/isnearupgrade.go +++ b/build/isnearupgrade.go @@ -5,5 +5,8 @@ import ( ) func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool { - return upgradeEpoch >= 0 && epoch > upgradeEpoch-Finality && epoch < upgradeEpoch+Finality + if upgradeEpoch < 0 { + return false + } + return epoch > upgradeEpoch-Finality && epoch < upgradeEpoch+Finality }