Merge remote-tracking branch 'origin/testnet/3' into feat/4stage-seal

This commit is contained in:
Łukasz Magiera
2020-02-29 03:21:01 +01:00
31 changed files with 205 additions and 275 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ func main() {
seed := lapi.SealSeed{
Epoch: 101,
Value: []byte{1, 2, 3, 4, 5},
Value: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 255},
}
log.Info("Generating PoRep for sector (1)")
+2 -2
View File
@@ -555,7 +555,7 @@ create temp table c (like blocks_challenges excluding constraints) on commit dro
}
}
stmt2, err := tx.Prepare(`copy b (cid, parentWeight, parentStateRoot, height, miner, "timestamp", vrfproof, tickets, eprof, prand, ep0partial, ep0sector, ep0challangei) from stdin`)
stmt2, err := tx.Prepare(`copy b (cid, parentWeight, parentStateRoot, height, miner, "timestamp", vrfproof, tickets, prand, ep0partial, ep0sector, ep0challangei) from stdin`)
if err != nil {
return err
}
@@ -575,7 +575,7 @@ create temp table c (like blocks_challenges excluding constraints) on commit dro
bh.Timestamp,
bh.Ticket.VRFProof,
l,
bh.EPostProof.Proof,
//bh.EPostProof.Proof,
bh.EPostProof.PostRand,
bh.EPostProof.Candidates[0].Partial,
bh.EPostProof.Candidates[0].SectorID,
+7 -27
View File
@@ -21,6 +21,7 @@ import (
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/cmd/lotus-seed/seed"
@@ -119,7 +120,7 @@ var preSealCmd = &cli.Command{
}
}
rp, err := registeredProofFromSsize(c.Uint64("sector-size"))
rp, _, err := lapi.ProofTypeFromSectorSize(abi.SectorSize(c.Uint64("sector-size")))
if err != nil {
return err
}
@@ -221,20 +222,15 @@ var aggregateSectorDirsCmd = &cli.Command{
ssize := abi.SectorSize(cctx.Uint64("sector-size"))
rp, err := registeredProofFromSsize(cctx.Uint64("sector-size"))
if err != nil {
return err
}
sp, err := rp.RegisteredSealProof()
ppt, spt, err := lapi.ProofTypeFromSectorSize(abi.SectorSize(cctx.Uint64("sector-size")))
if err != nil {
return err
}
agsb, err := sectorbuilder.New(&sectorbuilder.Config{
Miner: maddr,
SealProofType: sp,
PoStProofType: rp,
SealProofType: spt,
PoStProofType: ppt,
Paths: sectorbuilder.SimplePath(destdir),
WorkerThreads: 2,
}, namespace.Wrap(agmds, datastore.NewKey("/sectorbuilder")))
@@ -295,8 +291,8 @@ var aggregateSectorDirsCmd = &cli.Command{
sb, err := sectorbuilder.New(&sectorbuilder.Config{
Miner: maddr,
SealProofType: sp,
PoStProofType: rp,
SealProofType: spt,
PoStProofType: ppt,
Paths: sectorbuilder.SimplePath(dir),
WorkerThreads: 2,
}, namespace.Wrap(mds, datastore.NewKey("/sectorbuilder")))
@@ -336,19 +332,3 @@ func mergeGenMiners(a, b genesis.Miner) genesis.Miner {
Sectors: append(a.Sectors, b.Sectors...),
}
}
func registeredProofFromSsize(ssize uint64) (abi.RegisteredProof, error) {
// TODO: this should be provided to us by something lower down...
switch ssize {
case 2 << 10:
return abi.RegisteredProof_StackedDRG2KiBPoSt, nil
case 32 << 30:
return abi.RegisteredProof_StackedDRG32GiBPoSt, nil
case 8 << 20:
return abi.RegisteredProof_StackedDRG8MiBPoSt, nil
case 512 << 20:
return abi.RegisteredProof_StackedDRG512MiBPoSt, nil
default:
return 0, fmt.Errorf("unsupported sector size: %d", ssize)
}
}
+4 -3
View File
@@ -101,9 +101,10 @@ func PreSeal(maddr address.Address, pt abi.RegisteredProof, offset abi.SectorNum
log.Warn("PreCommitOutput: ", sid, scid, ucid)
sealedSectors = append(sealedSectors, &genesis.PreSeal{
CommR: scid,
CommD: ucid,
SectorID: sid,
CommR: scid,
CommD: ucid,
SectorID: sid,
ProofType: pt,
})
}