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

[Load Testing] Permissionless Demand Implementation Umbrella Ticket #758

Open
11 of 23 tasks
Olshansk opened this issue Aug 23, 2024 · 0 comments
Open
11 of 23 tasks
Assignees
Labels
on-chain On-chain business logic scalability

Comments

@Olshansk
Copy link
Member

Olshansk commented Aug 23, 2024

Objective

Ensure there will not be any scalability issues in Shannon.

This is done by:

  • Avoiding free loaders (suppliers that don't submit proofs for claims)
  • Keeping blocks size small
  • Creating incentives & disincentives to submit proofs
  • Enabling unlimited number of services & apps

Origin Document

Screenshot 2024-08-23 at 10 02 45 PM Screenshot 2024-08-23 at 9 53 06 PM

Goals

  • Understand missing gaps in the implementation of probabilistic proofs on both the supply (relayer) side & consensus (validator) side
  • Implement everything necessary to make sure Shannon demand side scales scales
  • Identify MUST have TODO for mainnet
  • Come up with new ideas to improve the overall design while keeping things simple
  • Update the documentation so all readers and ecosystem participants understand how things work
  • Keep iterations and PRs small because the scope of this can get out of hand

Deliverables

  • Ensure the ProofParams is used and reflected in the RelayMiner. It doesn't seem these are being used:

     type ProofParams interface {
     	GetRelayDifficultyTargetHash() []byte
     	GetProofRequestProbability() float32
     	GetProofRequirementThreshold() uint64
     	GetProofMissingPenalty() *cosmostypes.Coin
     }
  • Increase the tx fee of the SubmitProof msg so it's larger than a simple send

  • @Olshansk to build documentation for this. Specifically:

    • Probabilistic proofs in the Shannon. Tokenomics and incentives.
    • All the slashing conditions. Specifically, missing proofs.
    • Design & document feedback loop between Relay Mining & Probabilistic Proofs
    • Research & document whether proof_requirement_threshold needs to be a function of supplier stake. Look into x/tokenomics/keeper/settle_pending_claims.go
    • Penalize / slash the supplier if a proof is required but not available. Note: you need to determine what the slashing amount should be.
  • Implement the Relay Mining & Probabilistic Proof multiplier + closed loop systems [Tokenomics] Implement difficulty proportional rewards #840

  • Implement the supplier stake <> proof requirement threshold closed loop system

  • Implement slashing for missing proofs [Supplier] Initial slashing implementation #795

  • Look for TODOs in the code that call out SparseCompactClosestProof

  • Exploratory: Review all the probabilistic proof parameters and make sure they adjust dynamically based on the volume, similar to relay mining.

Non-goals / Non-deliverables

  • The following are requirements of [LoadTesting] Permissionless Demand Load Testing #711 being built by @okdas
    • Build the tooling for these load tests
    • Building observability tools for these tests
    • Gain an understanding into the block size
    • Get visibility
  • Diagrams that will be needed but outside of the scope:
    • Line charts showing:
      • Block size (in MB)
      • Num proofs per block
      • Total number of relays in network
    • Double bar chart showing average number of proof per application AND per service
    • Relay mining difficulty per service (already have this but make it more accessible)
      • Same chart needs to show what the multiplier looks like

Creator: @Olshansk
Co-Owners: @okdas @red-0ne

@Olshansk Olshansk added on-chain On-chain business logic scalability labels Aug 23, 2024
@Olshansk Olshansk added this to the Shannon Beta TestNet Launch milestone Aug 23, 2024
@Olshansk Olshansk changed the title [Load Testing] Permissionless Demand Implementation Umbrella Ticket [WIP][Load Testing] Permissionless Demand Implementation Umbrella Ticket Aug 23, 2024
@Olshansk Olshansk changed the title [WIP][Load Testing] Permissionless Demand Implementation Umbrella Ticket [Load Testing] Permissionless Demand Implementation Umbrella Ticket Aug 24, 2024
@Olshansk Olshansk self-assigned this Aug 26, 2024
@Olshansk Olshansk removed their assignment Sep 3, 2024
red-0ne added a commit that referenced this issue Sep 6, 2024
## Summary

This PR adds `ProofSubmissionFee` governance param as a `Coin` type.

It is based on PR #778 

## Issue

Proof messages take up a lot of block space. We need to deter submitting
unnecessary ones by making their submission payable by a governance
adjusted parameter.

The current PR is only about adding the governance param. The feature
itself will be submitted as a follow-up PR.

- #758 

## Type of change

Select one or more:

- [x] New feature, functionality or library
- [ ] 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`
- [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
red-0ne added a commit that referenced this issue Sep 6, 2024
## Summary

This PR implements payable proof submission given the proof submission
governance param.

This is a follow-up feature PR to #779 which adds the proof submission
governance param.

## Issue

Proof messages take up significant block space. We need to deter
submitting non-required ones by making proof submission payable by a
governance adjusted parameter.

- #758 

## Type of change

Select one or more:

- [x] New feature, functionality or library
- [ ] 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`
- [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
red-0ne added a commit that referenced this issue Sep 6, 2024
## Summary

This PR introduces the proof params to the `RelayMiner` so it does not
submit proofs when not required.

The E2E and `SessionManager` tests have been updated to account for
proof requirement.

## Issue

The `RelayMiner`'s `SessionManager` was systematically submitting proofs
on-chain whether they were required or not.

This led to a state chain bloat since proofs are what takes most for the
block space.

Given the permissionless nature of the protocol, this causing
scalability issues.

- #758 

## Type of change

Select one or more:

- [x] New feature, functionality or library
- [ ] 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`
- [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

---------

Co-authored-by: Daniel Olshansky <[email protected]>
red-0ne added a commit that referenced this issue Sep 18, 2024
## Summary

This PR introduces the initial implementation of `Supplier` slashing:
- Adjusts proof parameters to align with the probabilistic proofs paper.
- Adds comments on potential follow-up improvements and adjustments.
- Implements `Supplier` slashing for invalid or missing proofs.
- Unstakes a `Supplier` whose stake falls below the minimum due to
slashing.
- Move the `ComputeUnitsToTokenMultiplier` to the `shared` module.

_~1300LOC is auto-generated code_

## Issue

To enable permissionless demand, the protocol must discourage the
submission of false or invalid claims.

As part of this, `Suppliers` should be penalized for failing to comply
with the C&P life cycle rules.

- #758 

## Type of change

Select one or more from the following:

- [x] New feature, functionality or library
- [x] 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`
- [x] **LocalNet E2E Tests**: `make test_e2e`
- [x] **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: Daniel Olshansky <[email protected]>
red-0ne added a commit that referenced this issue Sep 23, 2024
## Summary

Add documentation about payable proof submissions to the
`relayminer_config` doc.

## Issue

Now that proof submission is a payable message. The `Supplier` operators
need to be aware that they have to have enough funds to cover for proof
submission.

- #758 

## 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
- [ ] Bug fix
- [ ] Code health or cleanup
- [x] Documentation
- [ ] Other (specify)

## Testing

- [x] **Documentation**: `make docusaurus_start`; only needed if you
make doc changes
- [ ] **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
- [ ] 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
bryanchriswhite pushed a commit that referenced this issue Sep 23, 2024
## Summary

Add documentation about payable proof submissions to the
`relayminer_config` doc.

## Issue

Now that proof submission is a payable message. The `Supplier` operators
need to be aware that they have to have enough funds to cover for proof
submission.

- #758 

## 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
- [ ] Bug fix
- [ ] Code health or cleanup
- [x] Documentation
- [ ] Other (specify)

## Testing

- [x] **Documentation**: `make docusaurus_start`; only needed if you
make doc changes
- [ ] **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
- [ ] 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
red-0ne added a commit that referenced this issue Sep 24, 2024
## Summary

This PR changes the proofs being sent in `MsgSubmitPRoof` and stored by
the `SubmitProof` keeper from `SparseMerkleClosestProof` to
`SparseCompactMerkleClosestProof`.

## Issue

`Proofs` one of the most block-space consuming primitives. The SMST
support compact proofs that could help reduce their sizes.

- #758 

## Type of change

Select one or more from the following:

- [x] New feature, functionality or library
- [x] 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
red-0ne added a commit that referenced this issue Oct 11, 2024
## 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

---------

Co-authored-by: Bryan White <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: red-0ne <[email protected]>
red-0ne added a commit that referenced this issue Oct 14, 2024
**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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-chain On-chain business logic scalability
Projects
Status: 🏗 In progress
Development

No branches or pull requests

3 participants