-
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
Support standalone miner-market process #6356
Conversation
…model moved to api package - PieceDealInfo, DealSchedule
This will likely conflict with #6280 a bunch (it also cherry-picks from my PR) |
68ab7b4
to
6b014f5
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.
Looks almost mergable, just a couple of small comments
@@ -242,7 +243,14 @@ func ConfigCommon(cfg *config.Common) Option { | |||
urls = append(urls, "http://"+ip+"/remote") // TODO: This makes no assumptions, and probably could... | |||
return urls, nil | |||
}), | |||
ApplyIf(func(s *Settings) bool { return s.Online }, | |||
ApplyIf(func(s *Settings) bool { return s.Base }), // apply only if Base has already been applied |
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.
Looking at this now, it probably makes more sense for this to Error if base isn't applied here
node/builder_miner.go
Outdated
Override(new(stores.SectorIndex), From(new(modules.MinerSealingService))), | ||
), | ||
|
||
If(cfg.Subsystems.EnableStorageMarket, |
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.
Why don't we include the LibP2P
option here (and in the client options)? This should allow us to get rid of settings.enableLibp2pNode
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.
I will give this a try, but I am not sure it is possible, as there are some configs that need to be applied earlier.
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.
Agree. Now that we've separated Libp2p
from Online
, enableLibp2pNode
maps directly to enabling the Libp2p
aggregate. This should be feasible.
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.
Oh wait, I think this may have to do with the fact that we need to read the Config to know whether to enable or not the libp2p node, right?
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.
Only when Markets is enabled in the miner config, should we enable libp2p. So it's a bit of a chicken and egg, and that's why it's convoluted.
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.
Actually, no. It should be possible, as ConfigStorageMiner and ConfigureFullNode have access to the config, and can decide whether to insert the Libp2p aggregate within the Options they return.
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.
Initial comments. We probably want to bring consistency between the terms "subsystem" and "service" -- we use them a bit interchangeably?
PieceStore dtypes.ProviderPieceStore `optional:"true"` | ||
StorageProvider storagemarket.StorageProvider `optional:"true"` | ||
RetrievalProvider retrievalmarket.RetrievalProvider `optional:"true"` | ||
DataTransfer dtypes.ProviderDataTransfer `optional:"true"` | ||
DealPublisher *storageadapter.DealPublisher `optional:"true"` | ||
SectorBlocks *sectorblocks.SectorBlocks `optional:"true"` | ||
Host host.Host `optional:"true"` |
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 should move these out to a MarketsAPI
struct and embed it 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.
LGTM, besides the comments! This was a heroic effort. Awesome work here, @nonsense and @magik6k ❤️ This is the start of a more modular Lotus!
Some top-level comments:
- Let's standardise on the name "subsystem" or "service". We use both interchangeably and it's confusing (service in the cli tooling, subsystem in the config). Either is fine with me, unless we do want to use both because they refer to different things now, or we expect them to (e.g. service as a collection of subsystems?). If so, we should document the difference.
- OK to merge the changes in the testkit as is. I can follow-up with a new PR to bring more order/structure to that and de-entropise.
- We may need commands to query a lotus node to know which subsystems is running, and to know which other APIs it's interacting with, but that can be a follow-up.
if err := checkV1ApiSupport(ctx, cctx); err != nil { | ||
return err | ||
} |
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 don't need this any longer?
if cctx.Args().Len() != 1 { | ||
return xerrors.Errorf("expected 1 argument") | ||
} | ||
func restore(ctx context.Context, cctx *cli.Context, manageConfig func(*config.StorageMiner) error, after func(api lapi.FullNode, addr address.Address, peerid peer.ID, mi miner.MinerInfo) error) error { |
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.
FYI, I wasn't able to review this file because the diff is too noisy and I'm not familiar with this command. I trust @magik6k here.
c884d81
to
7728d6b
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.
Well, I think this is in good enough shape to land in master, just one cosmetic suggestion.
Name: "enable-market", | ||
Usage: "enable market module", | ||
&cli.StringSliceFlag{ | ||
Name: "name", |
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.
Maybe type
? lotus-miner init service --name markets ...
looks a bit weild
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.
Renamed to type
.
4299bdd
to
2af02af
Compare
@magik6k @raulk in the last commit (2af02af), I renamed
So parsing of the storage-config.json is extracted away, and we call Docs at filecoin-project/filecoin-docs#890 have also been addressed to not mention |
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.
⛵
Associated docs: filecoin-project/filecoin-docs#890
This PR is a cherry-picked version of #5983. Closes #5149.
Subsystems
within thelotus-miner
process - currently:lotus-miner market service
connects to themain
lotus process for all sealing/storage interactions, or:market
service runsStorageMarget
subsystemmain miner
service runsMining
,Sealing
andSectorStorage
subsystems.Depending on configuration options, this PR provides flexibility for the the miner to be split into multiple processes, or to be run as one process as is currently the case.
Currently the deployment flow for running a
market
module as a separate process is the following:export LOTUS_BACKUP_BASE_PATH=~/.lotusbackup && export LOTUS_MINER_PATH=~/.lotusminer && export LOTUS_PATH=~/.devlotus && lotus-miner backup ~/.lotusbackup/backupfile
)This would also send a message on chain and update the address for the given miner, so that the markets process is the point of entry from the on-chain DHT.
3. Run market service as well as main miner service (i.e. something like:
TODO:
itests/kit
TODO FROM PARENT:
api/test/deal.go
tests, and run in this setupFOLLOW UP / NICE TO HAVE:
if x == nil { error(module x is disabled) }