diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 05b30afe..5bb4a309 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 05b30afeb00df254e72c0dadab8fa694dd68a4bc +Subproject commit 5bb4a309bce9d446ac618f34a8b9e2883af2002f diff --git a/go.mod b/go.mod index 66ac3052..72ab6955 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/filecoin-project/go-statemachine v0.0.0-20200612181802-4eb3d0c68eba github.com/filecoin-project/go-statestore v0.1.0 github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b - github.com/filecoin-project/sector-storage v0.0.0-20200508203401-a74812ba12f3 - github.com/filecoin-project/specs-actors v0.3.0 + github.com/filecoin-project/sector-storage v0.0.0-20200615154852-728a47ab99d6 + github.com/filecoin-project/specs-actors v0.6.0 github.com/hannahhoward/cbor-gen-for v0.0.0-20191218204337-9ab7b1bcc099 github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e github.com/ipfs/go-block-format v0.0.2 diff --git a/go.sum b/go.sum index cec8add2..7ac57bc4 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018 h1:6xT9KW8zLC5IlbaIF5Q7JNieBoACT7iW0YTxQHR0in0= github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= +github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e h1:lj77EKYUpYXTd8CD/+QMIf8b6OIOTsfEBSXiAzuEHTU= +github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e/go.mod h1:3ZQK6DMPSz/QZ73jlWxBtUhNA8xZx7LzUFSq/OfP8vk= github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= github.com/dgraph-io/badger v1.6.0-rc1 h1:JphPpoBZJ3WHha133BGYlQqltSGIhV+VsEID0++nN9A= github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= @@ -67,10 +69,13 @@ github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be h1:T github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be/go.mod h1:SAOwJoakQ8EPjwNIsiakIQKsoKdkcbx8U3IapgCg9R0= github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e h1:IOoff6yAZSJ5zHCPY2jzGNwQYQU6ygsRVe/cSnJrY+o= github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e/go.mod h1:boRtQhzmxNocrMxOXo1NYn4oUc1NGvR8tEa79wApNXg= -github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550 h1:aockulLU8Qjkdj4FQz53WQpNosAIYk8DxRediRLkE5c= -github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw= +github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200424220931-6263827e49f2 h1:jamfsxfK0Q9yCMHt8MPWx7Aa/O9k2Lve8eSc6FILYGQ= +github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200424220931-6263827e49f2/go.mod h1:boRtQhzmxNocrMxOXo1NYn4oUc1NGvR8tEa79wApNXg= github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060 h1:/3qjGMn6ukXgZJHsIbuwGL7ipla8DOV3uHZDBJkBYfU= github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw= +github.com/filecoin-project/go-bitfield v0.0.1/go.mod h1:Ry9/iUlWSyjPUzlAvdnfy4Gtvrq4kWmWDztCU1yEgJY= +github.com/filecoin-project/go-bitfield v0.0.2-0.20200518150651-562fdb554b6e h1:gkG/7G+iKy4He+IiQNeQn+nndFznb/vCoOR8iRQsm60= +github.com/filecoin-project/go-bitfield v0.0.2-0.20200518150651-562fdb554b6e/go.mod h1:Ry9/iUlWSyjPUzlAvdnfy4Gtvrq4kWmWDztCU1yEgJY= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= @@ -89,16 +94,16 @@ github.com/filecoin-project/go-statestore v0.1.0 h1:t56reH59843TwXHkMcwyuayStBIi github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b h1:fkRZSPrYpk42PV3/lIXiL0LHetxde7vyYYvSsttQtfg= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8= -github.com/filecoin-project/sector-storage v0.0.0-20200508203401-a74812ba12f3 h1:WezmdxkWlnTe9xLzIitUrsvUVmjmWDEEuAe9l8A+Os0= -github.com/filecoin-project/sector-storage v0.0.0-20200508203401-a74812ba12f3/go.mod h1:B+xzopr/oWZJz2hBL5Ekb7Obcum5ntmfbaAUlaaho28= +github.com/filecoin-project/sector-storage v0.0.0-20200615154852-728a47ab99d6 h1:NIcubpeasVs++K5EFelMXeURRb8sWCuXQNOSWnvTc14= +github.com/filecoin-project/sector-storage v0.0.0-20200615154852-728a47ab99d6/go.mod h1:M59QnAeA/oV+Z8oHFLoNpGMv0LZ8Rll+vHVXX7GirPM= github.com/filecoin-project/specs-actors v0.0.0-20200210130641-2d1fbd8672cf h1:fbxBG12yrxilPFV1EG2lYqpUyAlRZWkvtqjk2svSeXY= github.com/filecoin-project/specs-actors v0.0.0-20200210130641-2d1fbd8672cf/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA= -github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504 h1:mwuAaqxKThl70+7FkGdFKVLdwaQZQ8XmscKdhSBBtnc= -github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504/go.mod h1:mdJraXq5vMy0+/FqVQIrnNlpQ/Em6zeu06G/ltQ0/lA= github.com/filecoin-project/specs-actors v0.3.0 h1:QxgAuTrZr5TPqjyprZk0nTYW5o0JWpzbb5v+4UHHvN0= github.com/filecoin-project/specs-actors v0.3.0/go.mod h1:nQYnFbQ7Y0bHZyq6HDEuVlCPR+U3z5Q3wMOQ+2aiV+Y= -github.com/filecoin-project/specs-storage v0.0.0-20200417134612-61b2d91a6102 h1:T3f/zkuvgtgqcXrb0NO3BicuveGOxxUAMPa/Yif2kuE= -github.com/filecoin-project/specs-storage v0.0.0-20200417134612-61b2d91a6102/go.mod h1:xJ1/xl9+8zZeSSSFmDC3Wr6uusCTxyYPI0VeNVSFmPE= +github.com/filecoin-project/specs-actors v0.6.0 h1:IepUsmDGY60QliENVTkBTAkwqGWw9kNbbHOcU/9oiC0= +github.com/filecoin-project/specs-actors v0.6.0/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= +github.com/filecoin-project/specs-storage v0.1.0 h1:PkDgTOT5W5Ao7752onjDl4QSv+sgOVdJbvFjOnD5w94= +github.com/filecoin-project/specs-storage v0.1.0/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-check/check v0.0.0-20180628173108-788fd7840127 h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI= diff --git a/pieceio/pieceio.go b/pieceio/pieceio.go index 53599680..8882bfdd 100644 --- a/pieceio/pieceio.go +++ b/pieceio/pieceio.go @@ -52,7 +52,7 @@ func NewPieceIOWithStore(carIO CarIO, store filestore.FileStore, bs blockstore.B return &pieceIOWithStore{pieceIO{carIO, bs}, store} } -func (pio *pieceIO) GeneratePieceCommitment(rt abi.RegisteredProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) { +func (pio *pieceIO) GeneratePieceCommitment(rt abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) { preparedCar, err := pio.carIO.PrepareCar(context.Background(), pio.bs, payloadCid, selector) if err != nil { return cid.Undef, 0, err @@ -88,7 +88,7 @@ func (pio *pieceIO) GeneratePieceCommitment(rt abi.RegisteredProof, payloadCid c return commitment, paddedSize, nil } -func (pio *pieceIOWithStore) GeneratePieceCommitmentToFile(rt abi.RegisteredProof, payloadCid cid.Cid, selector ipld.Node, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) { +func (pio *pieceIOWithStore) GeneratePieceCommitmentToFile(rt abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) { f, err := pio.store.CreateTemp() if err != nil { return cid.Undef, "", 0, err @@ -117,7 +117,7 @@ func (pio *pieceIOWithStore) GeneratePieceCommitmentToFile(rt abi.RegisteredProo return commitment, f.Path(), paddedSize, nil } -func GeneratePieceCommitment(rt abi.RegisteredProof, rd io.Reader, pieceSize uint64) (cid.Cid, abi.UnpaddedPieceSize, error) { +func GeneratePieceCommitment(rt abi.RegisteredSealProof, rd io.Reader, pieceSize uint64) (cid.Cid, abi.UnpaddedPieceSize, error) { paddedReader, paddedSize := padreader.New(rd, pieceSize) commitment, err := ffiwrapper.GeneratePieceCIDFromFile(rt, paddedReader, paddedSize) if err != nil { diff --git a/pieceio/pieceio_test.go b/pieceio/pieceio_test.go index 4fa3b809..15a1ee7b 100644 --- a/pieceio/pieceio_test.go +++ b/pieceio/pieceio_test.go @@ -68,7 +68,7 @@ func Test_ThereAndBackAgain(t *testing.T) { ssb.ExploreIndex(1, ssb.ExploreRecursive(selector.RecursionLimitNone(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())))) }).Node() - pcid, tmpPath, _, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + pcid, tmpPath, _, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.NoError(t, err) tmpFile, err := store.Open(tmpPath) require.NoError(t, err) @@ -156,7 +156,7 @@ func Test_StoreRestoreMemoryBuffer(t *testing.T) { ssb.ExploreIndex(1, ssb.ExploreRecursive(selector.RecursionLimitNone(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())))) }).Node() - commitment, tmpPath, paddedSize, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + commitment, tmpPath, paddedSize, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.NoError(t, err) tmpFile, err := store.Open(tmpPath) require.NoError(t, err) @@ -175,7 +175,7 @@ func Test_StoreRestoreMemoryBuffer(t *testing.T) { _, err = tmpFile.Read(buf) require.NoError(t, err) buffer := bytes.NewBuffer(buf) - secondCommitment, err := ffiwrapper.GeneratePieceCIDFromFile(abi.RegisteredProof_StackedDRG2KiBPoSt, buffer, paddedSize) + secondCommitment, err := ffiwrapper.GeneratePieceCIDFromFile(abi.RegisteredSealProof_StackedDrg2KiBV1, buffer, paddedSize) require.NoError(t, err) require.Equal(t, commitment, secondCommitment) } @@ -221,13 +221,13 @@ func Test_PieceCommitmentEquivalenceMemoryFile(t *testing.T) { ssb.ExploreIndex(1, ssb.ExploreRecursive(selector.RecursionLimitNone(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())))) }).Node() - fcommitment, tmpPath, fpaddedSize, ferr := pio.GeneratePieceCommitmentToFile(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + fcommitment, tmpPath, fpaddedSize, ferr := pio.GeneratePieceCommitmentToFile(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) defer func() { deferErr := store.Delete(tmpPath) require.NoError(t, deferErr) }() - mcommitment, mpaddedSize, merr := pio.GeneratePieceCommitment(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + mcommitment, mpaddedSize, merr := pio.GeneratePieceCommitment(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.Equal(t, fcommitment, mcommitment) require.Equal(t, fpaddedSize, mpaddedSize) require.Equal(t, ferr, merr) @@ -272,7 +272,7 @@ func Test_Failures(t *testing.T) { fsmock := fsmocks.FileStore{} fsmock.On("CreateTemp").Return(nil, fmt.Errorf("Failed")) pio := pieceio.NewPieceIOWithStore(nil, &fsmock, sourceBs) - _, _, _, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + _, _, _, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.Error(t, err) }) t.Run("write CAR fails", func(t *testing.T) { @@ -284,7 +284,7 @@ func Test_Failures(t *testing.T) { any := mock.Anything ciomock.On("WriteCar", any, any, any, any, any).Return(fmt.Errorf("failed to write car")) pio := pieceio.NewPieceIOWithStore(&ciomock, store, sourceBs) - _, _, _, err = pio.GeneratePieceCommitmentToFile(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + _, _, _, err = pio.GeneratePieceCommitmentToFile(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.Error(t, err) }) t.Run("prepare CAR fails", func(t *testing.T) { @@ -293,7 +293,7 @@ func Test_Failures(t *testing.T) { any := mock.Anything ciomock.On("PrepareCar", any, any, any, any).Return(nil, fmt.Errorf("failed to prepare car")) pio := pieceio.NewPieceIO(&ciomock, sourceBs) - _, _, err := pio.GeneratePieceCommitment(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + _, _, err := pio.GeneratePieceCommitment(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.Error(t, err) }) t.Run("PreparedCard dump operation fails", func(t *testing.T) { @@ -304,7 +304,7 @@ func Test_Failures(t *testing.T) { preparedCarMock.On("Size").Return(uint64(1000)) preparedCarMock.On("Dump", any).Return(fmt.Errorf("failed to write car")) pio := pieceio.NewPieceIO(&ciomock, sourceBs) - _, _, err := pio.GeneratePieceCommitment(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + _, _, err := pio.GeneratePieceCommitment(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.Error(t, err) }) t.Run("seek fails", func(t *testing.T) { @@ -331,7 +331,7 @@ func Test_Failures(t *testing.T) { mockfile.On("Seek", mock.Anything, mock.Anything).Return(int64(0), fmt.Errorf("seek failed")) pio := pieceio.NewPieceIOWithStore(cio, &fsmock, sourceBs) - _, _, _, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredProof_StackedDRG2KiBPoSt, nd3.Cid(), node) + _, _, _, err := pio.GeneratePieceCommitmentToFile(abi.RegisteredSealProof_StackedDrg2KiBV1, nd3.Cid(), node) require.Error(t, err) }) } diff --git a/pieceio/types.go b/pieceio/types.go index d6f5d844..847b15fb 100644 --- a/pieceio/types.go +++ b/pieceio/types.go @@ -22,11 +22,11 @@ type ReadStore interface { // PieceIO converts between payloads and pieces type PieceIO interface { - GeneratePieceCommitment(rt abi.RegisteredProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) + GeneratePieceCommitment(rt abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) ReadPiece(r io.Reader) (cid.Cid, error) } type PieceIOWithStore interface { PieceIO - GeneratePieceCommitmentToFile(rt abi.RegisteredProof, payloadCid cid.Cid, selector ipld.Node, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) + GeneratePieceCommitmentToFile(rt abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) } diff --git a/retrievalmarket/storage_retrieval_integration_test.go b/retrievalmarket/storage_retrieval_integration_test.go index 1e407000..eb95d025 100644 --- a/retrievalmarket/storage_retrieval_integration_test.go +++ b/retrievalmarket/storage_retrieval_integration_test.go @@ -241,7 +241,7 @@ func newStorageHarness(ctx context.Context, t *testing.T) *storageHarness { dt2, providerNode, providerAddr, - abi.RegisteredProof_StackedDRG2KiBPoSt, + abi.RegisteredSealProof_StackedDrg2KiBV1, storedAsk, ) require.NoError(t, err) @@ -285,7 +285,7 @@ func (sh *storageHarness) ProposeStorageDeal(t *testing.T, dataRef *storagemarke sh.Epoch+20100, big.NewInt(1), big.NewInt(0), - abi.RegisteredProof_StackedDRG2KiBPoSt, + abi.RegisteredSealProof_StackedDrg2KiBV1, ) assert.NoError(t, err) return result diff --git a/storagemarket/impl/client.go b/storagemarket/impl/client.go index 3835742f..f543d039 100644 --- a/storagemarket/impl/client.go +++ b/storagemarket/impl/client.go @@ -200,7 +200,7 @@ func (c *Client) ProposeStorageDeal( endEpoch abi.ChainEpoch, price abi.TokenAmount, collateral abi.TokenAmount, - rt abi.RegisteredProof, + rt abi.RegisteredSealProof, ) (*storagemarket.ProposeStorageDealResult, error) { commP, pieceSize, err := clientutils.CommP(ctx, c.pio, rt, data) if err != nil { diff --git a/storagemarket/impl/clientutils/clientutils.go b/storagemarket/impl/clientutils/clientutils.go index 513a44ce..2e09e685 100644 --- a/storagemarket/impl/clientutils/clientutils.go +++ b/storagemarket/impl/clientutils/clientutils.go @@ -17,7 +17,7 @@ import ( ) // CommP calculates the commP for a given dataref -func CommP(ctx context.Context, pieceIO pieceio.PieceIO, rt abi.RegisteredProof, data *storagemarket.DataRef) (cid.Cid, abi.UnpaddedPieceSize, error) { +func CommP(ctx context.Context, pieceIO pieceio.PieceIO, rt abi.RegisteredSealProof, data *storagemarket.DataRef) (cid.Cid, abi.UnpaddedPieceSize, error) { if data.PieceCid != nil { return *data.PieceCid, data.PieceSize, nil } diff --git a/storagemarket/impl/clientutils/clientutils_test.go b/storagemarket/impl/clientutils/clientutils_test.go index 05390160..c5557e96 100644 --- a/storagemarket/impl/clientutils/clientutils_test.go +++ b/storagemarket/impl/clientutils/clientutils_test.go @@ -24,7 +24,7 @@ import ( func TestCommP(t *testing.T) { ctx := context.Background() - proofType := abi.RegisteredProof_StackedDRG2KiBPoSt + proofType := abi.RegisteredSealProof_StackedDrg2KiBV1 t.Run("when PieceCID is present on data ref", func(t *testing.T) { pieceCid := &shared_testutil.GenerateCids(1)[0] pieceSize := abi.UnpaddedPieceSize(rand.Uint64()) @@ -108,7 +108,7 @@ func TestVerifyResponse(t *testing.T) { type testPieceIO struct { t *testing.T - expectedRt abi.RegisteredProof + expectedRt abi.RegisteredSealProof expectedPayloadCid cid.Cid expectedSelector ipld.Node pieceCID cid.Cid @@ -116,7 +116,7 @@ type testPieceIO struct { err error } -func (t *testPieceIO) GeneratePieceCommitment(rt abi.RegisteredProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) { +func (t *testPieceIO) GeneratePieceCommitment(rt abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) { require.Equal(t.t, rt, t.expectedRt) require.Equal(t.t, payloadCid, t.expectedPayloadCid) require.Equal(t.t, selector, t.expectedSelector) diff --git a/storagemarket/impl/provider.go b/storagemarket/impl/provider.go index 05e483f3..91998f6a 100644 --- a/storagemarket/impl/provider.go +++ b/storagemarket/impl/provider.go @@ -43,7 +43,7 @@ type StoredAsk interface { type Provider struct { net network.StorageMarketNetwork - proofType abi.RegisteredProof + proofType abi.RegisteredSealProof spn storagemarket.StorageProviderNode fs filestore.FileStore @@ -105,7 +105,7 @@ func NewProvider(net network.StorageMarketNetwork, dataTransfer datatransfer.Manager, spn storagemarket.StorageProviderNode, minerAddress address.Address, - rt abi.RegisteredProof, + rt abi.RegisteredSealProof, storedAsk StoredAsk, options ...StorageProviderOption, ) (storagemarket.StorageProvider, error) { diff --git a/storagemarket/impl/providerutils/providerutils.go b/storagemarket/impl/providerutils/providerutils.go index 8153fbeb..92a43461 100644 --- a/storagemarket/impl/providerutils/providerutils.go +++ b/storagemarket/impl/providerutils/providerutils.go @@ -68,13 +68,13 @@ func SignMinerData(ctx context.Context, data interface{}, address address.Addres } // CommPGenerator is a commP generating function that writes to a file -type CommPGenerator func(abi.RegisteredProof, cid.Cid, ipld.Node, ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) +type CommPGenerator func(abi.RegisteredSealProof, cid.Cid, ipld.Node, ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) // GeneratePieceCommitmentWithMetadata generates a piece commitment along with block metadata func GeneratePieceCommitmentWithMetadata( fileStore filestore.FileStore, commPGenerator CommPGenerator, - proofType abi.RegisteredProof, + proofType abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, filestore.Path, filestore.Path, error) { metadataFile, err := fileStore.CreateTemp() diff --git a/storagemarket/impl/providerutils/providerutils_test.go b/storagemarket/impl/providerutils/providerutils_test.go index ded46f86..946f7cc8 100644 --- a/storagemarket/impl/providerutils/providerutils_test.go +++ b/storagemarket/impl/providerutils/providerutils_test.go @@ -122,7 +122,7 @@ func TestCommPGenerationWithMetadata(t *testing.T) { payloadCid := shared_testutil.GenerateCids(1)[0] ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any) selector := ssb.ExploreAll(ssb.Matcher()).Node() - proofType := abi.RegisteredProof_StackedDRG2KiBPoSt + proofType := abi.RegisteredSealProof_StackedDrg2KiBV1 pieceCid := shared_testutil.GenerateCids(1)[0] piecePath := filestore.Path("apiece.jpg") pieceSize := abi.UnpaddedPieceSize(rand.Uint64()) @@ -183,7 +183,7 @@ type fakeCommPGenerator struct { err error } -func (fcp *fakeCommPGenerator) GenerateCommPToFile(abi.RegisteredProof, cid.Cid, ipld.Node, ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) { +func (fcp *fakeCommPGenerator) GenerateCommPToFile(abi.RegisteredSealProof, cid.Cid, ipld.Node, ...car.OnNewCarBlockFunc) (cid.Cid, filestore.Path, abi.UnpaddedPieceSize, error) { return fcp.pieceCid, fcp.path, fcp.size, fcp.err } diff --git a/storagemarket/integration_test.go b/storagemarket/integration_test.go index d0266dee..71b39802 100644 --- a/storagemarket/integration_test.go +++ b/storagemarket/integration_test.go @@ -156,7 +156,7 @@ func TestMakeDealOffline(t *testing.T) { err := cario.NewCarIO().WriteCar(ctx, h.TestData.Bs1, h.PayloadCid, shared.AllSelector(), carBuf) require.NoError(t, err) - commP, size, err := pieceio.GeneratePieceCommitment(abi.RegisteredProof_StackedDRG2KiBPoSt, carBuf, uint64(carBuf.Len())) + commP, size, err := pieceio.GeneratePieceCommitment(abi.RegisteredSealProof_StackedDrg2KiBV1, carBuf, uint64(carBuf.Len())) assert.NoError(t, err) dataRef := &storagemarket.DataRef{ @@ -372,7 +372,7 @@ func newHarnessWithTestData(t *testing.T, ctx context.Context, td *shared_testut dt2, providerNode, providerAddr, - abi.RegisteredProof_StackedDRG2KiBPoSt, + abi.RegisteredSealProof_StackedDrg2KiBV1, storedAsk, ) assert.NoError(t, err) @@ -418,7 +418,7 @@ func (h *harness) ProposeStorageDeal(t *testing.T, dataRef *storagemarket.DataRe h.Epoch+20100, big.NewInt(1), big.NewInt(0), - abi.RegisteredProof_StackedDRG2KiBPoSt, + abi.RegisteredSealProof_StackedDrg2KiBV1, ) assert.NoError(t, err) return result diff --git a/storagemarket/types.go b/storagemarket/types.go index 0648c56e..3a9f3b4f 100644 --- a/storagemarket/types.go +++ b/storagemarket/types.go @@ -564,7 +564,7 @@ type StorageClient interface { //FindStorageOffers(criteria AskCriteria, limit uint) []*StorageOffer // ProposeStorageDeal initiates deal negotiation with a Storage Provider - ProposeStorageDeal(ctx context.Context, addr address.Address, info *StorageProviderInfo, data *DataRef, startEpoch abi.ChainEpoch, endEpoch abi.ChainEpoch, price abi.TokenAmount, collateral abi.TokenAmount, rt abi.RegisteredProof) (*ProposeStorageDealResult, error) + ProposeStorageDeal(ctx context.Context, addr address.Address, info *StorageProviderInfo, data *DataRef, startEpoch abi.ChainEpoch, endEpoch abi.ChainEpoch, price abi.TokenAmount, collateral abi.TokenAmount, rt abi.RegisteredSealProof) (*ProposeStorageDealResult, error) // GetPaymentEscrow returns the current funds available for deal payment GetPaymentEscrow(ctx context.Context, addr address.Address) (Balance, error)