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 storage market provider from go-fil-markets #3737

Merged
merged 45 commits into from
Feb 6, 2020

Conversation

acruikshank
Copy link
Contributor

@acruikshank acruikshank commented Feb 3, 2020

Motivation

The go-fil-markets project implements a spec compliant version of the storage market. We would like to use this code in go-filecoin to bring our storage market operations up to spec.

Proposed changes

This PR brings in go-fil-markets and wires it into go-filecoin by implementing the storage provider API and storage client API. Wiring up the retrieval market or the retrieval client is out of scope for this PR, and some retrieval code has been commented out to make this PR work. Since we lack the actor support to make the storage market work, a fully operational storage market is also out of scope. Consequently, we skipped and commented out some tests to allow us to continue building prior to making the storage market functional. We would eventually like these tests to. work with the new code.

As a consequence of integrating go-fil-markets, we upgrade ipld-prime and graphsync. This has various ramifications throughout the code.

closes #3719

Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

Partial review for the integration code. Not covering waiter / connector changes yet.

cmd/go-filecoin/client.go Outdated Show resolved Hide resolved
internal/app/go-filecoin/node/block_propagate_test.go Outdated Show resolved Hide resolved
internal/app/go-filecoin/node/node.go Show resolved Hide resolved
internal/app/go-filecoin/node/node.go Outdated Show resolved Hide resolved
internal/app/go-filecoin/node/node.go Outdated Show resolved Hide resolved
internal/app/go-filecoin/node/node_test.go Show resolved Hide resolved
Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

Good to merge.

My two most difficult opinions are:

  1. it is unfortunate that this work seems to be branching off in the same direction as porcelain but with different code and it would be good to imagine what we should do about this PR setting a precedent for duplicating that part of the system. If we continue to duplicate porcelain we should try to generalize the duplicated area and deprecate and delete porcelain code because maintaining two copies is bad. If want to double down on porcelain we could use it to implement the common connector and shove new functionality down there.

  2. any code to handle differences between the address types of markets and gfc is a step in the wrong direction not worth the cost-- it should be very easy to switch gfc to use the shared addresses (because it is just gfc code copy pasted) in a single large and tedious but mechanical commit.

@@ -44,8 +44,11 @@ type ChainMessage struct {
Receipt *types.MessageReceipt
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Great cleanup

return &stateKey{key, uint64(ts.At(0).Height)}, nil
}

func (c *connectorCommon) wait(ctx context.Context, mcid cid.Cid, pubErrCh chan error) (*types.MessageReceipt, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this PR has opted to circumvent the porcelain abstraction it ends up duplicating existing work like this in porcelain (while you're impl is nicer because it handles timeouts, it would have been better to improve existing and consolidate.)

This is a bummer all around so I'll be keeping my eyes out for some way to consolidate duplication among porcelain and connectors. Did you consider giving the connectorCommon a (subset of a?)porcelainAPI handle?


proposal := msgProposals[0] // TODO: Support more than one deal

// TODO: find a better way to do this
Copy link
Contributor

Choose a reason for hiding this comment

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

Would reflect.DeepEqual help here? If not seems like writing a custom Equals or CompareForValidation method on proposal would be nice. Seems like it shouldn't have to wait for after this PR.

@anorth
Copy link
Member

anorth commented Feb 4, 2020

Drive-by opinion: I favour us moving away from porcelain, so if there's a path to deleting the duplicated concepts, 👍 for landing new ones.

@codecov-io
Copy link

codecov-io commented Feb 4, 2020

Codecov Report

Merging #3737 into master will decrease coverage by <1%.
The diff coverage is 37%.

@@           Coverage Diff           @@
##           master   #3737    +/-   ##
=======================================
- Coverage      39%     39%    -1%     
=======================================
  Files         255     246     -9     
  Lines       14602   14353   -249     
=======================================
- Hits         5750    5609   -141     
+ Misses       8144    8051    -93     
+ Partials      708     693    -15

@acruikshank acruikshank force-pushed the feat/storage-provider-node-impl branch from 9d11cb7 to be0287f Compare February 6, 2020 01:51
@acruikshank acruikshank force-pushed the feat/storage-provider-node-impl branch from be0287f to 369a97f Compare February 6, 2020 02:43
@acruikshank acruikshank merged commit 20d8206 into master Feb 6, 2020
@anorth
Copy link
Member

anorth commented Feb 6, 2020

Thank you!

@zl03jsj zl03jsj deleted the feat/storage-provider-node-impl branch July 14, 2022 09:50
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.

Switch to shared address module
6 participants