Skip to content
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] Prevent GMR to produce zero values #866

Merged
merged 2 commits into from
Oct 8, 2024
Merged

Conversation

red-0ne
Copy link
Contributor

@red-0ne red-0ne commented Oct 8, 2024

Summary

This PR handles the case where non zero claimed rewards produce zero GMR rewards when the claimed rewards are too low.

Issue

When claimed rewards are too low, they might produce a global mint reward that is non-zero but less that 1. Since the TLM does not exepect a zero value, this might lead to a chain halt like below.

ERR error processing token logic modules for claim "af85b9dd2d49f1d5b133347eac2b65e7cd7a1a555fea742adba778f711207c6b": TLM "TLMGlobalMint": mint amount cannot be zero: failed to process TLM [/go/pkg/mod/cosmossdk.io/[email protected]/errors.go:155] module=server num_claim_compute_units=2 num_relays_in_session_tree=2 proof_requirement=NOT_REQUIRED session_id=af85b9dd2d49f1d5b133347eac2b65e7cd7a1a555fea742adba778f711207c6b supplier_operator_address=pokt1ytsx06dfxrp7cgt7t95jkxuyu2m97563zqz5pn
ERR could not settle pending claims due to error TLM "TLMGlobalMint": mint amount cannot be zero: failed to process TLM [/go/pkg/mod/cosmossdk.io/[email protected]/errors.go:155] method=EndBlocker module=x/tokenomics

https://gist.github.com/okdas/013df312354ca0e7877a41290d94fad2

Type of change

Select one or more from the following:

Testing

  • 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

  • I have tested my changes using the available tooling
  • I have commented my code
  • 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

@red-0ne red-0ne added the tokenomics Token Economics - what else do you need? label Oct 8, 2024
@red-0ne red-0ne added this to the Shannon Beta TestNet Launch milestone Oct 8, 2024
@red-0ne red-0ne self-assigned this Oct 8, 2024
@red-0ne red-0ne added the bug Something isn't working label Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

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 make trigger_ci to submit an empty commit that'll trigger the tests.

GCP workloads (requires changing the namespace to 866)
Grafana network dashboard for devnet-issue-866

@github-actions github-actions bot added devnet push-image CI related - pushes images to ghcr.io labels Oct 8, 2024
@red-0ne red-0ne requested a review from okdas October 8, 2024 19:02
@red-0ne red-0ne merged commit 31797ee into main Oct 8, 2024
10 checks passed
bryanchriswhite added a commit that referenced this pull request Oct 10, 2024
…to issues/612/application/burning

