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
3361d30e
Unverified
Commit
3361d30e
authored
Jan 07, 2020
by
Jakub Sztandera
Browse files
Fix uint64
Signed-off-by:
Jakub Sztandera
<
kubuxu@protocol.ai
>
parent
2c6f1269
Changes
2
Hide whitespace changes
Inline
Side-by-side
sectorbuilder.go
View file @
3361d30e
...
...
@@ -636,7 +636,7 @@ func (sb *SectorBuilder) GenerateEPostCandidates(sectorInfo SortedPublicSectorIn
return
nil
,
err
}
challengeCount
:=
ElectionPostChallengeCount
(
uint64
(
len
(
sectorInfo
.
Values
())),
len
(
faults
))
challengeCount
:=
ElectionPostChallengeCount
(
uint64
(
len
(
sectorInfo
.
Values
())),
uint64
(
len
(
faults
))
)
proverID
:=
addressToProverID
(
sb
.
Miner
)
return
sectorbuilder
.
GenerateCandidates
(
sb
.
ssize
,
proverID
,
challengeSeed
,
challengeCount
,
privsectors
)
...
...
@@ -680,7 +680,7 @@ func (sb *SectorBuilder) GenerateFallbackPoSt(sectorInfo SortedPublicSectorInfo,
return
nil
,
nil
,
err
}
challengeCount
:=
fallbackPostChallengeCount
(
uint64
(
len
(
sectorInfo
.
Values
())),
len
(
faults
))
challengeCount
:=
fallbackPostChallengeCount
(
uint64
(
len
(
sectorInfo
.
Values
())),
uint64
(
len
(
faults
))
)
proverID
:=
addressToProverID
(
sb
.
Miner
)
candidates
,
err
:=
sectorbuilder
.
GenerateCandidates
(
sb
.
ssize
,
proverID
,
challengeSeed
,
challengeCount
,
privsectors
)
...
...
@@ -696,7 +696,7 @@ func (sb *SectorBuilder) Stop() {
close
(
sb
.
stopping
)
}
func
fallbackPostChallengeCount
(
sectors
uint64
,
faults
int
)
uint64
{
func
fallbackPostChallengeCount
(
sectors
uint64
,
faults
u
int
64
)
uint64
{
challengeCount
:=
ElectionPostChallengeCount
(
sectors
,
faults
)
if
challengeCount
>
MaxFallbackPostChallengeCount
{
return
MaxFallbackPostChallengeCount
...
...
simple.go
View file @
3361d30e
...
...
@@ -40,7 +40,7 @@ func VerifyElectionPost(ctx context.Context, sectorSize uint64, sectorInfo Sorte
return
verifyPost
(
ctx
,
sectorSize
,
sectorInfo
,
challengeCount
,
challengeSeed
,
proof
,
candidates
,
proverID
)
}
func
VerifyFallbackPost
(
ctx
context
.
Context
,
sectorSize
uint64
,
sectorInfo
SortedPublicSectorInfo
,
challengeSeed
[]
byte
,
proof
[]
byte
,
candidates
[]
EPostCandidate
,
proverID
address
.
Address
,
faults
int
)
(
bool
,
error
)
{
func
VerifyFallbackPost
(
ctx
context
.
Context
,
sectorSize
uint64
,
sectorInfo
SortedPublicSectorInfo
,
challengeSeed
[]
byte
,
proof
[]
byte
,
candidates
[]
EPostCandidate
,
proverID
address
.
Address
,
faults
u
int
64
)
(
bool
,
error
)
{
challengeCount
:=
fallbackPostChallengeCount
(
uint64
(
len
(
sectorInfo
.
Values
())),
faults
)
return
verifyPost
(
ctx
,
sectorSize
,
sectorInfo
,
challengeCount
,
challengeSeed
,
proof
,
candidates
,
proverID
)
}
...
...
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