-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: Implement Boost equivalent deal market in Curio #135
Conversation
6b8ec18
to
c890aca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, in general this is moving in the right direction.
I'm really excited to start testing this when we get closer to completion, it will make my life so, so much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to add some flag to piece refs / piece park pieces which says that the piece is coming from an external, potentially untrusted source, eventually adding more special handling here.
(Also eventually one day we should add aria2 support here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also kinda tangential, but would be really cool to have a column in the parked_pieces table for download progress updated e.g. every 5s
2170220
to
ce53e3a
Compare
* temp: replace lotus to local * move storiface to Curio * fix build * don't refer to storiface2 * make gen * make remote path test happy * cleanup storiface
5a4eda5
to
1ac908f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this is big
Generally I'd say it's looking really good. I expect that as we run this some things will need adjusting, but on a high level this looks quite solid.
Lots of comments are more on the nicpicky side, but there are some that would be nice to address.
Overall feel free to merge into the base branch, the sooner we get this running in the real world the sooner we'll get this shipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly at this point I wouldn't do further reviews, looks really good.
Some minor comments, but other than that feel free to merge into the staging branch
How the new market works:
Modules:
Libp2p
Takes in all minerIDs and start a libp2p node for each. Table for storing address, key etc
MK12 Deal handler
Starts listening to deal protocols on each libp2p and then forwards the incoming requests to MK12 market module.
Deal market
Main poller process which starts all relevant modules based on config. For now, we only have one module Mk12. This module exposes a method called ExecuteDeal(). This method is used by Libp2p handler to forward the deal or execution from libp2p.
Deal market also load the ingestor modules (snap and normal deal flow) which assigns the deals from market to sectors
Market tasks
We have 3 different tasks in market with their own pollers based on a deal pipeline state
Indexing
Indexing task is a IAmBored. The entry is made in a dedicated table after MoveStorage task and this in turn triggers indexing of the deal. Once indexed, deal can be removed from the mk12 deal pipeline and piece/deal metadata is updated.
Index Store
A new store which exclusively is used for indexing based on Cassandra.
Pending
When to start offline deal
Index-Provider
Libp2p options
Deal Flow
Deal on Libp2p > libp2p hanlder (handle the deal) > Call MK12 modules inside the Deal market > Work through Market tasks > Deal market adds to sector pipeline using Ingestor > Create Indexing task (Move Storage) > Index > GC cleanup of deal pipeline
TODO:
Note
Remaining feature will be added in separate PRs. This is ready for review and merge.