-
Notifications
You must be signed in to change notification settings - Fork 326
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
ChainEndpoint trait: the role of associated type ConsensusState is ambiguous #1481
Comments
Hello and thank you for opening this issue. Briefly. I think you're right: there is something inconsistent in our definition of trait
Yes.
So far so good! I think the method name is
Correct.
I think To complement here with additional context: Suppose the relayer wants to build a client with identifier
We can also use other direction as an example. Suppose the relayer wants to build a client with identifier
To summarize, the As for This means that we probably have a problem in the diff --git a/relayer/src/chain.rs b/relayer/src/chain.rs
index b4afd859..ddff4f6b 100644
--- a/relayer/src/chain.rs
+++ b/relayer/src/chain.rs
@@ -287,11 +287,11 @@ pub trait ChainEndpoint: Sized {
fn proven_client_consensus(
&self,
client_id: &ClientId,
consensus_height: ICSHeight,
height: ICSHeight,
- ) -> Result<(Self::ConsensusState, MerkleProof), Error>;
+ ) -> Result<(AnyConsensusState, MerkleProof), Error>;
fn proven_channel(
&self,
port_id: &PortId,
channel_id: &ChannelId, Let me know if there's still anything ambiguous! Otherwise we'll go ahead and modify the trait |
Thanks a lot @adizere, The only thing I would add, is that probably the same reasoning applies to functions |
Hello,
I am working on hermes to implement an IBC connection between cosmos chain and a non-cosmos / non-tendermint-based chain.
For the sake of the explanation I will assume I have a
GenBlockChain
running a consensu protocol calledGenBFT
.Configuration is then:
GenBFT
light client that can monitor and validate events happening in theGenBlockChain
GenBlockChain
withGenBFT
consensus protocol running an IBC tendermint light client that can monitor and validate events happening in cosmos.As far as I understand the ibc-relayer crate, the key trait that I have to implement is the ChainEndpoint.
I am studying the methods and the associated types that the trait has, and I realised there is something that does not seem consistent: I am referring to the associated type
ChainEndpoint::ConsensusState
, and the two methodsChainEndpoint::build_consensus_state
andChainEndpoint::proven_consensus_state
.If I define the
ConsensusState
type to beTendermintConsensusState
I wouldn't be able to implementbuild_consensus_state
as my side ofChainEndpoint
does not have access to cosmos network and it wouldn't know anything about the current state of the tendermint consensus state, nor it should know anything about tendermint or cosmos (in terms of structs and functions) as this is the role of theCosmosSDKChainEndpoint
implementation.On the other hand, if I define
ConsensusState
to be theGenBFTConsensusState
then I wouldn't be able to implementproven_consensus_state
as, again, myChainEndpoint
does not have access to the cosmos network in order to request and prove the current state of theGenBFTLightClient
running on cosmos.I am clearly missing something from the code design POV, can you please help me out understanding how my
GenBlockChainEndpoint
should look like?The text was updated successfully, but these errors were encountered: