Skip to content

Commit 77fdac6

Browse files
remove window-size-nodes
1 parent 0e3c188 commit 77fdac6

File tree

7 files changed

+24
-56
lines changed

7 files changed

+24
-56
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ commands:
166166
steps:
167167
- run:
168168
name: Obtain filecoin groth parameters
169-
command: ./paramcache --params-for-sector-sizes='1024:16'
169+
command: ./paramcache --params-for-sector-sizes='1024'
170170
no_output_timeout: 60m
171171
build_project:
172172
steps:

proofs.go

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ type PublicPieceInfo struct {
170170
// derived was valid, and false if not.
171171
func VerifySeal(
172172
sectorSize uint64,
173-
windowSizeNodes uint32,
174173
commR [CommitmentBytesLen]byte,
175174
commD [CommitmentBytesLen]byte,
176175
proverID [32]byte,
@@ -201,7 +200,6 @@ func VerifySeal(
201200
// a mutable pointer to a VerifySealResponse C-struct
202201
resPtr := C.verify_seal(
203202
C.uint64_t(sectorSize),
204-
C.uint32_t(windowSizeNodes),
205203
(*[CommitmentBytesLen]C.uint8_t)(commRCBytes),
206204
(*[CommitmentBytesLen]C.uint8_t)(commDCBytes),
207205
(*[32]C.uint8_t)(proverIDCBytes),
@@ -224,7 +222,6 @@ func VerifySeal(
224222
// inputs were derived was valid, and false if not.
225223
func VerifyPoSt(
226224
sectorSize uint64,
227-
windowSizeNodes uint32,
228225
sectorInfo SortedPublicSectorInfo,
229226
randomness [32]byte,
230227
challengeCount uint64,
@@ -270,7 +267,6 @@ func VerifyPoSt(
270267
// a mutable pointer to a VerifyPoStResponse C-struct
271268
resPtr := C.verify_post(
272269
C.uint64_t(sectorSize),
273-
C.uint32_t(windowSizeNodes),
274270
(*[32]C.uint8_t)(randomnessCBytes),
275271
C.uint64_t(challengeCount),
276272
sectorIdsPtr,
@@ -312,11 +308,11 @@ func GeneratePieceCommitment(piecePath string, pieceSize uint64) ([CommitmentByt
312308

313309
// GenerateDataCommitment produces a commitment for the sector containing the
314310
// provided pieces.
315-
func GenerateDataCommitment(sectorSize uint64, windowSizeNodes uint32, pieces []PublicPieceInfo) ([CommitmentBytesLen]byte, error) {
311+
func GenerateDataCommitment(sectorSize uint64, pieces []PublicPieceInfo) ([CommitmentBytesLen]byte, error) {
316312
cPiecesPtr, cPiecesLen := cPublicPieceInfo(pieces)
317313
defer C.free(unsafe.Pointer(cPiecesPtr))
318314

319-
resPtr := C.generate_data_commitment(C.uint64_t(sectorSize), C.uint32_t(windowSizeNodes), (*C.FFIPublicPieceInfo)(cPiecesPtr), cPiecesLen)
315+
resPtr := C.generate_data_commitment(C.uint64_t(sectorSize), (*C.FFIPublicPieceInfo)(cPiecesPtr), cPiecesLen)
320316
defer C.destroy_generate_data_commitment_response(resPtr)
321317

322318
if resPtr.status_code != 0 {
@@ -405,7 +401,6 @@ func WriteWithoutAlignment(
405401
// SealPreCommit
406402
func SealPreCommit(
407403
sectorSize uint64,
408-
windowSizeNodes uint32,
409404
poRepProofPartitions uint8,
410405
cacheDirPath string,
411406
stagedSectorPath string,
@@ -434,7 +429,7 @@ func SealPreCommit(
434429
defer C.free(unsafe.Pointer(cPiecesPtr))
435430

436431
resPtr := C.seal_pre_commit(
437-
cSectorClass(sectorSize, poRepProofPartitions, windowSizeNodes),
432+
cSectorClass(sectorSize, poRepProofPartitions),
438433
cCacheDirPath,
439434
cStagedSectorPath,
440435
cSealedSectorPath,
@@ -456,7 +451,6 @@ func SealPreCommit(
456451
// SealCommit
457452
func SealCommit(
458453
sectorSize uint64,
459-
windowSizeNodes uint32,
460454
poRepProofPartitions uint8,
461455
cacheDirPath string,
462456
sectorID uint64,
@@ -482,7 +476,7 @@ func SealCommit(
482476
defer C.free(unsafe.Pointer(cPiecesPtr))
483477

484478
resPtr := C.seal_commit(
485-
cSectorClass(sectorSize, poRepProofPartitions, windowSizeNodes),
479+
cSectorClass(sectorSize, poRepProofPartitions),
486480
cCacheDirPath,
487481
C.uint64_t(sectorID),
488482
(*[32]C.uint8_t)(proverIDCBytes),
@@ -504,7 +498,6 @@ func SealCommit(
504498
// Unseal
505499
func Unseal(
506500
sectorSize uint64,
507-
windowSizeNodes uint32,
508501
poRepProofPartitions uint8,
509502
cacheDirPath string,
510503
sealedSectorPath string,
@@ -533,7 +526,7 @@ func Unseal(
533526
defer C.free(commDCBytes)
534527

535528
resPtr := C.unseal(
536-
cSectorClass(sectorSize, poRepProofPartitions, windowSizeNodes),
529+
cSectorClass(sectorSize, poRepProofPartitions),
537530
cCacheDirPath,
538531
cSealedSectorPath,
539532
cUnsealOutputPath,
@@ -569,7 +562,6 @@ func FinalizeTicket(partialTicket [32]byte) ([32]byte, error) {
569562
// GenerateCandidates
570563
func GenerateCandidates(
571564
sectorSize uint64,
572-
windowSizeNodes uint32,
573565
proverID [32]byte,
574566
randomness [32]byte,
575567
challengeCount uint64,
@@ -586,7 +578,6 @@ func GenerateCandidates(
586578

587579
resPtr := C.generate_candidates(
588580
C.uint64_t(sectorSize),
589-
C.uint32_t(windowSizeNodes),
590581
(*[32]C.uint8_t)(randomessCBytes),
591582
C.uint64_t(challengeCount),
592583
replicasPtr,
@@ -605,7 +596,6 @@ func GenerateCandidates(
605596
// GeneratePoSt
606597
func GeneratePoSt(
607598
sectorSize uint64,
608-
windowSizeNodes uint32,
609599
proverID [32]byte,
610600
privateSectorInfo SortedPrivateSectorInfo,
611601
randomness [32]byte,
@@ -622,7 +612,6 @@ func GeneratePoSt(
622612

623613
resPtr := C.generate_post(
624614
C.uint64_t(sectorSize),
625-
C.uint32_t(windowSizeNodes),
626615
(*[32]C.uint8_t)(unsafe.Pointer(&(randomness)[0])),
627616
replicasPtr,
628617
replicasSize,
@@ -677,11 +666,10 @@ func cUint64s(src []uint64) (*C.uint64_t, C.size_t) {
677666
return (*C.uint64_t)(cUint64s), srcCSizeT
678667
}
679668

680-
func cSectorClass(sectorSize uint64, poRepProofPartitions uint8, windowSizeNodes uint32) C.FFISectorClass {
669+
func cSectorClass(sectorSize uint64, poRepProofPartitions uint8) C.FFISectorClass {
681670
return C.FFISectorClass{
682671
sector_size: C.uint64_t(sectorSize),
683672
porep_proof_partitions: C.uint8_t(poRepProofPartitions),
684-
window_size_nodes: C.uint32_t(windowSizeNodes),
685673
}
686674
}
687675

proofs_test.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func TestImportSector(t *testing.T) {
2121
proverID := [32]byte{6, 7, 8}
2222
randomness := [32]byte{9, 9, 9}
2323
sectorSize := uint64(1024)
24-
windowSizeNodes := uint32(16)
2524
sectorID := uint64(42)
2625

2726
ticket := SealTicket{
@@ -107,7 +106,7 @@ func TestImportSector(t *testing.T) {
107106
CommP: commPB,
108107
}}
109108

110-
commD, err := GenerateDataCommitment(sectorSize, windowSizeNodes, publicPieces)
109+
commD, err := GenerateDataCommitment(sectorSize, publicPieces)
111110
require.NoError(t, err)
112111

113112
privatePieces := make([]PieceMetadata, len(publicPieces))
@@ -120,22 +119,22 @@ func TestImportSector(t *testing.T) {
120119
}
121120

122121
// pre-commit the sector
123-
output, err := SealPreCommit(sectorSize, windowSizeNodes, poRepProofPartitions, sectorCacheDirPath, stagedSectorFile.Name(), sealedSectorFile.Name(), sectorID, proverID, ticket.TicketBytes, publicPieces)
122+
output, err := SealPreCommit(sectorSize, poRepProofPartitions, sectorCacheDirPath, stagedSectorFile.Name(), sealedSectorFile.Name(), sectorID, proverID, ticket.TicketBytes, publicPieces)
124123
require.NoError(t, err)
125124

126125
require.Equal(t, output.CommD, commD, "prover and verifier should agree on data commitment")
127126

128127
// commit the sector
129-
proof, err := SealCommit(sectorSize, windowSizeNodes, poRepProofPartitions, sectorCacheDirPath, sectorID, proverID, ticket.TicketBytes, seed.TicketBytes, publicPieces, output)
128+
proof, err := SealCommit(sectorSize, poRepProofPartitions, sectorCacheDirPath, sectorID, proverID, ticket.TicketBytes, seed.TicketBytes, publicPieces, output)
130129
require.NoError(t, err)
131130

132131
// verify the 'ole proofy
133-
isValid, err := VerifySeal(sectorSize, windowSizeNodes, output.CommR, output.CommD, proverID, ticket.TicketBytes, seed.TicketBytes, sectorID, proof)
132+
isValid, err := VerifySeal(sectorSize, output.CommR, output.CommD, proverID, ticket.TicketBytes, seed.TicketBytes, sectorID, proof)
134133
require.NoError(t, err)
135134
require.True(t, isValid, "proof wasn't valid")
136135

137136
// unseal and verify that things went as we planned
138-
require.NoError(t, Unseal(sectorSize, windowSizeNodes, poRepProofPartitions, sectorCacheDirPath, sealedSectorFile.Name(), unsealOutputFile.Name(), sectorID, proverID, ticket.TicketBytes, output.CommD))
137+
require.NoError(t, Unseal(sectorSize, poRepProofPartitions, sectorCacheDirPath, sealedSectorFile.Name(), unsealOutputFile.Name(), sectorID, proverID, ticket.TicketBytes, output.CommD))
139138
contents, err := ioutil.ReadFile(unsealOutputFile.Name())
140139
require.NoError(t, err)
141140

@@ -171,18 +170,18 @@ func TestImportSector(t *testing.T) {
171170
CommR: output.CommR,
172171
})
173172

174-
candidatesA, err := GenerateCandidates(sectorSize, windowSizeNodes, proverID, randomness, challengeCount, privateInfo)
173+
candidatesA, err := GenerateCandidates(sectorSize, proverID, randomness, challengeCount, privateInfo)
175174
require.NoError(t, err)
176175

177176
// finalize the ticket, but don't do anything with the results (simply
178177
// exercise the API)
179178
_, err = FinalizeTicket(candidatesA[0].PartialTicket)
180179
require.NoError(t, err)
181180

182-
proofA, err := GeneratePoSt(sectorSize, windowSizeNodes, proverID, privateInfo, randomness, candidatesA)
181+
proofA, err := GeneratePoSt(sectorSize, proverID, privateInfo, randomness, candidatesA)
183182
require.NoError(t, err)
184183

185-
isValid, err = VerifyPoSt(sectorSize, windowSizeNodes, publicInfo, randomness, challengeCount, proofA, candidatesA, proverID)
184+
isValid, err = VerifyPoSt(sectorSize, publicInfo, randomness, challengeCount, proofA, candidatesA, proverID)
186185
require.NoError(t, err)
187186
require.True(t, isValid, "VerifyPoSt rejected the (standalone) proof as invalid")
188187
}

rust/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ publish = false
1313
crate-type = ["rlib", "staticlib"]
1414

1515
[dependencies]
16-
filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs.git", branch = "master" }
17-
storage-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs.git", branch = "master" }
16+
filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs.git", branch = "simpler-windows" }
17+
storage-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs.git", branch = "simpler-windows" }
1818
bls-signatures = { git = "https://github.com/filecoin-project/bls-signatures.git", branch = "master" }
1919
byteorder = "1.2"
2020
drop_struct_macro_derive = "0.4.0"

0 commit comments

Comments
 (0)