Documentation ¶
Index ¶
- Constants
- func CreateEventsCobraCommand() *cobra.Command
- type ConsumerEmergencyTrackerInf
- type ConsumerStateQuery
- func (csq *ConsumerStateQuery) GetEffectivePolicy(ctx context.Context, consumerAddress, specID string) (*plantypes.Policy, error)
- func (csq *ConsumerStateQuery) GetMaxCUForUser(ctx context.Context, chainID string, epoch uint64) (maxCu uint64, err error)
- func (csq *ConsumerStateQuery) GetPairing(ctx context.Context, chainID string, latestBlock int64) (pairingList []epochstoragetypes.StakeEntry, epoch, nextBlockForUpdate uint64, ...)
- type ConsumerStateTracker
- func (cst *ConsumerStateTracker) GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error)
- func (cst *ConsumerStateTracker) GetProtocolVersion(ctx context.Context) (*ProtocolVersionResponse, error)
- func (cst *ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, ...)
- func (cst *ConsumerStateTracker) RegisterFinalizationConsensusForUpdates(ctx context.Context, finalizationConsensus *lavaprotocol.FinalizationConsensus)
- func (cst *ConsumerStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable DowntimeParamsUpdatable) error
- func (cst *ConsumerStateTracker) RegisterForPairingUpdates(ctx context.Context, pairingUpdatable PairingUpdatable)
- func (cst *ConsumerStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable SpecUpdatable, ...) error
- func (cst *ConsumerStateTracker) RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, ...)
- func (cst *ConsumerStateTracker) TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, ...) error
- type ConsumerTxSender
- type ConsumerTxSenderInf
- type DowntimeParamsStateQuery
- type DowntimeParamsUpdatable
- type DowntimeParamsUpdater
- type EmergencyTracker
- func (cs *EmergencyTracker) GetDowntimeParams() downtimev1.Params
- func (cs *EmergencyTracker) GetLatestVirtualEpoch() uint64
- func (cs *EmergencyTracker) GetVirtualEpoch(epoch uint64) uint64
- func (cs *EmergencyTracker) SetDowntimeParams(params downtimev1.Params)
- func (cs *EmergencyTracker) UpdateEpoch(epoch uint64)
- type EmergencyTrackerMetrics
- type EpochStateQuery
- type EpochStateQueryInterface
- type EpochUpdatable
- type EpochUpdatableWithBlockDelay
- type EpochUpdater
- type EventTracker
- type FinalizationConsensusUpdater
- type MetricsManagerInf
- type MetricsUpdater
- type PairingUpdatable
- type PairingUpdater
- type PaymentUpdatable
- type PaymentUpdater
- type ProtocolVersionResponse
- type ProviderStateQuery
- func (psq *ProviderStateQuery) EarliestBlockInMemory(ctx context.Context) (uint64, error)
- func (psq *ProviderStateQuery) GetEpochSize(ctx context.Context) (uint64, error)
- func (psq *ProviderStateQuery) GetEpochSizeMultipliedByRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
- func (psq *ProviderStateQuery) GetMaxCuForUser(ctx context.Context, consumerAddress, chainID string, epoch uint64) (maxCu uint64, err error)
- func (psq *ProviderStateQuery) GetRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
- func (psq *ProviderStateQuery) VerifyPairing(ctx context.Context, consumerAddress, providerAddress string, epoch uint64, ...) (valid bool, total int64, projectId string, err error)
- func (psq *ProviderStateQuery) VoteEvents(ctx context.Context, latestBlock int64) (votes []*reliabilitymanager.VoteParams, err error)
- type ProviderStateTracker
- func (pst *ProviderStateTracker) EarliestBlockInMemory(ctx context.Context) (uint64, error)
- func (pst *ProviderStateTracker) GetAverageBlockTime() time.Duration
- func (pst *ProviderStateTracker) GetEpochSize(ctx context.Context) (uint64, error)
- func (pst *ProviderStateTracker) GetEpochSizeMultipliedByRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
- func (pst *ProviderStateTracker) GetMaxCuForUser(ctx context.Context, consumerAddress, chainID string, epoch uint64) (maxCu uint64, err error)
- func (pst *ProviderStateTracker) GetProtocolVersion(ctx context.Context) (*ProtocolVersionResponse, error)
- func (pst *ProviderStateTracker) GetRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
- func (pst *ProviderStateTracker) LatestBlock() int64
- func (pst *ProviderStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable DowntimeParamsUpdatable) error
- func (pst *ProviderStateTracker) RegisterForEpochUpdates(ctx context.Context, epochUpdatable EpochUpdatable)
- func (pst *ProviderStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable SpecUpdatable, ...) error
- func (pst *ProviderStateTracker) RegisterForSpecVerifications(ctx context.Context, specVerifier SpecVerifier, ...) error
- func (pst *ProviderStateTracker) RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, ...)
- func (pst *ProviderStateTracker) RegisterPaymentUpdatableForPayments(ctx context.Context, paymentUpdatable PaymentUpdatable)
- func (pst *ProviderStateTracker) RegisterReliabilityManagerForVoteUpdates(ctx context.Context, voteUpdatable VoteUpdatable, ...)
- func (pst *ProviderStateTracker) SendVoteCommitment(voteID string, vote *reliabilitymanager.VoteData) error
- func (pst *ProviderStateTracker) SendVoteReveal(voteID string, vote *reliabilitymanager.VoteData) error
- func (pst *ProviderStateTracker) TxRelayPayment(ctx context.Context, relayRequests []*pairingtypes.RelaySession, ...) error
- func (pst *ProviderStateTracker) VerifyPairing(ctx context.Context, consumerAddress, providerAddress string, epoch uint64, ...) (valid bool, total int64, projectId string, err error)
- type ProviderTxSender
- func (pts *ProviderTxSender) SendVoteCommitment(voteID string, vote *reliabilitymanager.VoteData) error
- func (pts *ProviderTxSender) SendVoteReveal(voteID string, vote *reliabilitymanager.VoteData) error
- func (pts *ProviderTxSender) TxRelayPayment(ctx context.Context, relayRequests []*pairingtypes.RelaySession, ...) error
- type SpecGetter
- type SpecUpdatable
- type SpecUpdater
- func (su *SpecUpdater) RegisterSpecUpdatable(ctx context.Context, specUpdatable *SpecUpdatable, ...) error
- func (su *SpecUpdater) RegisterSpecVerifier(ctx context.Context, specVerifier *SpecVerifier, ...) error
- func (su *SpecUpdater) Update(latestBlock int64)
- func (su *SpecUpdater) UpdaterKey() string
- type SpecVerifier
- type StateQuery
- type StateTracker
- type TxSender
- type Updater
- type VersionStateQuery
- type VersionUpdater
- type VersionValidationInf
- type VoteUpdatable
- type VoteUpdater
Constants ¶
const ( FlagTimeout = "timeout" FlagValue = "value" FlagEventName = "event" FlagBreak = "break" FlagHasAttributeName = "has-attribute" FlagShowAttributeName = "show-attribute" FlagDisableInteractiveShell = "disable-interactive" )
const ( CacheMaxCost = 10 * 1024 // 10K cost CacheNumCounters = 100000 // expect 10K items DefaultTimeToLiveExpiration = 30 * time.Minute PairingRespKey = "pairing-resp" VerifyPairingRespKey = "verify-pairing-resp" MaxCuResponseKey = "max-cu-resp" EffectivePolicyRespKey = "effective-policy-resp" )
const ( BlocksToSaveLavaChainTracker = 1 // we only need the latest block TendermintConsensusParamsQuery = "consensus_params" BlockResultRetry = 20 )
const (
CallbackKeyForDowntimeParamsUpdate = "downtime-params-update"
)
const (
CallbackKeyForEpochUpdate = "epoch-update"
)
const (
CallbackKeyForFinalizationConsensusUpdate = "finalization-consensus-update"
)
const (
CallbackKeyForMetricUpdate = "metric-update"
)
const (
CallbackKeyForPairingUpdate = "pairing-update"
)
const (
CallbackKeyForPaymentUpdate = "payment-update"
)
const (
CallbackKeyForSpecUpdate = "spec-update"
)
const (
CallbackKeyForVersionUpdate = "version-update"
)
const (
CallbackKeyForVoteUpdate = "vote-update"
)
const ( // same account can continue failing the more providers you have under the same account // for example if you have a provider staked at 20 chains you will ask for 20 payments per epoch. // therefore currently our best solution is to continue retrying increasing sequence number until successful RETRY_INCORRECT_SEQUENCE = 100 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsumerEmergencyTrackerInf ¶
type ConsumerEmergencyTrackerInf interface {
GetLatestVirtualEpoch() uint64
}
type ConsumerStateQuery ¶ added in v0.5.1
type ConsumerStateQuery struct { StateQuery // contains filtered or unexported fields }
func NewConsumerStateQuery ¶ added in v0.5.1
func NewConsumerStateQuery(ctx context.Context, clientCtx client.Context) *ConsumerStateQuery
func (*ConsumerStateQuery) GetEffectivePolicy ¶ added in v0.20.1
func (*ConsumerStateQuery) GetMaxCUForUser ¶ added in v0.5.1
func (*ConsumerStateQuery) GetPairing ¶ added in v0.5.1
func (csq *ConsumerStateQuery) GetPairing(ctx context.Context, chainID string, latestBlock int64) (pairingList []epochstoragetypes.StakeEntry, epoch, nextBlockForUpdate uint64, errRet error)
type ConsumerStateTracker ¶
type ConsumerStateTracker struct { ConsumerTxSenderInf *StateTracker ConsumerEmergencyTrackerInf // contains filtered or unexported fields }
ConsumerStateTracker CSTis a class for tracking consumer data from the lava blockchain, such as epoch changes. it allows also to query specific data form the blockchain and acts as a single place to send transactions
func NewConsumerStateTracker ¶
func NewConsumerStateTracker(ctx context.Context, txFactory tx.Factory, clientCtx client.Context, chainFetcher chaintracker.ChainFetcher, metrics *metrics.ConsumerMetricsManager) (ret *ConsumerStateTracker, err error)
func (*ConsumerStateTracker) GetConsumerPolicy ¶
func (*ConsumerStateTracker) GetProtocolVersion ¶
func (cst *ConsumerStateTracker) GetProtocolVersion(ctx context.Context) (*ProtocolVersionResponse, error)
func (*ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates ¶
func (cst *ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager)
func (*ConsumerStateTracker) RegisterFinalizationConsensusForUpdates ¶
func (cst *ConsumerStateTracker) RegisterFinalizationConsensusForUpdates(ctx context.Context, finalizationConsensus *lavaprotocol.FinalizationConsensus)
func (*ConsumerStateTracker) RegisterForDowntimeParamsUpdates ¶
func (cst *ConsumerStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable DowntimeParamsUpdatable) error
func (*ConsumerStateTracker) RegisterForPairingUpdates ¶
func (cst *ConsumerStateTracker) RegisterForPairingUpdates(ctx context.Context, pairingUpdatable PairingUpdatable)
func (*ConsumerStateTracker) RegisterForSpecUpdates ¶
func (cst *ConsumerStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable SpecUpdatable, endpoint lavasession.RPCEndpoint) error
func (*ConsumerStateTracker) RegisterForVersionUpdates ¶
func (cst *ConsumerStateTracker) RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, versionValidator VersionValidationInf)
func (*ConsumerStateTracker) TxConflictDetection ¶
func (cst *ConsumerStateTracker) TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error
type ConsumerTxSender ¶
type ConsumerTxSender struct {
*TxSender
}
func NewConsumerTxSender ¶
func (*ConsumerTxSender) TxSenderConflictDetection ¶
func (ts *ConsumerTxSender) TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict) error
type ConsumerTxSenderInf ¶
type ConsumerTxSenderInf interface {
TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict) error
}
type DowntimeParamsStateQuery ¶ added in v0.27.3
type DowntimeParamsStateQuery interface {
GetDowntimeParams(ctx context.Context) (*downtimev1.Params, error)
}
type DowntimeParamsUpdatable ¶ added in v0.27.3
type DowntimeParamsUpdatable interface {
SetDowntimeParams(downtimev1.Params)
}
type DowntimeParamsUpdater ¶ added in v0.27.3
type DowntimeParamsUpdater struct {
// contains filtered or unexported fields
}
DowntimeParamsUpdater update downtime params for registered updatables after params change proposals
func NewDowntimeParamsUpdater ¶ added in v0.27.3
func NewDowntimeParamsUpdater(downtimeParamsStateQuery DowntimeParamsStateQuery, eventTracker *EventTracker) *DowntimeParamsUpdater
func (*DowntimeParamsUpdater) RegisterDowntimeParamsUpdatable ¶ added in v0.27.3
func (dpu *DowntimeParamsUpdater) RegisterDowntimeParamsUpdatable(ctx context.Context, downtimeParamsUpdatable *DowntimeParamsUpdatable) error
func (*DowntimeParamsUpdater) Update ¶ added in v0.27.3
func (dpu *DowntimeParamsUpdater) Update(latestBlock int64)
func (*DowntimeParamsUpdater) UpdaterKey ¶ added in v0.27.3
func (dpu *DowntimeParamsUpdater) UpdaterKey() string
type EmergencyTracker ¶
type EmergencyTracker struct {
// contains filtered or unexported fields
}
func NewEmergencyTracker ¶
func NewEmergencyTracker(metrics EmergencyTrackerMetrics) (emergencyTracker *EmergencyTracker, emergencyCallback func(latestBlockTime time.Time))
func (*EmergencyTracker) GetDowntimeParams ¶
func (cs *EmergencyTracker) GetDowntimeParams() downtimev1.Params
func (*EmergencyTracker) GetLatestVirtualEpoch ¶
func (cs *EmergencyTracker) GetLatestVirtualEpoch() uint64
func (*EmergencyTracker) GetVirtualEpoch ¶
func (cs *EmergencyTracker) GetVirtualEpoch(epoch uint64) uint64
func (*EmergencyTracker) SetDowntimeParams ¶
func (cs *EmergencyTracker) SetDowntimeParams(params downtimev1.Params)
func (*EmergencyTracker) UpdateEpoch ¶
func (cs *EmergencyTracker) UpdateEpoch(epoch uint64)
type EmergencyTrackerMetrics ¶
type EmergencyTrackerMetrics interface {
SetVirtualEpoch(virtualEpoch uint64)
}
type EpochStateQuery ¶ added in v0.10.1
type EpochStateQuery struct {
StateQuery
}
func NewEpochStateQuery ¶ added in v0.10.1
func NewEpochStateQuery(stateQuery *StateQuery) *EpochStateQuery
func (*EpochStateQuery) CurrentEpochStart ¶ added in v0.10.1
func (esq *EpochStateQuery) CurrentEpochStart(ctx context.Context) (uint64, error)
type EpochStateQueryInterface ¶ added in v0.25.0
type EpochUpdatable ¶ added in v0.5.0
type EpochUpdatable interface {
UpdateEpoch(epoch uint64)
}
type EpochUpdatableWithBlockDelay ¶ added in v0.25.0
type EpochUpdatableWithBlockDelay struct { EpochUpdatable // contains filtered or unexported fields }
func (*EpochUpdatableWithBlockDelay) UpdateOnBlock ¶ added in v0.25.0
func (euwbd *EpochUpdatableWithBlockDelay) UpdateOnBlock(currentEpoch uint64, latestBlock int64)
Add a method to EpochUpdatableWithBlockDelay to update based on block delay.
type EpochUpdater ¶ added in v0.9.0
type EpochUpdater struct {
// contains filtered or unexported fields
}
func NewEpochUpdater ¶ added in v0.9.0
func NewEpochUpdater(stateQuery EpochStateQueryInterface) *EpochUpdater
func (*EpochUpdater) RegisterEpochUpdatable ¶ added in v0.9.0
func (eu *EpochUpdater) RegisterEpochUpdatable(ctx context.Context, epochUpdatable EpochUpdatable, blocksUpdateDelay int64)
func (*EpochUpdater) Update ¶ added in v0.9.0
func (eu *EpochUpdater) Update(latestBlock int64)
func (*EpochUpdater) UpdaterKey ¶ added in v0.9.0
func (eu *EpochUpdater) UpdaterKey() string
type EventTracker ¶ added in v0.12.0
type EventTracker struct {
// contains filtered or unexported fields
}
type FinalizationConsensusUpdater ¶ added in v0.4.5
type FinalizationConsensusUpdater struct {
// contains filtered or unexported fields
}
func NewFinalizationConsensusUpdater ¶ added in v0.4.5
func NewFinalizationConsensusUpdater(stateQuery *ConsumerStateQuery) *FinalizationConsensusUpdater
func (*FinalizationConsensusUpdater) RegisterFinalizationConsensus ¶ added in v0.4.5
func (fcu *FinalizationConsensusUpdater) RegisterFinalizationConsensus(finalizationConsensus *lavaprotocol.FinalizationConsensus)
func (*FinalizationConsensusUpdater) Update ¶ added in v0.4.5
func (fcu *FinalizationConsensusUpdater) Update(latestBlock int64)
func (*FinalizationConsensusUpdater) UpdaterKey ¶ added in v0.4.5
func (fcu *FinalizationConsensusUpdater) UpdaterKey() string
type MetricsManagerInf ¶ added in v0.12.0
type MetricsManagerInf interface {
SetBlock(int64)
}
type MetricsUpdater ¶ added in v0.12.0
type MetricsUpdater struct {
// contains filtered or unexported fields
}
func NewMetricsUpdater ¶ added in v0.12.0
func NewMetricsUpdater(consumerMetricsManager MetricsManagerInf) *MetricsUpdater
func (*MetricsUpdater) Update ¶ added in v0.12.0
func (mu *MetricsUpdater) Update(latestBlock int64)
func (*MetricsUpdater) UpdaterKey ¶ added in v0.12.0
func (mu *MetricsUpdater) UpdaterKey() string
type PairingUpdatable ¶ added in v0.27.3
type PairingUpdatable interface {
UpdateEpoch(epoch uint64)
}
type PairingUpdater ¶ added in v0.4.5
type PairingUpdater struct {
// contains filtered or unexported fields
}
func NewPairingUpdater ¶ added in v0.4.5
func NewPairingUpdater(stateQuery *ConsumerStateQuery) *PairingUpdater
func (*PairingUpdater) RegisterPairing ¶ added in v0.4.5
func (pu *PairingUpdater) RegisterPairing(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) error
func (*PairingUpdater) RegisterPairingUpdatable ¶ added in v0.27.3
func (pu *PairingUpdater) RegisterPairingUpdatable(ctx context.Context, pairingUpdatable *PairingUpdatable) error
func (*PairingUpdater) Update ¶ added in v0.4.5
func (pu *PairingUpdater) Update(latestBlock int64)
func (*PairingUpdater) UpdaterKey ¶ added in v0.4.5
func (pu *PairingUpdater) UpdaterKey() string
type PaymentUpdatable ¶ added in v0.9.0
type PaymentUpdatable interface { PaymentHandler(*rewardserver.PaymentRequest) Description() string }
type PaymentUpdater ¶ added in v0.9.0
type PaymentUpdater struct {
// contains filtered or unexported fields
}
func NewPaymentUpdater ¶ added in v0.9.0
func NewPaymentUpdater(eventTracker *EventTracker) *PaymentUpdater
func (*PaymentUpdater) RegisterPaymentUpdatable ¶ added in v0.9.0
func (pu *PaymentUpdater) RegisterPaymentUpdatable(ctx context.Context, paymentUpdatable *PaymentUpdatable)
func (*PaymentUpdater) Update ¶ added in v0.9.0
func (pu *PaymentUpdater) Update(latestBlock int64)
func (*PaymentUpdater) UpdaterKey ¶ added in v0.9.0
func (pu *PaymentUpdater) UpdaterKey() string
type ProtocolVersionResponse ¶ added in v0.25.1
type ProtocolVersionResponse struct { Version *protocoltypes.Version BlockNumber string }
type ProviderStateQuery ¶ added in v0.9.0
type ProviderStateQuery struct { StateQuery EpochStateQuery // contains filtered or unexported fields }
func NewProviderStateQuery ¶ added in v0.9.0
func NewProviderStateQuery(ctx context.Context, clientCtx client.Context) *ProviderStateQuery
func (*ProviderStateQuery) EarliestBlockInMemory ¶ added in v0.9.0
func (psq *ProviderStateQuery) EarliestBlockInMemory(ctx context.Context) (uint64, error)
func (*ProviderStateQuery) GetEpochSize ¶ added in v0.9.0
func (psq *ProviderStateQuery) GetEpochSize(ctx context.Context) (uint64, error)
func (*ProviderStateQuery) GetEpochSizeMultipliedByRecommendedEpochNumToCollectPayment ¶ added in v0.9.0
func (psq *ProviderStateQuery) GetEpochSizeMultipliedByRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
func (*ProviderStateQuery) GetMaxCuForUser ¶ added in v0.12.0
func (*ProviderStateQuery) GetRecommendedEpochNumToCollectPayment ¶ added in v0.9.0
func (psq *ProviderStateQuery) GetRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
func (*ProviderStateQuery) VerifyPairing ¶ added in v0.9.0
func (*ProviderStateQuery) VoteEvents ¶ added in v0.9.0
func (psq *ProviderStateQuery) VoteEvents(ctx context.Context, latestBlock int64) (votes []*reliabilitymanager.VoteParams, err error)
type ProviderStateTracker ¶
type ProviderStateTracker struct { *StateTracker *EmergencyTracker // contains filtered or unexported fields }
ProviderStateTracker PST is a class for tracking provider data from the lava blockchain, such as epoch changes. it allows also to query specific data form the blockchain and acts as a single place to send transactions
func NewProviderStateTracker ¶
func NewProviderStateTracker(ctx context.Context, txFactory tx.Factory, clientCtx client.Context, chainFetcher chaintracker.ChainFetcher, metrics *metrics.ProviderMetricsManager) (ret *ProviderStateTracker, err error)
func (*ProviderStateTracker) EarliestBlockInMemory ¶
func (pst *ProviderStateTracker) EarliestBlockInMemory(ctx context.Context) (uint64, error)
func (*ProviderStateTracker) GetAverageBlockTime ¶
func (pst *ProviderStateTracker) GetAverageBlockTime() time.Duration
func (*ProviderStateTracker) GetEpochSize ¶
func (pst *ProviderStateTracker) GetEpochSize(ctx context.Context) (uint64, error)
func (*ProviderStateTracker) GetEpochSizeMultipliedByRecommendedEpochNumToCollectPayment ¶
func (pst *ProviderStateTracker) GetEpochSizeMultipliedByRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
func (*ProviderStateTracker) GetMaxCuForUser ¶
func (*ProviderStateTracker) GetProtocolVersion ¶
func (pst *ProviderStateTracker) GetProtocolVersion(ctx context.Context) (*ProtocolVersionResponse, error)
func (*ProviderStateTracker) GetRecommendedEpochNumToCollectPayment ¶
func (pst *ProviderStateTracker) GetRecommendedEpochNumToCollectPayment(ctx context.Context) (uint64, error)
func (*ProviderStateTracker) LatestBlock ¶
func (pst *ProviderStateTracker) LatestBlock() int64
func (*ProviderStateTracker) RegisterForDowntimeParamsUpdates ¶
func (pst *ProviderStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable DowntimeParamsUpdatable) error
func (*ProviderStateTracker) RegisterForEpochUpdates ¶
func (pst *ProviderStateTracker) RegisterForEpochUpdates(ctx context.Context, epochUpdatable EpochUpdatable)
func (*ProviderStateTracker) RegisterForSpecUpdates ¶
func (pst *ProviderStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable SpecUpdatable, endpoint lavasession.RPCEndpoint) error
func (*ProviderStateTracker) RegisterForSpecVerifications ¶
func (pst *ProviderStateTracker) RegisterForSpecVerifications(ctx context.Context, specVerifier SpecVerifier, endpoint lavasession.RPCEndpoint) error
func (*ProviderStateTracker) RegisterForVersionUpdates ¶
func (pst *ProviderStateTracker) RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, versionValidator VersionValidationInf)
func (*ProviderStateTracker) RegisterPaymentUpdatableForPayments ¶
func (pst *ProviderStateTracker) RegisterPaymentUpdatableForPayments(ctx context.Context, paymentUpdatable PaymentUpdatable)
func (*ProviderStateTracker) RegisterReliabilityManagerForVoteUpdates ¶
func (pst *ProviderStateTracker) RegisterReliabilityManagerForVoteUpdates(ctx context.Context, voteUpdatable VoteUpdatable, endpointP *lavasession.RPCProviderEndpoint)
func (*ProviderStateTracker) SendVoteCommitment ¶
func (pst *ProviderStateTracker) SendVoteCommitment(voteID string, vote *reliabilitymanager.VoteData) error
func (*ProviderStateTracker) SendVoteReveal ¶
func (pst *ProviderStateTracker) SendVoteReveal(voteID string, vote *reliabilitymanager.VoteData) error
func (*ProviderStateTracker) TxRelayPayment ¶
func (pst *ProviderStateTracker) TxRelayPayment(ctx context.Context, relayRequests []*pairingtypes.RelaySession, description string, latestBlocks []*pairingtypes.LatestBlockReport) error
type ProviderTxSender ¶
type ProviderTxSender struct {
*TxSender
}
func NewProviderTxSender ¶
func (*ProviderTxSender) SendVoteCommitment ¶
func (pts *ProviderTxSender) SendVoteCommitment(voteID string, vote *reliabilitymanager.VoteData) error
func (*ProviderTxSender) SendVoteReveal ¶
func (pts *ProviderTxSender) SendVoteReveal(voteID string, vote *reliabilitymanager.VoteData) error
func (*ProviderTxSender) TxRelayPayment ¶
func (pts *ProviderTxSender) TxRelayPayment(ctx context.Context, relayRequests []*pairingtypes.RelaySession, description string, latestBlocks []*pairingtypes.LatestBlockReport) error
type SpecGetter ¶ added in v0.12.0
type SpecUpdatable ¶ added in v0.12.0
type SpecUpdater ¶ added in v0.12.0
type SpecUpdater struct {
// contains filtered or unexported fields
}
func NewSpecUpdater ¶ added in v0.12.0
func NewSpecUpdater(chainId string, specGetter SpecGetter, eventTracker *EventTracker) *SpecUpdater
func (*SpecUpdater) RegisterSpecUpdatable ¶ added in v0.12.0
func (su *SpecUpdater) RegisterSpecUpdatable(ctx context.Context, specUpdatable *SpecUpdatable, endpoint lavasession.RPCEndpoint) error
func (*SpecUpdater) RegisterSpecVerifier ¶ added in v0.31.0
func (su *SpecUpdater) RegisterSpecVerifier(ctx context.Context, specVerifier *SpecVerifier, endpoint lavasession.RPCEndpoint) error
func (*SpecUpdater) Update ¶ added in v0.12.0
func (su *SpecUpdater) Update(latestBlock int64)
func (*SpecUpdater) UpdaterKey ¶ added in v0.12.0
func (su *SpecUpdater) UpdaterKey() string
type SpecVerifier ¶ added in v0.31.0
type StateQuery ¶ added in v0.4.5
type StateQuery struct { SpecQueryClient spectypes.QueryClient PairingQueryClient pairingtypes.QueryClient EpochStorageQueryClient epochstoragetypes.QueryClient ProtocolClient protocoltypes.QueryClient DowntimeClient downtimev1.QueryClient ResponsesCache *ristretto.Cache }
func NewStateQuery ¶ added in v0.5.1
func NewStateQuery(ctx context.Context, clientCtx client.Context) *StateQuery
func (*StateQuery) GetDowntimeParams ¶ added in v0.27.3
func (csq *StateQuery) GetDowntimeParams(ctx context.Context) (*downtimev1.Params, error)
func (*StateQuery) GetProtocolVersion ¶ added in v0.20.4
func (csq *StateQuery) GetProtocolVersion(ctx context.Context) (*ProtocolVersionResponse, error)
type StateTracker ¶
type StateTracker struct { EventTracker *EventTracker AverageBlockTime time.Duration // contains filtered or unexported fields }
ConsumerStateTracker CSTis a class for tracking consumer data from the lava blockchain, such as epoch changes. it allows also to query specific data form the blockchain and acts as a single place to send transactions
func NewStateTracker ¶
func NewStateTracker(ctx context.Context, txFactory tx.Factory, clientCtx client.Context, chainFetcher chaintracker.ChainFetcher, blockNotFoundCallback func(latestBlockTime time.Time)) (ret *StateTracker, err error)
func (*StateTracker) GetAverageBlockTime ¶
func (st *StateTracker) GetAverageBlockTime() time.Duration
func (*StateTracker) GetEventTracker ¶
func (st *StateTracker) GetEventTracker() *EventTracker
For lavavisor access
func (*StateTracker) RegisterForUpdates ¶
func (st *StateTracker) RegisterForUpdates(ctx context.Context, updater Updater) Updater
func (*StateTracker) UpdateBlockTime ¶
func (st *StateTracker) UpdateBlockTime(blockTime time.Duration)
type TxSender ¶
type TxSender struct {
// contains filtered or unexported fields
}
func NewTxSender ¶
func (*TxSender) SendTxAndVerifyCommit ¶
type VersionStateQuery ¶ added in v0.20.4
type VersionStateQuery interface {
GetProtocolVersion(ctx context.Context) (*ProtocolVersionResponse, error)
}
type VersionUpdater ¶ added in v0.20.4
type VersionUpdater struct { Lock sync.RWMutex VersionStateQuery VersionStateQuery LastKnownVersion *ProtocolVersionResponse VersionValidationInf // embedding the interface, this tells: VersionUpdater has ValidateProtocolVersion method // contains filtered or unexported fields }
func NewVersionUpdater ¶ added in v0.20.4
func NewVersionUpdater(versionStateQuery VersionStateQuery, eventTracker *EventTracker, version *protocoltypes.Version, versionValidator VersionValidationInf) *VersionUpdater
func (*VersionUpdater) RegisterVersionUpdatable ¶ added in v0.20.4
func (vu *VersionUpdater) RegisterVersionUpdatable()
func (*VersionUpdater) Update ¶ added in v0.20.4
func (vu *VersionUpdater) Update(latestBlock int64)
func (*VersionUpdater) UpdaterKey ¶ added in v0.20.4
func (vu *VersionUpdater) UpdaterKey() string
type VersionValidationInf ¶ added in v0.22.0
type VersionValidationInf interface {
ValidateProtocolVersion(lastKnownVersion *ProtocolVersionResponse) error
}
type VoteUpdatable ¶ added in v0.9.0
type VoteUpdatable interface {
VoteHandler(*reliabilitymanager.VoteParams, uint64) error
}
type VoteUpdater ¶ added in v0.9.0
type VoteUpdater struct {
// contains filtered or unexported fields
}
func NewVoteUpdater ¶ added in v0.9.0
func NewVoteUpdater(eventTracker *EventTracker) *VoteUpdater
func (*VoteUpdater) RegisterVoteUpdatable ¶ added in v0.9.0
func (vu *VoteUpdater) RegisterVoteUpdatable(ctx context.Context, voteUpdatable *VoteUpdatable, endpoint lavasession.RPCEndpoint)
func (*VoteUpdater) Update ¶ added in v0.9.0
func (vu *VoteUpdater) Update(latestBlock int64)
func (*VoteUpdater) UpdaterKey ¶ added in v0.9.0
func (vu *VoteUpdater) UpdaterKey() string
Source Files ¶
- consumer_state_tracker.go
- downtime_params_updater.go
- emergency_tracker.go
- epoch_updater.go
- event_tracker.go
- events.go
- finalization_consensus_updater.go
- metrics_updater.go
- pairing_updater.go
- payment_updater.go
- provider_state_tracker.go
- spec_updater.go
- state_query.go
- state_tracker.go
- tx_sender.go
- version_updater.go
- vote_updater.go