Documentation
¶
Index ¶
- Constants
- func BuildFilter(filterInput string, replicationFactor uint16, params types.Params, ...) (types.Filter, error)
- func MeterExecutorGasDivergent(executors []string, gasReports []uint64, replicationFactor uint16, ...)
- func MeterExecutorGasFallback(req types.Request, gasCostCommit uint64, gasMeter *types.GasMeter)
- func MeterExecutorGasUniform(executors []string, gasReport uint64, replicationFactor uint16, ...)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type FilterResult
- type Keeper
- func (k Keeper) DistributionsFromGasMeter(ctx sdk.Context, reqID string, reqHeight uint64, gasMeter *types.GasMeter, ...) []types.Distribution
- func (k Keeper) EndBlock(ctx sdk.Context) (err error)
- func (k Keeper) ExecuteTallyProgram(ctx sdk.Context, req types.Request, filterResult FilterResult, ...) (types.VMResult, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
- func (k Keeper) FilterAndTally(ctx sdk.Context, req types.Request, params types.Params, ...) (FilterResult, TallyResult)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetMaxTallyGasLimit(ctx sdk.Context) (uint64, error)
- func (k Keeper) GetParams(ctx sdk.Context) (types.Params, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MeterProxyGas(ctx sdk.Context, proxyPubKeys []string, replicationFactor uint16, ...)
- func (k Keeper) ProcessTallies(ctx sdk.Context, coreContract sdk.AccAddress) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- type Querier
- type TallyResult
Constants ¶
const ( TallyExitCodeNotEnoughCommits = 200 // tally VM not executed due to not enough commits TallyExitCodeInvalidFilterInput = 253 // tally VM not executed due to invalid filter input TallyExitCodeFilterError = 254 // tally VM not executed due to filter error TallyExitCodeExecError = 255 // error while executing tally VM )
Variables ¶
This section is empty.
Functions ¶
func BuildFilter ¶
func BuildFilter(filterInput string, replicationFactor uint16, params types.Params, gasMeter *types.GasMeter) (types.Filter, error)
BuildFilter builds a filter based on the requestor-provided input.
func MeterExecutorGasDivergent ¶
func MeterExecutorGasDivergent(executors []string, gasReports []uint64, replicationFactor uint16, gasMeter *types.GasMeter)
MeterExecutorGasDivergent computes and records the gas consumption of executors when their gas reports are divergent.
func MeterExecutorGasFallback ¶
MeterExecutorGasFallback computes and records the gas consumption of committers of a data request when basic consensus has not been reached. If checkReveal is set to true, it will only consume gas for committers that have also revealed.
func MeterExecutorGasUniform ¶
func MeterExecutorGasUniform(executors []string, gasReport uint64, replicationFactor uint16, gasMeter *types.GasMeter)
MeterExecutorGasUniform computes and records the gas consumption of executors when their gas reports are uniformly at "gasReport".
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type FilterResult ¶
type FilterResult struct { Errors []bool // i-th item is true if i-th reveal is non-zero exit or corrupt Outliers []bool // i-th item is non-zero if i-th reveal is an outlier Consensus bool // whether consensus (either in data or in error) is reached ProxyPubKeys []string // data proxy public keys in consensus }
func ExecuteFilter ¶
func ExecuteFilter(reveals []types.RevealBody, filterInput string, replicationFactor uint16, params types.Params, gasMeter *types.GasMeter) (FilterResult, error)
ExecuteFilter builds a filter using the given filter input and applies it to the given reveals to determine consensus, proxy public keys in consensus, and outliers. It assumes that the reveals are sorted by their keys and that their proxy public keys are sorted.
type Keeper ¶
type Keeper struct { Schema collections.Schema // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, wsk types.WasmStorageKeeper, bk types.BatchingKeeper, dpk types.DataProxyKeeper, wk wasmtypes.ContractOpsKeeper, wvk wasmtypes.ViewKeeper, authority string) Keeper
func (Keeper) DistributionsFromGasMeter ¶
func (k Keeper) DistributionsFromGasMeter(ctx sdk.Context, reqID string, reqHeight uint64, gasMeter *types.GasMeter, burnRatio math.LegacyDec) []types.Distribution
DistributionsFromGasMeter constructs a list of distribution messages to be sent to the core contract based on the given gas meter. It takes the ID and the height of the request for event emission.
func (Keeper) ExecuteTallyProgram ¶
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
ExportGenesis extracts all data from store to genesis state.
func (Keeper) FilterAndTally ¶
func (k Keeper) FilterAndTally(ctx sdk.Context, req types.Request, params types.Params, gasMeter *types.GasMeter) (FilterResult, TallyResult)
FilterAndTally builds and applies filter, executes tally program, and calculates canonical gas consumption.
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetMaxTallyGasLimit ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis initializes the store based on the given genesis state.
func (Keeper) MeterProxyGas ¶
func (k Keeper) MeterProxyGas(ctx sdk.Context, proxyPubKeys []string, replicationFactor uint16, gasMeter *types.GasMeter)
MeterProxyGas computes and records the gas consumption of data proxies given proxy public keys in basic consensus and the request's replication factor.
func (Keeper) ProcessTallies ¶
ProcessTallies fetches from the core contract the list of requests to be tallied and then goes through it to filter and tally.