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

Partially implement IBC client creation of sovereign rollups on Cosmos chains #97

Closed
Tracked by #10
soareschen opened this issue Jan 26, 2024 · 0 comments · Fixed by #126
Closed
Tracked by #10

Partially implement IBC client creation of sovereign rollups on Cosmos chains #97

soareschen opened this issue Jan 26, 2024 · 0 comments · Fixed by #126
Assignees

Comments

@soareschen
Copy link
Collaborator

soareschen commented Jan 26, 2024

Part of: #10
Prerequisites: #95, #94
also: informalsystems/sovereign-ibc#65

Summary

  • In this task we will partially implement the creation of IBC clients on the Cosmos chains.
  • The IBC client will be a Wasm client that is compiled from sovereign-ibc to verify Sovereign client updates.
    • The initial implementation will use a pre-compiled Wasm blob that is checked in to the repository.
    • We will automate the build steps of the Wasm blob using Nix in a follow up PR.
  • The initial implementation will use a valid Celestia DA header when creating the client.
    • This should be mostly the same as a regular Cosmos client update.
  • The initial implementation will provide dummy hashes for the rollup states, and not involved in querying the actual rollup node.
    • The querying of rollup node requires Implement bootstrapping code for Sovereign rollups #94, which will be done in parallel of this PR.
    • Since the aggregate proof system of Sovereign SDK is still being implemented, the validation of rollup state transition is currently mocked in sovereign-ibc.

Implementation Strategy

We will first implement context-generic components that work with a Cosmos chain context, with a Sovereign chain as the counterparty chain. The components would be something like:

pub struct CreateSovereignClientOnCosmos;

impl<SovereignChain, CosmosChain>
    ProvideCreateClientOptionsType<SovereignChain, CosmosChain> 
    for CreateSovereignClientOnCosmos
{ /* ... */ }

impl<SovereignChain, CosmosChain>
    ProvideCreateClientPayloadType<SovereignChain, CosmosChain> 
    for CreateSovereignClientOnCosmos
{ /* ... */ }

impl<SovereignChain, CosmosChain>
    CreateClientPayloadBuilder<SovereignChain, CosmosChain>
    for CreateSovereignClientOnCosmos
{ /* ... */ }

impl<CosmosChain, SovereignChain>
    CreateClientMessageBuilder<CosmosChain, SovereignChain>
    for CreateSovereignClientOnCosmos
{ /* ... */ }

At the end, the SovereignToCosmosRelay context should implement CanCreateClient using CreateClientWithChains, with all its dependencies implemented.

An integration test would be written in the form:

#[test]
async fn test_sovereign_to_cosmos_create_client() -> Result<(), Error> {
    let cosmos_bootstrap = CosmosBootstrap { /* ... */ };

    let sovereign_bootstrap = SovereignBootstrap { /* ... */ };

    let cosmos_chain = cosmos_bootstrap.bootstrap_chain().await?;

    let sovereign_chain = sovereign_bootstrap.bootstrap_chain().await?;

    let create_client_options = SovereignToCosmosCreateClientOptions { /* ... */ };

    let client_id = SovereignToCosmosRelay::create_client(
        DesitinationTarget,
        &cosmos_chain,
        &sovereign_chain,
        &create_client_options,
    ).await?;

    Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants