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

vat-orchestration expose client (chain) connection info #8879

Closed
aj-agoric opened this issue Feb 9, 2024 · 3 comments · Fixed by #9486
Closed

vat-orchestration expose client (chain) connection info #8879

aj-agoric opened this issue Feb 9, 2024 · 3 comments · Fixed by #9486
Assignees
Labels
enhancement New feature or request

Comments

@aj-agoric
Copy link

aj-agoric commented Feb 9, 2024

What is the Problem Being Solved?

As a part of building the vat orchestration for the orchestration api, we need to allow a method to expose the client (chain) connection info

  • ⚠️ @agoric/orchestration, vat-orchestration (done through agoricNames instead)
  • ✅ Expose client (chain) connection info
  • ✅ Lookup (connection-0) by chainId
  • ❌ Display current capabilities (host_enabled, allow_messages, allow_queries) [no use cases yet require]
  • ❌ Alert when status changed (closed, expired) [no use cases yet require]

Description of the Design

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@0xpatrickdev
Copy link
Member

0xpatrickdev commented May 21, 2024

Here are pointers for some of the minimum configuration details required to create a Chain.

# /ibc.core.connection.v1.Query/Connections

$ agd query ibc connection connections

{
  "connections": [
    {
      "id": "connection-0",
      "client_id": "07-tendermint-0",
      "versions": [
        {
          "identifier": "1",
          "features": [
            "ORDER_ORDERED",
            "ORDER_UNORDERED"
          ]
        }
      ],
      "state": "STATE_OPEN",
      "counterparty": {
        "client_id": "07-tendermint-1",
        "connection_id": "connection-1",
        "prefix": {
          "key_prefix": "aWJj"
        }
      },
      "delay_period": "0"
    },
  ]
}

IBCConnectionID for the host and counterparty can be grabbed from here. IBCClientID is useful to gather if we want to make the following query:

# /ibc.core.client.v1.Query/ClientState
$ agd query ibc client state $CLIENTID

{
  "client_state": {
    "@type": "/ibc.lightclients.tendermint.v1.ClientState",
    "chain_id": "a-chain-id",
    "trust_level": {
      "numerator": "1",
      "denominator": "3"
    },
    "trusting_period": "100s",
    "unbonding_period": "100s",
    "max_clock_drift": "60s",
    "frozen_height": {
      "revision_number": "0",
      "revision_height": "0"
    },
    "latest_height": {
      "revision_number": "1",
      "revision_height": "1000"
    },
  }
}

We are able to retrieve a chainId from here. latestHeight is helpful for building timeout parameters for tx packets and height parameters for queries, but will update frequently.

# /ibc.core.channel.v1.Query/ConnectionChannels
$JQ_FILTER='.channels | map(select(.port_id == "transfer" and .state == "STATE_OPEN"))'
$ agd query ibc channel connections $CONNECTION_ID --output json | jq $JQ_FILTER

[
  {
    "state": "STATE_OPEN",
    "ordering": "ORDER_UNORDERED",
    "counterparty": {
      "port_id": "transfer",
      "channel_id": "channel-1"
    },
    "connection_hops": [
      "connection-0"
    ],
    "version": "ics20-1",
    "port_id": "transfer",
    "channel_id": "channel-0"
  }
]

The above is able to give us a list of active ics20-1 transfer channels. Useful for building ibc/MsgTransfer and denom mapping.

@dckc dckc mentioned this issue Jun 11, 2024
@mergify mergify bot closed this as completed in #9486 Jun 12, 2024
mergify bot added a commit that referenced this issue Jun 12, 2024
refs: #9063
closes: #8879

## Description

Fast follow on #9376

Tests that uncovered that the JSON.stringify encoding is not a valid
vstorage key. There's one character that can be used as a separator `_`,
the only vstorage valid char that's not a chain-id valid char. (vstorage
chars are superset of chain id chars)

Also fixes the chain_id half of the connection key, which had been chain
name.

Also adds a cache to chain info writer so it doesn't write entries that
exist and haven't changed.

Some misc test supports as well.

### Security Considerations

none

### Scaling Considerations

none

### Documentation Considerations

Eventually we'll document these new vstorage nodes, but probably by just
pointing to some snapshots.

### Testing Considerations

The A3P test checks that it works through agd CLI.

### Upgrade Considerations

not yet released
@dckc
Copy link
Member

dckc commented Jun 12, 2024

@mitdralla note the Xs in the description; these represent either clarification or changes in requirements / design or something.

@turadg turadg mentioned this issue Jun 12, 2024
mergify bot added a commit that referenced this issue Jun 13, 2024
_follow-up_

## Description

Adds 'umee', on the list in #8879. 

### Security Considerations



### Scaling Considerations



### Documentation Considerations



### Testing Considerations



### Upgrade Considerations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants