cmd, discovery, server: allow B to set MaxBroadcastPrice to filter acceptable O's stored in cache #933
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.
What does this pull request do? Explain your changes. (required)
Allows a broadcaster to set a maximum price preference
BroadcastPrice *MaxBroadcastPrice
(not required) in the same format as #916 either by specifying the flagsmaxPricePerUnit
andpixelsPerUnit
on node startup, or through the CLI.When
orchestratorPool.getOrchestrators
is called on the orchestrators cached in the DBcache, it will filter orchestrators based on this max price setting (if set).Specific updates (required)
maxPricePerUnit
flag tocmd/livepeer.go
maxPricePerUnit
andpixelsPerUnit
through broadcaster CLI configorchestratorPool
structorchestratorPool
with a predicate functionNewOrchestratorPoolWithPred
DBOrchestratorPoolCache.getOrchestrators
to initiateorchestratorPool
with a predicate function through the new constructorNewOrchestratorPoolWithPred
. The predicate function returns true when B'sMaxBroadcastPrice
isn't set, or is greater than OrchestratorsPriceInfo
server
packageBroadcastPrice
to be a struct of typeMaxBroadcastPrice
consisting out of a*big.Rat
andsync.RWMutex
How did you test each of these updates (required)
Added unit tests (80.3 % coverage for
discovery
package)Added test to
./test_args.sh
for when flags are set , but incorrectly providedDoes this pull request close any open issues?
Fixes #906
Checklist:
./test.sh
pass