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
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
759 changes: 723 additions & 36 deletions api/poktroll/proof/event.pulsar.go

Large diffs are not rendered by default.

165 changes: 142 additions & 23 deletions api/poktroll/proof/types.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions proto/poktroll/proof/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ message EventProofUpdated {
uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"];
cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"];
}

// Event emitted after a proof has been checked for validity.
red-0ne marked this conversation as resolved.
Show resolved Hide resolved
message EventProofValidityChecked {
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
poktroll.proof.Proof proof = 1 [(gogoproto.jsontag) = "proof"];
uint64 block_height = 2 [(gogoproto.jsontag) = "block_height"];
poktroll.proof.ClaimProofStatus proof_status = 3 [(gogoproto.jsontag) = "proof_status"];
string reason = 4 [(gogoproto.jsontag) = "reason"];
red-0ne marked this conversation as resolved.
Show resolved Hide resolved
red-0ne marked this conversation as resolved.
Show resolved Hide resolved
}
11 changes: 11 additions & 0 deletions proto/poktroll/proof/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ message Claim {
poktroll.session.SessionHeader session_header = 2;
// Root hash returned from smt.SMST#Root().
bytes root_hash = 3;
// Claim proof status captures the status of the proof for this claim.
// WARNING: This field MUST only be set by proofKeeper#EnsureValidProofSignaturesAndClosestPath
ClaimProofStatus proof_status = 4;
}
red-0ne marked this conversation as resolved.
Show resolved Hide resolved

enum ProofRequirementReason {
Expand All @@ -43,3 +46,11 @@ enum ClaimProofStage {
SETTLED = 2;
EXPIRED = 3;
}

// ClaimProofStatus defines the status of the proof for a claim.
// The default value is NOT_FOUND, whether the proof is required or not.
enum ClaimProofStatus {
NOT_FOUND = 0;
VALID = 1;
INVALID = 2;
}
red-0ne marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions testutil/testtree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,6 @@ func NewClaim(
SupplierOperatorAddress: supplierOperatorAddr,
SessionHeader: sessionHeader,
RootHash: rootHash,
ProofStatus: prooftypes.ClaimProofStatus_NOT_FOUND,
}
}
Loading
Loading