Documentation
¶
Index ¶
- func EntitlementPoolInvariant(k Keeper) sdk.Invariant
- func EpochSpentInvariant(k Keeper) sdk.Invariant
- func GasCreditConservationInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(k Keeper) types.MsgServer
- func OneSettlementInvariant(k Keeper) sdk.Invariant
- func OpenBudgetPoolInvariant(k Keeper) sdk.Invariant
- func OpenChallengeEscrowInvariant(k Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SettlementAttestationInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) Application(goCtx context.Context, req *types.QueryApplicationRequest) (*types.QueryApplicationResponse, error)
- func (k Keeper) Applications(goCtx context.Context, req *types.QueryApplicationsRequest) (*types.QueryApplicationsResponse, error)
- func (k Keeper) Attestation(goCtx context.Context, req *types.QueryAttestationRequest) (*types.QueryAttestationResponse, error)
- func (k Keeper) Attestations(goCtx context.Context, req *types.QueryAttestationsRequest) (*types.QueryAttestationsResponse, error)
- func (k Keeper) AutoConsumeForTx(ctx sdk.Context, feePayer sdk.AccAddress, gasUsed uint64, sourceTxHash []byte) error
- func (k Keeper) Candidate(goCtx context.Context, req *types.QueryCandidateRequest) (*types.QueryCandidateResponse, error)
- func (k Keeper) Challenge(goCtx context.Context, req *types.QueryChallengeRequest) (*types.QueryChallengeResponse, error)
- func (k Keeper) ConsumeGasCredit(ctx sdk.Context, appID []byte, gasPayer string, amount string, ...) (remaining string, err error)
- func (k Keeper) DeleteGasPayerIndex(ctx sdk.Context, payer string)
- func (k Keeper) DeleteOpenChallengeIndex(ctx sdk.Context, appID []byte, epoch, challengeID uint64)
- func (k Keeper) DeleteOpenEntitlementChallenge(ctx sdk.Context, entitlementID, challenger string)
- func (k Keeper) Entitlement(goCtx context.Context, req *types.QueryEntitlementRequest) (*types.QueryEntitlementResponse, error)
- func (k Keeper) EntitlementChallenge(goCtx context.Context, req *types.QueryEntitlementChallengeRequest) (*types.QueryEntitlementChallengeResponse, error)
- func (k Keeper) EntitlementsByApp(goCtx context.Context, req *types.QueryEntitlementsByAppRequest) (*types.QueryEntitlementsByAppResponse, error)
- func (k Keeper) EpochBudget(goCtx context.Context, req *types.QueryEpochBudgetRequest) (*types.QueryEpochBudgetResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GasCredit(goCtx context.Context, req *types.QueryGasCreditRequest) (*types.QueryGasCreditResponse, error)
- func (k Keeper) GasCreditConsumptions(goCtx context.Context, req *types.QueryGasCreditConsumptionsRequest) (*types.QueryGasCreditConsumptionsResponse, error)
- func (k Keeper) GetAppIDByGasPayer(ctx sdk.Context, payer string) ([]byte, bool)
- func (k Keeper) GetApplication(ctx sdk.Context, appID []byte) (types.Application, bool)
- func (k Keeper) GetAssessmentSigner(ctx sdk.Context, keyID string) (types.AssessmentSigner, bool)
- func (k Keeper) GetAttestation(ctx sdk.Context, appID []byte, epoch uint64) (types.AttestationCommitment, bool)
- func (k Keeper) GetCandidate(ctx sdk.Context, entitlementID string) (types.Candidate, bool)
- func (k Keeper) GetChallenge(ctx sdk.Context, id uint64) (types.Challenge, bool)
- func (k Keeper) GetCredentialEntitlement(ctx sdk.Context, credentialID string) (string, bool)
- func (k Keeper) GetEntitlement(ctx sdk.Context, entitlementID string) (types.Entitlement, bool)
- func (k Keeper) GetEntitlementChallenge(ctx sdk.Context, challengeID string) (types.EntitlementChallenge, bool)
- func (k Keeper) GetEntitlementPool(ctx sdk.Context, poolID string) (types.Pool, bool)
- func (k Keeper) GetEpochBudget(ctx sdk.Context, epoch uint64) (types.EpochBudget, bool)
- func (k Keeper) GetGasCredit(ctx sdk.Context, appID []byte) (types.GasCreditAccount, bool)
- func (k Keeper) GetNextChallengeID(ctx sdk.Context) uint64
- func (k Keeper) GetOpenEntitlementChallenge(ctx sdk.Context, entitlementID, challenger string) (string, bool)
- func (k Keeper) GetOrCreateGasCredit(ctx sdk.Context, appID []byte) types.GasCreditAccount
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetRoleKey(ctx sdk.Context, role types.EntitlementRole, keyID string) (types.RoleKey, bool)
- func (k Keeper) GetSettlement(ctx sdk.Context, appID []byte, epoch uint64) (types.Settlement, bool)
- func (k Keeper) HasAnyEntitlementChallenge(ctx sdk.Context, entitlementID string) bool
- func (k Keeper) HasAuthNonce(ctx sdk.Context, role types.EntitlementRole, keyID, nonce string) bool
- func (k Keeper) HasCredentialID(ctx sdk.Context, credentialID string) bool
- func (k Keeper) HasDismissedEntitlementChallengeResolution(ctx sdk.Context, entitlementID, digest string) bool
- func (k Keeper) HasGasCreditConsumption(ctx sdk.Context, appID, sourceTx []byte) bool
- func (k Keeper) HasOpenChallenge(ctx sdk.Context, appID []byte, epoch uint64) bool
- func (k Keeper) HasOpenOrUpheldEntitlementChallenge(ctx sdk.Context, entitlementID string) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)
- func (k Keeper) IsEntitlementFlowEnabled(ctx sdk.Context, pool types.Pool) bool
- func (k Keeper) IterateAssessmentSigners(ctx sdk.Context, fn func(types.AssessmentSigner) bool)
- func (k Keeper) IterateAuthNonces(ctx sdk.Context, fn func(string) bool)
- func (k Keeper) IterateEntitlementChallenges(ctx sdk.Context, fn func(types.EntitlementChallenge) bool)
- func (k Keeper) IterateRoleKeys(ctx sdk.Context, role types.EntitlementRole, fn func(types.RoleKey) bool)
- func (k Keeper) ListOpenChallengeIDs(ctx sdk.Context, appID []byte, epoch uint64) []uint64
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OpenChallenges(goCtx context.Context, req *types.QueryOpenChallengesRequest) (*types.QueryOpenChallengesResponse, error)
- func (k Keeper) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Pool(goCtx context.Context, req *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
- func (k Keeper) Roles(goCtx context.Context, req *types.QueryRolesRequest) (*types.QueryRolesResponse, error)
- func (k Keeper) SetApplication(ctx sdk.Context, app types.Application)
- func (k Keeper) SetAssessmentSigner(ctx sdk.Context, s types.AssessmentSigner)
- func (k Keeper) SetAttestation(ctx sdk.Context, a types.AttestationCommitment)
- func (k Keeper) SetAuthNonce(ctx sdk.Context, role types.EntitlementRole, keyID, nonce string, ...)
- func (k Keeper) SetCandidate(ctx sdk.Context, c types.Candidate)
- func (k Keeper) SetChallenge(ctx sdk.Context, c types.Challenge)
- func (k Keeper) SetCredentialIndex(ctx sdk.Context, credentialID, entitlementID string)
- func (k Keeper) SetEntitlement(ctx sdk.Context, e types.Entitlement)
- func (k Keeper) SetEntitlementChallenge(ctx sdk.Context, c types.EntitlementChallenge)
- func (k Keeper) SetEntitlementPool(ctx sdk.Context, p types.Pool)
- func (k Keeper) SetGasCredit(ctx sdk.Context, a types.GasCreditAccount)
- func (k Keeper) SetGasCreditConsumption(ctx sdk.Context, c types.GasCreditConsumption)
- func (k Keeper) SetGasPayerIndex(ctx sdk.Context, payer string, appID []byte) error
- func (k Keeper) SetNextChallengeID(ctx sdk.Context, id uint64)
- func (k Keeper) SetOpenChallengeIndex(ctx sdk.Context, appID []byte, epoch, challengeID uint64)
- func (k Keeper) SetOpenEntitlementChallenge(ctx sdk.Context, entitlementID, challenger, challengeID string)
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error
- func (k Keeper) SetRoleKey(ctx sdk.Context, rk types.RoleKey)
- func (k Keeper) SetSettlement(ctx sdk.Context, s types.Settlement)
- func (k Keeper) Settlement(goCtx context.Context, req *types.QuerySettlementRequest) (*types.QuerySettlementResponse, error)
- func (k Keeper) Settlements(goCtx context.Context, req *types.QuerySettlementsRequest) (*types.QuerySettlementsResponse, error)
- func (k Keeper) StoreEpochBudget(ctx sdk.Context, b types.EpochBudget)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntitlementPoolInvariant ¶
EntitlementPoolInvariant checks funded = available + reserved + paid per pool and, per denom, module balance >= Σ(available + reserved) across all pools sharing that denom (UGE doc15: unpaid liability must be fully backed).
func EpochSpentInvariant ¶
EpochSpentInvariant checks spent <= limit for every epoch budget.
func GasCreditConservationInvariant ¶
GasCreditConservationInvariant checks balance + total_consumed == total_issued.
func NewMsgServerImpl ¶
NewMsgServerImpl returns a MsgServer implementation.
func OneSettlementInvariant ¶
OneSettlementInvariant is a structural check: settlement keys are unique by construction.
func OpenBudgetPoolInvariant ¶
OpenBudgetPoolInvariant checks sum(limit-spent) over open budgets per denom does not exceed the reward pool balance (vector: released/commitment vs pool).
func OpenChallengeEscrowInvariant ¶
OpenChallengeEscrowInvariant checks challenge escrow balance covers sum of OPEN attestation bonds plus OPEN V1 entitlement challenge deposits per denom.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers appmining ledger invariants.
func SettlementAttestationInvariant ¶
SettlementAttestationInvariant checks each settlement references a FINALIZED attestation.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the appmining store.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, bank types.BankKeeper, ak types.AccountKeeper, ) Keeper
NewKeeper creates a new appmining Keeper.
func (Keeper) Application ¶
func (k Keeper) Application(goCtx context.Context, req *types.QueryApplicationRequest) (*types.QueryApplicationResponse, error)
func (Keeper) Applications ¶
func (k Keeper) Applications(goCtx context.Context, req *types.QueryApplicationsRequest) (*types.QueryApplicationsResponse, error)
func (Keeper) Attestation ¶
func (k Keeper) Attestation(goCtx context.Context, req *types.QueryAttestationRequest) (*types.QueryAttestationResponse, error)
func (Keeper) Attestations ¶
func (k Keeper) Attestations(goCtx context.Context, req *types.QueryAttestationsRequest) (*types.QueryAttestationsResponse, error)
func (Keeper) AutoConsumeForTx ¶
func (k Keeper) AutoConsumeForTx(ctx sdk.Context, feePayer sdk.AccAddress, gasUsed uint64, sourceTxHash []byte) error
AutoConsumeForTx debits gas credit for an enrolled fee payer after a Cosmos tx. Not enrolled → no-op. Insufficient/paused/inactive → skip event, no error (ledger path must not roll back an otherwise-valid Cosmos tx until fee replacement lands). Unexpected store errors are returned.
func (Keeper) Candidate ¶
func (k Keeper) Candidate(goCtx context.Context, req *types.QueryCandidateRequest) (*types.QueryCandidateResponse, error)
func (Keeper) Challenge ¶
func (k Keeper) Challenge(goCtx context.Context, req *types.QueryChallengeRequest) (*types.QueryChallengeResponse, error)
func (Keeper) ConsumeGasCredit ¶
func (k Keeper) ConsumeGasCredit( ctx sdk.Context, appID []byte, gasPayer string, amount string, sourceTxHash []byte, ) (remaining string, err error)
ConsumeGasCredit debits gas credit for an authorized payer. Shared by Msg server and Cosmos PostHandler auto-consume.
Storage note (P1-2): GasCreditConsumption records grow unboundedly by design and are NOT prunable. Each record is the only thing binding a source tx hash to exactly one debit; deleting one would let the same sourceTxHash be debited again (MsgConsumeGasCredit is a separate tx from the source tx, so cometbft dedup does not protect it). Growth is bounded in rate: one ~110B record per actual gas consumption, same order as the tx index itself. AuthNonce (the other append-only set) IS pruned -- see store.pruneAuthNonces -- because wire proofs carry expires_at.
func (Keeper) DeleteGasPayerIndex ¶
DeleteGasPayerIndex removes the reverse index entry.
func (Keeper) DeleteOpenChallengeIndex ¶
func (Keeper) DeleteOpenEntitlementChallenge ¶
func (Keeper) Entitlement ¶
func (k Keeper) Entitlement(goCtx context.Context, req *types.QueryEntitlementRequest) (*types.QueryEntitlementResponse, error)
func (Keeper) EntitlementChallenge ¶
func (k Keeper) EntitlementChallenge(goCtx context.Context, req *types.QueryEntitlementChallengeRequest) (*types.QueryEntitlementChallengeResponse, error)
func (Keeper) EntitlementsByApp ¶
func (k Keeper) EntitlementsByApp(goCtx context.Context, req *types.QueryEntitlementsByAppRequest) (*types.QueryEntitlementsByAppResponse, error)
func (Keeper) EpochBudget ¶
func (k Keeper) EpochBudget(goCtx context.Context, req *types.QueryEpochBudgetRequest) (*types.QueryEpochBudgetResponse, error)
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis exports full module state (BLOCK-2 fix).
func (Keeper) GasCredit ¶
func (k Keeper) GasCredit(goCtx context.Context, req *types.QueryGasCreditRequest) (*types.QueryGasCreditResponse, error)
func (Keeper) GasCreditConsumptions ¶
func (k Keeper) GasCreditConsumptions(goCtx context.Context, req *types.QueryGasCreditConsumptionsRequest) (*types.QueryGasCreditConsumptionsResponse, error)
func (Keeper) GetAppIDByGasPayer ¶
GetAppIDByGasPayer returns the app bound to this gas payer, if any.
func (Keeper) GetApplication ¶
func (Keeper) GetAssessmentSigner ¶
func (Keeper) GetAttestation ¶
func (Keeper) GetCandidate ¶
func (Keeper) GetChallenge ¶
func (Keeper) GetCredentialEntitlement ¶
func (Keeper) GetEntitlement ¶
func (Keeper) GetEntitlementChallenge ¶
func (Keeper) GetEntitlementPool ¶
func (Keeper) GetEpochBudget ¶
func (Keeper) GetGasCredit ¶
func (Keeper) GetOpenEntitlementChallenge ¶
func (Keeper) GetOrCreateGasCredit ¶
func (Keeper) GetRoleKey ¶
func (Keeper) GetSettlement ¶
func (Keeper) HasAnyEntitlementChallenge ¶
HasAnyEntitlementChallenge reports whether the candidate has any stored challenge record (any status). Used by the no-challenge approve path (UGE DEC-01 scheme C): empty challenge_resolution_hash requires zero challenges.
func (Keeper) HasAuthNonce ¶
HasAuthNonce reports whether the wire-v1 nonce was already consumed.
func (Keeper) HasCredentialID ¶
HasCredentialID reports whether credential_id was consumed. Index entries are never deleted — including after candidate REJECTED (D-A permanent one-shot).
func (Keeper) HasDismissedEntitlementChallengeResolution ¶
func (k Keeper) HasDismissedEntitlementChallengeResolution(ctx sdk.Context, entitlementID, digest string) bool
HasDismissedEntitlementChallengeResolution reports whether the candidate has a DISMISSED challenge whose stored ResolutionDigest equals digest.
func (Keeper) HasGasCreditConsumption ¶
func (Keeper) HasOpenChallenge ¶
func (Keeper) HasOpenOrUpheldEntitlementChallenge ¶
HasOpenOrUpheldEntitlementChallenge reports whether any challenge for the candidate is OPEN or UPHELD (blocks approval). DISMISSED does not block.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)
InitGenesis imports genesis state.
func (Keeper) IsEntitlementFlowEnabled ¶
IsEntitlementFlowEnabled reports whether V1 business msgs may run for pool: per-pool pause/min-funded gates, plus denom-aggregated available+reserved <= module balance (covers multi-pool / genesis skew).
func (Keeper) IterateAssessmentSigners ¶
func (Keeper) IterateAuthNonces ¶
IterateAuthNonces walks consumed wire-v1 nonces ("role/key_id/nonce"), reconstructing the identity from the store key so the value format stays free to evolve.
func (Keeper) IterateEntitlementChallenges ¶
func (k Keeper) IterateEntitlementChallenges(ctx sdk.Context, fn func(types.EntitlementChallenge) bool)
IterateEntitlementChallenges walks every entitlement challenge record.
func (Keeper) IterateRoleKeys ¶
func (k Keeper) IterateRoleKeys(ctx sdk.Context, role types.EntitlementRole, fn func(types.RoleKey) bool)
IterateRoleKeys walks every registered key of one role (key order = key_id).
func (Keeper) ListOpenChallengeIDs ¶
ListOpenChallengeIDs returns open challenge ids for (app, epoch).
func (Keeper) OpenChallenges ¶
func (k Keeper) OpenChallenges(goCtx context.Context, req *types.QueryOpenChallengesRequest) (*types.QueryOpenChallengesResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Pool ¶
func (k Keeper) Pool(goCtx context.Context, req *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
Pool returns the entitlement pool record, module balance and flow status.
func (Keeper) Roles ¶
func (k Keeper) Roles(goCtx context.Context, req *types.QueryRolesRequest) (*types.QueryRolesResponse, error)
Roles returns registered role keys, optionally filtered by role and status.
func (Keeper) SetApplication ¶
func (k Keeper) SetApplication(ctx sdk.Context, app types.Application)
func (Keeper) SetAssessmentSigner ¶
func (k Keeper) SetAssessmentSigner(ctx sdk.Context, s types.AssessmentSigner)
func (Keeper) SetAttestation ¶
func (k Keeper) SetAttestation(ctx sdk.Context, a types.AttestationCommitment)
func (Keeper) SetAuthNonce ¶
func (k Keeper) SetAuthNonce(ctx sdk.Context, role types.EntitlementRole, keyID, nonce string, expiresAt int64)
SetAuthNonce consumes the wire-v1 nonce. The value is the proof's expires_at as 8-byte big-endian, used only for pruning; the genesis string ("role_wire/key_id/nonce") is reconstructed from the key, which carries the full identity. Legacy entries written before the expiry format keep their old string values -- they are never pruned and export identically.
func (Keeper) SetCredentialIndex ¶
func (Keeper) SetEntitlement ¶
func (k Keeper) SetEntitlement(ctx sdk.Context, e types.Entitlement)
func (Keeper) SetEntitlementChallenge ¶
func (k Keeper) SetEntitlementChallenge(ctx sdk.Context, c types.EntitlementChallenge)
func (Keeper) SetEntitlementPool ¶
func (Keeper) SetGasCredit ¶
func (k Keeper) SetGasCredit(ctx sdk.Context, a types.GasCreditAccount)
func (Keeper) SetGasCreditConsumption ¶
func (k Keeper) SetGasCreditConsumption(ctx sdk.Context, c types.GasCreditConsumption)
func (Keeper) SetGasPayerIndex ¶
SetGasPayerIndex binds payer -> app_id. Rejects cross-app rebind.
func (Keeper) SetOpenChallengeIndex ¶
func (Keeper) SetOpenEntitlementChallenge ¶
func (Keeper) SetSettlement ¶
func (k Keeper) SetSettlement(ctx sdk.Context, s types.Settlement)
func (Keeper) Settlement ¶
func (k Keeper) Settlement(goCtx context.Context, req *types.QuerySettlementRequest) (*types.QuerySettlementResponse, error)
func (Keeper) Settlements ¶
func (k Keeper) Settlements(goCtx context.Context, req *types.QuerySettlementsRequest) (*types.QuerySettlementsResponse, error)
func (Keeper) StoreEpochBudget ¶
func (k Keeper) StoreEpochBudget(ctx sdk.Context, b types.EpochBudget)
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a helper for in-place store migrations.
func (Migrator) Migrate1to2 ¶
Migrate1to2 pauses the legacy attestation / GasCredit / Finalize settlement flow for audit-only retention and ensures the V1 entitlement pool module account exists. It does NOT convert POC settlements into Entitlements.