From ab4f135208481c86b7c7bfc31a2a12d2cccb72ed Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 21 Jan 2021 10:00:35 -0800 Subject: [PATCH] test actors v3 --- api/test/ccupgrade.go | 2 +- api/test/test.go | 13 +++++++++---- api/test/window_post.go | 4 ++-- cmd/lotus-storage-miner/actor_test.go | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/api/test/ccupgrade.go b/api/test/ccupgrade.go index eedcec6ca..2518d0ef9 100644 --- a/api/test/ccupgrade.go +++ b/api/test/ccupgrade.go @@ -31,7 +31,7 @@ func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) { func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeHeight abi.ChainEpoch) { ctx := context.Background() - n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV2At(upgradeHeight)}, OneMiner) + n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(upgradeHeight)}, OneMiner) client := n[0].FullNode.(*impl.FullNodeAPI) miner := sn[0] diff --git a/api/test/test.go b/api/test/test.go index a1b82c590..fed24d071 100644 --- a/api/test/test.go +++ b/api/test/test.go @@ -109,14 +109,19 @@ var OneMiner = []StorageMiner{{Full: 0, Preseal: PresealGenesis}} var OneFull = DefaultFullOpts(1) var TwoFull = DefaultFullOpts(2) -var FullNodeWithActorsV2At = func(upgradeHeight abi.ChainEpoch) FullNodeOpts { +var FullNodeWithActorsV3At = func(upgradeHeight abi.ChainEpoch) FullNodeOpts { return FullNodeOpts{ Opts: func(nodes []TestNode) node.Option { return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{ - // Skip directly to tape height so precommits work. - Network: network.Version5, - Height: upgradeHeight, + // prepare for upgrade. + Network: network.Version9, + Height: 1, Migration: stmgr.UpgradeActorsV2, + }, { + // Skip directly to tape height so precommits work. + Network: network.Version10, + Height: upgradeHeight, + Migration: stmgr.UpgradeActorsV3, }}) }, } diff --git a/api/test/window_post.go b/api/test/window_post.go index 84d668c76..0a7940513 100644 --- a/api/test/window_post.go +++ b/api/test/window_post.go @@ -218,7 +218,7 @@ func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, ctx, cancel := context.WithCancel(context.Background()) defer cancel() - n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV2At(upgradeHeight)}, OneMiner) + n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(upgradeHeight)}, OneMiner) client := n[0].FullNode.(*impl.FullNodeAPI) miner := sn[0] @@ -437,7 +437,7 @@ func TestTerminate(t *testing.T, b APIBuilder, blocktime time.Duration) { nSectors := uint64(2) - n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV2At(1)}, []StorageMiner{{Full: 0, Preseal: int(nSectors)}}) + n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(1)}, []StorageMiner{{Full: 0, Preseal: int(nSectors)}}) client := n[0].FullNode.(*impl.FullNodeAPI) miner := sn[0] diff --git a/cmd/lotus-storage-miner/actor_test.go b/cmd/lotus-storage-miner/actor_test.go index 2aea6bda9..c478c3236 100644 --- a/cmd/lotus-storage-miner/actor_test.go +++ b/cmd/lotus-storage-miner/actor_test.go @@ -50,7 +50,7 @@ func TestWorkerKeyChange(t *testing.T) { blocktime := 1 * time.Millisecond - n, sn := builder.MockSbBuilder(t, []test.FullNodeOpts{test.FullNodeWithActorsV2At(1), test.FullNodeWithActorsV2At(1)}, test.OneMiner) + n, sn := builder.MockSbBuilder(t, []test.FullNodeOpts{test.FullNodeWithActorsV3At(1), test.FullNodeWithActorsV3At(1)}, test.OneMiner) client1 := n[0] client2 := n[1]