Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-sectorbuilder
Commits
ae93a37a
Unverified
Commit
ae93a37a
authored
Nov 20, 2019
by
Erin Swenson-Healey
Committed by
GitHub
Nov 20, 2019
Browse files
feat(challenges): configurable challenge count (#54)
parent
24aaedac
Changes
3
Hide whitespace changes
Inline
Side-by-side
bindings.go
View file @
ae93a37a
...
...
@@ -232,6 +232,7 @@ func VerifyPoSt(
sectorSize
uint64
,
sectorInfo
SortedSectorInfo
,
challengeSeed
[
32
]
byte
,
challengeCount
uint64
,
proof
[]
byte
,
winners
[]
Candidate
,
proverID
[
32
]
byte
,
...
...
@@ -277,6 +278,7 @@ func VerifyPoSt(
resPtr
:=
C
.
sector_builder_ffi_reexported_verify_post
(
C
.
uint64_t
(
sectorSize
),
(
*
[
CommitmentBytesLen
]
C
.
uint8_t
)(
challengeSeedCBytes
),
C
.
uint64_t
(
challengeCount
),
sectorIdsPtr
,
sectorIdsSize
,
(
*
C
.
uint8_t
)(
flattenedCommRsCBytes
),
...
...
@@ -668,6 +670,7 @@ func GenerateCandidates(
sectorBuilderPtr
unsafe
.
Pointer
,
sectorInfo
SortedSectorInfo
,
challengeSeed
[
CommitmentBytesLen
]
byte
,
challengeCount
uint64
,
faults
[]
uint64
,
)
([]
Candidate
,
error
)
{
defer
elapsed
(
"GenerateCandidates"
)()
...
...
@@ -700,6 +703,7 @@ func GenerateCandidates(
(
*
C
.
uint8_t
)(
cflattened
),
C
.
size_t
(
len
(
flattened
)),
(
*
[
CommitmentBytesLen
]
C
.
uint8_t
)(
challengeSeedPtr
),
C
.
uint64_t
(
challengeCount
),
faultsPtr
,
faultsSize
,
)
...
...
@@ -717,6 +721,7 @@ func GeneratePoSt(
sectorBuilderPtr
unsafe
.
Pointer
,
sectorInfo
SortedSectorInfo
,
challengeSeed
[
CommitmentBytesLen
]
byte
,
challengeCount
uint64
,
winners
[]
Candidate
,
)
([]
byte
,
error
)
{
defer
elapsed
(
"GeneratePoSt"
)()
...
...
@@ -749,6 +754,7 @@ func GeneratePoSt(
(
*
C
.
uint8_t
)(
cflattened
),
C
.
size_t
(
len
(
flattened
)),
(
*
[
CommitmentBytesLen
]
C
.
uint8_t
)(
challengeSeedPtr
),
C
.
uint64_t
(
challengeCount
),
winnersPtr
,
winnersSize
,
)
...
...
bindings_test.go
View file @
ae93a37a
...
...
@@ -178,15 +178,15 @@ func TestSectorBuilderLifecycle(t *testing.T) {
CommR
:
statusA
.
CommR
,
})
candidates
,
err
:=
sb
.
GenerateCandidates
(
ptr
,
sectorInfo
,
[
32
]
byte
{},
[]
uint64
{})
candidates
,
err
:=
sb
.
GenerateCandidates
(
ptr
,
sectorInfo
,
[
32
]
byte
{},
2
,
[]
uint64
{})
require
.
NoError
(
t
,
err
)
// generate a PoSt
proofs
,
err
:=
sb
.
GeneratePoSt
(
ptr
,
sectorInfo
,
[
32
]
byte
{},
candidates
)
proofs
,
err
:=
sb
.
GeneratePoSt
(
ptr
,
sectorInfo
,
[
32
]
byte
{},
2
,
candidates
)
require
.
NoError
(
t
,
err
)
// verify the PoSt
isValid
,
err
=
sb
.
VerifyPoSt
(
1024
,
sectorInfo
,
[
32
]
byte
{},
proofs
,
candidates
,
proverID
)
isValid
,
err
=
sb
.
VerifyPoSt
(
1024
,
sectorInfo
,
[
32
]
byte
{},
2
,
proofs
,
candidates
,
proverID
)
require
.
NoError
(
t
,
err
)
require
.
True
(
t
,
isValid
)
...
...
rust-fil-sector-builder
@
89f194c6
Compare
9a0fe0de
...
89f194c6
Subproject commit
9a0fe0dee0f1e56ab853c331ffa6a3017dbf2acd
Subproject commit
89f194c6ea5e745dd36ed30d67e3685ceb3c65aa
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment