Documentation ¶
Overview ¶
Package rpcconsumer is a generated GoMock package.
Package rpcconsumer is a generated GoMock package.
Index ¶
- Constants
- Variables
- func CreateRPCConsumerCobraCommand() *cobra.Command
- func CreateTestRPCConsumerCobraCommand() *cobra.Command
- func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints []*lavasession.RPCEndpoint, err error)
- type AnalyticsServerAddresses
- type ArchiveStatus
- type CancelableContextHolder
- type ConsumerConsistency
- func (cc *ConsumerConsistency) GetSeenBlock(userData common.UserData) (int64, bool)
- func (cc *ConsumerConsistency) Key(userData common.UserData) string
- func (cc *ConsumerConsistency) SetSeenBlock(blockSeen int64, userData common.UserData)
- func (cc *ConsumerConsistency) SetSeenBlockFromKey(blockSeen int64, key string)
- type ConsumerRelaySender
- type ConsumerRelayStateMachine
- func (crsm *ConsumerRelayStateMachine) GetDebugState() bool
- func (crsm *ConsumerRelayStateMachine) GetProtocolMessage() chainlib.ProtocolMessage
- func (crsm *ConsumerRelayStateMachine) GetRelayTaskChannel() (chan RelayStateSendInstructions, error)
- func (crsm *ConsumerRelayStateMachine) GetSelection() Selection
- func (crsm *ConsumerRelayStateMachine) GetUsedProviders() *lavasession.UsedProviders
- func (crsm *ConsumerRelayStateMachine) Initialized() bool
- func (crsm *ConsumerRelayStateMachine) SetRelayRetriesManager(relayRetriesManager *lavaprotocol.RelayRetriesManager)
- func (crsm *ConsumerRelayStateMachine) SetResultsChecker(resultsChecker ResultsCheckerInf)
- func (crsm *ConsumerRelayStateMachine) UpdateBatch(err error)
- type ConsumerStateTrackerInf
- type ConsumerTxSender
- type CustomLavaTransport
- type MetricsInterface
- type MockConsumerStateTrackerInf
- func (m *MockConsumerStateTrackerInf) EXPECT() *MockConsumerStateTrackerInfMockRecorder
- func (m *MockConsumerStateTrackerInf) GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*types0.Policy, error)
- func (m *MockConsumerStateTrackerInf) GetLatestVirtualEpoch() uint64
- func (m *MockConsumerStateTrackerInf) GetProtocolVersion(ctx context.Context) (*updaters.ProtocolVersionResponse, error)
- func (m *MockConsumerStateTrackerInf) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, ...)
- func (m *MockConsumerStateTrackerInf) RegisterFinalizationConsensusForUpdates(arg0 context.Context, arg1 *finalizationconsensus.FinalizationConsensus)
- func (m *MockConsumerStateTrackerInf) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error
- func (m *MockConsumerStateTrackerInf) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, ...) error
- func (m *MockConsumerStateTrackerInf) RegisterForVersionUpdates(ctx context.Context, version *types1.Version, ...)
- func (m *MockConsumerStateTrackerInf) TxConflictDetection(ctx context.Context, finalizationConflict *types.FinalizationConflict, ...) error
- type MockConsumerStateTrackerInfMockRecorder
- func (mr *MockConsumerStateTrackerInfMockRecorder) GetConsumerPolicy(ctx, consumerAddress, chainID any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) GetLatestVirtualEpoch() *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) GetProtocolVersion(ctx any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterConsumerSessionManagerForPairingUpdates(ctx, consumerSessionManager any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterFinalizationConsensusForUpdates(arg0, arg1 any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForDowntimeParamsUpdates(ctx, downtimeParamsUpdatable any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForSpecUpdates(ctx, specUpdatable, endpoint any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForVersionUpdates(ctx, version, versionValidator any) *gomock.Call
- func (mr *MockConsumerStateTrackerInfMockRecorder) TxConflictDetection(ctx, finalizationConflict, responseConflict, conflictHandler any) *gomock.Call
- type MockRelayerClient
- func (m *MockRelayerClient) EXPECT() *MockRelayerClientMockRecorder
- func (m *MockRelayerClient) Probe(ctx context.Context, in *types.ProbeRequest, opts ...grpc.CallOption) (*types.ProbeReply, error)
- func (m *MockRelayerClient) Relay(ctx context.Context, in *types.RelayRequest, opts ...grpc.CallOption) (*types.RelayReply, error)
- func (m *MockRelayerClient) RelaySubscribe(ctx context.Context, in *types.RelayRequest, opts ...grpc.CallOption) (types.Relayer_RelaySubscribeClient, error)
- type MockRelayerClientMockRecorder
- type MockRelayerServer
- func (m *MockRelayerServer) EXPECT() *MockRelayerServerMockRecorder
- func (m *MockRelayerServer) Probe(arg0 context.Context, arg1 *types.ProbeRequest) (*types.ProbeReply, error)
- func (m *MockRelayerServer) Relay(arg0 context.Context, arg1 *types.RelayRequest) (*types.RelayReply, error)
- func (m *MockRelayerServer) RelaySubscribe(arg0 *types.RelayRequest, arg1 types.Relayer_RelaySubscribeServer) error
- type MockRelayerServerMockRecorder
- type MockRelayer_RelaySubscribeClient
- func (m *MockRelayer_RelaySubscribeClient) CloseSend() error
- func (m *MockRelayer_RelaySubscribeClient) Context() context.Context
- func (m *MockRelayer_RelaySubscribeClient) EXPECT() *MockRelayer_RelaySubscribeClientMockRecorder
- func (m *MockRelayer_RelaySubscribeClient) Header() (metadata.MD, error)
- func (m *MockRelayer_RelaySubscribeClient) Recv() (*types.RelayReply, error)
- func (m_2 *MockRelayer_RelaySubscribeClient) RecvMsg(m any) error
- func (m_2 *MockRelayer_RelaySubscribeClient) SendMsg(m any) error
- func (m *MockRelayer_RelaySubscribeClient) Trailer() metadata.MD
- type MockRelayer_RelaySubscribeClientMockRecorder
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) CloseSend() *gomock.Call
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Context() *gomock.Call
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Header() *gomock.Call
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Recv() *gomock.Call
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) RecvMsg(m any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) SendMsg(m any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Trailer() *gomock.Call
- type MockRelayer_RelaySubscribeServer
- func (m *MockRelayer_RelaySubscribeServer) Context() context.Context
- func (m *MockRelayer_RelaySubscribeServer) EXPECT() *MockRelayer_RelaySubscribeServerMockRecorder
- func (m_2 *MockRelayer_RelaySubscribeServer) RecvMsg(m any) error
- func (m *MockRelayer_RelaySubscribeServer) Send(arg0 *types.RelayReply) error
- func (m *MockRelayer_RelaySubscribeServer) SendHeader(arg0 metadata.MD) error
- func (m_2 *MockRelayer_RelaySubscribeServer) SendMsg(m any) error
- func (m *MockRelayer_RelaySubscribeServer) SetHeader(arg0 metadata.MD) error
- func (m *MockRelayer_RelaySubscribeServer) SetTrailer(arg0 metadata.MD)
- type MockRelayer_RelaySubscribeServerMockRecorder
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Context() *gomock.Call
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) RecvMsg(m any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Send(arg0 any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendHeader(arg0 any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendMsg(m any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetHeader(arg0 any) *gomock.Call
- func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetTrailer(arg0 any) *gomock.Call
- type RPCConsumer
- type RPCConsumerServer
- func (rpccs *RPCConsumerServer) CancelSubscriptionContext(subscriptionKey string)
- func (rpccs *RPCConsumerServer) CreateDappKey(userData common.UserData) string
- func (rpccs *RPCConsumerServer) GetChainIdAndApiInterface() (string, string)
- func (rpccs *RPCConsumerServer) GetExtensionParser() *extensionslib.ExtensionParser
- func (rpccs *RPCConsumerServer) GetListeningAddress() string
- func (rpccs *RPCConsumerServer) HandleDirectiveHeadersForMessage(chainMessage chainlib.ChainMessage, directiveHeaders map[string]string)
- func (rpccs *RPCConsumerServer) IsHealthy() bool
- func (rpccs *RPCConsumerServer) IsInitialized() bool
- func (rpccs *RPCConsumerServer) LavaDirectiveHeaders(metadata []pairingtypes.Metadata) ([]pairingtypes.Metadata, map[string]string)
- func (rpccs *RPCConsumerServer) ParseRelay(ctx context.Context, url string, req string, connectionType string, ...) (protocolMessage chainlib.ProtocolMessage, err error)
- func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, protocolMessage chainlib.ProtocolMessage, ...) (*RelayProcessor, error)
- func (rpccs *RPCConsumerServer) RoundTrip(req *http.Request) (*http.Response, error)
- func (rpccs *RPCConsumerServer) SendParsedRelay(ctx context.Context, analytics *metrics.RelayMetrics, ...) (relayResult *common.RelayResult, errRet error)
- func (rpccs *RPCConsumerServer) SendRelay(ctx context.Context, url string, req string, connectionType string, ...) (relayResult *common.RelayResult, errRet error)
- func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, ...) (err error)
- func (rpccs *RPCConsumerServer) SetConsistencySeenBlock(blockSeen int64, key string)
- type RelayError
- type RelayErrors
- type RelayParserInf
- type RelayProcessor
- func (rp *RelayProcessor) GetAllowSessionDegradation() bool
- func (rp *RelayProcessor) GetUsedProviders() *lavasession.UsedProviders
- func (rp *RelayProcessor) HasRequiredNodeResults() (bool, int)
- func (rp *RelayProcessor) NodeResults() []common.RelayResult
- func (rp *RelayProcessor) ProcessingResult() (returnedResult *common.RelayResult, processingError error)
- func (rp *RelayProcessor) SetDisallowDegradation()
- func (rp *RelayProcessor) SetResponse(response *relayResponse)
- func (rp *RelayProcessor) String() string
- func (rp *RelayProcessor) WaitForResults(ctx context.Context) error
- type RelayState
- func (rs *RelayState) CheckIsArchive(relayRequestData *pairingtypes.RelayPrivateData) bool
- func (rs *RelayState) GetIsArchive() bool
- func (rs *RelayState) GetIsEarliestUsed() bool
- func (rs *RelayState) GetIsUpgraded() bool
- func (rs *RelayState) GetProtocolMessage() chainlib.ProtocolMessage
- func (rs *RelayState) GetStateNumber() int
- func (rs *RelayState) SetIsArchive(isArchive bool)
- func (rs *RelayState) SetIsEarliestUsed()
- func (rs *RelayState) SetProtocolMessage(protocolMessage chainlib.ProtocolMessage)
- type RelayStateMachine
- type RelayStateSendInstructions
- type ResultsCheckerInf
- type ResultsManager
- type ResultsManagerInst
- func (rp *ResultsManagerInst) GetBestNodeErrorMessageForUser() RelayError
- func (rp *ResultsManagerInst) GetBestProtocolErrorMessageForUser() RelayError
- func (rm *ResultsManagerInst) GetResults() (success int, nodeErrors int, protocolErrors int)
- func (rp *ResultsManagerInst) GetResultsData() (successResults []common.RelayResult, nodeErrors []common.RelayResult, ...)
- func (rp *ResultsManagerInst) HasResults() bool
- func (rp *ResultsManagerInst) NodeResults() []common.RelayResult
- func (rp *ResultsManagerInst) ProtocolErrors() uint64
- func (rp *ResultsManagerInst) RequiredResults(requiredSuccesses int, selection Selection) bool
- func (rp *ResultsManagerInst) SetResponse(response *relayResponse, protocolMessage chainlib.ProtocolMessage) (nodeError error)
- func (rm *ResultsManagerInst) String() string
- type RetryHashCacheInf
- type Selection
Constants ¶
const ( CacheMaxCost = 20000 // each item cost would be 1 CacheNumCounters = 20000 // expect 2000 items EntryTTL = 5 * time.Minute )
this class handles seen block values in requests
const ( DefaultRPCConsumerFileName = "rpcconsumer.yml" DebugRelaysFlagName = "debug-relays" DebugProbesFlagName = "debug-probes" LavaOverLavaBackupFlagName = "use-lava-over-lava-backup" )
const ( // maximum number of retries to send due to the ticker, if we didn't get a response after 10 different attempts then just wait. MaximumNumberOfTickerRelayRetries = 10 MaxRelayRetries = 6 SendRelayAttempts = 3 )
const (
MaxCallsPerRelay = 50
)
Variables ¶
var ( Yaml_config_properties = []string{"network-address", "chain-id", "api-interface"} RelaysHealthEnableFlagDefault = true RelayHealthIntervalFlagDefault = 5 * time.Minute )
var NoResponseTimeout = sdkerrors.New("NoResponseTimeout Error", 685, "timeout occurred while waiting for providers responses")
Functions ¶
func ParseEndpoints ¶
func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints []*lavasession.RPCEndpoint, err error)
Types ¶
type ArchiveStatus ¶ added in v4.1.3
type ArchiveStatus struct {
// contains filtered or unexported fields
}
func (*ArchiveStatus) Copy ¶ added in v4.1.3
func (as *ArchiveStatus) Copy() *ArchiveStatus
type CancelableContextHolder ¶
type CancelableContextHolder struct { Ctx context.Context CancelFunc context.CancelFunc }
type ConsumerConsistency ¶
type ConsumerConsistency struct {
// contains filtered or unexported fields
}
func NewConsumerConsistency ¶
func NewConsumerConsistency(specId string) *ConsumerConsistency
func (*ConsumerConsistency) GetSeenBlock ¶
func (cc *ConsumerConsistency) GetSeenBlock(userData common.UserData) (int64, bool)
func (*ConsumerConsistency) Key ¶
func (cc *ConsumerConsistency) Key(userData common.UserData) string
func (*ConsumerConsistency) SetSeenBlock ¶
func (cc *ConsumerConsistency) SetSeenBlock(blockSeen int64, userData common.UserData)
func (*ConsumerConsistency) SetSeenBlockFromKey ¶
func (cc *ConsumerConsistency) SetSeenBlockFromKey(blockSeen int64, key string)
used on subscription, where we already have the dapp key stored, but we don't keep the dappId and ip separately
type ConsumerRelaySender ¶
type ConsumerRelaySender interface { GetChainIdAndApiInterface() (string, string) ParseRelay( ctx context.Context, url string, req string, connectionType string, dappID string, consumerIp string, metadata []pairingtypes.Metadata, ) (protocolMessage chainlib.ProtocolMessage, err error) GetExtensionParser() *extensionslib.ExtensionParser // contains filtered or unexported methods }
type ConsumerRelayStateMachine ¶
type ConsumerRelayStateMachine struct {
// contains filtered or unexported fields
}
func (*ConsumerRelayStateMachine) GetDebugState ¶
func (crsm *ConsumerRelayStateMachine) GetDebugState() bool
func (*ConsumerRelayStateMachine) GetProtocolMessage ¶
func (crsm *ConsumerRelayStateMachine) GetProtocolMessage() chainlib.ProtocolMessage
func (*ConsumerRelayStateMachine) GetRelayTaskChannel ¶
func (crsm *ConsumerRelayStateMachine) GetRelayTaskChannel() (chan RelayStateSendInstructions, error)
func (*ConsumerRelayStateMachine) GetSelection ¶
func (crsm *ConsumerRelayStateMachine) GetSelection() Selection
func (*ConsumerRelayStateMachine) GetUsedProviders ¶
func (crsm *ConsumerRelayStateMachine) GetUsedProviders() *lavasession.UsedProviders
func (*ConsumerRelayStateMachine) Initialized ¶ added in v4.1.3
func (crsm *ConsumerRelayStateMachine) Initialized() bool
func (*ConsumerRelayStateMachine) SetRelayRetriesManager ¶ added in v4.1.3
func (crsm *ConsumerRelayStateMachine) SetRelayRetriesManager(relayRetriesManager *lavaprotocol.RelayRetriesManager)
func (*ConsumerRelayStateMachine) SetResultsChecker ¶ added in v4.1.3
func (crsm *ConsumerRelayStateMachine) SetResultsChecker(resultsChecker ResultsCheckerInf)
func (*ConsumerRelayStateMachine) UpdateBatch ¶
func (crsm *ConsumerRelayStateMachine) UpdateBatch(err error)
type ConsumerStateTrackerInf ¶
type ConsumerStateTrackerInf interface { RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, versionValidator updaters.VersionValidationInf) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager, staticProvidersList []*lavasession.RPCProviderEndpoint) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error RegisterFinalizationConsensusForUpdates(context.Context, *finalizationconsensus.FinalizationConsensus) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error) GetProtocolVersion(ctx context.Context) (*updaters.ProtocolVersionResponse, error) GetLatestVirtualEpoch() uint64 }
type ConsumerTxSender ¶
type ConsumerTxSender interface { TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error) GetLatestVirtualEpoch() uint64 }
type CustomLavaTransport ¶ added in v4.1.4
type CustomLavaTransport struct {
// contains filtered or unexported fields
}
func NewCustomLavaTransport ¶ added in v4.1.4
func NewCustomLavaTransport(httpTransport http.RoundTripper, secondaryTransport http.RoundTripper) *CustomLavaTransport
func (*CustomLavaTransport) SetSecondaryTransport ¶ added in v4.1.4
func (c *CustomLavaTransport) SetSecondaryTransport(secondaryTransport http.RoundTripper)
func (*CustomLavaTransport) TogglePrimarySecondaryTransport ¶ added in v4.1.4
func (c *CustomLavaTransport) TogglePrimarySecondaryTransport()
used to switch the primary and secondary transports, in case the primary one fails too much
type MetricsInterface ¶
type MockConsumerStateTrackerInf ¶
type MockConsumerStateTrackerInf struct {
// contains filtered or unexported fields
}
MockConsumerStateTrackerInf is a mock of ConsumerStateTrackerInf interface.
func NewMockConsumerStateTrackerInf ¶
func NewMockConsumerStateTrackerInf(ctrl *gomock.Controller) *MockConsumerStateTrackerInf
NewMockConsumerStateTrackerInf creates a new mock instance.
func (*MockConsumerStateTrackerInf) EXPECT ¶
func (m *MockConsumerStateTrackerInf) EXPECT() *MockConsumerStateTrackerInfMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConsumerStateTrackerInf) GetConsumerPolicy ¶
func (m *MockConsumerStateTrackerInf) GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*types0.Policy, error)
GetConsumerPolicy mocks base method.
func (*MockConsumerStateTrackerInf) GetLatestVirtualEpoch ¶
func (m *MockConsumerStateTrackerInf) GetLatestVirtualEpoch() uint64
GetLatestVirtualEpoch mocks base method.
func (*MockConsumerStateTrackerInf) GetProtocolVersion ¶
func (m *MockConsumerStateTrackerInf) GetProtocolVersion(ctx context.Context) (*updaters.ProtocolVersionResponse, error)
GetProtocolVersion mocks base method.
func (*MockConsumerStateTrackerInf) RegisterConsumerSessionManagerForPairingUpdates ¶
func (m *MockConsumerStateTrackerInf) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager, staticProviders []*lavasession.RPCProviderEndpoint)
RegisterConsumerSessionManagerForPairingUpdates mocks base method.
func (*MockConsumerStateTrackerInf) RegisterFinalizationConsensusForUpdates ¶
func (m *MockConsumerStateTrackerInf) RegisterFinalizationConsensusForUpdates(arg0 context.Context, arg1 *finalizationconsensus.FinalizationConsensus)
RegisterFinalizationConsensusForUpdates mocks base method.
func (*MockConsumerStateTrackerInf) RegisterForDowntimeParamsUpdates ¶
func (m *MockConsumerStateTrackerInf) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error
RegisterForDowntimeParamsUpdates mocks base method.
func (*MockConsumerStateTrackerInf) RegisterForSpecUpdates ¶
func (m *MockConsumerStateTrackerInf) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error
RegisterForSpecUpdates mocks base method.
func (*MockConsumerStateTrackerInf) RegisterForVersionUpdates ¶
func (m *MockConsumerStateTrackerInf) RegisterForVersionUpdates(ctx context.Context, version *types1.Version, versionValidator updaters.VersionValidationInf)
RegisterForVersionUpdates mocks base method.
func (*MockConsumerStateTrackerInf) TxConflictDetection ¶
func (m *MockConsumerStateTrackerInf) TxConflictDetection(ctx context.Context, finalizationConflict *types.FinalizationConflict, responseConflict *types.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error
TxConflictDetection mocks base method.
type MockConsumerStateTrackerInfMockRecorder ¶
type MockConsumerStateTrackerInfMockRecorder struct {
// contains filtered or unexported fields
}
MockConsumerStateTrackerInfMockRecorder is the mock recorder for MockConsumerStateTrackerInf.
func (*MockConsumerStateTrackerInfMockRecorder) GetConsumerPolicy ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) GetConsumerPolicy(ctx, consumerAddress, chainID any) *gomock.Call
GetConsumerPolicy indicates an expected call of GetConsumerPolicy.
func (*MockConsumerStateTrackerInfMockRecorder) GetLatestVirtualEpoch ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) GetLatestVirtualEpoch() *gomock.Call
GetLatestVirtualEpoch indicates an expected call of GetLatestVirtualEpoch.
func (*MockConsumerStateTrackerInfMockRecorder) GetProtocolVersion ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) GetProtocolVersion(ctx any) *gomock.Call
GetProtocolVersion indicates an expected call of GetProtocolVersion.
func (*MockConsumerStateTrackerInfMockRecorder) RegisterConsumerSessionManagerForPairingUpdates ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterConsumerSessionManagerForPairingUpdates(ctx, consumerSessionManager any) *gomock.Call
RegisterConsumerSessionManagerForPairingUpdates indicates an expected call of RegisterConsumerSessionManagerForPairingUpdates.
func (*MockConsumerStateTrackerInfMockRecorder) RegisterFinalizationConsensusForUpdates ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterFinalizationConsensusForUpdates(arg0, arg1 any) *gomock.Call
RegisterFinalizationConsensusForUpdates indicates an expected call of RegisterFinalizationConsensusForUpdates.
func (*MockConsumerStateTrackerInfMockRecorder) RegisterForDowntimeParamsUpdates ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForDowntimeParamsUpdates(ctx, downtimeParamsUpdatable any) *gomock.Call
RegisterForDowntimeParamsUpdates indicates an expected call of RegisterForDowntimeParamsUpdates.
func (*MockConsumerStateTrackerInfMockRecorder) RegisterForSpecUpdates ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForSpecUpdates(ctx, specUpdatable, endpoint any) *gomock.Call
RegisterForSpecUpdates indicates an expected call of RegisterForSpecUpdates.
func (*MockConsumerStateTrackerInfMockRecorder) RegisterForVersionUpdates ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForVersionUpdates(ctx, version, versionValidator any) *gomock.Call
RegisterForVersionUpdates indicates an expected call of RegisterForVersionUpdates.
func (*MockConsumerStateTrackerInfMockRecorder) TxConflictDetection ¶
func (mr *MockConsumerStateTrackerInfMockRecorder) TxConflictDetection(ctx, finalizationConflict, responseConflict, conflictHandler any) *gomock.Call
TxConflictDetection indicates an expected call of TxConflictDetection.
type MockRelayerClient ¶
type MockRelayerClient struct {
// contains filtered or unexported fields
}
MockRelayerClient is a mock of RelayerClient interface.
func NewMockRelayerClient ¶
func NewMockRelayerClient(ctrl *gomock.Controller) *MockRelayerClient
NewMockRelayerClient creates a new mock instance.
func (*MockRelayerClient) EXPECT ¶
func (m *MockRelayerClient) EXPECT() *MockRelayerClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRelayerClient) Probe ¶
func (m *MockRelayerClient) Probe(ctx context.Context, in *types.ProbeRequest, opts ...grpc.CallOption) (*types.ProbeReply, error)
Probe mocks base method.
func (*MockRelayerClient) Relay ¶
func (m *MockRelayerClient) Relay(ctx context.Context, in *types.RelayRequest, opts ...grpc.CallOption) (*types.RelayReply, error)
Relay mocks base method.
func (*MockRelayerClient) RelaySubscribe ¶
func (m *MockRelayerClient) RelaySubscribe(ctx context.Context, in *types.RelayRequest, opts ...grpc.CallOption) (types.Relayer_RelaySubscribeClient, error)
RelaySubscribe mocks base method.
type MockRelayerClientMockRecorder ¶
type MockRelayerClientMockRecorder struct {
// contains filtered or unexported fields
}
MockRelayerClientMockRecorder is the mock recorder for MockRelayerClient.
func (*MockRelayerClientMockRecorder) Probe ¶
func (mr *MockRelayerClientMockRecorder) Probe(ctx, in any, opts ...any) *gomock.Call
Probe indicates an expected call of Probe.
func (*MockRelayerClientMockRecorder) Relay ¶
func (mr *MockRelayerClientMockRecorder) Relay(ctx, in any, opts ...any) *gomock.Call
Relay indicates an expected call of Relay.
func (*MockRelayerClientMockRecorder) RelaySubscribe ¶
func (mr *MockRelayerClientMockRecorder) RelaySubscribe(ctx, in any, opts ...any) *gomock.Call
RelaySubscribe indicates an expected call of RelaySubscribe.
type MockRelayerServer ¶
type MockRelayerServer struct {
// contains filtered or unexported fields
}
MockRelayerServer is a mock of RelayerServer interface.
func NewMockRelayerServer ¶
func NewMockRelayerServer(ctrl *gomock.Controller) *MockRelayerServer
NewMockRelayerServer creates a new mock instance.
func (*MockRelayerServer) EXPECT ¶
func (m *MockRelayerServer) EXPECT() *MockRelayerServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRelayerServer) Probe ¶
func (m *MockRelayerServer) Probe(arg0 context.Context, arg1 *types.ProbeRequest) (*types.ProbeReply, error)
Probe mocks base method.
func (*MockRelayerServer) Relay ¶
func (m *MockRelayerServer) Relay(arg0 context.Context, arg1 *types.RelayRequest) (*types.RelayReply, error)
Relay mocks base method.
func (*MockRelayerServer) RelaySubscribe ¶
func (m *MockRelayerServer) RelaySubscribe(arg0 *types.RelayRequest, arg1 types.Relayer_RelaySubscribeServer) error
RelaySubscribe mocks base method.
type MockRelayerServerMockRecorder ¶
type MockRelayerServerMockRecorder struct {
// contains filtered or unexported fields
}
MockRelayerServerMockRecorder is the mock recorder for MockRelayerServer.
func (*MockRelayerServerMockRecorder) Probe ¶
func (mr *MockRelayerServerMockRecorder) Probe(arg0, arg1 any) *gomock.Call
Probe indicates an expected call of Probe.
func (*MockRelayerServerMockRecorder) Relay ¶
func (mr *MockRelayerServerMockRecorder) Relay(arg0, arg1 any) *gomock.Call
Relay indicates an expected call of Relay.
func (*MockRelayerServerMockRecorder) RelaySubscribe ¶
func (mr *MockRelayerServerMockRecorder) RelaySubscribe(arg0, arg1 any) *gomock.Call
RelaySubscribe indicates an expected call of RelaySubscribe.
type MockRelayer_RelaySubscribeClient ¶
type MockRelayer_RelaySubscribeClient struct {
// contains filtered or unexported fields
}
MockRelayer_RelaySubscribeClient is a mock of Relayer_RelaySubscribeClient interface.
func NewMockRelayer_RelaySubscribeClient ¶
func NewMockRelayer_RelaySubscribeClient(ctrl *gomock.Controller) *MockRelayer_RelaySubscribeClient
NewMockRelayer_RelaySubscribeClient creates a new mock instance.
func (*MockRelayer_RelaySubscribeClient) CloseSend ¶
func (m *MockRelayer_RelaySubscribeClient) CloseSend() error
CloseSend mocks base method.
func (*MockRelayer_RelaySubscribeClient) Context ¶
func (m *MockRelayer_RelaySubscribeClient) Context() context.Context
Context mocks base method.
func (*MockRelayer_RelaySubscribeClient) EXPECT ¶
func (m *MockRelayer_RelaySubscribeClient) EXPECT() *MockRelayer_RelaySubscribeClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRelayer_RelaySubscribeClient) Header ¶
func (m *MockRelayer_RelaySubscribeClient) Header() (metadata.MD, error)
Header mocks base method.
func (*MockRelayer_RelaySubscribeClient) Recv ¶
func (m *MockRelayer_RelaySubscribeClient) Recv() (*types.RelayReply, error)
Recv mocks base method.
func (*MockRelayer_RelaySubscribeClient) RecvMsg ¶
func (m_2 *MockRelayer_RelaySubscribeClient) RecvMsg(m any) error
RecvMsg mocks base method.
func (*MockRelayer_RelaySubscribeClient) SendMsg ¶
func (m_2 *MockRelayer_RelaySubscribeClient) SendMsg(m any) error
SendMsg mocks base method.
func (*MockRelayer_RelaySubscribeClient) Trailer ¶
func (m *MockRelayer_RelaySubscribeClient) Trailer() metadata.MD
Trailer mocks base method.
type MockRelayer_RelaySubscribeClientMockRecorder ¶
type MockRelayer_RelaySubscribeClientMockRecorder struct {
// contains filtered or unexported fields
}
MockRelayer_RelaySubscribeClientMockRecorder is the mock recorder for MockRelayer_RelaySubscribeClient.
func (*MockRelayer_RelaySubscribeClientMockRecorder) CloseSend ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) CloseSend() *gomock.Call
CloseSend indicates an expected call of CloseSend.
func (*MockRelayer_RelaySubscribeClientMockRecorder) Context ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context.
func (*MockRelayer_RelaySubscribeClientMockRecorder) Header ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Header() *gomock.Call
Header indicates an expected call of Header.
func (*MockRelayer_RelaySubscribeClientMockRecorder) Recv ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Recv() *gomock.Call
Recv indicates an expected call of Recv.
func (*MockRelayer_RelaySubscribeClientMockRecorder) RecvMsg ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) RecvMsg(m any) *gomock.Call
RecvMsg indicates an expected call of RecvMsg.
func (*MockRelayer_RelaySubscribeClientMockRecorder) SendMsg ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) SendMsg(m any) *gomock.Call
SendMsg indicates an expected call of SendMsg.
func (*MockRelayer_RelaySubscribeClientMockRecorder) Trailer ¶
func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Trailer() *gomock.Call
Trailer indicates an expected call of Trailer.
type MockRelayer_RelaySubscribeServer ¶
type MockRelayer_RelaySubscribeServer struct {
// contains filtered or unexported fields
}
MockRelayer_RelaySubscribeServer is a mock of Relayer_RelaySubscribeServer interface.
func NewMockRelayer_RelaySubscribeServer ¶
func NewMockRelayer_RelaySubscribeServer(ctrl *gomock.Controller) *MockRelayer_RelaySubscribeServer
NewMockRelayer_RelaySubscribeServer creates a new mock instance.
func (*MockRelayer_RelaySubscribeServer) Context ¶
func (m *MockRelayer_RelaySubscribeServer) Context() context.Context
Context mocks base method.
func (*MockRelayer_RelaySubscribeServer) EXPECT ¶
func (m *MockRelayer_RelaySubscribeServer) EXPECT() *MockRelayer_RelaySubscribeServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRelayer_RelaySubscribeServer) RecvMsg ¶
func (m_2 *MockRelayer_RelaySubscribeServer) RecvMsg(m any) error
RecvMsg mocks base method.
func (*MockRelayer_RelaySubscribeServer) Send ¶
func (m *MockRelayer_RelaySubscribeServer) Send(arg0 *types.RelayReply) error
Send mocks base method.
func (*MockRelayer_RelaySubscribeServer) SendHeader ¶
func (m *MockRelayer_RelaySubscribeServer) SendHeader(arg0 metadata.MD) error
SendHeader mocks base method.
func (*MockRelayer_RelaySubscribeServer) SendMsg ¶
func (m_2 *MockRelayer_RelaySubscribeServer) SendMsg(m any) error
SendMsg mocks base method.
func (*MockRelayer_RelaySubscribeServer) SetHeader ¶
func (m *MockRelayer_RelaySubscribeServer) SetHeader(arg0 metadata.MD) error
SetHeader mocks base method.
func (*MockRelayer_RelaySubscribeServer) SetTrailer ¶
func (m *MockRelayer_RelaySubscribeServer) SetTrailer(arg0 metadata.MD)
SetTrailer mocks base method.
type MockRelayer_RelaySubscribeServerMockRecorder ¶
type MockRelayer_RelaySubscribeServerMockRecorder struct {
// contains filtered or unexported fields
}
MockRelayer_RelaySubscribeServerMockRecorder is the mock recorder for MockRelayer_RelaySubscribeServer.
func (*MockRelayer_RelaySubscribeServerMockRecorder) Context ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context.
func (*MockRelayer_RelaySubscribeServerMockRecorder) RecvMsg ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) RecvMsg(m any) *gomock.Call
RecvMsg indicates an expected call of RecvMsg.
func (*MockRelayer_RelaySubscribeServerMockRecorder) Send ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Send(arg0 any) *gomock.Call
Send indicates an expected call of Send.
func (*MockRelayer_RelaySubscribeServerMockRecorder) SendHeader ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendHeader(arg0 any) *gomock.Call
SendHeader indicates an expected call of SendHeader.
func (*MockRelayer_RelaySubscribeServerMockRecorder) SendMsg ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendMsg(m any) *gomock.Call
SendMsg indicates an expected call of SendMsg.
func (*MockRelayer_RelaySubscribeServerMockRecorder) SetHeader ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetHeader(arg0 any) *gomock.Call
SetHeader indicates an expected call of SetHeader.
func (*MockRelayer_RelaySubscribeServerMockRecorder) SetTrailer ¶
func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetTrailer(arg0 any) *gomock.Call
SetTrailer indicates an expected call of SetTrailer.
type RPCConsumer ¶
type RPCConsumer struct {
// contains filtered or unexported fields
}
func (*RPCConsumer) CreateConsumerEndpoint ¶ added in v4.1.4
func (rpcc *RPCConsumer) CreateConsumerEndpoint( ctx context.Context, rpcEndpoint *lavasession.RPCEndpoint, errCh chan error, consumerAddr sdk.AccAddress, consumerStateTracker *statetracker.ConsumerStateTracker, policyUpdaters *common.SafeSyncMap[string, *updaters.PolicyUpdater], optimizers *common.SafeSyncMap[string, *provideroptimizer.ProviderOptimizer], consumerConsistencies *common.SafeSyncMap[string, *ConsumerConsistency], finalizationConsensuses *common.SafeSyncMap[string, *finalizationconsensus.FinalizationConsensus], chainMutexes map[string]*sync.Mutex, options *rpcConsumerStartOptions, privKey *secp256k1.PrivateKey, lavaChainID string, rpcConsumerMetrics *metrics.RPCConsumerLogs, consumerReportsManager *metrics.ConsumerReportsClient, consumerOptimizerQoSClient *metrics.ConsumerOptimizerQoSClient, consumerMetricsManager *metrics.ConsumerMetricsManager, relaysMonitorAggregator *metrics.RelaysMonitorAggregator, ) (*RPCConsumerServer, error)
type RPCConsumerServer ¶
type RPCConsumerServer struct { ConsumerAddress sdk.AccAddress // contains filtered or unexported fields }
implements Relay Sender interfaced and uses an ChainListener to get it called
func (*RPCConsumerServer) CancelSubscriptionContext ¶
func (rpccs *RPCConsumerServer) CancelSubscriptionContext(subscriptionKey string)
func (*RPCConsumerServer) CreateDappKey ¶
func (rpccs *RPCConsumerServer) CreateDappKey(userData common.UserData) string
func (*RPCConsumerServer) GetChainIdAndApiInterface ¶
func (rpccs *RPCConsumerServer) GetChainIdAndApiInterface() (string, string)
func (*RPCConsumerServer) GetExtensionParser ¶ added in v4.1.3
func (rpccs *RPCConsumerServer) GetExtensionParser() *extensionslib.ExtensionParser
func (*RPCConsumerServer) GetListeningAddress ¶
func (rpccs *RPCConsumerServer) GetListeningAddress() string
func (*RPCConsumerServer) HandleDirectiveHeadersForMessage ¶
func (rpccs *RPCConsumerServer) HandleDirectiveHeadersForMessage(chainMessage chainlib.ChainMessage, directiveHeaders map[string]string)
func (*RPCConsumerServer) IsHealthy ¶
func (rpccs *RPCConsumerServer) IsHealthy() bool
func (*RPCConsumerServer) IsInitialized ¶ added in v4.1.4
func (rpccs *RPCConsumerServer) IsInitialized() bool
func (*RPCConsumerServer) LavaDirectiveHeaders ¶
func (rpccs *RPCConsumerServer) LavaDirectiveHeaders(metadata []pairingtypes.Metadata) ([]pairingtypes.Metadata, map[string]string)
func (*RPCConsumerServer) ParseRelay ¶
func (rpccs *RPCConsumerServer) ParseRelay( ctx context.Context, url string, req string, connectionType string, dappID string, consumerIp string, metadata []pairingtypes.Metadata, ) (protocolMessage chainlib.ProtocolMessage, err error)
func (*RPCConsumerServer) ProcessRelaySend ¶
func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, protocolMessage chainlib.ProtocolMessage, analytics *metrics.RelayMetrics) (*RelayProcessor, error)
func (*RPCConsumerServer) SendParsedRelay ¶
func (rpccs *RPCConsumerServer) SendParsedRelay( ctx context.Context, analytics *metrics.RelayMetrics, protocolMessage chainlib.ProtocolMessage, ) (relayResult *common.RelayResult, errRet error)
func (*RPCConsumerServer) SendRelay ¶
func (rpccs *RPCConsumerServer) SendRelay( ctx context.Context, url string, req string, connectionType string, dappID string, consumerIp string, analytics *metrics.RelayMetrics, metadata []pairingtypes.Metadata, ) (relayResult *common.RelayResult, errRet error)
func (*RPCConsumerServer) ServeRPCRequests ¶
func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, consumerStateTracker ConsumerStateTrackerInf, chainParser chainlib.ChainParser, finalizationConsensus finalizationconsensus.FinalizationConsensusInf, consumerSessionManager *lavasession.ConsumerSessionManager, requiredResponses int, privKey *btcec.PrivateKey, lavaChainID string, cache *performance.Cache, rpcConsumerLogs *metrics.RPCConsumerLogs, consumerAddress sdk.AccAddress, consumerConsistency *ConsumerConsistency, relaysMonitor *metrics.RelaysMonitor, cmdFlags common.ConsumerCmdFlags, sharedState bool, refererData *chainlib.RefererData, reporter metrics.Reporter, consumerWsSubscriptionManager *chainlib.ConsumerWSSubscriptionManager, ) (err error)
func (*RPCConsumerServer) SetConsistencySeenBlock ¶
func (rpccs *RPCConsumerServer) SetConsistencySeenBlock(blockSeen int64, key string)
type RelayError ¶
type RelayError struct { ProviderInfo common.ProviderInfo // contains filtered or unexported fields }
TODO: there's no need to save error twice and provider info twice, this can just be a relayResponse
func (RelayError) String ¶
func (re RelayError) String() string
type RelayErrors ¶
type RelayErrors struct {
// contains filtered or unexported fields
}
func (*RelayErrors) GetBestErrorMessageForUser ¶
func (r *RelayErrors) GetBestErrorMessageForUser() RelayError
type RelayParserInf ¶ added in v4.1.3
type RelayProcessor ¶
type RelayProcessor struct { ResultsManager RelayStateMachine // contains filtered or unexported fields }
func NewRelayProcessor ¶
func NewRelayProcessor( ctx context.Context, requiredSuccesses int, consumerConsistency *ConsumerConsistency, metricsInf MetricsInterface, chainIdAndApiInterfaceGetter chainIdAndApiInterfaceGetter, relayRetriesManager *lavaprotocol.RelayRetriesManager, relayStateMachine RelayStateMachine, ) *RelayProcessor
func (*RelayProcessor) GetAllowSessionDegradation ¶
func (rp *RelayProcessor) GetAllowSessionDegradation() bool
true if we never got an extension. (default value)
func (*RelayProcessor) GetUsedProviders ¶
func (rp *RelayProcessor) GetUsedProviders() *lavasession.UsedProviders
func (*RelayProcessor) HasRequiredNodeResults ¶
func (rp *RelayProcessor) HasRequiredNodeResults() (bool, int)
func (*RelayProcessor) NodeResults ¶
func (rp *RelayProcessor) NodeResults() []common.RelayResult
this function returns all results that came from a node, meaning success, and node errors
func (*RelayProcessor) ProcessingResult ¶
func (rp *RelayProcessor) ProcessingResult() (returnedResult *common.RelayResult, processingError error)
this function returns the results according to the defined strategy results were stored in WaitForResults and now there's logic to select which results are returned to the user will return an error if we did not meet quota of replies, if we did we follow the strategies: if return strategy == get_first: return the first success, if none: get best node error if strategy == quorum get majority of node responses on error: we will return a placeholder relayResult, with a provider address and a status code
func (*RelayProcessor) SetDisallowDegradation ¶
func (rp *RelayProcessor) SetDisallowDegradation()
in case we had an extension and managed to get a session successfully, we prevent session degradation.
func (*RelayProcessor) SetResponse ¶
func (rp *RelayProcessor) SetResponse(response *relayResponse)
func (*RelayProcessor) String ¶
func (rp *RelayProcessor) String() string
func (*RelayProcessor) WaitForResults ¶
func (rp *RelayProcessor) WaitForResults(ctx context.Context) error
this function waits for the processing results, they are written by multiple go routines and read by this go routine it then updates the responses in their respective place, node errors, protocol errors or success results
type RelayState ¶ added in v4.1.3
type RelayState struct {
// contains filtered or unexported fields
}
func GetEmptyRelayState ¶ added in v4.1.3
func GetEmptyRelayState(ctx context.Context, protocolMessage chainlib.ProtocolMessage) *RelayState
func NewRelayState ¶ added in v4.1.3
func NewRelayState(ctx context.Context, protocolMessage chainlib.ProtocolMessage, stateNumber int, cache RetryHashCacheInf, relayParser RelayParserInf, archiveStatus *ArchiveStatus) *RelayState
func (*RelayState) CheckIsArchive ¶ added in v4.1.3
func (rs *RelayState) CheckIsArchive(relayRequestData *pairingtypes.RelayPrivateData) bool
func (*RelayState) GetIsArchive ¶ added in v4.1.3
func (rs *RelayState) GetIsArchive() bool
func (*RelayState) GetIsEarliestUsed ¶ added in v4.1.3
func (rs *RelayState) GetIsEarliestUsed() bool
func (*RelayState) GetIsUpgraded ¶ added in v4.1.3
func (rs *RelayState) GetIsUpgraded() bool
func (*RelayState) GetProtocolMessage ¶ added in v4.1.3
func (rs *RelayState) GetProtocolMessage() chainlib.ProtocolMessage
func (*RelayState) GetStateNumber ¶ added in v4.1.3
func (rs *RelayState) GetStateNumber() int
func (*RelayState) SetIsArchive ¶ added in v4.1.3
func (rs *RelayState) SetIsArchive(isArchive bool)
func (*RelayState) SetIsEarliestUsed ¶ added in v4.1.3
func (rs *RelayState) SetIsEarliestUsed()
func (*RelayState) SetProtocolMessage ¶ added in v4.1.3
func (rs *RelayState) SetProtocolMessage(protocolMessage chainlib.ProtocolMessage)
type RelayStateMachine ¶
type RelayStateMachine interface { GetProtocolMessage() chainlib.ProtocolMessage GetDebugState() bool GetRelayTaskChannel() (chan RelayStateSendInstructions, error) UpdateBatch(err error) GetSelection() Selection GetUsedProviders() *lavasession.UsedProviders SetResultsChecker(resultsChecker ResultsCheckerInf) SetRelayRetriesManager(relayRetriesManager *lavaprotocol.RelayRetriesManager) }
func NewRelayStateMachine ¶
func NewRelayStateMachine( ctx context.Context, usedProviders *lavasession.UsedProviders, relaySender ConsumerRelaySender, protocolMessage chainlib.ProtocolMessage, analytics *metrics.RelayMetrics, debugRelays bool, tickerMetricSetter tickerMetricSetterInf, ) RelayStateMachine
type RelayStateSendInstructions ¶
type RelayStateSendInstructions struct {
// contains filtered or unexported fields
}
func (*RelayStateSendInstructions) IsDone ¶
func (rssi *RelayStateSendInstructions) IsDone() bool
type ResultsCheckerInf ¶ added in v4.1.3
type ResultsManager ¶
type ResultsManager interface { String() string NodeResults() []common.RelayResult RequiredResults(requiredSuccesses int, selection Selection) bool ProtocolErrors() uint64 HasResults() bool GetResults() (success int, nodeErrors int, protocolErrors int) GetResultsData() (successResults []common.RelayResult, nodeErrors []common.RelayResult, protocolErrors []RelayError) SetResponse(response *relayResponse, protocolMessage chainlib.ProtocolMessage) (nodeError error) GetBestNodeErrorMessageForUser() RelayError GetBestProtocolErrorMessageForUser() RelayError // contains filtered or unexported methods }
func NewResultsManager ¶
func NewResultsManager(guid uint64) ResultsManager
type ResultsManagerInst ¶
type ResultsManagerInst struct {
// contains filtered or unexported fields
}
func (*ResultsManagerInst) GetBestNodeErrorMessageForUser ¶
func (rp *ResultsManagerInst) GetBestNodeErrorMessageForUser() RelayError
func (*ResultsManagerInst) GetBestProtocolErrorMessageForUser ¶
func (rp *ResultsManagerInst) GetBestProtocolErrorMessageForUser() RelayError
func (*ResultsManagerInst) GetResults ¶
func (rm *ResultsManagerInst) GetResults() (success int, nodeErrors int, protocolErrors int)
func (*ResultsManagerInst) GetResultsData ¶
func (rp *ResultsManagerInst) GetResultsData() (successResults []common.RelayResult, nodeErrors []common.RelayResult, protocolErrors []RelayError)
func (*ResultsManagerInst) HasResults ¶
func (rp *ResultsManagerInst) HasResults() bool
this function defines if we should use the manager to return the result (meaning it has some insight and responses) or just return to the user
func (*ResultsManagerInst) NodeResults ¶
func (rp *ResultsManagerInst) NodeResults() []common.RelayResult
this function returns all results that came from a node, meaning success, and node errors
func (*ResultsManagerInst) ProtocolErrors ¶
func (rp *ResultsManagerInst) ProtocolErrors() uint64
func (*ResultsManagerInst) RequiredResults ¶
func (rp *ResultsManagerInst) RequiredResults(requiredSuccesses int, selection Selection) bool
func (*ResultsManagerInst) SetResponse ¶
func (rp *ResultsManagerInst) SetResponse(response *relayResponse, protocolMessage chainlib.ProtocolMessage) (nodeError error)
func (*ResultsManagerInst) String ¶
func (rm *ResultsManagerInst) String() string