diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index b6c6985e2..4fca13f96 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -211,11 +211,9 @@ func (sm *StateManager) handleStateForks(ctx context.Context, root cid.Cid, heig return retCid, nil } -// Returns true if executing the current tipset would trigger an expensive fork. -// -// - If the tipset is the genesis, this function always returns false. -// - If inclusive is true, this function will also return true if applying a message on-top-of the -// tipset would trigger a fork. +// Returns true executing tipsets between the specified heights would trigger an expensive +// migration. NOTE: migrations occuring _at_ the target height are not included, as they're executed +// _after_ the target height. func (sm *StateManager) hasExpensiveForkBetween(parent, height abi.ChainEpoch) bool { for h := parent; h < height; h++ { if _, ok := sm.expensiveUpgrades[h]; ok { diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index 97ec8643b..6c507a0c4 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -310,7 +310,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) { nullStart := abi.ChainEpoch(testForkHeight - nullsBefore) nullLength := abi.ChainEpoch(nullsBefore + nullsAfter) - for i := 0; i < 50; i++ { + for i := 0; i < testForkHeight*2; i++ { pts := cg.CurTipset.TipSet() skip := abi.ChainEpoch(0) if pts.Height() == nullStart {