* pokt/issues/612/application/staking:
  Empty commit
  [Tokenomics] Prevent GMR to produce zero values (#866)
  Empty commit
bryanchriswhite added a commit that referenced this pull request Oct 10, 2024
…application

* issues/612/application/burning: (94 commits)
  fix: linter error
  chore: quick fixes
  [DifficultyHash] Prepare for difficulty multiplier usage (#836)
  [Application] Enforce minimum stake when staking (#847)
  Empty commit
  [Tokenomics] Prevent GMR to produce zero values (#866)
  Empty commit
  chore: regenerate protobufs
  fix: linter error
  Empty commit
  chore: review feedback improvements
  Empty commit
  Empty commit
  fix: linter errors
  fix: typo
  chore: review feedback improvements
  chore: reconcile PreGeneratedAccountIterator#MustNext()
  chore: add review feedback TODOs
  Empty commit
  test: simplify coin equality assertions
  ...

# Conflicts:
#	x/application/keeper/msg_server_stake_application_test.go
#	x/application/keeper/msg_server_unstake_application.go
#	x/application/keeper/msg_server_unstake_application_test.go
#	x/application/keeper/unbond_applications.go
bryanchriswhite added a commit that referenced this pull request Oct 14, 2024
* issues/612/shared/refresh: (46 commits)
  test: supplier up-staking from below min. stake
  fix: linter error
  fix: flaky test
  [Application] Enforce minimum stake when burning (#848)
  Empty commit
  chore: review feedback improvements
  chore: regenerate protobufs
  chore: review feedback improvements
  test: fix application min stake integration test
  chore: review feedback improvements
  Empty commit
  fix: linter error
  chore: quick fixes
  [DifficultyHash] Prepare for difficulty multiplier usage (#836)
  [Application] Enforce minimum stake when staking (#847)
  Empty commit
  [Tokenomics] Prevent GMR to produce zero values (#866)
  Empty commit
  [Application] Add `min_stake` application module param (#845)
  chore: regenerate protobufs
  ...
bryanchriswhite added a commit that referenced this pull request Oct 14, 2024
* issues/612/proof/refresh: (46 commits)
  test: supplier up-staking from below min. stake
  fix: linter error
  fix: flaky test
  [Application] Enforce minimum stake when burning (#848)
  Empty commit
  chore: review feedback improvements
  chore: regenerate protobufs
  chore: review feedback improvements
  test: fix application min stake integration test
  chore: review feedback improvements
  Empty commit
  fix: linter error
  chore: quick fixes
  [DifficultyHash] Prepare for difficulty multiplier usage (#836)
  [Application] Enforce minimum stake when staking (#847)
  Empty commit
  [Tokenomics] Prevent GMR to produce zero values (#866)
  Empty commit
  [Application] Add `min_stake` application module param (#845)
  chore: regenerate protobufs
  ...

# Conflicts:
#	x/service/types/errors.go
bryanchriswhite added a commit that referenced this pull request Oct 14, 2024
…-uint64

* issues/612/service/refresh: (46 commits)
  test: supplier up-staking from below min. stake
  fix: linter error
  fix: flaky test
  [Application] Enforce minimum stake when burning (#848)
  Empty commit
  chore: review feedback improvements
  chore: regenerate protobufs
  chore: review feedback improvements
  test: fix application min stake integration test
  chore: review feedback improvements
  Empty commit
  fix: linter error
  chore: quick fixes
  [DifficultyHash] Prepare for difficulty multiplier usage (#836)
  [Application] Enforce minimum stake when staking (#847)
  Empty commit
  [Tokenomics] Prevent GMR to produce zero values (#866)
  Empty commit
  [Application] Add `min_stake` application module param (#845)
  chore: regenerate protobufs
  ...
bryanchriswhite added a commit that referenced this pull request Oct 15, 2024
…ed-params

* pokt/main:
  [On-Chain] Refactor `uint64` type individual param update logic (#863)
  [Service] Refresh service module params logic (#861)
  [Proof] Refresh proof module params logic (#851)
  [Shared] Refresh shared module params logic (#852)
  [Docs] Fix example of how to set rev share precentage (#877)
  [Tokenomics] Implement difficulty proportional rewards (#880)
  [Supplier] Enforce minimum stake when staking (#857)
  [Supplier] Add `min_stake` supplier module param (#850)
  [Supplier] Add `MsgUpdateParam` to application module (#849)
  [Application] Enforce minimum stake when burning (#848)
  [DifficultyHash] Prepare for difficulty multiplier usage (#836)
  [Application] Enforce minimum stake when staking (#847)
  [Tokenomics] Prevent GMR to produce zero values (#866)
bryanchriswhite added a commit that referenced this pull request Oct 15, 2024
* pokt/main:
  [On-Chain] Refactor `uint64` type individual param update logic (#863)
  [Service] Refresh service module params logic (#861)
  [Proof] Refresh proof module params logic (#851)
  [Shared] Refresh shared module params logic (#852)
  [Docs] Fix example of how to set rev share precentage (#877)
  [Tokenomics] Implement difficulty proportional rewards (#880)
  [Supplier] Enforce minimum stake when staking (#857)
  [Supplier] Add `min_stake` supplier module param (#850)
  [Supplier] Add `MsgUpdateParam` to application module (#849)
  [Application] Enforce minimum stake when burning (#848)
  [DifficultyHash] Prepare for difficulty multiplier usage (#836)
  [Application] Enforce minimum stake when staking (#847)
  [Tokenomics] Prevent GMR to produce zero values (#866)
okdas pushed a commit that referenced this pull request Nov 14, 2024
## Summary

This PR handles the case where non zero claimed rewards produce zero GMR
rewards when the claimed rewards are too low.

## Issue

When claimed rewards are too low, they might produce a global mint
reward that is non-zero but less that 1. Since the TLM does not exepect
a zero value, this might lead to a chain halt like below.

```
ERR error processing token logic modules for claim "af85b9dd2d49f1d5b133347eac2b65e7cd7a1a555fea742adba778f711207c6b": TLM "TLMGlobalMint": mint amount cannot be zero: failed to process TLM [/go/pkg/mod/cosmossdk.io/[email protected]/errors.go:155] module=server num_claim_compute_units=2 num_relays_in_session_tree=2 proof_requirement=NOT_REQUIRED session_id=af85b9dd2d49f1d5b133347eac2b65e7cd7a1a555fea742adba778f711207c6b supplier_operator_address=pokt1ytsx06dfxrp7cgt7t95jkxuyu2m97563zqz5pn
ERR could not settle pending claims due to error TLM "TLMGlobalMint": mint amount cannot be zero: failed to process TLM [/go/pkg/mod/cosmossdk.io/[email protected]/errors.go:155] method=EndBlocker module=x/tokenomics
```

https://gist.github.com/okdas/013df312354ca0e7877a41290d94fad2

## Type of change

Select one or more from the following:

- [ ] New feature, functionality or library
- [ ] Consensus breaking; add the `consensus-breaking` label if so. See
#791 for details
- [x] 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
- [ ] I have left TODOs throughout the codebase, if applicable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devnet devnet-test-e2e push-image CI related - pushes images to ghcr.io tokenomics Token Economics - what else do you need?
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants