-
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
[RelayMiner] Supplier rate limiting #895
Conversation
…Invalid_SupplierExceedsMaxClaimableAmount
…_pokt_reimbursement_request
…_pokt_reimbursement_request
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.
@red-0ne Please review all my comments (at a glance) before targeting them one-by-one. Something things made sense only when I finished reviewing anything.
@bryanchriswhite Want to make sure we get your 👀 on this as well.
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.
@red-0ne Looking good to me w/ no blockers.
- PTAL at the lingering nits.
- Lmk what you want to do with the unit tests.
- We definitely need a review from @bryanchriswhite given the overlap w/ settlement hardening.
|
||
// In case Allowance is positive, add it to the maxCoin to allow no or limited over-servicing. | ||
if !allowUnlimitedOverServicing { | ||
maxAllowedOverServicing := appRelayMeter.maxCoin.Add(rmtr.overServicingAllowanceCoins) |
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.
Could (should?) this be a value that we cache on initialization or new sessions?
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.
There seems to be no need to caching or initialization, this is the only place where it's being used.
The maxCoin
is updated at the beginning of each session, while overServicingAllowanceCoins
are configured at startup and unchanged.
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.
Very clean and well commented! 🙌 🚀
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.
@red-0ne Left one comment that really requies attention but approving a prior otherwise!
|
…pdates * pokt/main: (51 commits) [RelayMiner] Supplier rate limiting (#895) [Tokenomics] refactor: `MintAllocationApplication` var usage to param usage (#918) [Tokenomics] feat: add `mint_allocation_application` param to tokenomics module (#917) [Tokenomics] refactor: `MintAllocationSourceOwner` var usage to param usage (#916) [Tokenomics] feat: add `mint_allocation_source_owner` param to tokenomics module (#915) [Tokenomics] refactor: `MintAllocationSupplier` var usage to param usage (#914) [Tokenomics] feat: add `mint_allocation_supplier` param to tokenomics module (#913) [Tokenomics] refactor: `MintAllocationProposer` var usage to param usage (#912) [Tokenomics] feat: add `mint_allocation_proposer` param to tokenomics module (#911) [Tokenomics] refactor: `MintAllocationDao` var usage to param usage (#910) [Tokenomics] Add `mint_allocation_dao` tokenomics module param (#909) [quick-pr] change full-node.sh script links (#920) [Supplier] refactor: `NumSuppliersPerSession` var usage to param usage (#908) [Session Params] Add `num_suppliers_per_session` param to session module (#907) [Session Params] Add `MsgUpdateParam` to session module (#906) Updated some compiled proto files [TODOs] Update #2 to `TODO_BETA` to only reflect ACTUAL blockers (#900) [Workflow] Enforce `TODO_UPNEXT` comments to have an associated username (#896) [Observability] Foundation for load testing telemetry (#832) [Tokenomics] Implement Global Mint Reimbursement Request (#878) ...
…tlement * pokt/main: [RelayMiner] Supplier rate limiting (#895) [Tokenomics] refactor: `MintAllocationApplication` var usage to param usage (#918) [Tokenomics] feat: add `mint_allocation_application` param to tokenomics module (#917) [Tokenomics] refactor: `MintAllocationSourceOwner` var usage to param usage (#916) [Tokenomics] feat: add `mint_allocation_source_owner` param to tokenomics module (#915) [Tokenomics] refactor: `MintAllocationSupplier` var usage to param usage (#914) [Tokenomics] feat: add `mint_allocation_supplier` param to tokenomics module (#913) [Tokenomics] refactor: `MintAllocationProposer` var usage to param usage (#912) [Tokenomics] feat: add `mint_allocation_proposer` param to tokenomics module (#911) [Tokenomics] refactor: `MintAllocationDao` var usage to param usage (#910) [Tokenomics] Add `mint_allocation_dao` tokenomics module param (#909) [quick-pr] change full-node.sh script links (#920) [Supplier] refactor: `NumSuppliersPerSession` var usage to param usage (#908) [Session Params] Add `num_suppliers_per_session` param to session module (#907) [Session Params] Add `MsgUpdateParam` to session module (#906) Updated some compiled proto files [TODOs] Update #2 to `TODO_BETA` to only reflect ACTUAL blockers (#900) [Workflow] Enforce `TODO_UPNEXT` comments to have an associated username (#896)
Summary
This PR adds an optimistic
RelayMeter
to theRelayMiner
to monitor the consumed stake and stops servicing whenmaxStake
is reached.It works by
RelayRequest
s before being served.rate-limited
error if app stake share cannot cover of a minableRelayRequest
.Relay
is volume applicable and revert the initial deduction if it is not.Application
s stake if anEventApplicationStaked
is observed.Application
s stakes at the beginning of every session.Issue
RelayMiner
s need to know how much of theApplication
's stake they are allowed to consume without over-servicing.Type of change
Select one or more from the following:
Testing
make go_develop_and_test
make test_e2e
devnet-test-e2e
label to the PR.Sanity Checklist