From de95667a6a4c79e1edf7861e215056756a3edb6a Mon Sep 17 00:00:00 2001 From: Aayush Date: Tue, 4 Oct 2022 11:29:27 -0400 Subject: [PATCH] Integrate the v9 migration --- build/params_2k.go | 2 +- chain/actors/builtin/datacap/util.go | 6 +++--- cmd/lotus-shed/migrations.go | 11 ++++++----- go.mod | 2 +- go.sum | 2 ++ 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/build/params_2k.go b/build/params_2k.go index aaab3f835..1fdeaef24 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -56,7 +56,7 @@ var UpgradeOhSnapHeight = abi.ChainEpoch(-18) var UpgradeSkyrHeight = abi.ChainEpoch(-19) -var UpgradeV17Height = abi.ChainEpoch(99999999999999) +var UpgradeV17Height = abi.ChainEpoch(100) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ 0: DrandMainnet, diff --git a/chain/actors/builtin/datacap/util.go b/chain/actors/builtin/datacap/util.go index da997846d..a88c630b9 100644 --- a/chain/actors/builtin/datacap/util.go +++ b/chain/actors/builtin/datacap/util.go @@ -1,12 +1,12 @@ package datacap import ( + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/go-state-types/builtin/v9/datacap" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" @@ -34,7 +34,7 @@ func getDataCap(store adt.Store, ver actors.Version, root rootFunc, addr address return false, big.Zero(), nil } - return true, big.Div(dcap, datacap.DatacapGranularity), nil + return true, big.Div(dcap, verifreg9.DataCapGranularity), nil } func forEachCap(store adt.Store, ver actors.Version, root rootFunc, cb func(addr address.Address, dcap abi.StoragePower) error) error { @@ -48,6 +48,6 @@ func forEachCap(store adt.Store, ver actors.Version, root rootFunc, cb func(addr if err != nil { return err } - return cb(a, big.Div(dcap, datacap.DatacapGranularity)) + return cb(a, big.Div(dcap, verifreg9.DataCapGranularity)) }) } diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 2e291c947..5cae7c547 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -22,8 +22,8 @@ import ( ) var migrationsCmd = &cli.Command{ - Name: "migrate-nv16", - Description: "Run the nv16 migration", + Name: "migrate-nv17", + Description: "Run the nv17 migration", ArgsUsage: "[block to look back from]", Flags: []cli.Flag{ &cli.StringFlag{ @@ -100,7 +100,7 @@ var migrationsCmd = &cli.Command{ startTime := time.Now() - err = filcns.PreUpgradeActorsV8(ctx, sm, cache, ts1.ParentState(), ts1.Height()-1, ts1) + err = filcns.PreUpgradeActorsV9(ctx, sm, cache, ts1.ParentState(), ts1.Height()-1, ts1) if err != nil { return err } @@ -108,7 +108,7 @@ var migrationsCmd = &cli.Command{ fmt.Println("completed round 1, took ", time.Since(startTime)) startTime = time.Now() - newCid1, err := filcns.UpgradeActorsV8(ctx, sm, cache, nil, blk.ParentStateRoot, blk.Height-1, migrationTs) + newCid1, err := filcns.UpgradeActorsV9(ctx, sm, cache, nil, blk.ParentStateRoot, blk.Height-1, migrationTs) if err != nil { return err } @@ -116,13 +116,14 @@ var migrationsCmd = &cli.Command{ fmt.Println("new cid", newCid1) - newCid2, err := filcns.UpgradeActorsV8(ctx, sm, nv15.NewMemMigrationCache(), nil, blk.ParentStateRoot, blk.Height-1, migrationTs) + 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) + return nil }, } diff --git a/go.mod b/go.mod index 5cdcc583f..b07efd546 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/filecoin-project/go-legs v0.4.4 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.1.12 + github.com/filecoin-project/go-state-types v0.1.13-0.20221004152844-60ff2344a55e github.com/filecoin-project/go-statemachine v1.0.2 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 diff --git a/go.sum b/go.sum index 69f259841..6d270c1c1 100644 --- a/go.sum +++ b/go.sum @@ -345,6 +345,8 @@ github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/ github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.12 h1:KsC820XAwhhlcS7Fu6Yq7Bim53NbVe+4rWKS+81h+LM= github.com/filecoin-project/go-state-types v0.1.12/go.mod h1:n/kujdC9JphvYTrmaD1+vJpvDPy/DwzckoMzP0nBKWI= +github.com/filecoin-project/go-state-types v0.1.13-0.20221004152844-60ff2344a55e h1:vmBYH93NV8Q8CCPvg8ZjFrBEabtv3y42e38E0zMA5xM= +github.com/filecoin-project/go-state-types v0.1.13-0.20221004152844-60ff2344a55e/go.mod h1:+HCZifUV+e8TlQkgll22Ucuiq8OrVJkK+4Kh4u75iiw= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc= github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=