-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove dependency on ChainHandle
in cosmos-client-components
crate
#214
Comments
awesome! Thank you for creating this issue @soareschen, lemme dive into it. |
hi @soareschen I'm doing the first PR, if I understand correctly, the CGP's mentioning 3 kinds of contexts: Chain context, Relayer context and Tx context, am I right? Besides that, I want to ask how to verify my changes, I run so the test is not functional testing, am I right? It means I will need to spawn a local interchain to check it. |
CGP is a programming technique for defining modular contexts. There are several abstract contexts in Hermes SDK, such as For the integration tests, we make use of chain executable such as You can refer to the commands used on the CI to see how the integration tests can be run locally. For example, the Cosmos integration tests can be run using: nix shell .#cargo-nextest .#protobuf .#gaia .#celestia-app .#ibc-go-v8-simapp -c \
cargo nextest run -p hermes-cosmos-integration-tests \
--test-threads=2 Note that you can also run |
@soareschen Thank you for your detailed explanation, I will follow your instructions. |
hi @soareschen Im trying to use the command in github workflow file to run tests and I faced this error: I thought my change was made it failed and I tried to switch into the main branch, delete the |
After upgrading to the latest nix version, the test command is getting build but then I got the error And very soon after that, it failed just because the connection refused while that port was available on my machine. Changing from I will do some more updates and create PRs soon. |
hi @soareschen I saw a lot of implementations for a while, sorry for delay because of some personal reasons and now I think I'm good to move on. I just realized that there are only a few dependencies left on |
For
I may try with the component has suffix |
Hey @thaodt, you are right that we are doing quick refactoring on the payload builders to generalize the implementation to work on non-Cosmos chains. We won't touch the querier methods just yet, so you can give them a try if you like. |
Thanks @soareschen. I'm working on these: |
While I'm trying to remove hermes-sdk/crates/cosmos/cosmos-chain-components/src/impls/queries/write_ack_event.rs Lines 45 to 63 in 3bb20a0
the |
Yes, in this case you need to extract the relevant logic from Hermes v1 functions, such as Ultimately, the actual parameters you need are values such as |
Understood. Im on it. |
For the initial development of Hermes SDK, we reuse the existing
ChainHandle
implementation in Hermes v1 in order to speed up the prototyping. With the new code base maturing, it is now better to reimplement the corresponding methods inside Hermes SDK, so that we can eventually remove the dependency on the Hermes v1 code base.For the re-implementation, we would identify all uses of
with_blocking_chain_handle
in thecosmos-client-components
crate. We would then locate the correspondingCosmosSdkChain
ChainHandle
implementation atibc_relayer::chain::cosmos
, and copy over the implementation.The majority of implementation should be possible by including dependencies such as
CanQueryAbci
,HasGrpcAddress
, andHasRpcClient
. Other than that, the main difference for the new implementation is that we use async functions, and therefore there is no need to useblock_on
to call other async functions. For reference, one can look at the re-implementation that we have already done for components traits such asChainStatusQuerier
andClientStateBytesQuerier
.Following is a list of component implementations that use
with_blocking_chain_handle
in the implementation:ChannelHandshakePayloadBuilder
CreateClientPayloadBuilder
UpdateClientPayloadBuilder
ConnectionHandshakeMessageBuilder
ConnectionHandshakePayloadBuilder
AckPacketPayloadBuilder
ReceivePacketPayloadBuilder
TimeoutUnorderedPacketPayloadBuilder
CounterpartyChainIdQuerier
(@thaodt)ConnectionEndQuerier
ConsensusStateHeightQuerier
ConsensusStateHeightsQuerier
ConsensusStateQuerier
ReceivedPacketQuerier
(@thaodt)WriteAckQuerier
(@thaodt)The re-implementation should be done in small steps, with each PR only focus on one or few of the re-implementations.
The text was updated successfully, but these errors were encountered: