Documentation ¶
Index ¶
- Constants
- Variables
- type ChainChannelKey
- type ChainProcessor
- type ChainProcessorCacheData
- type ChainProcessors
- type ChannelCloseLifecycle
- type ChannelKey
- type ChannelMessage
- type ChannelMessageCache
- type ChannelMessageLifecycle
- type ChannelMessagesCache
- type ChannelPacketMessagesCache
- func (c ChannelPacketMessagesCache) Cache(eventType string, k ChannelKey, sequence uint64, ...)
- func (c ChannelPacketMessagesCache) IsCached(eventType string, k ChannelKey, sequence uint64) bool
- func (c ChannelPacketMessagesCache) Merge(other ChannelPacketMessagesCache)
- func (c ChannelPacketMessagesCache) Retain(k ChannelKey, m string, pi provider.PacketInfo)
- func (c ChannelPacketMessagesCache) ShouldRetainSequence(p PathProcessors, k ChannelKey, chainID string, m string, seq uint64) bool
- type ChannelPacketStateCache
- type ChannelState
- type ChannelStateCache
- type ClientICQMessageCache
- type ClientICQMessagesCache
- type ClientICQType
- type ConnectionKey
- type ConnectionMessage
- type ConnectionMessageCache
- type ConnectionMessageLifecycle
- type ConnectionMessagesCache
- type ConnectionStateCache
- type EventProcessor
- type EventProcessorBuilder
- func (ep EventProcessorBuilder) Build() EventProcessor
- func (ep EventProcessorBuilder) WithChainProcessors(chainProcessors ...ChainProcessor) EventProcessorBuilder
- func (ep EventProcessorBuilder) WithInitialBlockHistory(initialBlockHistory uint64) EventProcessorBuilder
- func (ep EventProcessorBuilder) WithMessageLifecycle(messageLifecycle MessageLifecycle) EventProcessorBuilder
- func (ep EventProcessorBuilder) WithPathProcessors(pathProcessors ...*PathProcessor) EventProcessorBuilder
- func (ep EventProcessorBuilder) WithStuckPacket(stuckPacket *StuckPacket) EventProcessorBuilder
- type FlushLifecycle
- type IBCHeaderCache
- type IBCMessagesCache
- type MessageLifecycle
- type PacketMessage
- type PacketMessageLifecycle
- type PacketMessagesCache
- type PacketSequenceCache
- type PacketSequenceStateCache
- type PathEnd
- type PathProcessor
- func (pp *PathProcessor) HandleNewData(chainID string, cacheData ChainProcessorCacheData)
- func (pp *PathProcessor) IsRelayedChannel(chainID string, channelKey ChannelKey) bool
- func (pp *PathProcessor) IsRelevantChannel(chainID string, channelID string) bool
- func (pp *PathProcessor) IsRelevantClient(chainID string, clientID string) bool
- func (pp *PathProcessor) IsRelevantConnection(chainID string, connectionID string) bool
- func (pp *PathProcessor) OnConnectionMessage(chainID string, eventType string, onMsg func(provider.ConnectionInfo))
- func (pp *PathProcessor) PathEnd1Messages(channelKey ChannelKey, message string) PacketSequenceCache
- func (pp *PathProcessor) PathEnd2Messages(channelKey ChannelKey, message string) PacketSequenceCache
- func (pp *PathProcessor) ProcessBacklogIfReady()
- func (pp *PathProcessor) RelevantClientID(chainID string) string
- func (pp *PathProcessor) Run(ctx context.Context, cancel func())
- func (pp *PathProcessor) SetChainProviderIfApplicable(chainProvider provider.ChainProvider) bool
- func (pp *PathProcessor) SetMessageLifecycle(messageLifecycle MessageLifecycle)
- type PathProcessorMessageResp
- type PathProcessors
- type PrometheusMetrics
- func (m *PrometheusMetrics) AddPacketsObserved(pathName, chain, channel, port, eventType string, count int)
- func (m *PrometheusMetrics) IncBlockQueryFailure(chain, err string)
- func (m *PrometheusMetrics) IncPacketsRelayed(pathName, chain, channel, port, eventType string)
- func (m *PrometheusMetrics) IncTxFailure(pathName, chain, errDesc string)
- func (m *PrometheusMetrics) SetClientExpiration(pathName, chain, clientID, trustingPeriod string, ...)
- func (m *PrometheusMetrics) SetClientTrustingPeriod(pathName, chain, clientID string, trustingPeriod time.Duration)
- func (m *PrometheusMetrics) SetFeesSpent(chain, gasPrice, key, address, denom string, amount float64)
- func (m *PrometheusMetrics) SetLatestHeight(chain string, height int64)
- func (m *PrometheusMetrics) SetUnrelayedAcks(pathName, srcChain, destChain, srcChannel, destChannel string, ...)
- func (m *PrometheusMetrics) SetUnrelayedPackets(pathName, srcChain, destChain, srcChannel, destChannel string, ...)
- func (m *PrometheusMetrics) SetWalletBalance(chain, gasPrice, key, address, denom string, balance float64)
- type StuckPacket
Constants ¶
const ( RuleAllowList = "allowlist" RuleDenyList = "denylist" )
Variables ¶
var PathProcMessageCollector chan *PathProcessorMessageResp
Functions ¶
This section is empty.
Types ¶
type ChainChannelKey ¶
type ChainChannelKey struct { ChainID string CounterpartyChainID string ChannelKey ChannelKey }
type ChainProcessor ¶
type ChainProcessor interface { // Run starts the query loop for the chain which will gather applicable ibc messages and push events out to the relevant PathProcessors. // The initialBlockHistory parameter determines how many historical blocks should be fetched and processed before continuing with current blocks. // ChainProcessors should obey the context and return upon context cancellation. Run(ctx context.Context, initialBlockHistory uint64, stuckPacket *StuckPacket) error // Provider returns the ChainProvider, which provides the methods for querying, assembling IBC messages, and sending transactions. Provider() provider.ChainProvider // Set the PathProcessors that this ChainProcessor should publish relevant IBC events to. // ChainProcessors need reference to their PathProcessors and vice-versa, handled by EventProcessorBuilder.Build(). SetPathProcessors(pathProcessors PathProcessors) }
The ChainProcessor interface is responsible for polling blocks and emitting IBC message events to the PathProcessors. It is also responsible for tracking open channels and not sending messages to the PathProcessors for closed channels.
type ChainProcessorCacheData ¶
type ChainProcessorCacheData struct { IBCMessagesCache IBCMessagesCache InSync bool ClientState provider.ClientState ConnectionStateCache ConnectionStateCache ChannelStateCache ChannelStateCache LatestBlock provider.LatestBlock LatestHeader provider.IBCHeader IBCHeaderCache IBCHeaderCache }
ChainProcessorCacheData is the data sent from the ChainProcessors to the PathProcessors to keep the PathProcessors up to date with the latest info from the chains.
type ChainProcessors ¶
type ChainProcessors []ChainProcessor
ChainProcessors is a slice of ChainProcessor instances.
type ChannelCloseLifecycle ¶
type ChannelCloseLifecycle struct { SrcChainID string SrcChannelID string SrcPortID string SrcConnID string DstConnID string }
ChannelCloseLifecycle is used as a stop condition for the PathProcessor. It will attempt to finish closing the channel and terminate once the channel is closed.
type ChannelKey ¶
type ChannelKey struct { ChannelID string PortID string CounterpartyChannelID string CounterpartyPortID string }
ChannelKey is the key used for identifying channels between ChainProcessor and PathProcessor.
func ChannelInfoChannelKey ¶
func ChannelInfoChannelKey(info provider.ChannelInfo) ChannelKey
ChannelInfoChannelKey returns the applicable ChannelKey for ChannelInfo.
func PacketInfoChannelKey ¶
func PacketInfoChannelKey(eventType string, info provider.PacketInfo) (ChannelKey, error)
PacketInfoChannelKey returns the applicable ChannelKey for the chain based on the eventType.
func (ChannelKey) Counterparty ¶
func (k ChannelKey) Counterparty() ChannelKey
Counterparty flips a ChannelKey for the perspective of the counterparty chain
func (ChannelKey) MarshalLogObject ¶
func (k ChannelKey) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (ChannelKey) MsgInitKey ¶
func (k ChannelKey) MsgInitKey() ChannelKey
MsgInitKey is used for comparing MsgChannelOpenInit keys with other connection handshake messages. MsgChannelOpenInit does not have CounterpartyChannelID.
func (ChannelKey) PreInitKey ¶
func (k ChannelKey) PreInitKey() ChannelKey
PreInitKey is used for comparing pre-init keys with other connection handshake messages. Before the channel handshake, do not have ChannelID or CounterpartyChannelID.
type ChannelMessage ¶
type ChannelMessage struct { ChainID string EventType string Info provider.ChannelInfo }
type ChannelMessageCache ¶
type ChannelMessageCache map[ChannelKey]provider.ChannelInfo
ChannelMessageCache is used for caching channel handshake IBC messages for a given IBC channel.
func (ChannelMessageCache) Merge ¶
func (c ChannelMessageCache) Merge(other ChannelMessageCache)
Merge merges another ChannelMessageCache into this one.
type ChannelMessageLifecycle ¶
type ChannelMessageLifecycle struct { Initial *ChannelMessage Termination *ChannelMessage }
ChannelMessageLifecycle is used as a stop condition for the PathProcessor. It will send the Initial channel message (if non-nil), then stop once it observes the termination channel message (if non-nil).
type ChannelMessagesCache ¶
type ChannelMessagesCache map[string]ChannelMessageCache
ChannelMessagesCache is used for caching a ChannelMessageCache for a given IBC message type.
func (ChannelMessagesCache) DeleteMessages ¶
func (c ChannelMessagesCache) DeleteMessages(toDelete ...map[string][]ChannelKey)
func (ChannelMessagesCache) Merge ¶
func (c ChannelMessagesCache) Merge(other ChannelMessagesCache)
Merge merges another ChannelMessagesCache into this one.
func (ChannelMessagesCache) Retain ¶
func (c ChannelMessagesCache) Retain(k ChannelKey, m string, ibcMsg provider.ChannelInfo)
Retain assumes creates cache path if it doesn't exist, then caches message.
type ChannelPacketMessagesCache ¶
type ChannelPacketMessagesCache map[ChannelKey]PacketMessagesCache
ChannelPacketMessagesCache is used for caching a PacketMessagesCache for a given IBC channel.
func (ChannelPacketMessagesCache) Cache ¶
func (c ChannelPacketMessagesCache) Cache( eventType string, k ChannelKey, sequence uint64, packetInfo provider.PacketInfo, )
Cache stores packet info safely, generating intermediate maps along the way if necessary.
func (ChannelPacketMessagesCache) IsCached ¶
func (c ChannelPacketMessagesCache) IsCached(eventType string, k ChannelKey, sequence uint64) bool
IsCached returns true if a sequence for a channel key and event type is already cached.
func (ChannelPacketMessagesCache) Merge ¶
func (c ChannelPacketMessagesCache) Merge(other ChannelPacketMessagesCache)
Merge merges another ChannelPacketMessagesCache into this one.
func (ChannelPacketMessagesCache) Retain ¶
func (c ChannelPacketMessagesCache) Retain(k ChannelKey, m string, pi provider.PacketInfo)
Retain assumes the packet is applicable to the channels for a path processor that is subscribed to this chain processor. It creates cache path if it doesn't exist, then caches message.
func (ChannelPacketMessagesCache) ShouldRetainSequence ¶
func (c ChannelPacketMessagesCache) ShouldRetainSequence(p PathProcessors, k ChannelKey, chainID string, m string, seq uint64) bool
ShouldRetainSequence returns true if packet is applicable to the channels for path processors that are subscribed to this chain processor
type ChannelPacketStateCache ¶
type ChannelPacketStateCache map[ChannelKey]PacketSequenceStateCache
ChannelPacketStateCache is used for caching a PacketSequenceStateCache for a given IBC channel.
func (ChannelPacketStateCache) Prune ¶
func (c ChannelPacketStateCache) Prune(keep int)
Prune deletes all map entries except for the most recent (keep) for all channels.
func (ChannelPacketStateCache) State ¶
func (c ChannelPacketStateCache) State(k ChannelKey, sequence uint64) (string, bool)
func (ChannelPacketStateCache) UpdateState ¶
func (c ChannelPacketStateCache) UpdateState(k ChannelKey, sequence uint64, state string)
type ChannelState ¶
ChannelState is used for caching channel open state and a lookup for the channel order.
type ChannelStateCache ¶
type ChannelStateCache map[ChannelKey]ChannelState
ChannelStateCache maintains channel open state for multiple channels.
func (ChannelStateCache) FilterForClient ¶
func (c ChannelStateCache) FilterForClient(clientID string, channelConnections map[string]string, connectionClients map[string]string) ChannelStateCache
FilterForClient returns a filtered copy of channels on top of an underlying clientID so it can be used by other goroutines.
func (ChannelStateCache) SetOpen ¶
func (c ChannelStateCache) SetOpen(k ChannelKey, open bool, order chantypes.Order)
SetOpen sets the open state for a channel, and also the order if it is not NONE.
type ClientICQMessageCache ¶
type ClientICQMessageCache map[provider.ClientICQQueryID]provider.ClientICQInfo
ClientICQMessageCache is used for caching a client ICQ message for a given query ID.
func (ClientICQMessageCache) Merge ¶
func (c ClientICQMessageCache) Merge(other ClientICQMessageCache)
Merge merges another ClientICQMessageCache into this one.
type ClientICQMessagesCache ¶
type ClientICQMessagesCache map[ClientICQType]ClientICQMessageCache
ClientICQMessagesCache is used for caching a ClientICQMessageCache for a given type (query/response).
func (ClientICQMessagesCache) DeleteMessages ¶
func (c ClientICQMessagesCache) DeleteMessages(queryID ...provider.ClientICQQueryID)
DeleteMessages deletes cached messages for the provided query ID.
func (ClientICQMessagesCache) Merge ¶
func (c ClientICQMessagesCache) Merge(other ClientICQMessagesCache)
Merge merges another ClientICQMessagesCache into this one.
func (ClientICQMessagesCache) Retain ¶
func (c ClientICQMessagesCache) Retain(icqType ClientICQType, ci provider.ClientICQInfo)
Retain creates cache path if it doesn't exist, then caches message.
type ClientICQType ¶
type ClientICQType string
ClientICQType string wrapper for query/response type.
const ( ClientICQTypeRequest ClientICQType = "query_request" ClientICQTypeResponse ClientICQType = "query_response" )
type ConnectionKey ¶
type ConnectionKey struct { ClientID string ConnectionID string CounterpartyClientID string CounterpartyConnID string }
ConnectionKey is the key used for identifying connections between ChainProcessor and PathProcessor.
func ConnectionInfoConnectionKey ¶
func ConnectionInfoConnectionKey(info provider.ConnectionInfo) ConnectionKey
ConnectionInfoConnectionKey returns the applicable ConnectionKey for ConnectionInfo.
func (ConnectionKey) Counterparty ¶
func (connectionKey ConnectionKey) Counterparty() ConnectionKey
Counterparty flips a ConnectionKey for the perspective of the counterparty chain
func (ConnectionKey) MarshalLogObject ¶
func (k ConnectionKey) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (ConnectionKey) MsgInitKey ¶
func (connectionKey ConnectionKey) MsgInitKey() ConnectionKey
MsgInitKey is used for comparing MsgConnectionOpenInit keys with other connection handshake messages. MsgConnectionOpenInit does not have CounterpartyConnectionID.
func (ConnectionKey) PreInitKey ¶
func (connectionKey ConnectionKey) PreInitKey() ConnectionKey
PreInitKey is used for comparing pre-init keys with other connection handshake messages. Before starting a connection handshake, do not have ConnectionID or CounterpartyConnectionID.
type ConnectionMessage ¶
type ConnectionMessage struct { ChainID string EventType string Info provider.ConnectionInfo }
type ConnectionMessageCache ¶
type ConnectionMessageCache map[ConnectionKey]provider.ConnectionInfo
ConnectionMessageCache is used for caching connection handshake IBC messages for a given IBC connection.
func (ConnectionMessageCache) Merge ¶
func (c ConnectionMessageCache) Merge(other ConnectionMessageCache)
Merge merges another ConnectionMessageCache into this one.
type ConnectionMessageLifecycle ¶
type ConnectionMessageLifecycle struct { Initial *ConnectionMessage Termination *ConnectionMessage }
ConnectionMessageLifecycle is used as a stop condition for the PathProcessor. It will send the Initial connection message (if non-nil), then stop once it observes the termination connection message (if non-nil).
type ConnectionMessagesCache ¶
type ConnectionMessagesCache map[string]ConnectionMessageCache
ConnectionMessagesCache is used for caching a ConnectionMessageCache for a given IBC message type.
func (ConnectionMessagesCache) DeleteMessages ¶
func (c ConnectionMessagesCache) DeleteMessages(toDelete ...map[string][]ConnectionKey)
func (ConnectionMessagesCache) Merge ¶
func (c ConnectionMessagesCache) Merge(other ConnectionMessagesCache)
Merge merges another ConnectionMessagesCache into this one.
func (ConnectionMessagesCache) Retain ¶
func (c ConnectionMessagesCache) Retain(k ConnectionKey, m string, ibcMsg provider.ConnectionInfo)
Retain assumes creates cache path if it doesn't exist, then caches message.
type ConnectionStateCache ¶
type ConnectionStateCache map[ConnectionKey]bool
ConnectionStateCache maintains connection open state for multiple connections.
func (ConnectionStateCache) FilterForClient ¶
func (c ConnectionStateCache) FilterForClient(clientID string) ConnectionStateCache
FilterForClient makes a filtered copy of the ConnectionStateCache for a single client ID so it can be used by other goroutines.
type EventProcessor ¶
type EventProcessor struct {
// contains filtered or unexported fields
}
EventProcessor is a built instance that is ready to be executed with Run(ctx).
func (EventProcessor) Run ¶
func (ep EventProcessor) Run(ctx context.Context) error
Run is a blocking call that launches all provided PathProcessors and ChainProcessors in parallel. It will return once all PathProcessors and ChainProcessors have stopped running due to context cancellation, or if a critical error has occurred within one of the ChainProcessors.
type EventProcessorBuilder ¶
type EventProcessorBuilder struct {
// contains filtered or unexported fields
}
EventProcessorBuilder is a configuration type with .With functions used for building an EventProcessor.
func NewEventProcessor ¶
func NewEventProcessor() EventProcessorBuilder
NewEventProcessor creates a builder than can be used to construct a multi-ChainProcessor, multi-PathProcessor topology for the relayer.
func (EventProcessorBuilder) Build ¶
func (ep EventProcessorBuilder) Build() EventProcessor
Build links the relevant ChainProcessors and PathProcessors, then returns an EventProcessor that can be used to run the ChainProcessors and PathProcessors.
func (EventProcessorBuilder) WithChainProcessors ¶
func (ep EventProcessorBuilder) WithChainProcessors(chainProcessors ...ChainProcessor) EventProcessorBuilder
WithChainProcessors adds to the list of ChainProcessors to be used if the chain name has not already been added.
func (EventProcessorBuilder) WithInitialBlockHistory ¶
func (ep EventProcessorBuilder) WithInitialBlockHistory(initialBlockHistory uint64) EventProcessorBuilder
WithInitialBlockHistory sets the initial block history to query for the ChainProcessors.
func (EventProcessorBuilder) WithMessageLifecycle ¶
func (ep EventProcessorBuilder) WithMessageLifecycle(messageLifecycle MessageLifecycle) EventProcessorBuilder
WithMessageLifecycle sets the message that should be sent to a chain once in sync, and also the message that should stop the EventProcessor once observed.
func (EventProcessorBuilder) WithPathProcessors ¶
func (ep EventProcessorBuilder) WithPathProcessors(pathProcessors ...*PathProcessor) EventProcessorBuilder
WithPathProcessors adds to the list of PathProcessors to be used.
func (EventProcessorBuilder) WithStuckPacket ¶
func (ep EventProcessorBuilder) WithStuckPacket(stuckPacket *StuckPacket) EventProcessorBuilder
WithStuckPacket sets the stuck packet configuration.
type FlushLifecycle ¶
type FlushLifecycle struct{}
Flush lifecycle informs the PathProcessor to terminate once all pending messages have been flushed.
type IBCHeaderCache ¶
IBCHeaderCache holds a mapping of IBCHeaders for their block height.
func (IBCHeaderCache) Clone ¶
func (c IBCHeaderCache) Clone() IBCHeaderCache
Clone makes a deep copy of an IBCHeaderCache.
func (IBCHeaderCache) Merge ¶
func (c IBCHeaderCache) Merge(other IBCHeaderCache)
Merge merges another IBCHeaderCache into this one.
func (IBCHeaderCache) Prune ¶
func (c IBCHeaderCache) Prune(keep int)
Prune deletes all map entries except for the most recent (keep).
type IBCMessagesCache ¶
type IBCMessagesCache struct { PacketFlow ChannelPacketMessagesCache PacketState ChannelPacketStateCache ConnectionHandshake ConnectionMessagesCache ChannelHandshake ChannelMessagesCache ClientICQ ClientICQMessagesCache }
IBCMessagesCache holds cached messages for packet flows, connection handshakes, and channel handshakes. The PathProcessors use this for message correlation to determine when messages should be sent and are pruned when flows/handshakes are complete. ChainProcessors construct this for new IBC messages and pass it to the PathProcessors which will retain relevant messages for each PathProcessor.
func NewIBCMessagesCache ¶
func NewIBCMessagesCache() IBCMessagesCache
NewIBCMessagesCache returns an empty IBCMessagesCache.
func (IBCMessagesCache) Clone ¶
func (c IBCMessagesCache) Clone() IBCMessagesCache
Clone makes a deep copy of an IBCMessagesCache.
type MessageLifecycle ¶
type MessageLifecycle interface {
// contains filtered or unexported methods
}
MessageLifecycle is used to send an initial IBC message to a chain once the chains are in sync for the PathProcessor. It also allows setting a stop condition for the PathProcessor. PathProcessor will stop if it observes a message that matches the MessageLifecycle's Termination message.
type PacketMessage ¶
type PacketMessage struct { ChainID string EventType string Info provider.PacketInfo }
type PacketMessageLifecycle ¶
type PacketMessageLifecycle struct { Initial *PacketMessage Termination *PacketMessage }
PacketMessageLifecycle is used as a stop condition for the PathProcessor. It will send the Initial packet message (if non-nil), then stop once it observes the Termination packet message (if non-nil).
type PacketMessagesCache ¶
type PacketMessagesCache map[string]PacketSequenceCache
PacketMessagesCache is used for caching a PacketSequenceCache for a given IBC message type.
func (PacketMessagesCache) Clone ¶
func (c PacketMessagesCache) Clone() PacketMessagesCache
Clone creates a deep copy of a PacketMessagesCache.
func (PacketMessagesCache) DeleteMessages ¶
func (c PacketMessagesCache) DeleteMessages(toDelete ...map[string][]uint64)
func (PacketMessagesCache) Merge ¶
func (c PacketMessagesCache) Merge(other PacketMessagesCache)
Merge merges another PacketMessagesCache into this one.
type PacketSequenceCache ¶
type PacketSequenceCache map[uint64]provider.PacketInfo
PacketSequenceCache is used for caching an IBC message for a given packet sequence.
func (PacketSequenceCache) Merge ¶
func (c PacketSequenceCache) Merge(other PacketSequenceCache)
Merge merges another PacketSequenceCache into this one.
type PacketSequenceStateCache ¶
PacketSequenceStateCache is used for caching the state of a packet sequence.
func (PacketSequenceStateCache) Prune ¶
func (c PacketSequenceStateCache) Prune(keep int)
Prune deletes all map entries except for the most recent (keep).
type PathEnd ¶
type PathEnd struct { PathName string ChainID string ClientID string // Can be either "allowlist" or "denylist" Rule string FilterList []ChainChannelKey // which channels to allow or deny }
PathEnd references one chain involved in a path. A path is composed of two PathEnds.
func NewPathEnd ¶
func NewPathEnd(pathName string, chainID string, clientID string, rule string, filterList []ChainChannelKey) PathEnd
NewPathEnd constructs a PathEnd, validating initial parameters.
type PathProcessor ¶
type PathProcessor struct {
// contains filtered or unexported fields
}
PathProcessor is a process that handles incoming IBC messages from a pair of chains. It determines what messages need to be relayed, and sends them.
func NewPathProcessor ¶
func (*PathProcessor) HandleNewData ¶
func (pp *PathProcessor) HandleNewData(chainID string, cacheData ChainProcessorCacheData)
ChainProcessors call this method when they have new IBC messages
func (*PathProcessor) IsRelayedChannel ¶
func (pp *PathProcessor) IsRelayedChannel(chainID string, channelKey ChannelKey) bool
func (*PathProcessor) IsRelevantChannel ¶
func (pp *PathProcessor) IsRelevantChannel(chainID string, channelID string) bool
func (*PathProcessor) IsRelevantClient ¶
func (pp *PathProcessor) IsRelevantClient(chainID string, clientID string) bool
func (*PathProcessor) IsRelevantConnection ¶
func (pp *PathProcessor) IsRelevantConnection(chainID string, connectionID string) bool
func (*PathProcessor) OnConnectionMessage ¶
func (pp *PathProcessor) OnConnectionMessage(chainID string, eventType string, onMsg func(provider.ConnectionInfo))
OnConnectionMessage allows the caller to handle connection handshake messages with a callback.
func (*PathProcessor) PathEnd1Messages ¶
func (pp *PathProcessor) PathEnd1Messages(channelKey ChannelKey, message string) PacketSequenceCache
TEST USE ONLY
func (*PathProcessor) PathEnd2Messages ¶
func (pp *PathProcessor) PathEnd2Messages(channelKey ChannelKey, message string) PacketSequenceCache
TEST USE ONLY
func (*PathProcessor) ProcessBacklogIfReady ¶
func (pp *PathProcessor) ProcessBacklogIfReady()
ProcessBacklogIfReady gives ChainProcessors a way to trigger the path processor process as soon as they are in sync for the first time, even if they do not have new messages.
func (*PathProcessor) RelevantClientID ¶
func (pp *PathProcessor) RelevantClientID(chainID string) string
RelevantClientID returns the relevant client ID or panics
func (*PathProcessor) Run ¶
func (pp *PathProcessor) Run(ctx context.Context, cancel func())
Run executes the main path process.
func (*PathProcessor) SetChainProviderIfApplicable ¶
func (pp *PathProcessor) SetChainProviderIfApplicable(chainProvider provider.ChainProvider) bool
Path Processors are constructed before ChainProcessors, so reference needs to be added afterwards This can be done inside the ChainProcessor constructor for simplification
func (*PathProcessor) SetMessageLifecycle ¶
func (pp *PathProcessor) SetMessageLifecycle(messageLifecycle MessageLifecycle)
type PathProcessorMessageResp ¶
type PathProcessorMessageResp struct { Response *provider.RelayerTxResponse DestinationChain provider.ChainProvider SuccessfulTx bool Error error }
type PathProcessors ¶
type PathProcessors []*PathProcessor
PathProcessors is a slice of PathProcessor instances
func (PathProcessors) IsRelayedChannel ¶
func (p PathProcessors) IsRelayedChannel(k ChannelKey, chainID string) bool
type PrometheusMetrics ¶
type PrometheusMetrics struct { Registry *prometheus.Registry PacketObservedCounter *prometheus.CounterVec PacketRelayedCounter *prometheus.CounterVec LatestHeightGauge *prometheus.GaugeVec WalletBalance *prometheus.GaugeVec FeesSpent *prometheus.GaugeVec TxFailureError *prometheus.CounterVec BlockQueryFailure *prometheus.CounterVec ClientExpiration *prometheus.GaugeVec ClientTrustingPeriod *prometheus.GaugeVec UnrelayedPackets *prometheus.GaugeVec UnrelayedAcks *prometheus.GaugeVec }
func NewPrometheusMetrics ¶
func NewPrometheusMetrics() *PrometheusMetrics
func (*PrometheusMetrics) AddPacketsObserved ¶
func (m *PrometheusMetrics) AddPacketsObserved(pathName, chain, channel, port, eventType string, count int)
func (*PrometheusMetrics) IncBlockQueryFailure ¶
func (m *PrometheusMetrics) IncBlockQueryFailure(chain, err string)
func (*PrometheusMetrics) IncPacketsRelayed ¶
func (m *PrometheusMetrics) IncPacketsRelayed(pathName, chain, channel, port, eventType string)
func (*PrometheusMetrics) IncTxFailure ¶
func (m *PrometheusMetrics) IncTxFailure(pathName, chain, errDesc string)
func (*PrometheusMetrics) SetClientExpiration ¶
func (m *PrometheusMetrics) SetClientExpiration(pathName, chain, clientID, trustingPeriod string, timeToExpiration time.Duration)
func (*PrometheusMetrics) SetClientTrustingPeriod ¶
func (m *PrometheusMetrics) SetClientTrustingPeriod(pathName, chain, clientID string, trustingPeriod time.Duration)
func (*PrometheusMetrics) SetFeesSpent ¶
func (m *PrometheusMetrics) SetFeesSpent(chain, gasPrice, key, address, denom string, amount float64)
func (*PrometheusMetrics) SetLatestHeight ¶
func (m *PrometheusMetrics) SetLatestHeight(chain string, height int64)
func (*PrometheusMetrics) SetUnrelayedAcks ¶
func (m *PrometheusMetrics) SetUnrelayedAcks(pathName, srcChain, destChain, srcChannel, destChannel string, UnrelayedAcks int)
func (*PrometheusMetrics) SetUnrelayedPackets ¶
func (m *PrometheusMetrics) SetUnrelayedPackets(pathName, srcChain, destChain, srcChannel, destChannel string, unrelayedPackets int)
func (*PrometheusMetrics) SetWalletBalance ¶
func (m *PrometheusMetrics) SetWalletBalance(chain, gasPrice, key, address, denom string, balance float64)
type StuckPacket ¶
StuckPacket is used for narrowing block queries on packets that are stuck on a channel for a specific chain.