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

Relayer v2 architecture redesign and new packet worker MVP #2478

Closed
wants to merge 506 commits into from

Conversation

soareschen
Copy link
Contributor

@soareschen soareschen commented Jul 29, 2022

Description

The cargo doc documentation for this PR is available at https://ibc-rs.netlify.app/ibc_relayer_framework/.

Rendered ADR

Concurrency Architectures (Excalidraw Diagrams)


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@netlify
Copy link

netlify bot commented Jul 29, 2022

Deploy Preview for ibc-rs ready!

Name Link
🔨 Latest commit 05d635c
🔍 Latest deploy log https://app.netlify.com/sites/ibc-rs/deploys/639731588f8ab90008119772
😎 Deploy Preview https://deploy-preview-2478--ibc-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@soareschen soareschen added the O: relayer-next Objective: work toward relayer v2 label Aug 29, 2022
@soareschen soareschen mentioned this pull request Aug 29, 2022
24 tasks
@seanchen1991
Copy link
Contributor

seanchen1991 commented Sep 26, 2022

Had a discussion with @adizere and @Farhad-Shabani regarding the need to validate Cosmos-Substrate relaying as part of the packet worker refactor. That work is tracked in ComposableFi/composable-ibc#78.

This work will likely require us to expose Hermes APIs to be able to call into them from the Hyperspace front. In other words, this will help us with the Hermes librarification effort.

romac and others added 8 commits July 14, 2023 20:14
* Refactor OfaChain types into OfaChainTypes

* Make Cosmos OfaIbcChain implementation slightly more generic

* Introduce CosmosMessage trait

* Isolate UpdateClient methods

* Isolate connection handshake methods

* Isolate channel handshake methods

* Isolate CreateClient and ConsensusState methods

* Isolate packet methods

* Isolate client state and chain methods

* Remove Self:: aliases in OFA chain implementation

* Move some methods from OfaIbcChain to OfaChain

* Add packet payload types

* Add HasIbcPacketFields

* Support ReceivePacket payload

* Support AckPacket payload

* Support TimeoutUnordered packet payload

* Remove constraint that counterparty message has to be CosmosMessage
* Refactor spawn functions to call ChainHandle methods

* Define CosmosUpdateClient message type

* Add CosmosCreateClientMessage type

* Add CosmosReceivePacketMessage type

* Add CosmosAckPacketMessage type

* Add CosmosTimeoutPacketMessage type

* Add CosmosConnectionOpenInitMessage type

* Add CosmosConnectionOpenTryMessage type

* Add CosmosConnectionOpenAckMessage type

* Fix packet message counterparty heights

* Add CosmosConnectionOpenConfirmMessage type

* Refactor payload fields in ConnectionOpenConfirm

* Refactor ConnectionOpenTry message and payload fields

* Refactor ConnectionOpenAck proof fields

* Refactor counterparty message height to be for UpdateClient

Previously it was for when the proofs were built

* Refactor ReceivePacket proof fields

* Refactor AckPacket proof fields

* Refactor TimeoutPacket proof fields

* Simplify ConnectionOpenTry handshake

* Simplify ConnectionOpenAck handshake

* Simplify ConnectionOpenConfirm handshake

* Fix clippy and test

* Add CosmosChannelOpenInitMessage type

* Add CosmosChannelOpenTryMessage message type

* Add CosmosChannelOpenAckMessage type

* Add CosmosChannelOpenConfirmMessage type

* Rearrange message modules
ljoss17 and others added 18 commits August 4, 2023 16:14
* Implement CanQueryPacketCommitments for relayer-next

* Implement CanQueryUnreceivedPacketSequences for relayer-next

* Implement CanQueryUnreceivedPacketEvents for relayer-next

* Implement CanQueryUnreceivedPackets for relayer-next

* Implement PacketClearerWithTarget for relayer-next

* Fix clear_packets_with_target

* Partial implementation of ClearPacketWorker for relayer-next

* Remove PacketClearConfig

* Rename channels to src/dst instead of using counterparty

* Improve clear_receive_packets

* Add test for packet clearing relayer-next

* Fix and improve Clear packet implementation and tests for relayer-next

* Add HasClearInterval trait for relayer-next

* Remove Target from ClearPacketWorker in relayer-next

* Update cargo lock

* Fix 'query_unreceived_packet_sequences' and 'query_packet_commitments' for relayer-next

