Documentation ¶
Index ¶
- Constants
- Variables
- func CheckProfitabilityAndBroadCastTx(clientCtx client.Context, txf tx.Factory, msg sdk.Msg) error
- func ReplaceRequestedBlock(requestedBlock int64, latestBlock int64) int64
- func SimulateAndBroadCastTx(clientCtx client.Context, txf tx.Factory, msg sdk.Msg) error
- func UpdateRequestedBlock(request *pairingtypes.RelayRequest, response *pairingtypes.RelayReply)
- type DataReliabilityResult
- type DataReliabilitySession
- type PaymentRequest
- type ProviderHashesConsensus
- type Sentry
- func (s *Sentry) AddExpectedPayment(expectedPay PaymentRequest)
- func (s *Sentry) AppendToReceivedPayments(paymentReq PaymentRequest)
- func (s *Sentry) CompareRelaysAndReportConflict(reply0 *pairingtypes.RelayReply, request0 *pairingtypes.RelayRequest, ...) (ok bool)
- func (s *Sentry) DataReliabilityThresholdToSession(vrfs [][]byte, uniqueIdentifiers []bool) (indexes map[int64]bool)
- func (s *Sentry) ExpectedBlockHeight() (int64, int)
- func (s *Sentry) FetchChainParams(ctx context.Context) error
- func (s *Sentry) FetchEpochParams(ctx context.Context) error
- func (s *Sentry) FetchEpochSize(ctx context.Context) error
- func (s *Sentry) FetchOverlapSize(ctx context.Context) error
- func (s *Sentry) FetchProvidersCount(ctx context.Context) error
- func (s *Sentry) GetAllSpecNames(ctx context.Context) (map[string][]spectypes.ApiInterface, error)
- func (s *Sentry) GetAverageBlockTime() int64
- func (s *Sentry) GetBlockHeight() int64
- func (s *Sentry) GetCUServiced() uint64
- func (s *Sentry) GetChainID() string
- func (s *Sentry) GetCurrentEpochHeight() uint64
- func (s *Sentry) GetEpochSize() uint64
- func (s *Sentry) GetLatestFinalizedBlock(latestBlock int64) int64
- func (s *Sentry) GetMaxCUForUser(ctx context.Context, address string, chainID string) (maxCu uint64, err error)
- func (s *Sentry) GetOverlapSize() uint64
- func (s *Sentry) GetPaidCU() uint64
- func (s *Sentry) GetPrevEpochHeight() uint64
- func (s *Sentry) GetProvidersCount() uint64
- func (s *Sentry) GetReliabilityThreshold() uint32
- func (s *Sentry) GetSpecApiByName(name string) (spectypes.ServiceApi, bool)
- func (s *Sentry) GetSpecApiByTag(tag string) (spectypes.ServiceApi, bool)
- func (s *Sentry) GetSpecBlockDistanceForFinalizedData() uint32
- func (s *Sentry) GetSpecBlocksInFinalizationProof() uint32
- func (s *Sentry) GetSpecDataReliabilityEnabled() bool
- func (s *Sentry) GetSpecHash() []byte
- func (s *Sentry) GetSpecName() string
- func (s *Sentry) GetVrfPkAndMaxCuForUser(ctx context.Context, address string, chainID string, requestBlock int64) (vrfPk *utils.VrfPubKey, maxCu uint64, err error)
- func (s *Sentry) IdentifyMissingPayments()
- func (s *Sentry) Init(ctx context.Context) error
- func (s *Sentry) IsAuthorizedConsumer(ctx context.Context, consumer string, blockHeight uint64) (*pairingtypes.QueryVerifyPairingResponse, error)
- func (s *Sentry) IsAuthorizedPairing(ctx context.Context, consumer string, provider string, block uint64) (bool, error)
- func (s *Sentry) IsFinalizedBlock(requestedBlock int64, latestBlock int64) bool
- func (s *Sentry) ListenForTXEvents(ctx context.Context)
- func (s *Sentry) MatchSpecApiByName(name string) (spectypes.ServiceApi, bool)
- func (s *Sentry) PrintExpectedPayments() string
- func (s *Sentry) RemoveExpectedPayment(paidCUToFInd uint64, expectedClient sdk.AccAddress, blockHeight int64, ...) bool
- func (s *Sentry) SendRelay(ctx context.Context, consumerSession *lavasession.SingleConsumerSession, ...) (*pairingtypes.RelayReply, *pairingtypes.Relayer_RelaySubscribeClient, ...)
- func (s *Sentry) SetBlockHeight(blockHeight int64)
- func (s *Sentry) SetCUServiced(cu uint64)
- func (s *Sentry) SetCurrentEpochHeight(blockHeight int64)
- func (s *Sentry) SetPrevEpochHeight(blockHeight uint64)
- func (s *Sentry) SetupConsumerSessionManager(ctx context.Context, ...) error
- func (s *Sentry) Start(ctx context.Context)
- func (s *Sentry) UpdateCUServiced(cu uint64)
- func (s *Sentry) UpdatePaidCU(extraPaidCU uint64)
- type VoteParams
Constants ¶
View Source
const ( MaxConsecutiveConnectionAttempts = 3 PercentileToCalculateLatency = 0.9 MinProvidersForSync = 0.6 LatencyThresholdStatic = 1 * time.Second LatencyThresholdSlope = 1 * time.Millisecond StaleEpochDistance = 3 // relays done 3 epochs back are ready to be rewarded )
View Source
const (
GeolocationFlag = "geolocation"
)
Variables ¶
View Source
var AvailabilityPercentage sdk.Dec = sdk.NewDecWithPrec(5, 2) // TODO move to params pairing
Functions ¶
func ReplaceRequestedBlock ¶
func SimulateAndBroadCastTx ¶
func UpdateRequestedBlock ¶
func UpdateRequestedBlock(request *pairingtypes.RelayRequest, response *pairingtypes.RelayReply)
Types ¶
type DataReliabilityResult ¶
type DataReliabilityResult struct {
// contains filtered or unexported fields
}
type DataReliabilitySession ¶
type DataReliabilitySession struct {
// contains filtered or unexported fields
}
type PaymentRequest ¶
type ProviderHashesConsensus ¶
type Sentry ¶
type Sentry struct { ClientCtx client.Context ChainID string NewTransactionEvents <-chan ctypes.ResultEvent NewBlockEvents <-chan ctypes.ResultEvent Acc string // account address (bech32) ApiInterface string // // expected payments storage PaymentsMu sync.RWMutex EpochSize uint64 EpochBlocksOverlap uint64 VrfSkMu utils.LavaMutex VrfSk vrf.PrivateKey // contains filtered or unexported fields }
func NewSentry ¶
func NewSentry( clientCtx client.Context, txFactory tx.Factory, chainID string, isUser bool, voteInitiationCb func(ctx context.Context, voteID string, voteDeadline uint64, voteParams *VoteParams), newEpochCb func(epochHeight int64), apiInterface string, vrf_sk vrf.PrivateKey, flagSet *pflag.FlagSet, serverID uint64, ) *Sentry
func (*Sentry) AddExpectedPayment ¶
func (s *Sentry) AddExpectedPayment(expectedPay PaymentRequest)
expecting caller to lock
func (*Sentry) AppendToReceivedPayments ¶
func (s *Sentry) AppendToReceivedPayments(paymentReq PaymentRequest)
func (*Sentry) CompareRelaysAndReportConflict ¶
func (s *Sentry) CompareRelaysAndReportConflict(reply0 *pairingtypes.RelayReply, request0 *pairingtypes.RelayRequest, reply1 *pairingtypes.RelayReply, request1 *pairingtypes.RelayRequest) (ok bool)
func (*Sentry) DataReliabilityThresholdToSession ¶
func (*Sentry) ExpectedBlockHeight ¶
func (*Sentry) FetchProvidersCount ¶
func (*Sentry) GetAllSpecNames ¶
func (*Sentry) GetAverageBlockTime ¶
func (*Sentry) GetBlockHeight ¶
func (*Sentry) GetCUServiced ¶
func (*Sentry) GetChainID ¶
func (*Sentry) GetCurrentEpochHeight ¶
func (*Sentry) GetEpochSize ¶
func (*Sentry) GetLatestFinalizedBlock ¶
func (*Sentry) GetMaxCUForUser ¶
func (*Sentry) GetOverlapSize ¶
func (*Sentry) GetPrevEpochHeight ¶
func (*Sentry) GetProvidersCount ¶
func (*Sentry) GetReliabilityThreshold ¶
func (*Sentry) GetSpecApiByName ¶
func (s *Sentry) GetSpecApiByName(name string) (spectypes.ServiceApi, bool)
func (*Sentry) GetSpecApiByTag ¶
func (s *Sentry) GetSpecApiByTag(tag string) (spectypes.ServiceApi, bool)
func (*Sentry) GetSpecBlockDistanceForFinalizedData ¶
func (*Sentry) GetSpecBlocksInFinalizationProof ¶
func (*Sentry) GetSpecDataReliabilityEnabled ¶
func (*Sentry) GetSpecHash ¶
func (*Sentry) GetSpecName ¶
func (*Sentry) GetVrfPkAndMaxCuForUser ¶
func (*Sentry) IdentifyMissingPayments ¶
func (s *Sentry) IdentifyMissingPayments()
func (*Sentry) IsAuthorizedConsumer ¶
func (s *Sentry) IsAuthorizedConsumer(ctx context.Context, consumer string, blockHeight uint64) (*pairingtypes.QueryVerifyPairingResponse, error)
func (*Sentry) IsAuthorizedPairing ¶
func (*Sentry) IsFinalizedBlock ¶
func (*Sentry) ListenForTXEvents ¶
func (*Sentry) MatchSpecApiByName ¶
func (s *Sentry) MatchSpecApiByName(name string) (spectypes.ServiceApi, bool)
func (*Sentry) PrintExpectedPayments ¶
func (*Sentry) RemoveExpectedPayment ¶
func (*Sentry) SendRelay ¶
func (s *Sentry) SendRelay( ctx context.Context, consumerSession *lavasession.SingleConsumerSession, sessionEpoch uint64, providerPubAddress string, cb_send_relay func(consumerSession *lavasession.SingleConsumerSession) (*pairingtypes.RelayReply, *pairingtypes.Relayer_RelaySubscribeClient, *pairingtypes.RelayRequest, time.Duration, bool, error), cb_send_reliability func(consumerSession *lavasession.SingleConsumerSession, dataReliability *pairingtypes.VRFData, providerAddress string) (*pairingtypes.RelayReply, *pairingtypes.RelayRequest, time.Duration, error), specCategory *spectypes.SpecCategory, ) (*pairingtypes.RelayReply, *pairingtypes.Relayer_RelaySubscribeClient, time.Duration, bool, error)
func (*Sentry) SetBlockHeight ¶
func (*Sentry) SetCUServiced ¶
func (*Sentry) SetCurrentEpochHeight ¶
func (*Sentry) SetPrevEpochHeight ¶
func (*Sentry) SetupConsumerSessionManager ¶
func (s *Sentry) SetupConsumerSessionManager(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) error
func (*Sentry) UpdateCUServiced ¶
func (*Sentry) UpdatePaidCU ¶
type VoteParams ¶
type VoteParams struct { CloseVote bool ChainID string ApiURL string RequestData []byte RequestBlock uint64 Voters []string ConnectionType string }
func (*VoteParams) GetCloseVote ¶
func (vp *VoteParams) GetCloseVote() bool
Click to show internal directories.
Click to hide internal directories.