Documentation
¶
Index ¶
- Variables
- type Keeper
- func (k *Keeper) BeginBlock(ctx sdk.Context)
- func (k *Keeper) ExtendVoteHandler() sdk.ExtendVoteHandler
- func (k *Keeper) GetAllProviderMessages(ctx sdk.Context) []types.ProviderMessage
- func (k *Keeper) GetCachedActiveLeases() []types.ActiveLease
- func (k *Keeper) GetCachedEndpoint() (string, bool)
- func (k *Keeper) GetContractAddr(ctx sdk.Context) string
- func (k *Keeper) GetLastLeaseRefresh(ctx sdk.Context) int64
- func (k *Keeper) GetLastRefreshHeight(ctx sdk.Context) int64
- func (k *Keeper) GetLastSudoPush(ctx sdk.Context) int64
- func (k *Keeper) LoadOracleConfigFromKV(ctx sdk.Context) (types.OracleConfig, bool)
- func (k *Keeper) Params() types.Params
- func (k *Keeper) PrepareProposalHandler() sdk.PrepareProposalHandler
- func (k *Keeper) ProcessOracleTxFromBlock(ctx sdk.Context, txs [][]byte)
- func (k *Keeper) ProcessProposalHandler() sdk.ProcessProposalHandler
- func (k *Keeper) RefreshActiveLeases(ctx sdk.Context)
- func (k *Keeper) RefreshOracleEndpoint(ctx sdk.Context)
- func (k *Keeper) RestoreCachedEndpoint(ctx sdk.Context)
- func (k *Keeper) SaveOracleConfigToKV(ctx sdk.Context, cfg types.OracleConfig)
- func (k *Keeper) SetContractAddr(ctx sdk.Context, addr string)
- func (k *Keeper) SetLastLeaseRefresh(ctx sdk.Context, h int64)
- func (k *Keeper) SetLastRefreshHeight(ctx sdk.Context, h int64)
- func (k *Keeper) SetLastSudoPush(ctx sdk.Context, h int64)
- func (k *Keeper) StoreProviderMessage(ctx sdk.Context, msg types.ProviderMessage)
- func (k *Keeper) SudoPushProviderMessages(ctx sdk.Context)
- func (k *Keeper) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrProbeEndpointInvalid marks a registered provider endpoint the // probe guard could not even parse into a URL/host to evaluate. ErrProbeEndpointInvalid = errors.New("probe endpoint invalid") // ErrProbeSchemeNotAllowed rejects probe endpoints whose scheme is // not http or https (Phase 3.3 SSRF guard). ErrProbeSchemeNotAllowed = errors.New("probe endpoint scheme not http(s)") // ErrProbeTargetBlocked rejects probe targets that resolve (or, at // dial time, connect) to a loopback, link-local — including the // 169.254.0.0/16 cloud metadata range — or unspecified address // while Params.AllowPrivateProbeTargets is false (Phase 3.3 SSRF // guard). ErrProbeTargetBlocked = errors.New("probe target address blocked by SSRF guard") )
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper aggregates the valiporacle module's runtime state. P0.2 added `params`, a shared `*http.Client`, and a per-provider circuit breaker so ExtendVote probes reuse connections, apply operator-tunable limits, and back off against sinkholed providers instead of spending the validator's time budget on a dead host.
func NewKeeper ¶
func NewKeeper( storeKey storetypes.StoreKey, wasmKeeper *wasmkeeper.Keeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, logger log.Logger, homePath string, params types.Params, ) *Keeper
NewKeeper constructs the valiporacle keeper. `params` carries all runtime-tunable probe-load knobs — see types/params.go.
func (*Keeper) BeginBlock ¶
func (*Keeper) ExtendVoteHandler ¶
func (k *Keeper) ExtendVoteHandler() sdk.ExtendVoteHandler
ExtendVoteHandler returns the validator-local probe handler. P0.2 rewired it to:
- Use operator-tuned Params (probe interval, concurrency, timeouts).
- Reuse a single *http.Client built at keeper construction so TCP / TLS sessions survive across blocks.
- Respect a per-provider circuit breaker so a sinkholed endpoint doesn't burn the validator's vote-extension time budget.
- Fan probes out across a bounded worker pool, then re-sort the results deterministically so every validator marshals an identical-shaped extension — critical for aggregation matching.
- Enforce Params.MaxVoteExtensionBytes; when exceeded, drop the tail of the list and emit a metric so operators can raise the ceiling if they're chronically full.
func (*Keeper) GetAllProviderMessages ¶
func (k *Keeper) GetAllProviderMessages(ctx sdk.Context) []types.ProviderMessage
GetAllProviderMessages returns all stored provider messages.
func (*Keeper) GetCachedActiveLeases ¶
func (k *Keeper) GetCachedActiveLeases() []types.ActiveLease
GetCachedActiveLeases returns the in-memory active lease list.
func (*Keeper) GetCachedEndpoint ¶
func (*Keeper) LoadOracleConfigFromKV ¶
func (*Keeper) PrepareProposalHandler ¶
func (k *Keeper) PrepareProposalHandler() sdk.PrepareProposalHandler
PrepareProposalHandler aggregates vote extensions into a synthetic oracle tx.
func (*Keeper) ProcessOracleTxFromBlock ¶
func (*Keeper) ProcessProposalHandler ¶
func (k *Keeper) ProcessProposalHandler() sdk.ProcessProposalHandler
ProcessProposalHandler verifies a proposed block's oracle tx.
func (*Keeper) RefreshActiveLeases ¶
RefreshActiveLeases combines three sources to build the list of providers to health-check:
- Contract-registered endpoints (explicit self-registration)
- On-chain leases from x/market (providers with active deployments)
- On-chain provider records from x/provider (fallback HostURI discovery)
Providers with active market leases that have no contract-registered endpoint get a fallback URL derived from their on-chain HostURI.
func (*Keeper) RefreshOracleEndpoint ¶
func (*Keeper) RestoreCachedEndpoint ¶
func (*Keeper) SaveOracleConfigToKV ¶
func (k *Keeper) SaveOracleConfigToKV(ctx sdk.Context, cfg types.OracleConfig)
func (*Keeper) SetLastRefreshHeight ¶
func (*Keeper) StoreProviderMessage ¶
func (k *Keeper) StoreProviderMessage(ctx sdk.Context, msg types.ProviderMessage)
StoreProviderMessage persists a provider message keyed by provider+type.
func (*Keeper) SudoPushProviderMessages ¶
func (*Keeper) VerifyVoteExtensionHandler ¶
func (k *Keeper) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
VerifyVoteExtensionHandler validates a peer's vote extension.