From 0b68348738e19f3694372c896eb63f8fdb4908f1 Mon Sep 17 00:00:00 2001 From: Mikers Date: Wed, 9 Aug 2023 14:18:05 -1000 Subject: [PATCH] initial skeleton for nv21 migrations test. migration succesfully executes. todo @aayush and @zen add relevant tests --- itests/migration_test.go | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/itests/migration_test.go b/itests/migration_test.go index f9ce6a95f..5ba5d0c49 100644 --- a/itests/migration_test.go +++ b/itests/migration_test.go @@ -762,3 +762,49 @@ waitForProof20: require.Equal(t, v1proof, minerInfo.WindowPoStProofType) } + +func TestMigrationNV21(t *testing.T) { + kit.QuietMiningLogs() + + nv21epoch := abi.ChainEpoch(100) + testClient, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), + kit.UpgradeSchedule(stmgr.Upgrade{ + Network: network.Version20, + Height: -1, + }, stmgr.Upgrade{ + Network: network.Version21, + Height: nv21epoch, + Migration: filcns.UpgradeActorsV12, + }, + )) + + ens.InterconnectAll().BeginMining(10 * time.Millisecond) + + clientApi := testClient.FullNode.(*impl.FullNodeAPI) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv21epoch+5)) + + // Now that we have upgraded, we need to verify: + // - Sector info changes executed succesfully + // - Direct data onboarding correct + + bs := blockstore.NewAPIBlockstore(testClient) + ctxStore := gstStore.WrapBlockStore(ctx, bs) + + currTs, err := clientApi.ChainHead(ctx) + require.NoError(t, err) + + newStateTree, err := state.LoadStateTree(ctxStore, currTs.Blocks()[0].ParentStateRoot) + require.NoError(t, err) + + require.Equal(t, types.StateTreeVersion5, newStateTree.Version()) + + // start post migration checks + + //todo @aayush sector info changes + + //todo @zen Direct data onboarding tests + +}