From 56d13534b4f16360288bc76be17de24822dd4e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 17 Jul 2020 16:26:48 +0200 Subject: [PATCH] ProvingSet -> ActiveSectors --- api/api_full.go | 4 ++-- api/apistruct/struct.go | 2 +- cli/state.go | 10 +++++----- cmd/lotus-storage-miner/sectors.go | 16 ++++++++-------- node/impl/full/state.go | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api/api_full.go b/api/api_full.go index e63d1592e..9dbb07dca 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -243,8 +243,8 @@ type FullNode interface { // If the filterOut boolean is set to true, any sectors in the filter are excluded. // If false, only those sectors in the filter are included. StateMinerSectors(context.Context, address.Address, *abi.BitField, bool, types.TipSetKey) ([]*ChainSectorInfo, error) - // StateMinerProvingSet returns info about those sectors that a given miner is actively proving. - StateMinerProvingSet(context.Context, address.Address, types.TipSetKey) ([]*ChainSectorInfo, error) + // StateMinerActiveSectors returns info about sectors that a given miner is actively proving. + StateMinerActiveSectors(context.Context, address.Address, types.TipSetKey) ([]*ChainSectorInfo, error) // StateMinerProvingDeadline calculates the deadline at some epoch for a proving period // and returns the deadline-related calculations. StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*miner.DeadlineInfo, error) diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index 043bb6986..65ec3e1a1 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -581,7 +581,7 @@ func (c *FullNodeStruct) StateMinerSectors(ctx context.Context, addr address.Add return c.Internal.StateMinerSectors(ctx, addr, filter, filterOut, tsk) } -func (c *FullNodeStruct) StateMinerProvingSet(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.ChainSectorInfo, error) { +func (c *FullNodeStruct) StateMinerActiveSectors(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.ChainSectorInfo, error) { return c.Internal.StateMinerProvingSet(ctx, addr, tsk) } diff --git a/cli/state.go b/cli/state.go index 89cf3eff0..1f605f0bf 100644 --- a/cli/state.go +++ b/cli/state.go @@ -49,7 +49,7 @@ var stateCmd = &cli.Command{ Subcommands: []*cli.Command{ statePowerCmd, stateSectorsCmd, - stateProvingSetCmd, + stateActiveSectorsCmd, statePledgeCollateralCmd, stateListActorsCmd, stateListMinersCmd, @@ -241,9 +241,9 @@ var stateSectorsCmd = &cli.Command{ }, } -var stateProvingSetCmd = &cli.Command{ - Name: "proving", - Usage: "Query the proving set of a miner", +var stateActiveSectorsCmd = &cli.Command{ + Name: "active-sectors", + Usage: "Query the active sector set of a miner", ArgsUsage: "[minerAddress]", Action: func(cctx *cli.Context) error { api, closer, err := GetFullNodeAPI(cctx) @@ -268,7 +268,7 @@ var stateProvingSetCmd = &cli.Command{ return err } - sectors, err := api.StateMinerProvingSet(ctx, maddr, ts.Key()) + sectors, err := api.StateMinerActiveSectors(ctx, maddr, ts.Key()) if err != nil { return err } diff --git a/cmd/lotus-storage-miner/sectors.go b/cmd/lotus-storage-miner/sectors.go index 0de9ac31c..24cb7d5f6 100644 --- a/cmd/lotus-storage-miner/sectors.go +++ b/cmd/lotus-storage-miner/sectors.go @@ -138,20 +138,20 @@ var sectorsListCmd = &cli.Command{ return err } - pset, err := fullApi.StateMinerProvingSet(ctx, maddr, types.EmptyTSK) + activeSet, err := fullApi.StateMinerActiveSectors(ctx, maddr, types.EmptyTSK) if err != nil { return err } - provingIDs := make(map[abi.SectorNumber]struct{}, len(pset)) - for _, info := range pset { - provingIDs[info.ID] = struct{}{} + activeIDs := make(map[abi.SectorNumber]struct{}, len(activeSet)) + for _, info := range activeSet { + activeIDs[info.ID] = struct{}{} } sset, err := fullApi.StateMinerSectors(ctx, maddr, nil, true, types.EmptyTSK) if err != nil { return err } - commitedIDs := make(map[abi.SectorNumber]struct{}, len(pset)) + commitedIDs := make(map[abi.SectorNumber]struct{}, len(activeSet)) for _, info := range sset { commitedIDs[info.ID] = struct{}{} } @@ -170,13 +170,13 @@ var sectorsListCmd = &cli.Command{ } _, inSSet := commitedIDs[s] - _, inPSet := provingIDs[s] + _, inASet := activeIDs[s] - fmt.Fprintf(w, "%d: %s\tsSet: %s\tpSet: %s\ttktH: %d\tseedH: %d\tdeals: %v\n", + fmt.Fprintf(w, "%d: %s\tsSet: %s\tactive: %s\ttktH: %d\tseedH: %d\tdeals: %v\n", s, st.State, yesno(inSSet), - yesno(inPSet), + yesno(inASet), st.Ticket.Epoch, st.Seed.Epoch, st.Deals, diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 76c2ca56e..2dbdbf220 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -70,7 +70,7 @@ func (a *StateAPI) StateMinerSectors(ctx context.Context, addr address.Address, return stmgr.GetMinerSectorSet(ctx, a.StateManager, ts, addr, filter, filterOut) } -func (a *StateAPI) StateMinerProvingSet(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*api.ChainSectorInfo, error) { +func (a *StateAPI) StateMinerActiveSectors(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*api.ChainSectorInfo, error) { var out []*api.ChainSectorInfo err := a.StateManager.WithParentStateTsk(tsk,