Commit ff46a753 authored by 董子豪's avatar 董子豪

modify aggregate window-post struct

parent 87714ae0
#!/bin/bash
rm -f bench
cd extern/filecoin-ffi
make clean
FFI_BUILD_FROM_SOURCE=1 FFI_USE_BLST=1 make
......
......@@ -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
......@@ -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)
......
......@@ -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)GenProofForC2(
func (sb *Sealer)GenerateCommit2Proof(
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)GenProofForWindowPoSt(
func (sb *Sealer)GenerateWindowPoStProofs(
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
......
......@@ -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)
GenProofForC2( ctx context.Context, sid storage.SectorRef, seed abi.InteractiveSealRandomness, ticket abi.SealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storage.Proof, error)
GenProofForWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []spproof.SectorInfo, randomness abi.PoStRandomness) ([]spproof.PoStProof, []abi.SectorID, error)
GenerateCommit2Proof( ctx context.Context, sid storage.SectorRef, seed abi.InteractiveSealRandomness, ticket abi.SealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storage.Proof, error)
GenerateWindowPoStProofs(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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment