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

ADR for Relayer v0 Concurrency Architecture #326

Closed
4 tasks done
ancazamfir opened this issue Oct 19, 2020 · 2 comments · Fixed by #497
Closed
4 tasks done

ADR for Relayer v0 Concurrency Architecture #326

ancazamfir opened this issue Oct 19, 2020 · 2 comments · Fixed by #497
Assignees
Labels
I: documentation Internal: improvements or additions to documentation I: logic Internal: related to the relaying logic
Milestone

Comments

@ancazamfir
Copy link
Collaborator

ancazamfir commented Oct 19, 2020

Summary

Specify the relayer concurrency architecture for the first release of the Relayer. The goal is to document this in ADR-005.

Problem Definition

There are a few threads required by the v0 relayer, per chain and per relaying path or link.

Proposal

We would like to document the architecture in an ADR capturing the following decomposition:

v0-concurrency

In this version of the relayer a single connection and channel are supported and they must be configured in the relayer configuration file. These limitations will be lifted in subsequent releases.
config executor - single thread that runs upon start and creates a link associated with the relaying path. It also triggers initiation messages for objects included in the config file. These are theConnOpenStart or ChannOpenStart that could potentially cause the relayer to build and send ConnOpenInit or ChannOpenInit messages to the chain. It should work even these events are received by the link in the same time with the live chain IBC events. In other words, no synchronization with starts of other threads should be required.

chain - one thread per chain that registers with the chain and forwards the notification messages to the link. Currently the relayer registers for Tx and Block notifications. It then extracts the IBC events from the Tx and generates a "NewBlock" event also for the block. Note that the notification may include multiple IBC Events.

chain light client - one thread per chain that receives relayer requests, downloads and verifies headers, and returns the minimal header set in the response. In addition this thread should ensure latest locally stored state does not expire, i.e. when some timer fires it fetches and verifies the latest header. Timeout should be a fraction of the trusting period. Timer should be reset by the on-demand relayer requests.

link - one thread per forwarding path. It receives events from the chains, performs queries and sends transactions synchronously.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ancazamfir ancazamfir added this to the v0.0.7 milestone Oct 19, 2020
@adizere adizere changed the title Relayer v1 Concurrency Architecture Relayer v0 Concurrency Architecture Nov 2, 2020
@adizere adizere changed the title Relayer v0 Concurrency Architecture ADR for Relayer v0 Concurrency Architecture Nov 5, 2020
@romac
Copy link
Member

romac commented Nov 5, 2020

We should either close this now that #162 is merged, or rename it for v1, since the ADR covers the case for v0 already.

@ancazamfir
Copy link
Collaborator Author

I would still like to say explicitly in someplace what happens when we start the relayer. Do we start the light clients? How do we interact with them? In listen mode (does this still work?), we have one monitor thread per chain, or used to. Do we still do this? Then state that all queries and transactions are blocking calls (will they stay like this in v0?). We can add to ADR004 or create a new one. We can change it over v0, v1, v2 releases to reflect the status quo.

@adizere adizere self-assigned this Nov 24, 2020
@adizere adizere mentioned this issue Jan 4, 2021
5 tasks
@ancazamfir ancazamfir modified the milestones: v0.1.0, v0.1.1 Jan 28, 2021
@ancazamfir ancazamfir modified the milestones: v0.1.1, v0.1.2 Feb 11, 2021
@adizere adizere modified the milestones: backlog, 03.2021 Feb 24, 2021
@adizere adizere added I: documentation Internal: improvements or additions to documentation I: logic Internal: related to the relaying logic labels Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: documentation Internal: improvements or additions to documentation I: logic Internal: related to the relaying logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants