From 99b9dfe18df830ab19c91e0fb7dca518b8d2992d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 27 Nov 2019 23:34:48 +0100 Subject: [PATCH] filecoin-ffi master --- build/params_shared.go | 14 -------------- extern/filecoin-ffi | 2 +- lib/sectorbuilder/sectorbuilder.go | 12 +++++------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/build/params_shared.go b/build/params_shared.go index 48a30a530..44b66248d 100644 --- a/build/params_shared.go +++ b/build/params_shared.go @@ -19,20 +19,6 @@ var SectorSizes = []uint64{ 1 << 30, } -const nodeSize = 32 - -// sector size -> winSzNodes -// -// https://github.com/filecoin-project/rust-fil-proofs/blob/master/filecoin-proofs/src/constants.rs#L16-L20 -var WindowSizeNodes = map[uint64]uint32{ - 1 << 10: 512 / nodeSize, - - 16 << 20: (4 << 20) / nodeSize, - 256 << 20: (64 << 20) / nodeSize, - - 1 << 30: (128 << 20) / nodeSize, -} - func SupportedSectorSize(ssize uint64) bool { for _, ss := range SectorSizes { if ssize == ss { diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 0e3c18829..0e71b164c 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 0e3c18829e42c95e2c92242e612f77781d5825ea +Subproject commit 0e71b164cf4b2e1c0f53ca25145e3ea57cc53e90 diff --git a/lib/sectorbuilder/sectorbuilder.go b/lib/sectorbuilder/sectorbuilder.go index 4b9b922a0..fae3db3b9 100644 --- a/lib/sectorbuilder/sectorbuilder.go +++ b/lib/sectorbuilder/sectorbuilder.go @@ -222,7 +222,6 @@ func (sb *SectorBuilder) SealPreCommit(sectorID uint64, ticket SealTicket, piece rspco, err := sectorbuilder.SealPreCommit( sb.ssize, - build.WindowSizeNodes[sb.ssize], PoRepProofPartitions, cacheDir, stagedPath, @@ -250,7 +249,6 @@ func (sb *SectorBuilder) SealCommit(sectorID uint64, ticket SealTicket, seed Sea proof, err = sectorbuilder.SealCommit( sb.ssize, - build.WindowSizeNodes[sb.ssize], PoRepProofPartitions, cacheDir, sectorID, @@ -292,7 +290,7 @@ func (sb *SectorBuilder) ComputeElectionPoSt(sectorInfo SortedPublicSectorInfo, } proverID := addressToProverID(sb.Miner) - return sectorbuilder.GeneratePoSt(sb.ssize, build.WindowSizeNodes[sb.ssize], proverID, privsects, cseed, winners) + return sectorbuilder.GeneratePoSt(sb.ssize, proverID, privsects, cseed, winners) } func (sb *SectorBuilder) GenerateEPostCandidates(sectorInfo SortedPublicSectorInfo, challengeSeed [CommLen]byte, faults []uint64) ([]EPostCandidate, error) { @@ -304,7 +302,7 @@ func (sb *SectorBuilder) GenerateEPostCandidates(sectorInfo SortedPublicSectorIn challengeCount := challangeCount(uint64(len(sectorInfo.Values()))) proverID := addressToProverID(sb.Miner) - return sectorbuilder.GenerateCandidates(sb.ssize, build.WindowSizeNodes[sb.ssize], proverID, challengeSeed, challengeCount, privsectors) + return sectorbuilder.GenerateCandidates(sb.ssize, proverID, challengeSeed, challengeCount, privsectors) } func (sb *SectorBuilder) pubSectorToPriv(sectorInfo SortedPublicSectorInfo) (SortedPrivateSectorInfo, error) { @@ -344,7 +342,7 @@ func VerifySeal(sectorSize uint64, commR, commD []byte, proverID address.Address copy(seeda[:], seed) proverIDa := addressToProverID(proverID) - return sectorbuilder.VerifySeal(sectorSize, build.WindowSizeNodes[sectorSize], commRa, commDa, proverIDa, ticketa, seeda, sectorID, proof) + return sectorbuilder.VerifySeal(sectorSize, commRa, commDa, proverIDa, ticketa, seeda, sectorID, proof) } func NewSortedPrivateSectorInfo(sectors []sectorbuilder.PrivateSectorInfo) SortedPrivateSectorInfo { @@ -364,7 +362,7 @@ func VerifyPost(ctx context.Context, sectorSize uint64, sectorInfo SortedPublicS _, span := trace.StartSpan(ctx, "VerifyPoSt") defer span.End() prover := addressToProverID(proverID) - return sectorbuilder.VerifyPoSt(sectorSize, build.WindowSizeNodes[sectorSize], sectorInfo, challengeSeeda, challengeCount, proof, winners, prover) + return sectorbuilder.VerifyPoSt(sectorSize, sectorInfo, challengeSeeda, challengeCount, proof, winners, prover) } func GeneratePieceCommitment(piece io.Reader, pieceSize uint64) (commP [CommLen]byte, err error) { @@ -382,7 +380,7 @@ func GeneratePieceCommitment(piece io.Reader, pieceSize uint64) (commP [CommLen] } func GenerateDataCommitment(ssize uint64, pieces []PublicPieceInfo) ([CommLen]byte, error) { - return sectorbuilder.GenerateDataCommitment(ssize, build.WindowSizeNodes[ssize], pieces) + return sectorbuilder.GenerateDataCommitment(ssize, pieces) } func challangeCount(sectors uint64) uint64 {