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 requirements for the Light Client #497

Open
7 of 8 tasks
ancazamfir opened this issue May 3, 2020 · 7 comments
Open
7 of 8 tasks

Relayer requirements for the Light Client #497

ancazamfir opened this issue May 3, 2020 · 7 comments
Assignees
Labels
light-client Issues/features which involve the light client

Comments

@ancazamfir
Copy link
Contributor

ancazamfir commented May 3, 2020

Summary

Relayer requirements (shown in bold) for and interactions with the per-chain light clients.

Proposal

(re)Stating the light client relayer interactions with the light client:

  • The relayer needs to send MsgUpdateClient specifying a light block at some height h, trusted height t and valset as the trusted validator set (fetched at t+1). In order to build this message, it needs:

  • misbehaviour_evidence(h1, h2) The relayer monitors client update messages and verifies the headers against locally configured full node witness(es). If evidence of misbehaviour is found, the relayer submit the evidence to the IBC client on chain (this is done currently in ibc-rs). In addition the relayer should submit the evidence to the full node.
    Alternatively the relayer could call light client with check_misbehaviour(h1) and get back some h2 if the light client detects misbehaviour.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@milosevic milosevic self-assigned this Jun 5, 2020
@ancazamfir ancazamfir changed the title light client get_minimal_header_set() API Relayer requirements the Light Client Jun 17, 2020
@ancazamfir
Copy link
Contributor Author

@milosevic please take a look if it reflects our discussion. Where should this be included wrt to documentation? I tend to update the relayer ADR with everything :) Should we start another ADR?

@adizere
Copy link
Member

adizere commented Jun 26, 2020

Should we start another ADR?

Yes, I vote for this.

Would also be useful to have a terminology or dictionary document to resolve ambiguities around the term client, since I find it confusing. There are two kinds of light clients we're referring to here:

  1. Relayer client: a thread running inside a relayer. This is sometimes called "per-chain light client" or just "light client".
  2. IBC client: a client hosted on a chain, running on all full nodes of that chain. Sometimes called "on-chain client".

What these clients have in common is that they are both an abstract layer of communication to a certain chain, e.g., can verify headers of that chain or fetch headers.

Please let me know If this distinction is accurate @ancazamfir @milosevic. Then I can write it down in a more permanent form somewhere. I propose we try to avoid using different terms than the two ones above.

@ancazamfir ancazamfir changed the title Relayer requirements the Light Client Relayer requirements for the Light Client Jun 29, 2020
@ebuchman ebuchman transferred this issue from informalsystems/hermes Jul 30, 2020
@ebuchman ebuchman added the light-client Issues/features which involve the light client label Jul 30, 2020
@ebuchman ebuchman added this to the v0.17.0 milestone Aug 28, 2020
@thanethomson thanethomson assigned romac and unassigned milosevic Sep 23, 2020
@romac
Copy link
Member

romac commented Oct 15, 2020

Let's move this to v0.18 as we will likely not have time to get it done for v0.17. Will tackle this once it's actually needed on the ibc-rs side.

@romac romac modified the milestones: v0.17.0, v0.18 Oct 15, 2020
@thanethomson
Copy link
Contributor

@romac, when do you anticipate this will be needed in ibc-rs?

@romac
Copy link
Member

romac commented Mar 23, 2021

Very soon :) I am actually going to start working on that this week.

@thanethomson thanethomson removed this from the v0.19 milestone Apr 7, 2021
@romac romac added this to the IBC Relayer milestone Apr 14, 2021
@ancazamfir
Copy link
Contributor Author

Made some updates to the issue to reflect the recent changes in the relayer light client. I think first priority is to get get_minimal_set(t, h) in.

@ancazamfir
Copy link
Contributor Author

  • misbehaviour_evidence(h1, h2) The relayer monitors client update messages and verifies the headers against locally configured full node witness(es). If evidence of misbehaviour is found, the relayer submit the evidence to the IBC client on chain (this is done currently in ibc-rs). In addition the relayer should submit the evidence to the full node.

Looked a bit in the light client code and this looks as the simpler solution: an API that eventually calls into

fn report(&self, e: Evidence, peer: PeerId) -> Result<Hash, IoError>;

I guess the relayer will need to pass the two conflicting headers (h1 and h2) and the peerId, url and timeout to the API, which should instantiate a ProdEvidenceReporter and report ConflictingHeadersEvidence with h1 and h2.

Alternatively the relayer could call light client with check_misbehaviour(h1) and get back some h2 if the light client detects misbehaviour.

Currently the relayer pulls the first header from the IBC client on chain and the second header from the full node for the counterparty chain. It then compares the two. The comment above refers to moving the pulling of second header in the light client library (or making use of existing functionality...haven't traced it yet) and submitting evidence to the full node and returning the evidence back to the relayer who will submit it to the IBC client on chain. I think we can do this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
light-client Issues/features which involve the light client
Projects
None yet
Development

No branches or pull requests

6 participants