Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the frequency that queryChannelsOnConnection() is called in the main relayer loop #726

Closed
jtieri opened this issue Apr 26, 2022 · 2 comments · Fixed by #755
Closed
Assignees
Labels
C: Relayer COMPONENT: Relayer T: Refactor TYPE: Refactor

Comments

@jtieri
Copy link
Member

jtieri commented Apr 26, 2022

The main relayer loop queries all of the channels available for the configured connection, applies a filter rule (allow or deny list), then filters out only the channels that are in OPEN state, spins up a goroutine for each open channel that it is attempting to relay against and blocks until one of these goroutines die; at which point the slice of open channels is updated and the entire loop runs again.

Because the goroutines that are relaying packets/acks can die with some frequency we see the query for all channels on the connection run a lot. This query can fetch a rather large collection of data and puts some strain on the configured RPC endpoint so on busier IBC paths we see queryChannelsOnConnection() fail after the main relayer loop runs a few times and then the relayer process exits.

There is an open issue #685 to not quit if this query fails but to instead keep dialing if we have already run the query once in the same runtime but I propose that we also limit how often this query is even ran.

@jtieri jtieri added T: Refactor TYPE: Refactor C: Relayer COMPONENT: Relayer labels Apr 26, 2022
@boojamya boojamya added this to the v2.0.0 Release ❇️ milestone Apr 27, 2022
@boojamya
Copy link
Contributor

boojamya commented May 2, 2022

Potentially only call this once when the relayer starts up, and cache results on path.

@jtieri
Copy link
Member Author

jtieri commented May 2, 2022

This is an option as well. My thought process for including the query inside of the loop instead of running it once when the relayer starts is that it allows the user to have a constantly updated list of open channels which can be useful especially in the case of ordered channels, e.g. interchain accounts, where the channel could potentially be closed and then later reopened.

For interchain accounts we will additionally need to be querying txs and checking the events for ChannelOpenInit so that we can properly open channels since the interchain accounts module initiates the channel handshake and the relayer just finishes it. So maybe we actually do just execute queryChannelsOnConnection() once at startup and then inside of the loop we can also query for ChannelOpenConfirm events to pickup any new channels that could have been opened.

maybe @jackzampolin has some thoughts on this as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Relayer COMPONENT: Relayer T: Refactor TYPE: Refactor
Projects
None yet
3 participants