diff --git a/chain/consensus/filcns/upgrades.go b/chain/consensus/filcns/upgrades.go index 07184ec68..d3fb21412 100644 --- a/chain/consensus/filcns/upgrades.go +++ b/chain/consensus/filcns/upgrades.go @@ -197,9 +197,14 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule { Migration: UpgradeActorsV9, PreMigrations: []stmgr.PreMigration{{ PreMigration: PreUpgradeActorsV9, - StartWithin: 180, + StartWithin: 240, DontStartWithin: 60, StopWithin: 5, + }, { + PreMigration: PreUpgradeActorsV9, + StartWithin: 15, + DontStartWithin: 10, + StopWithin: 5, }}, Expensive: true, }, diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index f00bad5a5..74d1999f0 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -115,7 +115,7 @@ var migrationsCmd = &cli.Command{ return err } - ts1, err := cs.GetTipsetByHeight(ctx, blk.Height-180, migrationTs, false) + ts1, err := cs.GetTipsetByHeight(ctx, blk.Height-240, migrationTs, false) if err != nil { return err } @@ -127,30 +127,51 @@ var migrationsCmd = &cli.Command{ return err } - fmt.Println("completed round 1, took ", time.Since(startTime)) + preMigration1Time := time.Since(startTime) + + ts2, err := cs.GetTipsetByHeight(ctx, blk.Height-15, migrationTs, false) + if err != nil { + return err + } + + startTime = time.Now() + + err = filcns.PreUpgradeActorsV9(ctx, sm, cache, ts2.ParentState(), ts2.Height()-1, ts2) + if err != nil { + return err + } + + preMigration2Time := time.Since(startTime) + startTime = time.Now() newCid1, err := filcns.UpgradeActorsV9(ctx, sm, cache, nil, blk.ParentStateRoot, blk.Height-1, migrationTs) if err != nil { return err } - fmt.Println("completed round actual (with cache), took ", time.Since(startTime)) - fmt.Println("new cid", newCid1) + cachedMigrationTime := time.Since(startTime) + + startTime = time.Now() newCid2, err := filcns.UpgradeActorsV9(ctx, sm, nv15.NewMemMigrationCache(), nil, blk.ParentStateRoot, blk.Height-1, migrationTs) if err != nil { return err } - fmt.Println("completed round actual (without cache), took ", time.Since(startTime)) - fmt.Println("new cid", newCid2) + uncachedMigrationTime := time.Since(startTime) if newCid1 != newCid2 { return xerrors.Errorf("got different results with and without the cache: %s, %s", newCid1, newCid2) } + fmt.Println("new cid", newCid2) + fmt.Println("completed premigration 1, took ", preMigration1Time) + fmt.Println("completed premigration 2, took ", preMigration2Time) + fmt.Println("completed round actual (with cache), took ", cachedMigrationTime) + fmt.Println("completed round actual (without cache), took ", uncachedMigrationTime) + err = checkStateInvariants(ctx, blk.ParentStateRoot, newCid1, bs) if err != nil { return err