-
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
106 commits
Select commit
Hold shift + click to select a range
a989f60
add SectorAddPieceToAny and SectorUnsealPiece to StorageMiner iface; …
nonsense 87ed228
extract pushUrl and fix return type for worker RPC v0
nonsense e275b54
export PartialFile and OpenPartialFile
nonsense 5540111
add UnpaddedByteIndex.Valid()
nonsense 83e55dc
move handleProvingSector to correct file - states_proving.go
nonsense 1295c92
confirm that Miner struct satisfies sectorblocks.SectorBuilder
nonsense 2aad7b6
update sectorstorage.New (Manager) interface
nonsense 2562f2e
add ReaderParamDecoder to json rpc server to lotus-miner run
nonsense c12d802
update reader to use ReadAtLeast
nonsense cb603c6
update retrievaladapter ; add piece_provider
nonsense 76bb424
update StorageMinerAPI
nonsense 4693c61
re-arrange NodeBuilder and add storageminer_svc
nonsense 9092899
remove DealInfo and DealSchedule from storage-sealing gen/main.go
nonsense 1a9b576
add remoteGetAllocated http handler
nonsense 19bd5be
update remoteGetSector
nonsense 9a7b0b6
comment
nonsense 8d3d3c8
introduce init service, refactor restore service
nonsense 9979de2
logs and defaults
nonsense c311520
add missing messagepool override
nonsense 46a368d
bump api ver
nonsense d195a12
Merge branch 'master' into nonsense/split-market-miner-processes
nonsense e4136b0
add modules.StorageAuthWithURL to set correct token
nonsense 0a79f49
fix tests
nonsense 88756f3
fix TestAPIDeal tests
nonsense 7f23480
make linter happy
nonsense c877166
add messagepool to test node constructor
nonsense 8bd09e3
resolve merge conflicts
nonsense d9a7348
use masters filecoin-ffi
nonsense 6f125cc
add prover to fullnode and miner builders
nonsense c4d10bc
apply messagepool.NewProviderLite to lite nodes
nonsense ed634bc
rebuild docs
nonsense ded5341
fixup test node builder
nonsense 042ac82
testplans: lotus-soup: new images with filecoin-ffi ; use default WPo…
nonsense b0cb0c1
do not depend on filecoin-ffi in api package
nonsense de646a5
fix node builder
nonsense 9f3ec82
initial resolution of conflicts
nonsense c0607a0
Merge branch 'master' into nonsense/split-market-miner-processes
nonsense 4dd093b
fix piece provider test
nonsense 3f5f96d
go mod tidy
nonsense 30ba9a2
remove double http handler decl
nonsense 9ab84bd
upgrade docsgen
nonsense beb5bff
fix log.Error; rename RemoteStore
nonsense 31e6fb1
resolve conflicts
nonsense c0feb36
add missing debug
nonsense 090a163
bump miner version apiv0
nonsense 323c78e
comment for checkV1ApiSupport
nonsense d45bb14
Merge branch 'master' into nonsense/split-market-miner-processes
nonsense 338bd04
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense 89df3cc
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense 577b730
wip
nonsense 6720463
resolve merge conflicts
nonsense 5e10d53
wip
nonsense 0061867
policy.SetPreCommitChallengeDelay to reduce WaitSeed stage time
nonsense b0d1668
comment out preseal sectors
nonsense e656aad
regenerate docs
nonsense 9567807
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense a828b15
revert MockSectorMgr
nonsense 4f2d8b0
add all subsystems to deadlines and wdpost_dispute tests
nonsense 218c919
fix testNonGenesisMiner
nonsense aa58447
fix paych and sdr tests
nonsense fc7feff
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense d98eca7
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense 51a4657
fix SDR test
nonsense 7fb93d4
refactor kit.NewDealHarness to include main miner and market node
nonsense 99646d2
fix TestFirstDealEnablesMining
nonsense 21b5132
adding TestDealWithMarketAndMinerNode
nonsense 4217ec5
make auth on remote rpc server optional
nonsense a8d5ae5
enable more tests
nonsense 9ec7cd7
enable libp2p options
nonsense 4f0a96c
resolved conflicts
nonsense 3aa6d03
connect miner to full node , only when running markets
nonsense 1869de7
unwire host from storage.Miner.
raulk 4194c7f
revert back optional for Miner; remove ActorAddress call in node.Mine…
nonsense 96245c3
lint
nonsense 9e85492
fix test
nonsense 287e069
missing flag, that will need to be refactored
nonsense 8dbae00
fix lotus-soup
nonsense 724f728
enable more tests
nonsense ab6e01e
remove --enable-markets flag, read from repo
nonsense e9d0a25
remove redundant flag from docs
nonsense adba1a7
add missing err check
nonsense 4be0a7a
resolve conflicts with master
nonsense 5a87f04
fix finalize sectors early test
nonsense 9839d57
fix SectorsStatus to query full node for on-chain data
nonsense ff2772a
resolved conflicts
nonsense 604be5f
Update extern/sector-storage/stores/remote.go
nonsense 8cf3acc
Update itests/kit/ensemble.go
nonsense 898687e
Update node/modules/storageminer.go
nonsense 10dc90f
addressing comments
nonsense b572c2b
fix IsUnsealed
nonsense 7a78527
remove not used sa; cleanup
nonsense 2a7af38
fix testServ to Start with correct listener
nonsense 566a9d5
fix signature
nonsense 42ae876
remove ApplyIfEnableLibP2P
nonsense caa366b
variadic WithSubsystems
nonsense 6b014f5
pass Subsystems to StorageMiner option; add enableLibp2p bool in Sett…
nonsense 1fe08f5
refactor testkit in lotus-soup to include Subsystems when instantiati…
nonsense bb466ed
fix cast on role_miner in testground lotus-soup plan
nonsense 82efe01
fixup
nonsense 16784aa
remove pieceProvider from DI; small refactors
nonsense d89ddb9
resolve conflicts
nonsense a423c46
rename mock.go to net.go
nonsense 056136e
rename argument from url to apiInfo
nonsense 4bc9fa0
rename cfg.Subsystems.EnableStorageMarket to EnableMarkets
nonsense 7728d6b
remove --enable-markets flag; add --name string slice flag
nonsense 2af02af
rename --name to --type; provide empty stores.StorageConfig when init…
nonsense File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,33 +17,9 @@ import ( | |
"golang.org/x/xerrors" | ||
) | ||
|
||
func checkApiInfo(ctx context.Context, ai string) (string, error) { | ||
ai = strings.TrimPrefix(strings.TrimSpace(ai), "MINER_API_INFO=") | ||
info := cliutil.ParseApiInfo(ai) | ||
addr, err := info.DialArgs("v0") | ||
if err != nil { | ||
return "", xerrors.Errorf("could not get DialArgs: %w", err) | ||
} | ||
|
||
log.Infof("Checking api version of %s", addr) | ||
|
||
api, closer, err := client.NewStorageMinerRPCV0(ctx, addr, info.AuthHeader()) | ||
if err != nil { | ||
return "", err | ||
} | ||
defer closer() | ||
|
||
v, err := api.Version(ctx) | ||
if err != nil { | ||
return "", xerrors.Errorf("checking version: %w", err) | ||
} | ||
|
||
if !v.APIVersion.EqMajorMinor(lapi.MinerAPIVersion0) { | ||
return "", xerrors.Errorf("remote service API version didn't match (expected %s, remote %s)", lapi.MinerAPIVersion0, v.APIVersion) | ||
} | ||
|
||
return ai, nil | ||
} | ||
const ( | ||
MarketsService = "markets" | ||
) | ||
|
||
var serviceCmd = &cli.Command{ | ||
Name: "service", | ||
|
@@ -63,12 +39,10 @@ var serviceCmd = &cli.Command{ | |
Name: "nosync", | ||
Usage: "don't check full-node sync status", | ||
}, | ||
|
||
&cli.BoolFlag{ | ||
Name: "enable-market", | ||
Usage: "enable market module", | ||
&cli.StringSliceFlag{ | ||
Name: "name", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed to |
||
Usage: "services to be enabled", | ||
}, | ||
|
||
&cli.StringFlag{ | ||
Name: "api-sealer", | ||
Usage: "sealer API info (lotus-miner auth api-info --perm=admin)", | ||
|
@@ -83,10 +57,17 @@ var serviceCmd = &cli.Command{ | |
ctx := lcli.ReqContext(cctx) | ||
log.Info("Initializing lotus miner service") | ||
|
||
if !cctx.Bool("enable-market") { | ||
es := EnabledServices(cctx.StringSlice("name")) | ||
|
||
if len(es) == 0 { | ||
return xerrors.Errorf("at least one module must be enabled") | ||
} | ||
|
||
// we should remove this as soon as we have more service types and not just `markets` | ||
if !es.Contains(MarketsService) { | ||
return xerrors.Errorf("markets module must be enabled") | ||
} | ||
|
||
if !cctx.IsSet("api-sealer") { | ||
return xerrors.Errorf("--api-sealer is required without the sealer module enabled") | ||
} | ||
|
@@ -95,7 +76,7 @@ var serviceCmd = &cli.Command{ | |
} | ||
|
||
if err := restore(ctx, cctx, func(cfg *config.StorageMiner) error { | ||
cfg.Subsystems.EnableStorageMarket = cctx.Bool("enable-market") | ||
cfg.Subsystems.EnableMarkets = es.Contains(MarketsService) | ||
cfg.Subsystems.EnableMining = false | ||
cfg.Subsystems.EnableSealing = false | ||
cfg.Subsystems.EnableSectorStorage = false | ||
|
@@ -118,7 +99,7 @@ var serviceCmd = &cli.Command{ | |
|
||
return nil | ||
}, func(api lapi.FullNode, maddr address.Address, peerid peer.ID, mi miner.MinerInfo) error { | ||
if cctx.Bool("enable-market") { | ||
if es.Contains(MarketsService) { | ||
log.Info("Configuring miner actor") | ||
|
||
if err := configureStorageMiner(ctx, api, maddr, peerid, big.Zero()); err != nil { | ||
|
@@ -134,3 +115,42 @@ var serviceCmd = &cli.Command{ | |
return nil | ||
}, | ||
} | ||
|
||
type EnabledServices []string | ||
|
||
func (es EnabledServices) Contains(name string) bool { | ||
for _, s := range es { | ||
if s == name { | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
func checkApiInfo(ctx context.Context, ai string) (string, error) { | ||
ai = strings.TrimPrefix(strings.TrimSpace(ai), "MINER_API_INFO=") | ||
info := cliutil.ParseApiInfo(ai) | ||
addr, err := info.DialArgs("v0") | ||
if err != nil { | ||
return "", xerrors.Errorf("could not get DialArgs: %w", err) | ||
} | ||
|
||
log.Infof("Checking api version of %s", addr) | ||
|
||
api, closer, err := client.NewStorageMinerRPCV0(ctx, addr, info.AuthHeader()) | ||
if err != nil { | ||
return "", err | ||
} | ||
defer closer() | ||
|
||
v, err := api.Version(ctx) | ||
if err != nil { | ||
return "", xerrors.Errorf("checking version: %w", err) | ||
} | ||
|
||
if !v.APIVersion.EqMajorMinor(lapi.MinerAPIVersion0) { | ||
return "", xerrors.Errorf("remote service API version didn't match (expected %s, remote %s)", lapi.MinerAPIVersion0, v.APIVersion) | ||
} | ||
|
||
return ai, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.