-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Proposal] Simplify ClientRetrieveAPIs to mirror storage #6415
Comments
@hannahhoward the proposal seems reasonable to me. I have a couple of questions:
|
I ran into this again recently. would be great to get consensus and see if we could simplify&standardize this API |
To respond to @dirkmc 's questions:
|
@dircmc @raulk for follow-up. |
@dirkmc one more follow-up -- this also allows us to add a --watch option to the |
refactor retrievals per proposal fix #6415
refactor retrievals per proposal fix #6415
I went ahead and implemented a PR for this proposal, mostly so its off my plate: #6702 |
Closing this proposal as these APIs has been removed as part of removing the Legacy Lotus/Lotus-Miner Markets sub-system, which reached EOL at the end of the 31st January 2023, and has been completely removed from the code: |
Is your feature request related to a problem? Please describe.
Currently, we have apis for initiating client retrievals:
These functions do A LOT:
The APIs also convert the stream of events generated by go-fil-markets to a custom stream, in the process dropping some important data (like the retrieval deal ID). The only difference between the two methods is one version returns the custom event stream while the other consumes said stream to then end and returns the final error.
Finally, these APIs look quite different from storage APIs, which provide:
Describe the solution you'd like
Per #6337 we now have functions that mirror two of the four storage functions:
ClientGetRetrievalUpdates
ClientListRetrievals
My proposal is to remove the two above APIs from the V1 API and provide two much simpler functions:
The types referenced are:
The V0 API could continue to offer the old methods, backed by the functions above, plus
ClientGetRetrievalUpdates
andClientRemoveImport
(to clear out blockstore data)Describe alternatives you've considered
Adding a DealID to the event stream returned by ClientRetrieveWithEvents, a simpler solution one way my team is block, but one which really doesn't fix the API asymmetry and how complicated the retrieval methods currently are
Additional context
There is one potential gotcha:
ClientGetRetrievalUpdates
returns a struct that is missing one field from the custom stream returned by ClientRetrieveWithEvents who data type is marketevents.Event -- an "Event" field which references the internal go-fil-markets event that triggered the update. This is currently included in the CLI output, though I don't think it's very informative and I'd be surprised if anyone else is using it. We could accept the breaking change of dropping this parameter, or add it to the return channel forClientGetRetrievalUpdates
This also allows us to remove the retrieval store manager.
We might potentially consider CLI changes as well but as a starting point we'd just reimplement the CLI with the new APIs.
Also, this does cause a number of changes to integration tests and lotus-soup, plus we can optionally rewrite the CLI command. I've actually implemented a lot of this change but don't want to spend more time without general approval of the direction
The text was updated successfully, but these errors were encountered: