diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 51a128d54d1..26f52eae0f3 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -239,6 +239,9 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid st.TotalQualityAdjPower = big.Sub(st.TotalQualityAdjPower, big.NewInt(1)) return nil }) + if err != nil { + return cid.Undef, xerrors.Errorf("mutating state: %w", err) + } c, err := vm.Flush(ctx) if err != nil { diff --git a/cli/chain.go b/cli/chain.go index cbdd957e9fa..0dfcb926a9d 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -221,6 +221,9 @@ var chainStatObjCmd = &cli.Command{ base := cid.Undef if cctx.IsSet("base") { base, err = cid.Decode(cctx.String("base")) + if err != nil { + return err + } } stats, err := api.ChainStatObj(ctx, obj, base) diff --git a/cli/state.go b/cli/state.go index 6b5c9035b9e..910b9557a5e 100644 --- a/cli/state.go +++ b/cli/state.go @@ -359,7 +359,7 @@ var stateReplaySetCmd = &cli.Command{ return fmt.Errorf("message cid was invalid: %s", err) } - api, closer, err := GetFullNodeAPI(cctx) + fapi, closer, err := GetFullNodeAPI(cctx) if err != nil { return err } @@ -381,7 +381,7 @@ var stateReplaySetCmd = &cli.Command{ if len(tscids) > 0 { var headers []*types.BlockHeader for _, c := range tscids { - h, err := api.ChainGetBlock(ctx, c) + h, err := fapi.ChainGetBlock(ctx, c) if err != nil { return err } @@ -391,12 +391,13 @@ var stateReplaySetCmd = &cli.Command{ ts, err = types.NewTipSet(headers) } else { - r, err := api.StateWaitMsg(ctx, mcid) + var r *api.MsgLookup + r, err = fapi.StateWaitMsg(ctx, mcid) if err != nil { return xerrors.Errorf("finding message in chain: %w", err) } - ts, err = api.ChainGetTipSet(ctx, r.TipSet.Parents()) + ts, err = fapi.ChainGetTipSet(ctx, r.TipSet.Parents()) } if err != nil { return err @@ -404,7 +405,7 @@ var stateReplaySetCmd = &cli.Command{ } - res, err := api.StateReplay(ctx, ts.Key(), mcid) + res, err := fapi.StateReplay(ctx, ts.Key(), mcid) if err != nil { return xerrors.Errorf("replay call failed: %w", err) } diff --git a/cli/wallet.go b/cli/wallet.go index f9f749d72d1..ccca4d23d4a 100644 --- a/cli/wallet.go +++ b/cli/wallet.go @@ -113,7 +113,12 @@ var walletBalance = &cli.Command{ return err } - fmt.Printf("%s\n", types.FIL(balance)) + if balance.Equals(types.NewInt(0)) { + fmt.Printf("%s (warning: may display 0 if chain sync in progress)\n", types.FIL(balance)) + } else { + fmt.Printf("%s\n", types.FIL(balance)) + } + return nil }, } diff --git a/cmd/lotus-storage-miner/proving.go b/cmd/lotus-storage-miner/proving.go index 7cfa010b9a3..d419efd7b62 100644 --- a/cmd/lotus-storage-miner/proving.go +++ b/cmd/lotus-storage-miner/proving.go @@ -15,7 +15,8 @@ import ( ) var provingCmd = &cli.Command{ - Name: "proving", + Name: "proving", + Usage: "View proving information", Subcommands: []*cli.Command{ provingInfoCmd, provingDeadlinesCmd, @@ -23,7 +24,8 @@ var provingCmd = &cli.Command{ } var provingInfoCmd = &cli.Command{ - Name: "info", + Name: "info", + Usage: "View current state information", Action: func(cctx *cli.Context) error { nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) if err != nil { @@ -145,7 +147,8 @@ func epochTime(curr, e abi.ChainEpoch) string { } var provingDeadlinesCmd = &cli.Command{ - Name: "deadlines", + Name: "deadlines", + Usage: "View the current proving period deadlines information", Action: func(cctx *cli.Context) error { nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) if err != nil {