Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AllClaims(ctx context.Context, req *types.QueryAllClaimsRequest) (*types.QueryAllClaimsResponse, error)
- func (k Keeper) AllProofs(ctx context.Context, req *types.QueryAllProofsRequest) (*types.QueryAllProofsResponse, error)
- func (k Keeper) Claim(ctx context.Context, req *types.QueryGetClaimRequest) (*types.QueryGetClaimResponse, error)
- func (k Keeper) EnsureValidProofSignaturesAndClosestPath(ctx context.Context, claim *types.Claim, proof *types.Proof) error
- func (k Keeper) EnsureWellFormedProof(ctx context.Context, proof *types.Proof) error
- func (k Keeper) GetAllClaims(ctx context.Context) (claims []types.Claim)
- func (k Keeper) GetAllProofs(ctx context.Context) (proofs []types.Proof)
- func (k Keeper) GetAllProofsIterator(ctx context.Context) storetypes.Iterator
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetClaim(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Claim, isClaimFound bool)
- func (k Keeper) GetParams(ctx context.Context) (params types.Params)
- func (k Keeper) GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Proof, isProofFound bool)
- func (k Keeper) Logger() log.Logger
- func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Proof(ctx context.Context, req *types.QueryGetProofRequest) (*types.QueryGetProofResponse, error)
- func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim) (_ types.ProofRequirementReason, err error)
- func (k Keeper) RemoveClaim(ctx context.Context, sessionId, supplierOperatorAddr string)
- func (k Keeper) RemoveProof(ctx context.Context, sessionId, supplierOperatorAddr string)
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k Keeper) UpsertClaim(ctx context.Context, claim types.Claim)
- func (k Keeper) UpsertProof(ctx context.Context, proof types.Proof)
- func (k Keeper) ValidateSubmittedProofs(ctx sdk.Context) (numValidProofs, numInvalidProofs uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, logger log.Logger, authority string, bankKeeper types.BankKeeper, sessionKeeper types.SessionKeeper, applicationKeeper types.ApplicationKeeper, accountKeeper types.AccountKeeper, sharedKeeper types.SharedKeeper, serviceKeeper types.ServiceKeeper, ) Keeper
func (Keeper) AllClaims ¶
func (k Keeper) AllClaims(ctx context.Context, req *types.QueryAllClaimsRequest) (*types.QueryAllClaimsResponse, error)
func (Keeper) AllProofs ¶
func (k Keeper) AllProofs( ctx context.Context, req *types.QueryAllProofsRequest, ) (*types.QueryAllProofsResponse, error)
func (Keeper) Claim ¶
func (k Keeper) Claim(ctx context.Context, req *types.QueryGetClaimRequest) (*types.QueryGetClaimResponse, error)
func (Keeper) EnsureValidProofSignaturesAndClosestPath ¶ added in v0.0.12
func (k Keeper) EnsureValidProofSignaturesAndClosestPath( ctx context.Context, claim *types.Claim, proof *types.Proof, ) error
EnsureValidProofSignaturesAndClosestPath validates:
- Proof signatures from the supplier
- Valid relay request/response signatures from the application/supplier respectively
- Closest path validation against onchain claim
Execution requirements:
- Must run in the EndBlocker of the proof submission height
- Cannot run during SubmitProof due to computational cost
NOTE: Full validation requires passing both:
- EnsureWellFormedProof
- EnsureValidProofSignaturesAndClosestPath (this function)
func (Keeper) EnsureWellFormedProof ¶ added in v0.0.12
EnsureWellFormedProof validates a supplier's proof for:
- Valid session header
- Submission height within window
- Matching relay request/response headers
- Relay Mining difficulty above reward threshold
EnsureWellFormedProof does not validate computationally expensive operations like:
- Proof relay signatures
- ClosestMerkleProof
Additional developer context as of #1031:
- This function is expected to be called from the SubmitProof messages handler
- Computationally expensive operations are left to the block's EndBlocker
NOTE: Full validation requires passing both:
- EnsureWellFormedProof (this function)
- EnsureValidProofSignaturesAndClosestPath
func (Keeper) GetAllClaims ¶
GetAllClaims returns all claim
func (Keeper) GetAllProofs ¶
GetAllProofs returns all proofs in the store
func (Keeper) GetAllProofsIterator ¶ added in v0.0.12
func (k Keeper) GetAllProofsIterator(ctx context.Context) storetypes.Iterator
GetAllProofsIterator returns an iterator for all proofs in the store
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetClaim ¶
func (k Keeper) GetClaim(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Claim, isClaimFound bool)
GetClaim returns a claim from its index
func (Keeper) GetProof ¶
func (k Keeper) GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Proof, isProofFound bool)
GetProof returns a proof from its index
func (Keeper) Params ¶
func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Proof ¶
func (k Keeper) Proof(ctx context.Context, req *types.QueryGetProofRequest) (*types.QueryGetProofResponse, error)
func (Keeper) ProofRequirementForClaim ¶ added in v0.0.9
func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim) (_ types.ProofRequirementReason, err error)
ProofRequirementForClaim checks if a proof is required for a claim. If it is not, the claim will be settled without a proof. If it is, the claim will only be settled if a valid proof is available. TODO_BETA(@olshansk): Document safety assumptions of the probabilistic proofs mechanism.
func (Keeper) RemoveClaim ¶
RemoveClaim removes a claim from the store
func (Keeper) RemoveProof ¶
RemoveProof removes a proof from the store
func (Keeper) UpsertClaim ¶
UpsertClaim set a specific claim in the store from its index
func (Keeper) UpsertProof ¶
UpsertProof set a specific proof in the store from its index
func (Keeper) ValidateSubmittedProofs ¶ added in v0.0.12
func (k Keeper) ValidateSubmittedProofs(ctx sdk.Context) (numValidProofs, numInvalidProofs uint64, err error)
ValidateSubmittedProofs performs concurrent proof validation, updating claims' proof validation states and removing processed proofs from storage.