Replies: 3 comments 1 reply
-
I can share few of my ideas as well: NixNix provides reproducible build across different language boundaries. Using Nix we will be able to build Hermes, Tendermint, and Cosmos SDK as Nix packages, and create a reproducible environment for the different executables to interact. The build artifacts can be packages as Docker containers, and they can also be deployed directly using NixOps. The Nix build is much more lightweight than Docker build, and users can run the executables directly on the host machine without any tools such as Rust and Go being installed. Async / AwaitThe current concurrency model of ibc-rs introduces unnecessary complexity by separating components to run in threads that communicate through messages. This introduces various bottlenecks to the system as the components are processing each message sequentially. We should instead move to an event-driven architecture using async/await, and run each execution flow in their own lightweight async tasks. That way, all events can be processed concurrency with no limit on the underlying OS threads. Message-passing concurrency is only needed when two concurrent executions need to be synchronized. We may need that in some cases, but I suspect in the common cases, the execution tasks can run independent of each others. So async tasks may result in simpler architecture. Generic TypesWe should make more using of generic types instead of dynamic traits to abstract over the implementation. For example, instead of a function like Decouple from Cosmos SDKThe current code is pretty tightly coupled to Cosmos SDK, even so with only specific version. The code should allow multiple chain implementations, at least starting with multiple versions of Cosmos SDK. In a truly multichain world, I do not think all blockchains will be running the same software. With the relayer restricted to specific versions of Cosmos SDK, this can significantly affect the ability of chains to evolve their implementations independently. In terms of chain sovereignty, this also gives too much power to the developers of Cosmos SDK, if they can force chains to use specific versions of the code because of the limitations of the relayer. Using the generic types design earlier, we should be able to implement different types of chains, and ensure that ibc-rs can evolve independently of the chain implementations. Isolated Unit TestsIt is essential to have end to end testing of the relayer done with actual Cosmos SDK chain. However we are pretty lacking in isolated unit tests that test for the correctness of the relayer independent of the chains. With the current design, it is very difficult to know if a code change would break anything, unless we run the full end to end tests. Ideally, we should aim for catching most bugs and breaking changes by running only the unit tests. The end to end tests should be reserved for catching obscure scenarios that have not been considered in the unit tests. With the correct design, many of the functionalities of the relayer should be testable without having to spawn up the full Tendermint and Cosmos SDK. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for starting this discussion, @hu55a1n1! Some thoughts/comments below:
|
Beta Was this translation helpful? Give feedback.
-
Great start! I'm also amazed to see how on many of these points we're converging, though coming from different perspectives. To make things concrete and follow-up, I would like to propose the following priorities:
These are ranked by a combination of their simplicity (i.e., the fix/feature is localized, and needs not much context for a successful PR) and value. |
Beta Was this translation helpful? Give feedback.
-
CI
cross
cross provides “Zero setup” cross compilation and “cross testing” of Rust crates using docker/podman.
criterion.rs
Statistics-driven benchmarking library for Rust
Testing
fail-rs
Fail points for rust
CLI tests
Long-running tests & DSL
Design and Distribution
actix
hermes = hermesd + hermesctl
UX
hermes help
Misc
Beta Was this translation helpful? Give feedback.
All reactions