-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Refactor connection/channel identifier handling #329
Comments
@AdityaSripal and I discussed a potential architecture refactor. The scope of the following relates only to the client/connection/channel stack starting from a config and state based relaying and ending once the config is full and the client is created, the connections are open and the channels are open. We can envision the relayer stack having two core components, client and the core relayer. From the client level we want to allow partially filled config or fully filled config files to be passed to the core relayer. We will need to modify path end validation and path validation to allow certain fields to be optionally left empty. These fields should include The fields left empty and the current state of filled in field determines what handshake step or client creation step to begin at and continue from. After path validation is modified. We can assume the case where the user fills in the minimal possible amount of fields begins by creating a client on both chains. This code will largely remain the same.
If the clientID or counterpartyClientID is empty then after creation of the client, write the identifier to the config. Once clients are created we can move to the connection handshake. The logic will be as follows:
Since connection identifiers need to be updated after the corresponding step, we propose modifying the
The function that calls the create connections function should only handle the looping logic related to keeping a failed counter and retrying the step. We want to remove the message execution from this step since it isolates the logic necessary to respond to message specific logic embedded in events. The connection logic will be duplicated for channels. It should basically be identical but calling channel specific functions. Once clients are created, connections are open and channels are open a boolean should be set to true in the config indicating that the relayer is ready to begin relaying packets and that paths should be validation fully. This proposal reduces UX complexity for the user, allows us to refactor to support the lastest SDK changes and do so in a minimal fashion. The only code changes will largely be to path validation, connection handshake and channel handshake handling (not construction). I plan to start sketching some of this work in parallel with the typed events work specifically because this refactor only relies on having access to a function |
Thanks for the write-up @colin-axner . Note channel ORDER and port IDS must always be specified by user. If a user does specify a Even if we get a fully fleshed out config from the user, we should still go through the config and validate that it is consistent. Ie, the specified channels are built on top of specified connections, which are built on top of specified clients. (This should be happening even with the current architecture, though I'm not sure if it is checked or not). Since the relayer's |
One thing I'm thinking now is that we don't expose users to
|
address significant changes
I will handle this since the changes are non-trivial
The text was updated successfully, but these errors were encountered: