-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Tokenomics] Implement difficulty proportional rewards #840
[Tokenomics] Implement difficulty proportional rewards #840
Conversation
…onal-rewards' into feat/difficulty-proportional-rewards
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.
…onal-rewards' into feat/difficulty-proportional-rewards
## Summary This PR prepares for claimed amount calculation to use the `RelayDifficultyMultiplier`. * It removes the `RelayDifficultyTargetHash` `proof` param. * Replace `prooftypes.DefaultRelayDifficultyTargetHash` occurrences with `protocol.BaseRelayDifficultyHashBz`. * Moves the `RleayMiningDifficulty` logic to the `service` module due to cyclic dependencies. * Rename `num_compute_units` to `num_claimed_compute_units` and add `num_estimated_compute_units` and `claimed_amount_upokt` * Remove the no longer used tokenomics querier to retrieve a service difficulty target hash. The PR is only renaming and moving of files most (~13200LOC) changes are auto-generated code. ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [x] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. You may need to run GCP workloads (requires changing the namespace to 840) |
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.
Preemptively approving - just a few suggestions, otherwise LGTM! 🙌
Please do merge main before merging this.
🚢
|
||
// Prepare the test supplier. | ||
supplierAddress := sample.AccAddress() | ||
supplierStake := sdk.NewInt64Coin(volatile.DenomuPOKT, 1000) |
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.
supplierStake := sdk.NewInt64Coin(volatile.DenomuPOKT, 1000) | |
supplierStake := suppliertypes.DefaultMinStake |
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.
Supplier min stake is not merged yet
require.NoError(t, err) | ||
|
||
// +1 to push threshold above s.claim's compute units | ||
proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) | ||
require.NoError(t, err) | ||
proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) |
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.
Loving this pattern ❤️; nice and 🧼! 😎
// The current test suite sets the CUPR to 1, making sum == count * CUPR | ||
// valid. So, we can change the last byte to 'b' to make it invalid. |
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.
👌 Thank you!
## Summary Updates `ProcessTokenLogicModules()` logic to unbond applications whose stake is below the minimum **after** processing all TLMs. ## Dependencies - #809 - #843 - #844 - #845 - #847 ## Dependents - #849 - #850 - #857 - #852 - #861 - #851 - #863 ## Issue - #612 ## Type of change Select one or more from the following: - [x] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [x] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [x] I have left TODOs throughout the codebase, if applicable --------- Co-authored-by: Redouane Lakrache <[email protected]> Co-authored-by: Daniel Olshansky <[email protected]> Co-authored-by: red-0ne <[email protected]>
aab06af
into
feat/prepare-difficulty-proportional-rewards
**This is a repost of PR #840 which did not get merged into main** ## Summary This PR incorporated the mining difficulty into the claim reward calculation. * Encapsulates the claimed tokens into a `claim.GetClaimeduPOKT(params, difficulty)` * Implements a test to assert that the difficulty based rewards are proportional to the off-chain relays served. * Removes unused `min_relay_difficulty_bits` gov. param. It is based on the preparation work of PR #836. ## Issue - #781 - #758 ## Type of change Select one or more from the following: - [x] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [x] I have left TODOs throughout the codebase, if applicable
**This is a repost of PR #840 which did not get merged into main** ## Summary This PR incorporated the mining difficulty into the claim reward calculation. * Encapsulates the claimed tokens into a `claim.GetClaimeduPOKT(params, difficulty)` * Implements a test to assert that the difficulty based rewards are proportional to the off-chain relays served. * Removes unused `min_relay_difficulty_bits` gov. param. It is based on the preparation work of PR #836. ## Issue - #781 - #758 ## Type of change Select one or more from the following: - [x] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [x] I have left TODOs throughout the codebase, if applicable
Summary
This PR incorporated the mining difficulty into the claim reward calculation.
claim.GetClaimeduPOKT(params, difficulty)
min_relay_difficulty_bits
gov. param.It is based on the preparation work of PR #836.
Issue
Type of change
Select one or more from the following:
consensus-breaking
label if so. See [Infra] Automatically add theconsensus-breaking
label #791 for detailsTesting
make go_develop_and_test
make test_e2e
devnet-test-e2e
label to the PR.Sanity Checklist