* Add documentation to 'query_packet_commitments'

* Rename 'CanQueryUnreceivedPackets' to 'CanQuerySendPacketsFromSequences'

* Add documentation for 'height' used in 'query_unreceived_packets'

* Clean 'packet_clear' test for relayer-next

* Split CanQuerySendPacketsFromSequences into two traits

* Add 'try_extract_send_packet_event' to relayer-cosmos methods module

* Moved traits related to send packets in their own mod

* Moved packet_clear traits to relayer-components

* Moved send_packet impls to its own mod

* Moved 'try_extract_write_acknowledgement_event' to the methods module
* Use component graph pattern for UpdateClientMessageBuilder

* Use macros to derive component graph

* Auto derive CanQueryChainStatus

* Use components pattern for PacketRelayer

* Use component graph for auto relayer

* Attempt to define macros that derive the derive macros

* Revert "Attempt to define macros that derive the derive macros"

This reverts commit ca47c72.

* Use component graph for consensus state querier

* Use component graph for receive packet relayer

* Use component graph for ack packet relayer

* Use component graph for timeout unordered packet relayer

* Use component graph for IbcMessageSender

* Use component graph for mock components

* Use component graph for packet filter

* Use component graph for auto birelay

* Rename impl modules to components for component-based impls
* Define ForwardComponent to auto forward component with less macros

* Forward IBC message sender components

* Auto derive from HasComponent for both provider and consumer traits.

* Use new component pattern for chain status and consensus state querier

* Use new component pattern for all other components

* Remove HasComponents trait

* Add forward_components! macro to forward multiple components at once

* Reorder macro arguments and rename forward_component to delegate_component

* Rename HasComponent to DelegateComponent

* Separate out component graphs for each context

* Remove generic Mode argument from AutoRelayer

* Delegate event relayer component

* Rearrange modules

* Turn CreateClient into a component

* Remove unused traits

* Use component delegation for PacketClearer

* Do not retry failed tests in CI

* Use component delegation for chain builder

* Use component delegation for RelayBuilder

* Use component delegation for RelayFromChainsBuilder

* Use component delegation for RelayWithBatchBuilder

* Rearrange modules

* Rearrange birelay traits

* Use component delegation for BiRelayBuilder

* Allow delegate_components! to match without trailing comma

* Use component delegation for BiRelayFromRelayBuilder

* Fix CI
* Implement runtime traits directly for TokioRuntimeContext

* Use AfoRuntime directly

* Remove OfaRuntime constructs

* Rename Log to LogEntries

* Implement telemetry traits directly

* Remove OfaTelemetry

* Slightly improve telemetry
* Use component delegation for chain MessageSender

* Simplify nonce allocator design

* Refactor nonce traits

* Use component delegation for nonce allocator

* Use component delegation for message as tx sender

* Use component delegation for TxResponsePoller

* Use component delegation for TxResponseQuerier

* Use component delegation for TxFeeEstimator

* Use component delegation for TxEncoder

* Use component delegation for NonceQuerier

* Use component delegation for TxSubmitter

* Implement tx traits directly in CosmosTxContext

* Remove OfaTxContext

* Add proof for CosmosTxContext implementing CanSendMessages
* Add HasComponents trait

* Remove DelegateComponents implementation in chain and transaction context

* Add tx components closure

* Use HasComponents for relay context

* Construct closure for ExtraChainComponents

* Building ExtraRelayComponents closure

* More relay component closure

* Done constructing packet relayer closure

* Add packet relayer closure for ExtraRelayComponents

* Use UseExtraChainComponents in UseExtraPacketRelayer

* Add relay components closure traits

* Add DefaultEventRelayer closure

* Add DefaultAckPacketRelayer closure

* Add ExtraAckPacketRelayer closure

* Add ExtraEventRelayer closure
* Add default auto relayer closure

* Add extra auto relayer closure

* Make packet fields reader into a component

* Use HasComponents to delegate builder context methods

* Rename builder module to build

* Construct closure for default builder components

* Construct closure for extra builder components

* Add closure for batch worker spawner

* Use batch worker closure in extra builder components closure
@soareschen
Copy link
Contributor Author

This PR has been moved to the main branch of https://github.com/informalsystems/hermes-sdk.

@soareschen soareschen closed this Sep 26, 2023
@romac romac deleted the soares/relayer-next branch September 5, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: relayer-next Objective: work toward relayer v2
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants