filecoin-project / go-data-transfer

Data Transfer Shared Component for go-filecoin & go-lotus
Other
39 stars 17 forks source link

Support per channel transport config #362

Closed hannahhoward closed 1 year ago

hannahhoward commented 1 year ago

Goals

This aims to import transport configuration by allowing a configuration when opening a channel.

You can now pass WithTransportOptions, and then use options provided by your chose transport.

Implementation

For Discussion

This implementation is... not quite perfect, but I think good enough for Lassie + go-fil-markets, the consumers.

The interaction between the old mechanism and the new mechanism is somewhat conflicting, and once I tried to replace the old mechanism completely, I ran into many of the perpetual design problems I struggle with in this library:

Companion PR for go-fil-markets: https://github.com/filecoin-project/go-fil-markets/pull/780

codecov-commenter commented 1 year ago

Codecov Report

Merging #362 (ad4a627) into master (f936292) will decrease coverage by 0.51%. The diff coverage is 0.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/filecoin-project/go-data-transfer/pull/362/graphs/tree.svg?width=650&height=150&src=pr&token=M4Th4q6xd3&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project)](https://codecov.io/gh/filecoin-project/go-data-transfer/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project) ```diff @@ Coverage Diff @@ ## master #362 +/- ## ========================================== - Coverage 67.81% 67.30% -0.52% ========================================== Files 23 23 Lines 2865 2887 +22 ========================================== Hits 1943 1943 - Misses 701 721 +20 - Partials 221 223 +2 ``` | [Impacted Files](https://codecov.io/gh/filecoin-project/go-data-transfer/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project) | Coverage Δ | | |---|---|---| | [impl/impl.go](https://codecov.io/gh/filecoin-project/go-data-transfer/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-aW1wbC9pbXBsLmdv) | `50.52% <0.00%> (-2.23%)` | :arrow_down: | | [transport/graphsync/graphsync.go](https://codecov.io/gh/filecoin-project/go-data-transfer/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-dHJhbnNwb3J0L2dyYXBoc3luYy9ncmFwaHN5bmMuZ28=) | `76.66% <0.00%> (-0.80%)` | :arrow_down: |