Skip to content

Commit

Permalink
chore: address review change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne committed Jan 24, 2025
1 parent b4e5074 commit 4ed42b3
Show file tree
Hide file tree
Showing 17 changed files with 1,724 additions and 334 deletions.
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.
message EventProofValidityChecked {
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"];
}
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;
}

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;
}
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

0 comments on commit 4ed42b3

Please sign in to comment.