Some electionPoSt -> winningPoSt renaming

This commit is contained in:
Łukasz Magiera 2020-04-11 00:20:48 +02:00
parent d3ffe48fcb
commit a2554952d1
9 changed files with 12 additions and 28 deletions

View File

@ -187,24 +187,6 @@ func GetMinerSectorSet(ctx context.Context, sm *StateManager, ts *types.TipSet,
return LoadSectorsFromSet(ctx, sm.ChainStore().Blockstore(), mas.Sectors)
}
func GetSectorsForElectionPost(ctx context.Context, sm *StateManager, ts *types.TipSet, maddr address.Address) ([]abi.SectorInfo, error) {
sectors, err := GetMinerProvingSet(ctx, sm, ts, maddr)
if err != nil {
return nil, xerrors.Errorf("failed to get sector set for miner: %w", err)
}
var uselessOtherArray []abi.SectorInfo
for _, s := range sectors {
uselessOtherArray = append(uselessOtherArray, abi.SectorInfo{
RegisteredProof: s.Info.Info.RegisteredProof,
SectorNumber: s.ID,
SealedCID: s.Info.Info.SealedCID,
})
}
return uselessOtherArray, nil
}
func GetMinerSectorSize(ctx context.Context, sm *StateManager, ts *types.TipSet, maddr address.Address) (abi.SectorSize, error) {
return getMinerSectorSizeRaw(ctx, sm, ts.ParentState(), maddr)
}

View File

@ -77,7 +77,7 @@ func (inv *invoker) Invoke(codeCid cid.Cid, rt runtime.Runtime, method abi.Metho
func (inv *invoker) Register(c cid.Cid, instance Invokee, state interface{}) {
code, err := inv.transform(instance)
if err != nil {
panic(err)
panic(xerrors.Errorf("%s: %w", string(c.Hash()), err))
}
inv.builtInCode[c] = code
inv.builtInState[c] = reflect.TypeOf(state)

View File

@ -109,7 +109,7 @@ var sealBenchCmd = &cli.Command{
},
&cli.StringFlag{
Name: "benchmark-existing-sectorbuilder",
Usage: "pass a directory to run election-post timings on an existing sectorbuilder",
Usage: "pass a directory to run post timings on an existing sectorbuilder",
},
&cli.BoolFlag{
Name: "json-out",
@ -174,7 +174,7 @@ var sealBenchCmd = &cli.Command{
}
sectorSize := abi.SectorSize(sectorSizeInt)
_, spt, err := ffiwrapper.SealProofTypeFromSectorSize(sectorSize)
spt, err := ffiwrapper.SealProofTypeFromSectorSize(sectorSize)
if err != nil {
return err
}
@ -535,7 +535,7 @@ var proveCmd = &cli.Command{
return err
}
_, spt, err := ffiwrapper.SealProofTypeFromSectorSize(abi.SectorSize(c2in.SectorSize))
spt, err := ffiwrapper.SealProofTypeFromSectorSize(abi.SectorSize(c2in.SectorSize))
if err != nil {
return err
}

View File

@ -3,7 +3,6 @@ package main
import (
"context"
"encoding/json"
"github.com/filecoin-project/sector-storage/ffiwrapper"
"io/ioutil"
"net"
"net/http"
@ -17,6 +16,7 @@ import (
"gopkg.in/urfave/cli.v2"
paramfetch "github.com/filecoin-project/go-paramfetch"
"github.com/filecoin-project/sector-storage/ffiwrapper"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/apistruct"

View File

@ -120,7 +120,7 @@ var preSealCmd = &cli.Command{
}
sectorSize := abi.SectorSize(sectorSizeInt)
rp, _, err := ffiwrapper.SealProofTypeFromSectorSize(sectorSize)
rp, err := ffiwrapper.SealProofTypeFromSectorSize(sectorSize)
if err != nil {
return err
}

View File

@ -447,7 +447,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
if err != nil {
return err
}
epp := storage.NewElectionPoStProver(smgr, dtypes.MinerID(mid), winPt)
epp := storage.NewWinningPoStProver(smgr, dtypes.MinerID(mid), winPt)
beacon := beacon.NewMockBeacon(build.BlockDelay * time.Second)

2
go.mod
View File

@ -124,3 +124,5 @@ replace github.com/filecoin-project/sector-storage => /home/magik6k/gohack/githu
replace github.com/filecoin-project/go-fil-markets => /home/magik6k/gohack/github.com/filecoin-project/go-fil-markets
replace github.com/filecoin-project/storage-fsm => /home/magik6k/gohack/github.com/filecoin-project/storage-fsm
replace github.com/filecoin-project/specs-actors => /home/magik6k/gohack/github.com/filecoin-project/specs-actors

View File

@ -298,7 +298,7 @@ func Online() Option {
Override(HandleRetrievalKey, modules.HandleRetrieval),
Override(GetParamsKey, modules.GetParams),
Override(HandleDealsKey, modules.HandleDeals),
Override(new(gen.WinningPoStProver), storage.NewElectionPoStProver),
Override(new(gen.WinningPoStProver), storage.NewWinningPoStProver),
Override(new(*miner.Miner), modules.SetupBlockProducer),
),
)

View File

@ -133,7 +133,7 @@ type StorageWpp struct {
winnRpt abi.RegisteredProof
}
func NewElectionPoStProver(sb storage.Prover, miner dtypes.MinerID, winnRpt abi.RegisteredProof) *StorageWpp {
func NewWinningPoStProver(sb storage.Prover, miner dtypes.MinerID, winnRpt abi.RegisteredProof) *StorageWpp {
return &StorageWpp{sb, abi.ActorID(miner), winnRpt}
}
@ -161,6 +161,6 @@ func (wpp *StorageWpp) ComputeProof(ctx context.Context, ssi []abi.SectorInfo, r
if err != nil {
return nil, err
}
log.Infof("ComputeElectionPost took %s", time.Since(start))
log.Infof("GenerateWinningPoSt took %s", time.Since(start))
return proof, nil
}