Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
interface-test
Commits
ff46a753
Commit
ff46a753
authored
3 years ago
by
董子豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify aggregate window-post struct
parent
87714ae0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
19 deletions
+20
-19
build.sh
build.sh
+1
-0
proof.go
build/proof/proof.go
+5
-6
proofs.go
extern/filecoin-ffi/proofs.go
+2
-2
seal_api.go
seal/seal_api.go
+10
-9
type.go
seal/type.go
+2
-2
No files found.
build.sh
View file @
ff46a753
#!/bin/bash
rm
-f
bench
cd
extern/filecoin-ffi
make clean
FFI_BUILD_FROM_SOURCE
=
1
FFI_USE_BLST
=
1 make
...
...
This diff is collapsed.
Click to expand it.
build/proof/proof.go
View file @
ff46a753
...
...
@@ -20,8 +20,8 @@ type SealVerifyInfo struct {
Proof
[]
byte
// Safe because we get those from the miner actor
SealedCID
cid
.
Cid
`checked:"true"`
// CommR
UnsealedCID
cid
.
Cid
`checked:"true"`
// CommD
SealedCID
cid
.
Cid
`checked:"true"`
// CommR
UnsealedCID
cid
.
Cid
`checked:"true"`
// CommD
}
type
AggregateSealVerifyInfo
struct
{
...
...
@@ -30,8 +30,8 @@ type AggregateSealVerifyInfo struct {
InteractiveRandomness
abi
.
InteractiveSealRandomness
// Safe because we get those from the miner actor
SealedCID
cid
.
Cid
`checked:"true"`
// CommR
UnsealedCID
cid
.
Cid
`checked:"true"`
// CommD
SealedCID
cid
.
Cid
`checked:"true"`
// CommR
UnsealedCID
cid
.
Cid
`checked:"true"`
// CommD
}
type
AggregateSealVerifyProofAndInfos
struct
{
...
...
@@ -67,7 +67,6 @@ type AggregateWindowPostInfos struct{
Miner
abi
.
ActorID
AggregationProof
[]
byte
ChallengedSectors
[]
SectorInfo
Arr
[]
uint
Randomnesses
[]
abi
.
PoStRandomness
SectorCount
[]
uint
Randomnesses
[]
abi
.
PoStRandomness
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
extern/filecoin-ffi/proofs.go
View file @
ff46a753
...
...
@@ -230,8 +230,8 @@ func VerifyAggregateWindowPostProofs(aggregateInfo spproof.AggregateWindowPostIn
randomnesses
,
uint
(
len
(
randomnesses
)),
filPublicReplicaInfos
,
aggregateInfo
.
Arr
,
uint
(
len
(
aggregateInfo
.
Arr
)))
aggregateInfo
.
SectorCount
,
uint
(
len
(
aggregateInfo
.
SectorCount
)))
resp
.
Deref
()
defer
generated
.
FilDestroyVerifyAggregateSealResponse
(
resp
)
...
...
This diff is collapsed.
Click to expand it.
seal/seal_api.go
View file @
ff46a753
...
...
@@ -896,11 +896,11 @@ func (sb *Sealer)Sealed(
return
cids
,
proof
,
nil
}
func
(
sb
*
Sealer
)
AggregateSealProofs
(
aggregateInfo
spproof
.
AggregateSealVerifyProofAndInfos
,
proofs
[]
[]
byte
)
([]
byte
,
error
){
func
(
sb
*
Sealer
)
AggregateSealProofs
(
aggregateInfo
spproof
.
AggregateSealVerifyProofAndInfos
,
proofs
[]
storage
.
Proof
)
([]
byte
,
error
){
return
ffi
.
AggregateSealProofs
(
aggregateInfo
,
proofs
)
}
func
(
sb
*
Sealer
)
Gen
ProofForC2
(
func
(
sb
*
Sealer
)
Gen
erateCommit2Proof
(
ctx
context
.
Context
,
sid
storage
.
SectorRef
,
seed
abi
.
InteractiveSealRandomness
,
...
...
@@ -916,7 +916,7 @@ func (sb *Sealer)GenProofForC2(
return
sb
.
SealCommit2
(
ctx
,
sid
,
c1out
)
}
func
(
sb
*
Sealer
)
Gen
ProofForWindowPoSt
(
func
(
sb
*
Sealer
)
Gen
erateWindowPoStProofs
(
ctx
context
.
Context
,
minerID
abi
.
ActorID
,
sectorInfo
[]
spproof
.
SectorInfo
,
...
...
@@ -1036,15 +1036,16 @@ func (Verifier) VerifyWindowPoSt(info spproof.WindowPoStVerifyInfo) (bool, error
func
(
Verifier
)
VerifyAggregateWindowPostProofs
(
aggregateInfo
spproof
.
AggregateWindowPostInfos
,
sealedSectors
[][]
spproof
.
SectorInfo
)
(
bool
,
error
)
{
var
sectorInfos
[]
spproof
.
SectorInfo
arr
:=
make
([]
uint
,
len
(
sealedSectors
))
sectorCount
:=
make
([]
uint
,
len
(
sealedSectors
))
for
i
,
sectors
:=
range
(
sealedSectors
)
{
arr
[
i
]
=
uint
(
len
(
sectors
))
for
_
,
sector
:=
range
(
sectors
)
{
sectorInfos
=
append
(
sectorInfos
,
sector
)
}
sectorCount
[
i
]
=
uint
(
len
(
sectors
))
sectorInfos
=
append
(
sectorInfos
,
sectors
...
)
// for _, sector := range(sectors) {
// sectorInfos = append(sectorInfos, sector)
// }
}
aggregateInfo
.
ChallengedSectors
=
sectorInfos
aggregateInfo
.
Arr
=
arr
aggregateInfo
.
SectorCount
=
sectorCount
for
i
,
random
:=
range
(
aggregateInfo
.
Randomnesses
)
{
aggregateInfo
.
Randomnesses
[
i
][
31
]
=
random
[
31
]
&
0x3f
...
...
This diff is collapsed.
Click to expand it.
seal/type.go
View file @
ff46a753
...
...
@@ -18,8 +18,8 @@ type SectorSealer interface{
AddPiece
(
ctx
context
.
Context
,
sector
storage
.
SectorRef
,
existingPieceSizes
[]
abi
.
UnpaddedPieceSize
,
pieceSize
abi
.
UnpaddedPieceSize
,
file
storage
.
Data
,
numbers
...
int32
)
(
abi
.
PieceInfo
,
error
)
CheckPieceAndDataRoot
(
sid
storage
.
SectorRef
,
commd
cid
.
Cid
,
pieces
[]
abi
.
PieceInfo
)
(
bool
,
error
)
Sealed
(
ctx
context
.
Context
,
sid
storage
.
SectorRef
,
seed
abi
.
InteractiveSealRandomness
,
ticket
abi
.
SealRandomness
,
pieces
[]
abi
.
PieceInfo
)
(
storage
.
SectorCids
,
storage
.
Proof
,
error
)
Gen
ProofForC2
(
ctx
context
.
Context
,
sid
storage
.
SectorRef
,
seed
abi
.
InteractiveSealRandomness
,
ticket
abi
.
SealRandomness
,
pieces
[]
abi
.
PieceInfo
,
cids
storage
.
SectorCids
)
(
storage
.
Proof
,
error
)
Gen
ProofForWindowPoSt
(
ctx
context
.
Context
,
minerID
abi
.
ActorID
,
sectorInfo
[]
spproof
.
SectorInfo
,
randomness
abi
.
PoStRandomness
)
([]
spproof
.
PoStProof
,
[]
abi
.
SectorID
,
error
)
Gen
erateCommit2Proof
(
ctx
context
.
Context
,
sid
storage
.
SectorRef
,
seed
abi
.
InteractiveSealRandomness
,
ticket
abi
.
SealRandomness
,
pieces
[]
abi
.
PieceInfo
,
cids
storage
.
SectorCids
)
(
storage
.
Proof
,
error
)
Gen
erateWindowPoStProofs
(
ctx
context
.
Context
,
minerID
abi
.
ActorID
,
sectorInfo
[]
spproof
.
SectorInfo
,
randomness
abi
.
PoStRandomness
)
([]
spproof
.
PoStProof
,
[]
abi
.
SectorID
,
error
)
UnsealedRange
(
ctx
context
.
Context
,
sid
storage
.
SectorRef
,
sectorSize
abi
.
SectorSize
,
ticket
abi
.
SealRandomness
,
commd
cid
.
Cid
,
out
io
.
Writer
,
offset
storiface
.
UnpaddedByteIndex
,
size
abi
.
UnpaddedPieceSize
)
error
AggregateSealProofs
(
aggregateInfo
spproof
.
AggregateSealVerifyProofAndInfos
,
proofs
[][]
byte
)
([]
byte
,
error
)
AggregateWindowPoStProofs
(
aggregateInfo
spproof
.
AggregateWindowPostInfos
,
proofs
[]
spproof
.
PoStProof
)
([]
byte
,
error
)
...
...
This diff is collapsed.
Click to expand it.
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