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

[Utility][Morse Parity] Built In Revenue Share #496

Closed
8 tasks
Olshansk opened this issue Apr 25, 2024 · 0 comments
Closed
8 tasks

[Utility][Morse Parity] Built In Revenue Share #496

Olshansk opened this issue Apr 25, 2024 · 0 comments
Assignees
Labels
protocol General core protocol related changes utility

Comments

@Olshansk
Copy link
Member

Olshansk commented Apr 25, 2024

Objective

Feature parity with Supplier Revenue Share from Morse.

Origin Document

Goals

  • Achieve supplier revenue share parity w/ Morse
  • Mimic the same business logic in terms of reward sharing; see the RewardDelegators param in pocket-core
  • Create a better user interface than how stakeNew works (see below) by allowing to set the complex configurations via a yaml file (like we do elsewhere)
pocket nodes stakeNew \
    $OPERATOR_PUBKEY \
    $OUTPUT_ADDR_NEW \
    $OUTPUT_ADDR_OLD \
    $STAKE_PLUS_1 \
    $CHAINS \
    $URL \
    $COPY_PASTE_OF_reward_delegators_FROM_RESULT_ABOVE \
    mainnet \
    10000 \
    "changing output address from {} to {}"

Deliverables

  • Research Morse: Study & understand how RevShare works in Morse
  • Governance: Add any necessary governance parameters (if need be)
  • Implement: Implement supplier revenue share in Shannon
  • CLI: Update the poktrolld (if necessary) to support updating the revenue sharing governance parameter
  • Test: Add unit, integration and E2E tests
  • Tooling: Add Makefile targets to easily trigger (on LocalNet) and test (e2e) modifying / updating / testing different revenue share configurations TTM values
  • Document: Add a new page to dev.poktroll.com explaining how revenue sharing works and how to use it
  • Comments: Add/update TODOs and comments alongside the source code so it is easier to follow.

Non-goals / Non-deliverables

  • Expanding beyond what Morse has for RevShare

Estimated Days of Work

3 days

Disclaimer: This is the total projected number of estimated hours to completion & merge. The owner of this tickets is expected to use this GitHub issue to communicate with the core protocol team along the way, with update & feedback for each deliverable throughout the duration of this work._


Creator: @Olshansk
Co-Owners: @moatus

@Olshansk Olshansk added protocol General core protocol related changes utility labels Apr 25, 2024
@Olshansk Olshansk changed the title [REPLACE_WITH_IDENTIFIER] Provide a descriptive title [Utility] Built In Revenue Share Apr 25, 2024
@Olshansk Olshansk added the community A ticket intended to potentially be picked up by a community member label Apr 25, 2024
@Olshansk Olshansk added this to Shannon Jul 3, 2024
@Olshansk Olshansk moved this to 🔖 Ready in Shannon Jul 3, 2024
@Olshansk Olshansk added this to the Shannon Beta TestNet Launch milestone Jul 3, 2024
@Olshansk Olshansk removed the community A ticket intended to potentially be picked up by a community member label Jul 4, 2024
@Olshansk Olshansk changed the title [Utility] Built In Revenue Share [Utility][Morse Parity] Built In Revenue Share Jul 4, 2024
@red-0ne red-0ne moved this from 🔖 Ready to 🏗 In progress in Shannon Aug 5, 2024
@red-0ne red-0ne moved this from 🏗 In progress to 👀 In review in Shannon Aug 10, 2024
red-0ne added a commit that referenced this issue Aug 15, 2024
## Summary

This PR implements rev share feature for supplier rewards.
* Adds a `Supplier.RevShare` slice property.
* Adds the corresponding supplier staking configuration parser along
with its tests.
* Updates the tests to include the mandatory `Supplier.RevShare`
property.
* Includes revshare testing in the tokenomics test suite.
* Updates the supplier staking config documentation

_Note: ~1100LOC are protobuf autogenerated code._

## Issue

- #496 

## Type of change

Select one or more:

- [x] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Testing

**Documentation changes** (only if making doc changes)
- [x] `make docusaurus_start`; only needed if you make doc changes

**Local Testing** (only if making code changes)
- [x] **Unit Tests**: `make go_develop_and_test`
- [x] **LocalNet E2E Tests**: `make test_e2e`
- See [quickstart
guide](https://dev.poktroll.com/developer_guide/quickstart) for
instructions

**PR Testing** (only if making code changes)
- [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR.
- **THIS IS VERY EXPENSIVE**, so only do it after all the reviews are
complete.
- Optionally run `make trigger_ci` if you want to re-trigger tests
without any code changes
- If tests fail, try re-running failed tests only using the GitHub UI as
shown
[here](https://github.com/pokt-network/poktroll/assets/1892194/607984e9-0615-4569-9452-4c730190c1d2)


## 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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced flexible revenue sharing configurations for suppliers,
allowing for detailed management of service revenue shares.
- Added new fields to configuration files and structures to support
default and service-specific revenue share percentages.
- Implemented stricter validation for revenue share entries to ensure
compliance with defined criteria.

- **Bug Fixes**
- Enhanced error handling related to invalid revenue shares and owner
addresses in configurations.

- **Tests**
- Expanded test coverage to include revenue sharing logic, ensuring
robust validation of configurations and expected behaviors.
- Added new test cases for various scenarios, including configurations
with default and service-specific revenue shares.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Daniel Olshansky <[email protected]>
@red-0ne red-0ne closed this as completed Aug 15, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Shannon Aug 15, 2024
okdas pushed a commit that referenced this issue Nov 14, 2024
## Summary

This PR implements rev share feature for supplier rewards.
* Adds a `Supplier.RevShare` slice property.
* Adds the corresponding supplier staking configuration parser along
with its tests.
* Updates the tests to include the mandatory `Supplier.RevShare`
property.
* Includes revshare testing in the tokenomics test suite.
* Updates the supplier staking config documentation

_Note: ~1100LOC are protobuf autogenerated code._

## Issue

- #496 

## Type of change

Select one or more:

- [x] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Testing

**Documentation changes** (only if making doc changes)
- [x] `make docusaurus_start`; only needed if you make doc changes

**Local Testing** (only if making code changes)
- [x] **Unit Tests**: `make go_develop_and_test`
- [x] **LocalNet E2E Tests**: `make test_e2e`
- See [quickstart
guide](https://dev.poktroll.com/developer_guide/quickstart) for
instructions

**PR Testing** (only if making code changes)
- [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR.
- **THIS IS VERY EXPENSIVE**, so only do it after all the reviews are
complete.
- Optionally run `make trigger_ci` if you want to re-trigger tests
without any code changes
- If tests fail, try re-running failed tests only using the GitHub UI as
shown
[here](https://github.com/pokt-network/poktroll/assets/1892194/607984e9-0615-4569-9452-4c730190c1d2)


## 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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced flexible revenue sharing configurations for suppliers,
allowing for detailed management of service revenue shares.
- Added new fields to configuration files and structures to support
default and service-specific revenue share percentages.
- Implemented stricter validation for revenue share entries to ensure
compliance with defined criteria.

- **Bug Fixes**
- Enhanced error handling related to invalid revenue shares and owner
addresses in configurations.

- **Tests**
- Expanded test coverage to include revenue sharing logic, ensuring
robust validation of configurations and expected behaviors.
- Added new test cases for various scenarios, including configurations
with default and service-specific revenue shares.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Daniel Olshansky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol General core protocol related changes utility
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants