diff --git a/cmd/lotus-shed/stateroot-stats.go b/cmd/lotus-shed/stateroot-stats.go index c02e0202a..023f782bd 100644 --- a/cmd/lotus-shed/stateroot-stats.go +++ b/cmd/lotus-shed/stateroot-stats.go @@ -182,6 +182,11 @@ var staterootStatCmd = &cli.Command{ return infos[i].Stat.Size > infos[j].Stat.Size }) + var totalActorsSize uint64 + for _, info := range infos { + totalActorsSize += info.Stat.Size + } + outcap := 10 if cctx.Args().Len() > outcap { outcap = cctx.Args().Len() @@ -190,6 +195,15 @@ var staterootStatCmd = &cli.Command{ outcap = len(infos) } + totalStat, err := api.ChainStatObj(ctx, ts.ParentState(), cid.Undef) + if err != nil { + return err + } + + fmt.Println("Total state tree size: ", totalStat.Size) + fmt.Println("Sum of actor state size: ", totalActorsSize) + fmt.Println("State tree structure size: ", totalStat.Size-totalActorsSize) + fmt.Print("Addr\tType\tSize\n") for _, inf := range infos[:outcap] { cmh, err := multihash.Decode(inf.Actor.Code.Hash())