-
Notifications
You must be signed in to change notification settings - Fork 332
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
Relayer Message Builder logic #122
Comments
One way of thinking about the relayer might be that, for each chain it's connected to, it synchronizes the chain's entire IBC store (ie. the whole If the relayer had a local copy of each chain's IBC store like this, it could model and test this whole message builder flow more directly between local copies, without having to worry about querying from and sending transactions to real chains. While we wouldn't have an IAVL tree, we could mock out the proof verification part, and just capture the core state transitions of the ibc store. Without building something like this, I can imagine it's going to be very cumbersome to test the whole system, since we'll be depending on Go software, and integrations with all the queries and txs are likely to still take some time (ie. we're waiting for tendermint v0.34 to release, need to get tendermint-rs upgraded to it, then need proto files for clients in the sdk; we're still waiting some time for proto tx integration; etc.) Having the local model might also really help clarify all the flow and what IBC is really about, and would get us significant progress towards the handlers. |
Having a mirror of the IBC store of each chain is clearly helpful. To make this idea concrete, for connection handshake in particular, the relayer flow depends on the following interactions:
The bullets marked with [x] we can model/mock with the help of the local copy of IBC stores if I understood correctly. As a side note, we could take this idea even further and assume that the relayer participates as a full node in both chains.. and then we can fulfil locally all the bullets above. |
* v1 English description of connection handshake (ICS3) FSM for message builder (#122). * Fixing the update client transitions * Removed unnecessary state transitions * cleanup, made transaction submission synchronous * rename file * formatting Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
We decided on a different relayer architecture (#326), which does not require the message builder anymore. |
…ms#137) * v1 English description of connection handshake (ICS3) FSM for message builder (informalsystems#122). * Fixing the update client transitions * Removed unnecessary state transitions * cleanup, made transaction submission synchronous * rename file * formatting Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
Summary
Describe and implement the message builder algorithm and FSM
Problem Definition
The Message Builder is a Relayer module that contains most of the logic of how IBC datagrams are built. For an event based model, this should be implemented as an FSM.
There should be clearly defined events and actions (routines).
An analysis of the action to be taken for each (state, event) combination should be done. Given ~15 events and ~10 states,
this may seem like an overwhelming task. However, many combinations can be ignored (e.g. all packet events for a connection builder FSM).
For a builder of message related to some object X, only the IBC events related to X and its flipped version (if one exists) and to the client(s) involved should be considered.
It will probably be the event handler that decides to remove an existing message builder when a "superior" event occurs for same X (e.g. a builder is in progress for
ConnOpenTry
to B message and a notification forConnOpenTry
from chain B is received for the same object)Consideration should be given to having an FSM framework that presents events as generic or trait objects, with concrete implementations limited to object specific details. In the same time, it should be implemented such that it is very clear what is the action taken in a given state and for a given event.
Proposal
Here is one draft proposal, final decision and implementation may look differently. Only main "success" path events and actions are shown. Shown in italics are states valid for builders of messages
connOpenTry
andconnOpenAck
only.Details should be included in an ADR and also documented in the implementation.
(lower level issues to be raised soon)
For Admin Use
The text was updated successfully, but these errors were encountered: