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

[Proof] Implement scalable proof validation #1031

Merged
merged 14 commits into from
Jan 30, 2025
Merged

Conversation

red-0ne
Copy link
Contributor

@red-0ne red-0ne commented Jan 17, 2025

Summary

This PR refactors proof validation by distributing it across the proof submission workflow for better scalability.

The validation process is divided into two stages:

  1. Proof Submission: Ensures the proof is well-formed and adheres to the current on-chain state.
  2. Proof Module Endblocker: Handles computationally intensive tasks using self-contained parallel verification. It includes:
    • Relay request and response signature verification.
    • Validation of the ClosestMerkleProof.

Additionally, the proof module endblocker:

  • Deletes all the processed proofs
  • Reflects the verification result in the corresponding claim's ProofStatus field.

The potential supplier slashing is retained within the SettlePendingClaims flow, ensuring a clear separation of concerns.

Issue

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 scalability proof Claim & Proof life cycle labels Jan 17, 2025
@red-0ne red-0ne added this to the Beta TestNet Iteration milestone Jan 17, 2025
@red-0ne red-0ne self-assigned this Jan 17, 2025
@okdas okdas added the push-image CI related - pushes images to ghcr.io label Jan 22, 2025
Copy link

The image is going to be pushed after the next commit.

You can use make trigger_ci to push an empty commit.

If you also want to run E2E tests, please add devnet-test-e2e label.

Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@red-0ne I did a first pass of this, but I plan to do a COMPLETE second pass as well.

This is very critical and going to need some work.

x/proof/keeper/proof.go Show resolved Hide resolved
x/proof/module/abci.go Outdated Show resolved Hide resolved
x/proof/module/abci.go Outdated Show resolved Hide resolved
x/proof/module/abci.go Outdated Show resolved Hide resolved
x/tokenomics/keeper/settle_pending_claims.go Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
@red-0ne red-0ne requested a review from Olshansk January 24, 2025 05:51
proto/poktroll/proof/event.proto Outdated Show resolved Hide resolved
proto/poktroll/proof/event.proto Show resolved Hide resolved
proto/poktroll/proof/event.proto Outdated Show resolved Hide resolved
proto/poktroll/proof/types.proto Show resolved Hide resolved
proto/poktroll/proof/types.proto Outdated Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
x/proof/keeper/validate_proofs.go Outdated Show resolved Hide resolved
x/proof/module/abci.go Outdated Show resolved Hide resolved
x/proof/module/abci.go Outdated Show resolved Hide resolved
x/tokenomics/keeper/settle_pending_claims.go Outdated Show resolved Hide resolved
@Olshansk
Copy link
Member

@red-0ne Ty for taking all of my feedback in the iteration. Looking much better!

I think it should. be g2g after another round of review.

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

@red-0ne red-0ne requested a review from Olshansk January 29, 2025 15:06
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more renaming request. Other than that g2g.

Approving prematively!

pkg/crypto/protocol/proof_path.go Outdated Show resolved Hide resolved
pkg/crypto/protocol/proof_path.go Outdated Show resolved Hide resolved
pkg/crypto/protocol/proof_path.go Outdated Show resolved Hide resolved
proto/poktroll/proof/event.proto Outdated Show resolved Hide resolved
@red-0ne red-0ne merged commit 2055b0f into main Jan 30, 2025
10 checks passed
@Olshansk
Copy link
Member

@red-0ne Let's also submit a docs PR w/ the diagram we put together in the other discussion.

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 scalability
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants