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

[SessionManager] Skip claims creation if supplier operator balance is too low #817

Merged
merged 28 commits into from
Sep 24, 2024

Conversation

red-0ne
Copy link
Contributor

@red-0ne red-0ne commented Sep 11, 2024

Summary

This PR introduces filters in the SubmitClaims step to ensure that the SessionManager only submits claims it can afford to prove.

Before each submission, it checks the SupplierOperator balance and filters the claims based on the available funds.

Claims are sorted by descending profitability to maximize rewards.

Issue

Since submitting a proof incurs a cost, a SupplierOperator without sufficient funds would be unable to submit the required proof.

This could result in the supplier's stake being slashed if a proof submission is required.

The SessionManager must verify that it can afford a proof submission before creating the corresponding claim.

Type of change

Select one or more from the following:

Testing

  • 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

  • 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 relayminer Changes related to the Relayminer session Changes related to Session management proof Claim & Proof life cycle labels Sep 11, 2024
@red-0ne red-0ne added this to the Shannon Beta TestNet Launch milestone Sep 11, 2024
@red-0ne red-0ne self-assigned this Sep 11, 2024
@Olshansk Olshansk changed the base branch from feat/slash-missing-proofs to main September 19, 2024 22:55
@Olshansk Olshansk changed the base branch from main to feat/slash-missing-proofs September 19, 2024 22:56
@red-0ne red-0ne changed the base branch from feat/slash-missing-proofs to main September 20, 2024 15:36
pkg/relayer/session/claim.go Show resolved Hide resolved
pkg/relayer/session/claim.go Outdated Show resolved Hide resolved
pkg/relayer/session/claim.go Show resolved Hide resolved
pkg/relayer/session/claim.go Show resolved Hide resolved
pkg/relayer/session/claim.go Show resolved Hide resolved
pkg/relayer/session/session_test.go Outdated Show resolved Hide resolved
pkg/relayer/session/session_test.go Show resolved Hide resolved
pkg/relayer/session/session_test.go Outdated Show resolved Hide resolved
pkg/relayer/session/session_test.go Show resolved Hide resolved
pkg/relayer/session/session_test.go Show resolved Hide resolved
pkg/relayer/session/claim.go Outdated Show resolved Hide resolved
Copy link

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 817)
Grafana network dashboard for devnet-issue-817

@github-actions github-actions bot added devnet push-image CI related - pushes images to ghcr.io labels Sep 23, 2024
@red-0ne red-0ne merged commit b39f84b into main Sep 24, 2024
10 checks passed
bryanchriswhite added a commit that referenced this pull request Sep 24, 2024
…rge/integration-app_x_sup-stake-evts

* issues/799/refactor/integration-app:
  chore: review feedback improvements
  [SMST] feat: Use compact SMST proofs (#823)
  [SessionManager] Skip claims creation if supplier operator balance is too low (#817)
  chore: self-review improvements
bryanchriswhite added a commit that referenced this pull request Sep 24, 2024
… issues/799/tests/params

* issues/799/merge/integration-app_x_sup-stake-evts:
  chore: review feedback improvements
  [SMST] feat: Use compact SMST proofs (#823)
  [SessionManager] Skip claims creation if supplier operator balance is too low (#817)
  chore: self-review improvements

# Conflicts:
#	tests/integration/tokenomics/relay_mining_integration_test.go
bryanchriswhite added a commit that referenced this pull request Sep 24, 2024
…rge/integration-app_x_transfer-period-base

* issues/799/refactor/integration-app:
  fixup! HEAD^
  fix: linter errors
  chore: review feedback improvements
  [SMST] feat: Use compact SMST proofs (#823)
  [SessionManager] Skip claims creation if supplier operator balance is too low (#817)
  chore: self-review improvements
  [Code Health] refactor: rename `ApplicationTransfer` msgs (#788)
  [Docs] Add operations documentation about proof submission fee (#806)
  [Testing] Fix non-idempotency in (and speed up) supplier staking tests (#815)
bryanchriswhite added a commit that referenced this pull request Sep 24, 2024
…' into issues/657/chore/app-transfer-period

* issues/657/merge/integration-app_x_transfer-period-base:
  fixup! HEAD^
  fix: linter errors
  chore: review feedback improvements
  [SMST] feat: Use compact SMST proofs (#823)
  [SessionManager] Skip claims creation if supplier operator balance is too low (#817)
  chore: self-review improvements
  [Code Health] refactor: rename `ApplicationTransfer` msgs (#788)
  [Docs] Add operations documentation about proof submission fee (#806)
  [Testing] Fix non-idempotency in (and speed up) supplier staking tests (#815)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devnet devnet-test-e2e proof Claim & Proof life cycle push-image CI related - pushes images to ghcr.io relayminer Changes related to the Relayminer session Changes related to Session management
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants