From 1b69c480e6e26a0702ba039400e5efbff1908d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 25 Jan 2024 16:58:35 +0100 Subject: [PATCH 01/17] shed: Add v13 migration to migrate-state --- cmd/lotus-shed/migrations.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 96e4747b7ef..327c5f4daf2 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -22,6 +22,7 @@ import ( v10 "github.com/filecoin-project/go-state-types/builtin/v10" v11 "github.com/filecoin-project/go-state-types/builtin/v11" v12 "github.com/filecoin-project/go-state-types/builtin/v12" + v13 "github.com/filecoin-project/go-state-types/builtin/v13" market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" v9 "github.com/filecoin-project/go-state-types/builtin/v9" @@ -246,6 +247,8 @@ func getMigrationFuncsForNetwork(nv network.Version) (UpgradeActorsFunc, PreUpgr return filcns.UpgradeActorsV11, filcns.PreUpgradeActorsV11, checkNv19Invariants, nil case network.Version21: return filcns.UpgradeActorsV12, filcns.PreUpgradeActorsV12, checkNv21Invariants, nil + case network.Version22: + return filcns.UpgradeActorsV13, filcns.PreUpgradeActorsV13, checkNv22Invariants, nil default: return nil, nil, nil, xerrors.Errorf("migration not implemented for nv%d", nv) } @@ -255,6 +258,38 @@ type UpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.Migrat type PreUpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.MigrationCache, cid.Cid, abi.ChainEpoch, *types.TipSet) error type CheckInvariantsFunc = func(context.Context, cid.Cid, cid.Cid, blockstore.Blockstore, abi.ChainEpoch) error +func checkNv22Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { + + actorStore := store.ActorStore(ctx, bs) + startTime := time.Now() + + // Load the new state root. + var newStateRoot types.StateRoot + if err := actorStore.Get(ctx, newStateRootCid, &newStateRoot); err != nil { + return xerrors.Errorf("failed to decode state root: %w", err) + } + + actorCodeCids, err := actors.GetActorCodeIDs(actorstypes.Version13) + if err != nil { + return err + } + newActorTree, err := builtin.LoadTree(actorStore, newStateRoot.Actors) + if err != nil { + return err + } + messages, err := v13.CheckStateInvariants(newActorTree, epoch, actorCodeCids) + if err != nil { + return xerrors.Errorf("checking state invariants: %w", err) + } + + for _, message := range messages.Messages() { + fmt.Println("got the following error: ", message) + } + + fmt.Println("completed invariant checks, took ", time.Since(startTime)) + + return nil +} func checkNv21Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { actorStore := store.ActorStore(ctx, bs) From 1ca66c309c82d48985d321c0102871d7e983550c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 29 Jan 2024 12:11:23 +0100 Subject: [PATCH 02/17] shed: some ADL tools, update GST --- cmd/lotus-shed/adl.go | 124 ++++++++++++++++++++ cmd/lotus-shed/diff.go | 221 ++++++++++++++++++++++++++++++++++- cmd/lotus-shed/main.go | 1 + cmd/lotus-shed/migrations.go | 26 +++++ go.mod | 4 +- go.sum | 4 +- 6 files changed, 375 insertions(+), 5 deletions(-) create mode 100644 cmd/lotus-shed/adl.go diff --git a/cmd/lotus-shed/adl.go b/cmd/lotus-shed/adl.go new file mode 100644 index 00000000000..762f78b6c82 --- /dev/null +++ b/cmd/lotus-shed/adl.go @@ -0,0 +1,124 @@ +package main + +import ( + "encoding/json" + "fmt" + "io" + "os" + + "github.com/ipfs/go-cid" + cbor "github.com/ipfs/go-ipld-cbor" + "github.com/ipld/go-car" + "github.com/urfave/cli/v2" + cbg "github.com/whyrusleeping/cbor-gen" + "golang.org/x/xerrors" + + adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt" + + "github.com/filecoin-project/lotus/blockstore" + "github.com/filecoin-project/lotus/chain/actors/adt" +) + +var adlCmd = &cli.Command{ + Name: "adl", + Usage: "adl manipulation commands", + Subcommands: []*cli.Command{ + adlAmtCmd, + }, +} + +var adlAmtCmd = &cli.Command{ + Name: "amt", + Usage: "AMT manipulation commands", + Subcommands: []*cli.Command{ + adlAmtGetCmd, + }, +} + +var adlAmtGetCmd = &cli.Command{ + Name: "get", + Usage: "Get an element from an AMT", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "car-file", + Usage: "write a car file with two hamts (use lotus-shed export-car)", + }, + &cli.IntFlag{ + Name: "bitwidth", + Usage: "bitwidth of the HAMT", + Value: 5, + }, + &cli.StringFlag{ + Name: "root", + Usage: "root cid of the HAMT", + }, + &cli.Int64Flag{ + Name: "key", + Usage: "key to get", + }, + }, + Action: func(cctx *cli.Context) error { + bs := blockstore.NewMemorySync() + + f, err := os.Open(cctx.String("car-file")) + if err != nil { + return err + } + defer func(f *os.File) { + _ = f.Close() + }(f) + + cr, err := car.NewCarReader(f) + if err != nil { + return err + } + + for { + blk, err := cr.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + if err := bs.Put(cctx.Context, blk); err != nil { + return err + } + } + + root, err := cid.Parse(cctx.String("root")) + if err != nil { + return err + } + + m, err := adt13.AsArray(adt.WrapStore(cctx.Context, cbor.NewCborStore(bs)), root, cctx.Int("bitwidth")) + if err != nil { + return err + } + + var out cbg.Deferred + ok, err := m.Get(cctx.Uint64("key"), &out) + if err != nil { + return err + } + if !ok { + return xerrors.Errorf("no such element") + } + + fmt.Printf("RAW: %x\n", out.Raw) + fmt.Println("----") + + var i interface{} + if err := cbor.DecodeInto(out.Raw, &i); err == nil { + ij, err := json.MarshalIndent(i, "", " ") + if err != nil { + return err + } + + fmt.Println(string(ij)) + } + + return nil + }, +} diff --git a/cmd/lotus-shed/diff.go b/cmd/lotus-shed/diff.go index 981dc850c62..483c53ac9e9 100644 --- a/cmd/lotus-shed/diff.go +++ b/cmd/lotus-shed/diff.go @@ -1,20 +1,30 @@ package main import ( + "bytes" "context" + "encoding/json" "fmt" "io" + "os" + "github.com/fatih/color" "github.com/ipfs/go-cid" + cbor "github.com/ipfs/go-ipld-cbor" + "github.com/ipld/go-car" "github.com/urfave/cli/v2" "golang.org/x/xerrors" + "github.com/filecoin-project/go-amt-ipld/v4" + "github.com/filecoin-project/go-hamt-ipld/v3" "github.com/filecoin-project/go-state-types/abi" miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" + "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/lib/must" "github.com/filecoin-project/lotus/node/repo" ) @@ -24,6 +34,8 @@ var diffCmd = &cli.Command{ Subcommands: []*cli.Command{ diffStateTrees, diffMinerStates, + diffHAMTs, + diffAMTs, }, } @@ -64,7 +76,9 @@ var diffMinerStates = &cli.Command{ return err } - defer lkrepo.Close() //nolint:errcheck + defer func(lkrepo repo.LockedRepo) { + _ = lkrepo.Close() + }(lkrepo) bs, err := lkrepo.Blockstore(ctx, repo.UniversalBlockstore) if err != nil { @@ -258,3 +272,208 @@ var diffStateTrees = &cli.Command{ return nil }, } + +var diffHAMTs = &cli.Command{ + Name: "hamts", + Usage: "diff two HAMTs", + ArgsUsage: " ", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "car-file", + Usage: "write a car file with two hamts (use lotus-shed export-car)", + }, + &cli.IntFlag{ + Name: "bitwidth", + Usage: "bitwidth of the HAMT", + Value: 5, + }, + }, + Action: func(cctx *cli.Context) error { + bs := blockstore.NewMemorySync() + + f, err := os.Open(cctx.String("car-file")) + if err != nil { + return err + } + defer func(f *os.File) { + _ = f.Close() + }(f) + + cr, err := car.NewCarReader(f) + if err != nil { + return err + } + + for { + blk, err := cr.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + if err := bs.Put(cctx.Context, blk); err != nil { + return err + } + } + + cidA, err := cid.Parse(cctx.Args().Get(0)) + if err != nil { + return err + } + + cidB, err := cid.Parse(cctx.Args().Get(1)) + if err != nil { + return err + } + + cst := cbor.NewCborStore(bs) + + diffs, err := hamt.Diff(cctx.Context, cst, cst, cidA, cidB, hamt.UseTreeBitWidth(cctx.Int("bitwidth"))) + if err != nil { + return err + } + + keyParser := abi.ParseUIntKey + + for _, d := range diffs { + switch d.Type { + case hamt.Add: + color.Green("+ Add %v", must.One(keyParser(d.Key))) + case hamt.Remove: + color.Red("- Remove %v", must.One(keyParser(d.Key))) + case hamt.Modify: + color.Yellow("~ Modify %v", must.One(keyParser(d.Key))) + } + } + + return nil + }, +} + +var diffAMTs = &cli.Command{ + Name: "amts", + Usage: "diff two AMTs", + ArgsUsage: " ", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "car-file", + Usage: "write a car file with two amts (use lotus-shed export-car)", + }, + &cli.UintFlag{ + Name: "bitwidth", + Usage: "bitwidth of the AMT", + Value: 5, + }, + }, + Action: func(cctx *cli.Context) error { + bs := blockstore.NewMemorySync() + + f, err := os.Open(cctx.String("car-file")) + if err != nil { + return err + } + defer func(f *os.File) { + _ = f.Close() + }(f) + + cr, err := car.NewCarReader(f) + if err != nil { + return err + } + + for { + blk, err := cr.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + if err := bs.Put(cctx.Context, blk); err != nil { + return err + } + } + + cidA, err := cid.Parse(cctx.Args().Get(0)) + if err != nil { + return err + } + + cidB, err := cid.Parse(cctx.Args().Get(1)) + if err != nil { + return err + } + + cst := cbor.NewCborStore(bs) + + diffs, err := amt.Diff(cctx.Context, cst, cst, cidA, cidB, amt.UseTreeBitWidth(cctx.Uint("bitwidth"))) + if err != nil { + return err + } + + for _, d := range diffs { + switch d.Type { + case amt.Add: + color.Green("+ Add %v", d.Key) + case amt.Remove: + color.Red("- Remove %v", d.Key) + case amt.Modify: + color.Yellow("~ Modify %v", d.Key) + + var vb, va interface{} + err := cbor.DecodeInto(d.Before.Raw, &vb) + if err != nil { + return err + } + err = cbor.DecodeInto(d.After.Raw, &va) + if err != nil { + return err + } + + vjsonb, err := json.MarshalIndent(vb, " ", " ") + if err != nil { + return err + } + vjsona, err := json.MarshalIndent(va, " ", " ") + if err != nil { + return err + } + + linesb := bytes.Split(vjsonb, []byte("\n")) // - + linesa := bytes.Split(vjsona, []byte("\n")) // + + + maxLen := len(linesb) + if len(linesa) > maxLen { + maxLen = len(linesa) + } + + for i := 0; i < maxLen; i++ { + // Check if 'linesb' has run out of lines but 'linesa' hasn't + if i >= len(linesb) && i < len(linesa) { + color.Green("+ %s\n", linesa[i]) + continue + } + // Check if 'linesa' has run out of lines but 'linesb' hasn't + if i >= len(linesa) && i < len(linesb) { + color.Red("- %s\n", linesb[i]) + continue + } + // Compare lines if both slices have lines at index i + if !bytes.Equal(linesb[i], linesa[i]) { + color.Red("- %s\n", linesb[i]) + color.Green("+ %s\n", linesa[i]) + } else { + // Print the line if it is the same in both slices + fmt.Printf(" %s\n", linesb[i]) + } + } + + } + } + + return nil + }, +} diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go index e3b1333edbd..2b3b18670da 100644 --- a/cmd/lotus-shed/main.go +++ b/cmd/lotus-shed/main.go @@ -91,6 +91,7 @@ func main() { FevmAnalyticsCmd, mismatchesCmd, blockCmd, + adlCmd, } app := &cli.App{ diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 327c5f4daf2..5642e6bbbfd 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -8,8 +8,12 @@ import ( "strconv" "time" + "github.com/ipfs/boxo/blockservice" + "github.com/ipfs/boxo/exchange/offline" + "github.com/ipfs/boxo/ipld/merkledag" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" + "github.com/ipld/go-car" "github.com/urfave/cli/v2" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" @@ -73,6 +77,9 @@ var migrationsCmd = &cli.Command{ &cli.BoolFlag{ Name: "check-invariants", }, + &cli.StringFlag{ + Name: "export-bad-migration", + }, }, Action: func(cctx *cli.Context) error { fmt.Println("REMINDER: If you are running this, you likely want to ALSO run the continuity testing tool!") @@ -216,6 +223,25 @@ var migrationsCmd = &cli.Command{ cachedMigrationTime := time.Since(startTime) if newCid1 != newCid2 { + if cctx.IsSet("export-bad-migration") { + fi, err := os.Create(cctx.String("export-bad-migration")) + if err != nil { + return xerrors.Errorf("opening the output file: %w", err) + } + + defer fi.Close() //nolint:errcheck + + roots := []cid.Cid{newCid1, newCid2} + + dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) + err = car.WriteCarWithWalker(ctx, dag, roots, fi, carWalkFunc) + if err != nil { + return err + } + + fmt.Println("exported bad migration to ", cctx.String("export-bad-migration")) + } + return xerrors.Errorf("got different results with and without the cache: %s, %s", newCid1, newCid2) } diff --git a/go.mod b/go.mod index 9f6d7209b50..b12c2c6f7b5 100644 --- a/go.mod +++ b/go.mod @@ -43,10 +43,11 @@ require ( github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 github.com/filecoin-project/go-fil-markets v1.28.3 + github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 github.com/filecoin-project/go-jsonrpc v0.3.1 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.12.9-0.20240125111137-dbf4b5b126e2 + github.com/filecoin-project/go-state-types v0.12.9-0.20240127183926-66732dc006c0 github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 @@ -205,7 +206,6 @@ require ( github.com/filecoin-project/go-ds-versioning v0.1.2 // indirect github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect - github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect github.com/flynn/noise v1.0.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect diff --git a/go.sum b/go.sum index 13496a5b5ca..36107914f78 100644 --- a/go.sum +++ b/go.sum @@ -339,8 +339,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= 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.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.9-0.20240125111137-dbf4b5b126e2 h1:kl0+C3V2skRVuCDEMLv6A0h52JudeB8S8b8DbhEH36g= -github.com/filecoin-project/go-state-types v0.12.9-0.20240125111137-dbf4b5b126e2/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= +github.com/filecoin-project/go-state-types v0.12.9-0.20240127183926-66732dc006c0 h1:IS2mYSgekO56TzOXPYYNm2u6+1HE7iZbGe22mikEXhQ= +github.com/filecoin-project/go-state-types v0.12.9-0.20240127183926-66732dc006c0/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= From c4d76b80dfb0aa3f2200ff37db06defdedc8dc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 2 Feb 2024 16:26:30 +0100 Subject: [PATCH 03/17] shed: diff hamt address mode --- cmd/lotus-shed/diff.go | 124 +++++++++++++++++++++++++++-------------- 1 file changed, 82 insertions(+), 42 deletions(-) diff --git a/cmd/lotus-shed/diff.go b/cmd/lotus-shed/diff.go index 483c53ac9e9..ad7b42dbfdc 100644 --- a/cmd/lotus-shed/diff.go +++ b/cmd/lotus-shed/diff.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/filecoin-project/go-address" "io" "os" @@ -287,35 +288,51 @@ var diffHAMTs = &cli.Command{ Usage: "bitwidth of the HAMT", Value: 5, }, + &cli.StringFlag{ + Name: "key-type", + Usage: "type of the key", + Value: "uint", + }, }, Action: func(cctx *cli.Context) error { - bs := blockstore.NewMemorySync() + var bs blockstore.Blockstore = blockstore.NewMemorySync() - f, err := os.Open(cctx.String("car-file")) - if err != nil { - return err - } - defer func(f *os.File) { - _ = f.Close() - }(f) - - cr, err := car.NewCarReader(f) - if err != nil { - return err - } - - for { - blk, err := cr.Next() + if cctx.IsSet("car-file") { + f, err := os.Open(cctx.String("car-file")) if err != nil { - if err == io.EOF { - break - } return err } + defer func(f *os.File) { + _ = f.Close() + }(f) - if err := bs.Put(cctx.Context, blk); err != nil { + cr, err := car.NewCarReader(f) + if err != nil { return err } + + for { + blk, err := cr.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + if err := bs.Put(cctx.Context, blk); err != nil { + return err + } + } + } else { + // use running node + api, closer, err := lcli.GetFullNodeAPI(cctx) + if err != nil { + return xerrors.Errorf("connect to full node: %w", err) + } + defer closer() + + bs = blockstore.NewAPIBlockstore(api) } cidA, err := cid.Parse(cctx.Args().Get(0)) @@ -330,13 +347,25 @@ var diffHAMTs = &cli.Command{ cst := cbor.NewCborStore(bs) + var keyParser func(k string) (interface{}, error) + switch cctx.String("key-type") { + case "uint": + keyParser = func(k string) (interface{}, error) { + return abi.ParseUIntKey(k) + } + case "actor": + keyParser = func(k string) (interface{}, error) { + return address.NewFromBytes([]byte(k)) + } + default: + return fmt.Errorf("unknown key type: %s", cctx.String("key-type")) + } + diffs, err := hamt.Diff(cctx.Context, cst, cst, cidA, cidB, hamt.UseTreeBitWidth(cctx.Int("bitwidth"))) if err != nil { return err } - keyParser := abi.ParseUIntKey - for _, d := range diffs { switch d.Type { case hamt.Add: @@ -368,33 +397,44 @@ var diffAMTs = &cli.Command{ }, }, Action: func(cctx *cli.Context) error { - bs := blockstore.NewMemorySync() - - f, err := os.Open(cctx.String("car-file")) - if err != nil { - return err - } - defer func(f *os.File) { - _ = f.Close() - }(f) + var bs blockstore.Blockstore = blockstore.NewMemorySync() - cr, err := car.NewCarReader(f) - if err != nil { - return err - } - - for { - blk, err := cr.Next() + if cctx.IsSet("car-file") { + f, err := os.Open(cctx.String("car-file")) if err != nil { - if err == io.EOF { - break - } return err } + defer func(f *os.File) { + _ = f.Close() + }(f) - if err := bs.Put(cctx.Context, blk); err != nil { + cr, err := car.NewCarReader(f) + if err != nil { return err } + + for { + blk, err := cr.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + if err := bs.Put(cctx.Context, blk); err != nil { + return err + } + } + } else { + // use running node + api, closer, err := lcli.GetFullNodeAPI(cctx) + if err != nil { + return xerrors.Errorf("connect to full node: %w", err) + } + defer closer() + + bs = blockstore.NewAPIBlockstore(api) } cidA, err := cid.Parse(cctx.Args().Get(0)) From 3798e1504d72a491cf58695ee8a2005f0ad28112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:10:01 +0100 Subject: [PATCH 04/17] shed migration debug tooling --- cmd/lotus-shed/migrations.go | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 5642e6bbbfd..654c69152f2 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -3,6 +3,10 @@ package main import ( "context" "fmt" + "github.com/fatih/color" + "github.com/filecoin-project/go-hamt-ipld/v3" + "github.com/filecoin-project/lotus/lib/must" + cbornode "github.com/ipfs/go-ipld-cbor" "os" "path/filepath" "strconv" @@ -223,6 +227,10 @@ var migrationsCmd = &cli.Command{ cachedMigrationTime := time.Since(startTime) if newCid1 != newCid2 { + { + printStateDiff(ctx, newCid2, newCid1, bs) + } + if cctx.IsSet("export-bad-migration") { fi, err := os.Create(cctx.String("export-bad-migration")) if err != nil { @@ -284,6 +292,60 @@ type UpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.Migrat type PreUpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.MigrationCache, cid.Cid, abi.ChainEpoch, *types.TipSet) error type CheckInvariantsFunc = func(context.Context, cid.Cid, cid.Cid, blockstore.Blockstore, abi.ChainEpoch) error +func printStateDiff(ctx context.Context, newCid1, newCid2 cid.Cid, bs blockstore.Blockstore) error { + // migration diff + var sra, srb types.StateRoot + cst := cbornode.NewCborStore(bs) + + if err := cst.Get(ctx, newCid1, &sra); err != nil { + return err + } + if err := cst.Get(ctx, newCid2, &srb); err != nil { + return err + } + + if sra.Version != srb.Version { + fmt.Println("state root versions do not match: ", sra.Version, srb.Version) + } + if sra.Info != srb.Info { + fmt.Println("state root infos do not match: ", sra.Info, srb.Info) + } + if sra.Actors != srb.Actors { + fmt.Println("state root actors do not match: ", sra.Actors, srb.Actors) + if err := printActorDiff(ctx, cst, sra.Actors, srb.Actors); err != nil { + return err + } + } + + return nil +} + +func printActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, a, b cid.Cid) error { + // actor diff, a b are a hamt + + diffs, err := hamt.Diff(ctx, cst, cst, a, b, hamt.UseTreeBitWidth(builtin.DefaultHamtBitwidth)) + if err != nil { + return err + } + + keyParser := func(k string) (interface{}, error) { + return address.NewFromBytes([]byte(k)) + } + + for _, d := range diffs { + switch d.Type { + case hamt.Add: + color.Green("+ Add %v", must.One(keyParser(d.Key))) + case hamt.Remove: + color.Red("- Remove %v", must.One(keyParser(d.Key))) + case hamt.Modify: + color.Yellow("~ Modify %v", must.One(keyParser(d.Key))) + } + } + + return nil +} + func checkNv22Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { actorStore := store.ActorStore(ctx, bs) From c8a710bcb1fc895bbdb290bbaa146a35ecc19bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:24:54 +0100 Subject: [PATCH 05/17] shed migration: market diff on error --- cmd/lotus-shed/migrations.go | 156 +++++++++++++++++++++++++++++++++-- 1 file changed, 151 insertions(+), 5 deletions(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 654c69152f2..9204f376d95 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -1,10 +1,12 @@ package main import ( + "bytes" "context" "fmt" "github.com/fatih/color" "github.com/filecoin-project/go-hamt-ipld/v3" + market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" "github.com/filecoin-project/lotus/lib/must" cbornode "github.com/ipfs/go-ipld-cbor" "os" @@ -228,7 +230,9 @@ var migrationsCmd = &cli.Command{ if newCid1 != newCid2 { { - printStateDiff(ctx, newCid2, newCid1, bs) + if err := printStateDiff(ctx, nv, newCid2, newCid1, bs); err != nil { + fmt.Println("failed to print state diff: ", err) + } } if cctx.IsSet("export-bad-migration") { @@ -292,7 +296,7 @@ type UpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.Migrat type PreUpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.MigrationCache, cid.Cid, abi.ChainEpoch, *types.TipSet) error type CheckInvariantsFunc = func(context.Context, cid.Cid, cid.Cid, blockstore.Blockstore, abi.ChainEpoch) error -func printStateDiff(ctx context.Context, newCid1, newCid2 cid.Cid, bs blockstore.Blockstore) error { +func printStateDiff(ctx context.Context, nv network.Version, newCid1, newCid2 cid.Cid, bs blockstore.Blockstore) error { // migration diff var sra, srb types.StateRoot cst := cbornode.NewCborStore(bs) @@ -312,7 +316,7 @@ func printStateDiff(ctx context.Context, newCid1, newCid2 cid.Cid, bs blockstore } if sra.Actors != srb.Actors { fmt.Println("state root actors do not match: ", sra.Actors, srb.Actors) - if err := printActorDiff(ctx, cst, sra.Actors, srb.Actors); err != nil { + if err := printActorsDiff(ctx, cst, nv, sra.Actors, srb.Actors); err != nil { return err } } @@ -320,7 +324,7 @@ func printStateDiff(ctx context.Context, newCid1, newCid2 cid.Cid, bs blockstore return nil } -func printActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, a, b cid.Cid) error { +func printActorsDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv network.Version, a, b cid.Cid) error { // actor diff, a b are a hamt diffs, err := hamt.Diff(ctx, cst, cst, a, b, hamt.UseTreeBitWidth(builtin.DefaultHamtBitwidth)) @@ -339,8 +343,150 @@ func printActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, a, b cid. case hamt.Remove: color.Red("- Remove %v", must.One(keyParser(d.Key))) case hamt.Modify: - color.Yellow("~ Modify %v", must.One(keyParser(d.Key))) + addr := must.One(keyParser(d.Key)).(address.Address) + color.Yellow("~ Modify %v", addr) + var aa, bb types.ActorV5 + + if err := aa.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { + return err + } + if err := bb.UnmarshalCBOR(bytes.NewReader(d.After.Raw)); err != nil { + return err + } + + if err := printActorDiff(ctx, cst, nv, addr, aa, bb); err != nil { + return err + } + } + } + + return nil +} + +func printActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv network.Version, addr address.Address, a, b types.ActorV5) error { + if a.Code != b.Code { + fmt.Println(" Code: ", a.Code, b.Code) + } + if a.Head != b.Head { + fmt.Println(" Head: ", a.Head, b.Head) + } + if a.Nonce != b.Nonce { + fmt.Println(" Nonce: ", a.Nonce, b.Nonce) + } + if a.Balance != b.Balance { + fmt.Println(" Balance: ", a.Balance, b.Balance) + } + + switch addr.String() { + case "f05": + if err := printMarketActorDiff(ctx, cst, nv, a.Head, b.Head); err != nil { + return err + } + default: + fmt.Println("no logic to diff actor state for ", addr) + } + + return nil +} + +func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv network.Version, a, b cid.Cid) error { + if nv != network.Version22 { + return xerrors.Errorf("market actor diff not implemented for nv%d", nv) + } + + var ma, mb market13.State + if err := cst.Get(ctx, a, &ma); err != nil { + return err + } + if err := cst.Get(ctx, b, &mb); err != nil { + return err + } + + /* + type State struct { + // Proposals are deals that have been proposed and not yet cleaned up after expiry or termination. + Proposals cid.Cid // AMT[DealID]DealProposal + // States contains state for deals that have been activated and not yet cleaned up after expiry or termination. + // After expiration, the state exists until the proposal is cleaned up too. + // Invariant: keys(States) ⊆ keys(Proposals). + States cid.Cid // AMT[DealID]DealState + + // PendingProposals tracks dealProposals that have not yet reached their deal start date. + // We track them here to ensure that miners can't publish the same deal proposal twice + PendingProposals cid.Cid // Set[DealCid] + + // Total amount held in escrow, indexed by actor address (including both locked and unlocked amounts). + EscrowTable cid.Cid // BalanceTable + + // Amount locked, indexed by actor address. + // Note: the amounts in this table do not affect the overall amount in escrow: + // only the _portion_ of the total escrow amount that is locked. + LockedTable cid.Cid // BalanceTable + + NextID abi.DealID + + // Metadata cached for efficient iteration over deals. + DealOpsByEpoch cid.Cid // SetMultimap, HAMT[epoch]Set + LastCron abi.ChainEpoch + + // Total Client Collateral that is locked -> unlocked when deal is terminated + TotalClientLockedCollateral abi.TokenAmount + // Total Provider Collateral that is locked -> unlocked when deal is terminated + TotalProviderLockedCollateral abi.TokenAmount + // Total storage fee that is locked in escrow -> unlocked when payments are made + TotalClientStorageFee abi.TokenAmount + + // Verified registry allocation IDs for deals that are not yet activated. + PendingDealAllocationIds cid.Cid // HAMT[DealID]AllocationID + + /// Maps providers to their sector IDs to deal IDs. + /// This supports finding affected deals when a sector is terminated early + /// or has data replaced. + /// Grouping by provider limits the cost of operations in the expected use case + /// of multiple sectors all belonging to the same provider. + /// HAMT[ActorID]HAMT[SectorNumber]SectorDealIDs + ProviderSectors cid.Cid } + */ + + if ma.Proposals != mb.Proposals { + fmt.Println(" Proposals: ", ma.Proposals, mb.Proposals) + } + if ma.States != mb.States { + fmt.Println(" States: ", ma.States, mb.States) + } + if ma.PendingProposals != mb.PendingProposals { + fmt.Println(" PendingProposals: ", ma.PendingProposals, mb.PendingProposals) + } + if ma.EscrowTable != mb.EscrowTable { + fmt.Println(" EscrowTable: ", ma.EscrowTable, mb.EscrowTable) + } + if ma.LockedTable != mb.LockedTable { + fmt.Println(" LockedTable: ", ma.LockedTable, mb.LockedTable) + } + if ma.NextID != mb.NextID { + fmt.Println(" NextID: ", ma.NextID, mb.NextID) + } + if ma.DealOpsByEpoch != mb.DealOpsByEpoch { + fmt.Println(" DealOpsByEpoch: ", ma.DealOpsByEpoch, mb.DealOpsByEpoch) + } + if ma.LastCron != mb.LastCron { + fmt.Println(" LastCron: ", ma.LastCron, mb.LastCron) + } + if ma.TotalClientLockedCollateral != mb.TotalClientLockedCollateral { + fmt.Println(" TotalClientLockedCollateral: ", ma.TotalClientLockedCollateral, mb.TotalClientLockedCollateral) + } + if ma.TotalProviderLockedCollateral != mb.TotalProviderLockedCollateral { + fmt.Println(" TotalProviderLockedCollateral: ", ma.TotalProviderLockedCollateral, mb.TotalProviderLockedCollateral) + } + if ma.TotalClientStorageFee != mb.TotalClientStorageFee { + fmt.Println(" TotalClientStorageFee: ", ma.TotalClientStorageFee, mb.TotalClientStorageFee) + } + if ma.PendingDealAllocationIds != mb.PendingDealAllocationIds { + fmt.Println(" PendingDealAllocationIds: ", ma.PendingDealAllocationIds, mb.PendingDealAllocationIds) + } + if ma.ProviderSectors != mb.ProviderSectors { + fmt.Println(" ProviderSectors: ", ma.ProviderSectors, mb.ProviderSectors) } return nil From 9dd4649eb19bf5c9df7100cab353f2a182b81c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:25:57 +0100 Subject: [PATCH 06/17] shed: Fix cached migration diff --- cmd/lotus-shed/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 9204f376d95..28f90bce167 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -230,7 +230,7 @@ var migrationsCmd = &cli.Command{ if newCid1 != newCid2 { { - if err := printStateDiff(ctx, nv, newCid2, newCid1, bs); err != nil { + if err := printStateDiff(ctx, network.Version(nv), newCid2, newCid1, bs); err != nil { fmt.Println("failed to print state diff: ", err) } } From defac60e5f87342ec19a949de5b4de514d3f55a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:32:33 +0100 Subject: [PATCH 07/17] shed: Diff deal states on bad migration --- cmd/lotus-shed/migrations.go | 70 +++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 28f90bce167..3b3ea29521b 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -5,10 +5,13 @@ import ( "context" "fmt" "github.com/fatih/color" + "github.com/filecoin-project/go-amt-ipld/v4" "github.com/filecoin-project/go-hamt-ipld/v3" + "github.com/filecoin-project/go-state-types/big" market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" "github.com/filecoin-project/lotus/lib/must" cbornode "github.com/ipfs/go-ipld-cbor" + "github.com/polydawn/refmt/json" "os" "path/filepath" "strconv" @@ -373,7 +376,7 @@ func printActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv networ if a.Nonce != b.Nonce { fmt.Println(" Nonce: ", a.Nonce, b.Nonce) } - if a.Balance != b.Balance { + if big.Cmp(a.Balance, b.Balance) == 0 { fmt.Println(" Balance: ", a.Balance, b.Balance) } @@ -454,6 +457,43 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv } if ma.States != mb.States { fmt.Println(" States: ", ma.States, mb.States) + + // diff the AMTs + amtDiff, err := amt.Diff(ctx, cst, cst, ma.States, mb.States, amt.UseTreeBitWidth(market13.StatesAmtBitwidth)) + if err != nil { + return err + } + + for _, d := range amtDiff { + switch d.Type { + case amt.Add: + color.Green(" state + Add %v", d.Key) + case amt.Remove: + color.Red(" state - Remove %v", d.Key) + case amt.Modify: + color.Yellow(" state ~ Modify %v", d.Key) + + var a, b market13.DealState + if err := a.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { + return err + } + if err := b.UnmarshalCBOR(bytes.NewReader(d.After.Raw)); err != nil { + return err + } + + ja, err := json.Marshal(a) + if err != nil { + return err + } + jb, err := json.Marshal(b) + if err != nil { + return err + } + + fmt.Println(" A: ", string(ja)) + fmt.Println(" B: ", string(jb)) + } + } } if ma.PendingProposals != mb.PendingProposals { fmt.Println(" PendingProposals: ", ma.PendingProposals, mb.PendingProposals) @@ -487,6 +527,34 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv } if ma.ProviderSectors != mb.ProviderSectors { fmt.Println(" ProviderSectors: ", ma.ProviderSectors, mb.ProviderSectors) + + // diff the HAMTs + hamtDiff, err := hamt.Diff(ctx, cst, cst, ma.ProviderSectors, mb.ProviderSectors, hamt.UseTreeBitWidth(market13.ProviderSectorsHamtBitwidth)) + if err != nil { + return err + } + + for _, d := range hamtDiff { + switch d.Type { + case hamt.Add: + color.Green(" ProviderSectors + Add %v", d.Key) + case hamt.Remove: + color.Red(" ProviderSectors - Remove %v", d.Key) + case hamt.Modify: + color.Yellow(" ProviderSectors ~ Modify %v", d.Key) + + var a, b cbg.CborCid + if err := a.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { + return err + } + if err := b.UnmarshalCBOR(bytes.NewReader(d.After.Raw)); err != nil { + return err + } + + fmt.Println(" A: ", b) + fmt.Println(" B: ", a) + } + } } return nil From 76937a9a0eba681038bc8b5fe92e5642d6bfd11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:34:19 +0100 Subject: [PATCH 08/17] shed: Use std json --- cmd/lotus-shed/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 3b3ea29521b..39a3c6a669e 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -3,6 +3,7 @@ package main import ( "bytes" "context" + "encoding/json" "fmt" "github.com/fatih/color" "github.com/filecoin-project/go-amt-ipld/v4" @@ -11,7 +12,6 @@ import ( market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" "github.com/filecoin-project/lotus/lib/must" cbornode "github.com/ipfs/go-ipld-cbor" - "github.com/polydawn/refmt/json" "os" "path/filepath" "strconv" From 6348b91a3a71a5fb754ef695803da45fc1903d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:40:19 +0100 Subject: [PATCH 09/17] shed: Drill in the migration diff more --- cmd/lotus-shed/migrations.go | 56 ++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 39a3c6a669e..9fbe755ff9a 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -535,13 +535,15 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv } for _, d := range hamtDiff { + spIDk := must.One(abi.ParseUIntKey(d.Key)) + switch d.Type { case hamt.Add: - color.Green(" ProviderSectors + Add %v", d.Key) + color.Green(" ProviderSectors + Add %v", spIDk) case hamt.Remove: - color.Red(" ProviderSectors - Remove %v", d.Key) + color.Red(" ProviderSectors - Remove %v", spIDk) case hamt.Modify: - color.Yellow(" ProviderSectors ~ Modify %v", d.Key) + color.Yellow(" ProviderSectors ~ Modify %v", spIDk) var a, b cbg.CborCid if err := a.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { @@ -551,8 +553,52 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv return err } - fmt.Println(" A: ", b) - fmt.Println(" B: ", a) + fmt.Println(" A: ", cid.Cid(b).String()) + fmt.Println(" B: ", cid.Cid(a).String()) + + // diff the inner HAMTs + innerHamtDiff, err := hamt.Diff(ctx, cst, cst, cid.Cid(a), cid.Cid(b), hamt.UseTreeBitWidth(market13.ProviderSectorsHamtBitwidth)) + if err != nil { + return err + } + + for _, d := range innerHamtDiff { + sectorNumber := must.One(abi.ParseUIntKey(d.Key)) + + switch d.Type { + case hamt.Add: + var b market13.SectorDealIDs + + if err := b.UnmarshalCBOR(bytes.NewReader(d.After.Raw)); err != nil { + return err + } + + color.Green(" |-- ProviderSectors + Add %v", sectorNumber) + fmt.Printf(" B: %v\n", b) + case hamt.Remove: + var a market13.SectorDealIDs + + if err := a.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { + return err + } + + color.Red(" |-- ProviderSectors - Remove %v", sectorNumber) + fmt.Printf(" A: %v\n", a) + case hamt.Modify: + var a, b market13.SectorDealIDs + + if err := a.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { + return err + } + if err := b.UnmarshalCBOR(bytes.NewReader(d.After.Raw)); err != nil { + return err + } + + color.Yellow(" |-- ProviderSectors ~ Modify %v", sectorNumber) + fmt.Printf(" A: %v\n", a) + fmt.Printf(" B: %v\n", b) + } + } } } } From 5f07d5bf4497ef76be8cbfc79372c5a794f84a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 12:48:22 +0100 Subject: [PATCH 10/17] shed: Show proposals in migration market diff --- cmd/lotus-shed/migrations.go | 53 ++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 9fbe755ff9a..d0aac9d22a3 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -10,6 +10,7 @@ import ( "github.com/filecoin-project/go-hamt-ipld/v3" "github.com/filecoin-project/go-state-types/big" market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" + adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt" "github.com/filecoin-project/lotus/lib/must" cbornode "github.com/ipfs/go-ipld-cbor" "os" @@ -464,6 +465,15 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv return err } + proposalsArrA, err := adt13.AsArray(adt8.WrapStore(ctx, cst), ma.Proposals, market13.ProposalsAmtBitwidth) + if err != nil { + return err + } + proposalsArrB, err := adt13.AsArray(adt8.WrapStore(ctx, cst), mb.Proposals, market13.ProposalsAmtBitwidth) + if err != nil { + return err + } + for _, d := range amtDiff { switch d.Type { case amt.Add: @@ -492,6 +502,31 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv fmt.Println(" A: ", string(ja)) fmt.Println(" B: ", string(jb)) + + var propA, propB market13.DealProposal + + if _, err := proposalsArrA.Get(d.Key, &propA); err != nil { + return err + } + if _, err := proposalsArrB.Get(d.Key, &propB); err != nil { + return err + } + + pab, err := json.Marshal(propA) + if err != nil { + return err + } + pbb, err := json.Marshal(propB) + if err != nil { + return err + } + if string(pab) != string(pbb) { + fmt.Println(" PropA: ", string(pab)) + fmt.Println(" PropB: ", string(pbb)) + } else { + fmt.Println(" Prop: ", string(pab)) + } + } } } @@ -539,11 +574,11 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv switch d.Type { case hamt.Add: - color.Green(" ProviderSectors + Add %v", spIDk) + color.Green(" ProviderSectors + Add f0%v", spIDk) case hamt.Remove: - color.Red(" ProviderSectors - Remove %v", spIDk) + color.Red(" ProviderSectors - Remove f0%v", spIDk) case hamt.Modify: - color.Yellow(" ProviderSectors ~ Modify %v", spIDk) + color.Yellow(" ProviderSectors ~ Modify f0%v", spIDk) var a, b cbg.CborCid if err := a.UnmarshalCBOR(bytes.NewReader(d.Before.Raw)); err != nil { @@ -553,8 +588,8 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv return err } - fmt.Println(" A: ", cid.Cid(b).String()) - fmt.Println(" B: ", cid.Cid(a).String()) + fmt.Println(" |-A: ", cid.Cid(b).String()) + fmt.Println(" |-B: ", cid.Cid(a).String()) // diff the inner HAMTs innerHamtDiff, err := hamt.Diff(ctx, cst, cst, cid.Cid(a), cid.Cid(b), hamt.UseTreeBitWidth(market13.ProviderSectorsHamtBitwidth)) @@ -574,7 +609,7 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv } color.Green(" |-- ProviderSectors + Add %v", sectorNumber) - fmt.Printf(" B: %v\n", b) + fmt.Printf(" |B: %v\n", b) case hamt.Remove: var a market13.SectorDealIDs @@ -583,7 +618,7 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv } color.Red(" |-- ProviderSectors - Remove %v", sectorNumber) - fmt.Printf(" A: %v\n", a) + fmt.Printf(" |A: %v\n", a) case hamt.Modify: var a, b market13.SectorDealIDs @@ -595,8 +630,8 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv } color.Yellow(" |-- ProviderSectors ~ Modify %v", sectorNumber) - fmt.Printf(" A: %v\n", a) - fmt.Printf(" B: %v\n", b) + fmt.Printf(" |A: %v\n", a) + fmt.Printf(" |B: %v\n", b) } } } From 4891388fe34a095ba4f59c4a17e772512c7488a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 14:20:02 +0100 Subject: [PATCH 11/17] shed: Show added provider sectors diff --- cmd/lotus-shed/migrations.go | 72 +++++++++++++----------------------- 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index d0aac9d22a3..e06ef047a8d 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -406,53 +406,6 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv return err } - /* - type State struct { - // Proposals are deals that have been proposed and not yet cleaned up after expiry or termination. - Proposals cid.Cid // AMT[DealID]DealProposal - // States contains state for deals that have been activated and not yet cleaned up after expiry or termination. - // After expiration, the state exists until the proposal is cleaned up too. - // Invariant: keys(States) ⊆ keys(Proposals). - States cid.Cid // AMT[DealID]DealState - - // PendingProposals tracks dealProposals that have not yet reached their deal start date. - // We track them here to ensure that miners can't publish the same deal proposal twice - PendingProposals cid.Cid // Set[DealCid] - - // Total amount held in escrow, indexed by actor address (including both locked and unlocked amounts). - EscrowTable cid.Cid // BalanceTable - - // Amount locked, indexed by actor address. - // Note: the amounts in this table do not affect the overall amount in escrow: - // only the _portion_ of the total escrow amount that is locked. - LockedTable cid.Cid // BalanceTable - - NextID abi.DealID - - // Metadata cached for efficient iteration over deals. - DealOpsByEpoch cid.Cid // SetMultimap, HAMT[epoch]Set - LastCron abi.ChainEpoch - - // Total Client Collateral that is locked -> unlocked when deal is terminated - TotalClientLockedCollateral abi.TokenAmount - // Total Provider Collateral that is locked -> unlocked when deal is terminated - TotalProviderLockedCollateral abi.TokenAmount - // Total storage fee that is locked in escrow -> unlocked when payments are made - TotalClientStorageFee abi.TokenAmount - - // Verified registry allocation IDs for deals that are not yet activated. - PendingDealAllocationIds cid.Cid // HAMT[DealID]AllocationID - - /// Maps providers to their sector IDs to deal IDs. - /// This supports finding affected deals when a sector is terminated early - /// or has data replaced. - /// Grouping by provider limits the cost of operations in the expected use case - /// of multiple sectors all belonging to the same provider. - /// HAMT[ActorID]HAMT[SectorNumber]SectorDealIDs - ProviderSectors cid.Cid - } - */ - if ma.Proposals != mb.Proposals { fmt.Println(" Proposals: ", ma.Proposals, mb.Proposals) } @@ -575,6 +528,31 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv switch d.Type { case hamt.Add: color.Green(" ProviderSectors + Add f0%v", spIDk) + + var b cbg.CborCid + if err := b.UnmarshalCBOR(bytes.NewReader(d.After.Raw)); err != nil { + return err + } + + fmt.Println(" |-B: ", cid.Cid(b).String()) + + inner, err := adt13.AsMap(adt8.WrapStore(ctx, cst), cid.Cid(b), market13.ProviderSectorsHamtBitwidth) + if err != nil { + return err + } + + var ids market13.SectorDealIDs + err = inner.ForEach(&ids, func(k string) error { + sectorNumber := must.One(abi.ParseUIntKey(d.Key)) + + color.Green(" |-- ProviderSectors + Add %v", sectorNumber) + fmt.Printf(" |+: %v\n", ids) + + return nil + }) + if err != nil { + return err + } case hamt.Remove: color.Red(" ProviderSectors - Remove f0%v", spIDk) case hamt.Modify: From 2451a97ee886a6cbbe3373bfb5605afc93561698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 14:29:29 +0100 Subject: [PATCH 12/17] shed: hamts are hard to use --- cmd/lotus-shed/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index e06ef047a8d..225df109e45 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -543,7 +543,7 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv var ids market13.SectorDealIDs err = inner.ForEach(&ids, func(k string) error { - sectorNumber := must.One(abi.ParseUIntKey(d.Key)) + sectorNumber := must.One(abi.ParseUIntKey(k)) color.Green(" |-- ProviderSectors + Add %v", sectorNumber) fmt.Printf(" |+: %v\n", ids) From fb19028356333c78850f6ee4f6fefbd8c16a7049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 6 Feb 2024 17:23:31 +0100 Subject: [PATCH 13/17] update gst --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b12c2c6f7b5..c97c8ae02f4 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.3.1 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.12.9-0.20240127183926-66732dc006c0 + github.com/filecoin-project/go-state-types v0.12.9-0.20240206142357-191c05a03707 github.com/filecoin-project/go-statemachine v1.0.3 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 36107914f78..704fe5a18c1 100644 --- a/go.sum +++ b/go.sum @@ -339,8 +339,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= 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.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.9-0.20240127183926-66732dc006c0 h1:IS2mYSgekO56TzOXPYYNm2u6+1HE7iZbGe22mikEXhQ= -github.com/filecoin-project/go-state-types v0.12.9-0.20240127183926-66732dc006c0/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= +github.com/filecoin-project/go-state-types v0.12.9-0.20240206142357-191c05a03707 h1:fnclDAe2gVv1ZLJ85tcitdz22yY4seQN+jGaAhYS7Hg= +github.com/filecoin-project/go-state-types v0.12.9-0.20240206142357-191c05a03707/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= From 742735dc098a985ba3b9b68ac33e2ca4afa30b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 8 Feb 2024 16:35:01 +0100 Subject: [PATCH 14/17] update gst --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c97c8ae02f4..76ec9f57229 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.3.1 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.12.9-0.20240206142357-191c05a03707 + github.com/filecoin-project/go-state-types v0.12.9-0.20240208153308-a7dbfc361ea2 github.com/filecoin-project/go-statemachine v1.0.3 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 704fe5a18c1..03cae7521db 100644 --- a/go.sum +++ b/go.sum @@ -339,8 +339,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= 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.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.9-0.20240206142357-191c05a03707 h1:fnclDAe2gVv1ZLJ85tcitdz22yY4seQN+jGaAhYS7Hg= -github.com/filecoin-project/go-state-types v0.12.9-0.20240206142357-191c05a03707/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= +github.com/filecoin-project/go-state-types v0.12.9-0.20240208153308-a7dbfc361ea2 h1:CBl8ePNoXS/2R8Lifj8L6NZmfv+SiMYJOCNa21SmQxc= +github.com/filecoin-project/go-state-types v0.12.9-0.20240208153308-a7dbfc361ea2/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= From 88b3ee6d555e66a970e421a133dda42d23881cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 9 Feb 2024 18:58:30 +0100 Subject: [PATCH 15/17] update gst --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 76ec9f57229..8d8c4d27fde 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.3.1 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.12.9-0.20240208153308-a7dbfc361ea2 + github.com/filecoin-project/go-state-types v0.12.9-0.20240209174911-f339bd4cd03f github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 @@ -146,7 +146,7 @@ require ( github.com/triplewz/poseidon v0.0.0-20220525065023-a7cdb0e183e7 github.com/urfave/cli/v2 v2.25.5 github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba - github.com/whyrusleeping/cbor-gen v0.0.0-20240124134906-0efd71a8493b + github.com/whyrusleeping/cbor-gen v0.0.0-20240207022414-c5f90eb30d41 github.com/whyrusleeping/ledger-filecoin-go v0.9.1-0.20201010031517-c3dcc1bddce4 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 github.com/xeipuuv/gojsonschema v1.2.0 diff --git a/go.sum b/go.sum index 03cae7521db..e360d762f4e 100644 --- a/go.sum +++ b/go.sum @@ -339,8 +339,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= 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.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.9-0.20240208153308-a7dbfc361ea2 h1:CBl8ePNoXS/2R8Lifj8L6NZmfv+SiMYJOCNa21SmQxc= -github.com/filecoin-project/go-state-types v0.12.9-0.20240208153308-a7dbfc361ea2/go.mod h1:m/6/3fAMykSC9eCWCGlwh89SN/+pDVapo+jRDov1JXk= +github.com/filecoin-project/go-state-types v0.12.9-0.20240209174911-f339bd4cd03f h1:vhf9iKJuSBG/Lx2Y0+jxopuBhuncAxxD9J9w8lM8uO4= +github.com/filecoin-project/go-state-types v0.12.9-0.20240209174911-f339bd4cd03f/go.mod h1:myupwhyuJmNaOCyodpQwutw9nWUCJ3ZtftZIzvasgag= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= @@ -1655,8 +1655,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20220323183124-98fa8256a799/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20240124134906-0efd71a8493b h1:+Yd0HVs6f9v2sRlpqcODhojlOd2PiBtWZTPcYmaSm5A= -github.com/whyrusleeping/cbor-gen v0.0.0-20240124134906-0efd71a8493b/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20240207022414-c5f90eb30d41 h1:w7OO90SNCSrjl2mgFna9Cpx+o0wcwnRMhalfaQU/dAE= +github.com/whyrusleeping/cbor-gen v0.0.0-20240207022414-c5f90eb30d41/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= From c0f21a999910e4375d0246e4db94bd829ef5a70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 12 Feb 2024 13:09:03 +0100 Subject: [PATCH 16/17] update GST with fixed invartiant --- cmd/lotus-shed/diff.go | 2 +- cmd/lotus-shed/migrations.go | 16 ++++++++-------- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/lotus-shed/diff.go b/cmd/lotus-shed/diff.go index ad7b42dbfdc..a8eac657514 100644 --- a/cmd/lotus-shed/diff.go +++ b/cmd/lotus-shed/diff.go @@ -5,7 +5,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/filecoin-project/go-address" "io" "os" @@ -16,6 +15,7 @@ import ( "github.com/urfave/cli/v2" "golang.org/x/xerrors" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-amt-ipld/v4" "github.com/filecoin-project/go-hamt-ipld/v3" "github.com/filecoin-project/go-state-types/abi" diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 225df109e45..febe833d75e 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -5,24 +5,18 @@ import ( "context" "encoding/json" "fmt" - "github.com/fatih/color" - "github.com/filecoin-project/go-amt-ipld/v4" - "github.com/filecoin-project/go-hamt-ipld/v3" - "github.com/filecoin-project/go-state-types/big" - market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" - adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt" - "github.com/filecoin-project/lotus/lib/must" - cbornode "github.com/ipfs/go-ipld-cbor" "os" "path/filepath" "strconv" "time" + "github.com/fatih/color" "github.com/ipfs/boxo/blockservice" "github.com/ipfs/boxo/exchange/offline" "github.com/ipfs/boxo/ipld/merkledag" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" + cbornode "github.com/ipfs/go-ipld-cbor" "github.com/ipld/go-car" "github.com/urfave/cli/v2" cbg "github.com/whyrusleeping/cbor-gen" @@ -30,13 +24,18 @@ import ( ffi "github.com/filecoin-project/filecoin-ffi" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-amt-ipld/v4" + "github.com/filecoin-project/go-hamt-ipld/v3" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/builtin" v10 "github.com/filecoin-project/go-state-types/builtin/v10" v11 "github.com/filecoin-project/go-state-types/builtin/v11" v12 "github.com/filecoin-project/go-state-types/builtin/v12" v13 "github.com/filecoin-project/go-state-types/builtin/v13" + market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" + adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt" market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" v9 "github.com/filecoin-project/go-state-types/builtin/v9" @@ -68,6 +67,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/lib/must" "github.com/filecoin-project/lotus/node/repo" "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) diff --git a/go.mod b/go.mod index eb2d23bb03c..81a332a7dd3 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.3.1 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.12.9-0.20240209174911-f339bd4cd03f + github.com/filecoin-project/go-state-types v0.12.9-0.20240212105925-11fc27ca4593 github.com/filecoin-project/go-statemachine v1.0.3 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 98d91715b76..8d4bbd4f7c6 100644 --- a/go.sum +++ b/go.sum @@ -334,8 +334,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= 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.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.9-0.20240209174911-f339bd4cd03f h1:vhf9iKJuSBG/Lx2Y0+jxopuBhuncAxxD9J9w8lM8uO4= -github.com/filecoin-project/go-state-types v0.12.9-0.20240209174911-f339bd4cd03f/go.mod h1:myupwhyuJmNaOCyodpQwutw9nWUCJ3ZtftZIzvasgag= +github.com/filecoin-project/go-state-types v0.12.9-0.20240212105925-11fc27ca4593 h1:hHCjpn3UKcf3ohzJmKXkHIxMDReOTY4FtqeO7UasN50= +github.com/filecoin-project/go-state-types v0.12.9-0.20240212105925-11fc27ca4593/go.mod h1:myupwhyuJmNaOCyodpQwutw9nWUCJ3ZtftZIzvasgag= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= From 0db945345c09448d6cc8b0fe3d8914607c2bb816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 20 Mar 2024 09:39:08 +0100 Subject: [PATCH 17/17] go mod tidy --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f576d507d26..00dea8176d9 100644 --- a/go.mod +++ b/go.mod @@ -43,6 +43,7 @@ require ( github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 github.com/filecoin-project/go-fil-markets v1.28.3 + github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 github.com/filecoin-project/go-jsonrpc v0.3.1 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 @@ -205,7 +206,6 @@ require ( github.com/filecoin-project/go-ds-versioning v0.1.2 // indirect github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect - github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect github.com/flynn/noise v1.0.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/gdamore/encoding v1.0.0 // indirect