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

modify aggregate window-post struct

parent 87714ae0
#!/bin/bash #!/bin/bash
rm -f bench
cd extern/filecoin-ffi cd extern/filecoin-ffi
make clean make clean
FFI_BUILD_FROM_SOURCE=1 FFI_USE_BLST=1 make FFI_BUILD_FROM_SOURCE=1 FFI_USE_BLST=1 make
......
...@@ -67,7 +67,6 @@ type AggregateWindowPostInfos struct{ ...@@ -67,7 +67,6 @@ type AggregateWindowPostInfos struct{
Miner abi.ActorID Miner abi.ActorID
AggregationProof []byte AggregationProof []byte
ChallengedSectors []SectorInfo ChallengedSectors []SectorInfo
Arr []uint
Randomnesses []abi.PoStRandomness
SectorCount []uint SectorCount []uint
Randomnesses []abi.PoStRandomness
} }
\ No newline at end of file
...@@ -230,8 +230,8 @@ func VerifyAggregateWindowPostProofs(aggregateInfo spproof.AggregateWindowPostIn ...@@ -230,8 +230,8 @@ func VerifyAggregateWindowPostProofs(aggregateInfo spproof.AggregateWindowPostIn
randomnesses, randomnesses,
uint(len(randomnesses)), uint(len(randomnesses)),
filPublicReplicaInfos, filPublicReplicaInfos,
aggregateInfo.Arr, aggregateInfo.SectorCount,
uint(len(aggregateInfo.Arr))) uint(len(aggregateInfo.SectorCount)))
resp.Deref() resp.Deref()
defer generated.FilDestroyVerifyAggregateSealResponse(resp) defer generated.FilDestroyVerifyAggregateSealResponse(resp)
......
...@@ -896,11 +896,11 @@ func (sb *Sealer)Sealed( ...@@ -896,11 +896,11 @@ func (sb *Sealer)Sealed(
return cids, proof, nil 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) return ffi.AggregateSealProofs(aggregateInfo, proofs)
} }
func (sb *Sealer)GenProofForC2( func (sb *Sealer)GenerateCommit2Proof(
ctx context.Context, ctx context.Context,
sid storage.SectorRef, sid storage.SectorRef,
seed abi.InteractiveSealRandomness, seed abi.InteractiveSealRandomness,
...@@ -916,7 +916,7 @@ func (sb *Sealer)GenProofForC2( ...@@ -916,7 +916,7 @@ func (sb *Sealer)GenProofForC2(
return sb.SealCommit2(ctx, sid, c1out) return sb.SealCommit2(ctx, sid, c1out)
} }
func (sb *Sealer)GenProofForWindowPoSt( func (sb *Sealer)GenerateWindowPoStProofs(
ctx context.Context, ctx context.Context,
minerID abi.ActorID, minerID abi.ActorID,
sectorInfo []spproof.SectorInfo, sectorInfo []spproof.SectorInfo,
...@@ -1036,15 +1036,16 @@ func (Verifier) VerifyWindowPoSt(info spproof.WindowPoStVerifyInfo) (bool, error ...@@ -1036,15 +1036,16 @@ func (Verifier) VerifyWindowPoSt(info spproof.WindowPoStVerifyInfo) (bool, error
func (Verifier)VerifyAggregateWindowPostProofs(aggregateInfo spproof.AggregateWindowPostInfos, sealedSectors [][]spproof.SectorInfo) (bool, error) { func (Verifier)VerifyAggregateWindowPostProofs(aggregateInfo spproof.AggregateWindowPostInfos, sealedSectors [][]spproof.SectorInfo) (bool, error) {
var sectorInfos []spproof.SectorInfo var sectorInfos []spproof.SectorInfo
arr := make([]uint, len(sealedSectors)) sectorCount := make([]uint, len(sealedSectors))
for i, sectors := range(sealedSectors) { for i, sectors := range(sealedSectors) {
arr[i] = uint(len(sectors)) sectorCount[i] = uint(len(sectors))
for _, sector := range(sectors) { sectorInfos = append(sectorInfos, sectors...)
sectorInfos = append(sectorInfos, sector) // for _, sector := range(sectors) {
} // sectorInfos = append(sectorInfos, sector)
// }
} }
aggregateInfo.ChallengedSectors = sectorInfos aggregateInfo.ChallengedSectors = sectorInfos
aggregateInfo.Arr = arr aggregateInfo.SectorCount = sectorCount
for i, random := range(aggregateInfo.Randomnesses) { for i, random := range(aggregateInfo.Randomnesses) {
aggregateInfo.Randomnesses[i][31] = random[31] & 0x3f aggregateInfo.Randomnesses[i][31] = random[31] & 0x3f
......
...@@ -18,8 +18,8 @@ type SectorSealer interface{ ...@@ -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) 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) 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) 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) GenerateCommit2Proof( 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) 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 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) AggregateSealProofs(aggregateInfo spproof.AggregateSealVerifyProofAndInfos, proofs [][]byte) ([]byte, error)
AggregateWindowPoStProofs(aggregateInfo spproof.AggregateWindowPostInfos, proofs []spproof.PoStProof) ([]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