Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate CARv2 blockstore in the retrieval market #560

Merged
merged 18 commits into from Jul 13, 2021

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Jun 28, 2021

WIP

TODO

  • Unit Tests for the lazy store.

@dirkmc dirkmc force-pushed the feat/dagstore-retrieval branch 16 times, most recently from 14562e0 to 2b0175b Compare July 2, 2021 07:16
@aarshkshah1992 aarshkshah1992 changed the title integrate dag store into retrieval market Integrate CARv2 blockstore into retrieval market Jul 4, 2021
@aarshkshah1992 aarshkshah1992 changed the title Integrate CARv2 blockstore into retrieval market Integrate CARv2 blockstore in the retrieval market Jul 4, 2021
@dirkmc dirkmc force-pushed the feat/dagstore-retrieval branch 2 times, most recently from 0edae9f to bbc081d Compare July 5, 2021 12:35
@aarshkshah1992
Copy link
Collaborator

@dirkmc Please can you write some unit tests for the lazyBlockstore and we can merge all the work we've done in the Storage & Retrieval Markets to the feature branch and open seperate PRs for the Sharded DAG Store integration work ?

* dagstore lotus mount impl

* refactor: nicer error messages

* mount api tests

* refactor: integrate dag store (#565)

Co-authored-by: Dirk McCormick <dirkmdev@gmail.com>
storagemarket/impl/provider_environments.go Outdated Show resolved Hide resolved
storagemarket/impl/provider_environments.go Outdated Show resolved Hide resolved
storagemarket/impl/provider.go Outdated Show resolved Hide resolved
@@ -77,7 +77,8 @@ func (deal *ClientDealState) NextInterval() uint64 {
// of a retrieval provider
type ProviderDealState struct {
DealProposal
StoreID multistore.StoreID
StoreID multistore.StoreID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can we get rid of this completely ? We don't need to support inflight storage deals after the upgrade. It'd be great if Markets does NOT depend on go-multistore after the upgrade.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this will enable Lotus to completely get rid of the go-multistore dep and have a green CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migrations depend on this field being here.
We could get rid of it but we'd also have to get rid of those migrations. I'd suggest we do that in a separate PR.


// CarFileStore provides the path at which to store CAR files created during
// storage or retrieval
type CarFileStore interface {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a separate abstraction/impl here ? I think we can simply use the existing Filestore here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing fileStore in filestore/filestore.go is for a different use case - it's used to create a file at a path, and delete it later.
Whereas the carStore is just a way for code that uses the retrieval client to be able to tell the retrieval client where to create CAR files. The actual creation of the CAR files is managed by the go-car package.

storagemarket/impl/providerstates/provider_states.go Outdated Show resolved Hide resolved
storagemarket/impl/providerstates/provider_states.go Outdated Show resolved Hide resolved
storagemarket/impl/providerstates/provider_states.go Outdated Show resolved Hide resolved
storagemarket/impl/client_environments.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@aarshkshah1992 aarshkshah1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great !

retrievalmarket/impl/client.go Show resolved Hide resolved

"github.com/filecoin-project/go-fil-markets/shared_testutil"
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you also write a test to verify that the lazy blockstore loads the underlying blockstore only once ? Can pass a CountingBlockstore wrapper to the lazy blockstore...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retrievalmarket/impl/provider_environments.go Outdated Show resolved Hide resolved
@@ -16,11 +16,12 @@ import (
datatransfer "github.com/filecoin-project/go-data-transfer"
versioning "github.com/filecoin-project/go-ds-versioning/pkg"
versionedfsm "github.com/filecoin-project/go-ds-versioning/pkg/fsm"
"github.com/filecoin-project/go-multistore"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can we get rid of go-multistore completely from go.mod ?

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2021

Codecov Report

Merging #560 (6c5210e) into feat/lotus-dagstore-mount (468dae9) will increase coverage by 0.02%.
The diff coverage is 57.64%.

Impacted file tree graph

@@                      Coverage Diff                      @@
##           feat/lotus-dagstore-mount     #560      +/-   ##
=============================================================
+ Coverage                      65.69%   65.71%   +0.02%     
=============================================================
  Files                             56       65       +9     
  Lines                           3756     4487     +731     
=============================================================
+ Hits                            2467     2948     +481     
- Misses                          1039     1264     +225     
- Partials                         250      275      +25     
Impacted Files Coverage Δ
dagstore/dagstorewrapper.go 0.00% <0.00%> (ø)
dagstore/readonlyblockstore.go 0.00% <0.00%> (ø)
filestore/carfilestore.go 0.00% <0.00%> (ø)
retrievalmarket/dealstatus.go 0.00% <ø> (-75.00%) ⬇️
retrievalmarket/events.go 0.00% <ø> (-75.00%) ⬇️
...market/impl/requestvalidation/requestvalidation.go 88.10% <ø> (+0.45%) ⬆️
retrievalmarket/types.go 58.03% <ø> (+0.89%) ⬆️
storagemarket/impl/client_environments.go 0.00% <0.00%> (ø)
storagemarket/impl/clientstates/client_states.go 89.03% <0.00%> (-1.18%) ⬇️
storagemarket/types.go 85.37% <ø> (-2.51%) ⬇️
... and 83 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05738c3...6c5210e. Read the comment docs.

Copy link
Collaborator

@aarshkshah1992 aarshkshah1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP.

@dirkmc dirkmc marked this pull request as ready for review July 13, 2021 06:57
@dirkmc dirkmc merged commit 2cbcf20 into feat/lotus-dagstore-mount Jul 13, 2021
@dirkmc dirkmc deleted the feat/dagstore-retrieval branch July 13, 2021 06:57
aarshkshah1992 added a commit that referenced this pull request Jul 13, 2021
* dag store lotus mount

* storage client code complete-tests remain

* storage miner first draft

* second draft

* provider state tests are now working

* most unit tests working and more unit tests

* refactor: car store trackers (#559)

* Apply suggestions from code review

Co-authored-by: dirkmc <dirkmdev@gmail.com>

* nits and review

* integration testing changes

* storage test harness changes

* added more TODOs

* fix itests for storage

* get offline deal tests working

* tests work

* more tests

* integration tests

* fix blockstore finalize

* Integrate CARv2 blockstore in the retrieval market (#560)

* refactor: integrate dag store into retrieval market

* fix all tests and the padding issue

* refactor: move mount from shared testutil to dagstore dir

* refactor: add tests for lazy blockstore

* refactor: code cleanup

* feat: update go-car to latest

* Dagstore lotus mount Implementation with tests (#564)

* dagstore lotus mount impl

* refactor: nicer error messages

* mount api tests

* refactor: integrate dag store (#565)

Co-authored-by: Dirk McCormick <dirkmdev@gmail.com>

* some storage market fixes by aarsh

* fix: better error messages in DAG store wrapper

* refactor: simplify mock dag store wrapper

* fix: TestBounceConnectionDealTransferOngoing

* refactor: remove some commented out code

* refactor: closable blockstore interface to use full blockstore

* fix: TestBounceConnectionDealTransferUnsealing

* refactor: add comment explaining lotus mount template

* test: verify that the lazy blockstore is only initialized once

* fix: comment

* fix: always finalize blockstore before reaching complete state (#567)

Co-authored-by: aarshkshah1992 <aarshkshah1992@gmail.com>

Co-authored-by: dirkmc <dirkmdev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants