Testplans: go mod tidy
This commit is contained in:
parent
e3fbe53f76
commit
6d21b72d6c
141
extern/sector-storage/manager_test.go
vendored
141
extern/sector-storage/manager_test.go
vendored
@ -470,147 +470,6 @@ func TestSnarkPackV2(t *testing.T) {
|
||||
require.True(t, ret, "proof should be good")
|
||||
}
|
||||
|
||||
func TestSnarkPackV2(t *testing.T) {
|
||||
logging.SetAllLoggers(logging.LevelWarn)
|
||||
ctx := context.Background()
|
||||
m, lstor, stor, idx, cleanup := newTestMgr(ctx, t, datastore.NewMapDatastore())
|
||||
defer cleanup()
|
||||
|
||||
localTasks := []sealtasks.TaskType{
|
||||
sealtasks.TTAddPiece, sealtasks.TTPreCommit1, sealtasks.TTPreCommit2, sealtasks.TTCommit1, sealtasks.TTCommit2, sealtasks.TTFinalize,
|
||||
sealtasks.TTFetch, sealtasks.TTReplicaUpdate, sealtasks.TTProveReplicaUpdate1, sealtasks.TTProveReplicaUpdate2, sealtasks.TTUnseal,
|
||||
sealtasks.TTRegenSectorKey,
|
||||
}
|
||||
wds := datastore.NewMapDatastore()
|
||||
|
||||
w := NewLocalWorker(WorkerConfig{TaskTypes: localTasks}, stor, lstor, idx, m, statestore.New(wds))
|
||||
err := m.AddWorker(ctx, w)
|
||||
require.NoError(t, err)
|
||||
|
||||
proofType := abi.RegisteredSealProof_StackedDrg2KiBV1
|
||||
ptStr := os.Getenv("LOTUS_TEST_SNAP_DEALS_PROOF_TYPE")
|
||||
switch ptStr {
|
||||
case "2k":
|
||||
case "8M":
|
||||
proofType = abi.RegisteredSealProof_StackedDrg8MiBV1
|
||||
case "512M":
|
||||
proofType = abi.RegisteredSealProof_StackedDrg512MiBV1
|
||||
case "32G":
|
||||
proofType = abi.RegisteredSealProof_StackedDrg32GiBV1
|
||||
case "64G":
|
||||
proofType = abi.RegisteredSealProof_StackedDrg64GiBV1
|
||||
default:
|
||||
log.Warn("Unspecified proof type, make sure to set LOTUS_TEST_SNAP_DEALS_PROOF_TYPE to '2k', '8M', '512M', '32G' or '64G'")
|
||||
log.Warn("Continuing test with 2k sectors")
|
||||
}
|
||||
|
||||
mid := abi.ActorID(1000)
|
||||
|
||||
sid1 := storage.SectorRef{
|
||||
ID: abi.SectorID{Miner: mid, Number: 1},
|
||||
ProofType: proofType,
|
||||
}
|
||||
|
||||
sid2 := storage.SectorRef{
|
||||
ID: abi.SectorID{Miner: mid, Number: 2},
|
||||
ProofType: proofType,
|
||||
}
|
||||
|
||||
ss, err := proofType.SectorSize()
|
||||
require.NoError(t, err)
|
||||
|
||||
unpaddedSectorSize := abi.PaddedPieceSize(ss).Unpadded()
|
||||
|
||||
// Pack sector with no pieces
|
||||
p1, err := m.AddPiece(ctx, sid1, nil, unpaddedSectorSize, NewNullReader(unpaddedSectorSize))
|
||||
require.NoError(t, err)
|
||||
ccPieces1 := []abi.PieceInfo{p1}
|
||||
|
||||
p2, err := m.AddPiece(ctx, sid2, nil, unpaddedSectorSize, NewNullReader(unpaddedSectorSize))
|
||||
require.NoError(t, err)
|
||||
ccPieces2 := []abi.PieceInfo{p2}
|
||||
|
||||
// Precommit and Seal 2 CC sectors
|
||||
fmt.Printf("PC1\n")
|
||||
|
||||
ticket1 := abi.SealRandomness{9, 9, 9, 9, 9, 9, 9, 9}
|
||||
ticket2 := abi.SealRandomness{1, 9, 8, 9, 1, 9, 8, 9}
|
||||
interactiveRandomness1 := abi.InteractiveSealRandomness{1, 9, 2, 1, 2, 5, 3, 0}
|
||||
interactiveRandomness2 := abi.InteractiveSealRandomness{1, 5, 2, 2, 1, 5, 2, 2}
|
||||
|
||||
pc1Out1, err := m.SealPreCommit1(ctx, sid1, ticket1, ccPieces1)
|
||||
require.NoError(t, err)
|
||||
pc1Out2, err := m.SealPreCommit1(ctx, sid2, ticket2, ccPieces2)
|
||||
require.NoError(t, err)
|
||||
|
||||
fmt.Printf("PC2\n")
|
||||
|
||||
pc2Out1, err := m.SealPreCommit2(ctx, sid1, pc1Out1)
|
||||
require.NoError(t, err)
|
||||
pc2Out2, err := m.SealPreCommit2(ctx, sid2, pc1Out2)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Commit the sector
|
||||
|
||||
fmt.Printf("C1\n")
|
||||
|
||||
c1Out1, err := m.SealCommit1(ctx, sid1, ticket1, interactiveRandomness1, ccPieces1, pc2Out1)
|
||||
require.NoError(t, err)
|
||||
c1Out2, err := m.SealCommit1(ctx, sid2, ticket2, interactiveRandomness2, ccPieces2, pc2Out2)
|
||||
require.NoError(t, err)
|
||||
|
||||
fmt.Printf("C2\n")
|
||||
|
||||
c2Out1, err := m.SealCommit2(ctx, sid1, c1Out1)
|
||||
require.NoError(t, err)
|
||||
c2Out2, err := m.SealCommit2(ctx, sid2, c1Out2)
|
||||
require.NoError(t, err)
|
||||
|
||||
fmt.Println("Aggregate")
|
||||
agg, err := ffi.AggregateSealProofs(proof.AggregateSealVerifyProofAndInfos{
|
||||
Miner: mid,
|
||||
SealProof: proofType,
|
||||
AggregateProof: abi.RegisteredAggregationProof_SnarkPackV2,
|
||||
Infos: []proof.AggregateSealVerifyInfo{{
|
||||
Number: sid1.ID.Number,
|
||||
Randomness: ticket1,
|
||||
InteractiveRandomness: interactiveRandomness1,
|
||||
SealedCID: pc2Out1.Sealed,
|
||||
UnsealedCID: pc2Out1.Unsealed,
|
||||
}, {
|
||||
Number: sid2.ID.Number,
|
||||
Randomness: ticket2,
|
||||
InteractiveRandomness: interactiveRandomness2,
|
||||
SealedCID: pc2Out2.Sealed,
|
||||
UnsealedCID: pc2Out2.Unsealed,
|
||||
}},
|
||||
}, [][]byte{c2Out1, c2Out2})
|
||||
require.NoError(t, err)
|
||||
|
||||
fmt.Println("Verifying aggregate")
|
||||
ret, err := ffi.VerifyAggregateSeals(proof.AggregateSealVerifyProofAndInfos{
|
||||
Miner: mid,
|
||||
SealProof: proofType,
|
||||
AggregateProof: abi.RegisteredAggregationProof_SnarkPackV2,
|
||||
Proof: agg,
|
||||
Infos: []proof.AggregateSealVerifyInfo{{
|
||||
Number: sid1.ID.Number,
|
||||
Randomness: ticket1,
|
||||
InteractiveRandomness: interactiveRandomness1,
|
||||
SealedCID: pc2Out1.Sealed,
|
||||
UnsealedCID: pc2Out1.Unsealed,
|
||||
}, {
|
||||
Number: sid2.ID.Number,
|
||||
Randomness: ticket2,
|
||||
InteractiveRandomness: interactiveRandomness2,
|
||||
SealedCID: pc2Out2.Sealed,
|
||||
UnsealedCID: pc2Out2.Unsealed,
|
||||
}},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.True(t, ret, "proof should be good")
|
||||
}
|
||||
|
||||
func TestRedoPC1(t *testing.T) {
|
||||
logging.SetAllLoggers(logging.LevelDebug)
|
||||
|
||||
|
@ -504,13 +504,8 @@ github.com/filecoin-project/specs-actors/v6 v6.0.2/go.mod h1:wnfVvPnYmzPZilNvSqC
|
||||
github.com/filecoin-project/specs-actors/v7 v7.0.0/go.mod h1:TA5FwCna+Yi36POaT7SLKXsgEDvJwc0V/L6ZsO19B9M=
|
||||
github.com/filecoin-project/specs-actors/v7 v7.0.1 h1:w72xCxijK7xs1qzmJiw+WYJaVt2EPHN8oiwpA1Ay3/4=
|
||||
github.com/filecoin-project/specs-actors/v7 v7.0.1/go.mod h1:tPLEYXoXhcpyLh69Ccq91SOuLXsPWjHiY27CzawjUEk=
|
||||
<<<<<<< HEAD
|
||||
github.com/filecoin-project/specs-actors/v8 v8.0.1 h1:4u0tIRJeT5G7F05lwLRIsDnsrN+bJ5Ixj6h49Q7uE2Y=
|
||||
github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
|
||||
=======
|
||||
github.com/filecoin-project/specs-actors/v8 v8.0.0 h1:c6NztoE4J5j7KvIfGmx9XW9o5aszPl6DU0M4xDqAJVU=
|
||||
github.com/filecoin-project/specs-actors/v8 v8.0.0/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
|
||||
>>>>>>> release/v1.16.0
|
||||
github.com/filecoin-project/specs-storage v0.4.1 h1:yvLEaLZj8f+uByhNC4mFOtCUyL2wQku+NGBp6hjTe9M=
|
||||
github.com/filecoin-project/specs-storage v0.4.1/go.mod h1:Z2eK6uMwAOSLjek6+sy0jNV2DSsMEENziMUz0GHRFBw=
|
||||
github.com/filecoin-project/storetheindex v0.3.5 h1:KoS9TvjPm6zIZfUH8atAHJbVHOO7GTP1MdTG+v0eE+Q=
|
||||
|
Loading…
Reference in New Issue
Block a user