IBC modules and relayer - Formal specifications and Rust implementation

Overview

ibc-rs

Build Status End to End testing Apache 2.0 Licensed Rust Stable Rust 1.51+

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.

This project comprises primarily four crates:

  • The ibc crate defines the main data structures and on-chain logic for the IBC protocol.
  • The ibc-relayer crate provides an implementation of an IBC relayer, as a library.
  • The ibc-relayer-cli is a CLI (a wrapper over the ibc-relayer library), comprising the hermes binary.
  • The ibc-proto is a library with proto definitions necessary for interacting with Cosmos SDK IBC structs.

See the table below for more details.

Includes TLA+ specifications.

Crate name Type Version Docs
ibc (modules) lib IBC Crate IBC Docs
ibc-relayer lib IBC Relayer Crate IBC Relayer Docs
ibc-relayer-cli bin: hermes IBC Relayer CLI Crate IBC Relayer CLI Docs
ibc-proto lib IBC Proto Crate IBC Proto Docs

Requirements

Developed with the latest stable version of Rust: 1.51.0. (May work with older versions.)

Hermes Guide

The relayer CLI binary, called hermes, has a comprehensive guide at hermes.informal.systems.

Contributing

IBC is specified in English in the cosmos/ics repo. Any protocol changes or clarifications should be contributed there.

This repo contains the TLA+ specification and Rust implementation for the IBC modules and relayer. If you're interested in contributing, please comment on an issue or open a new one!

See also CONTRIBUTING.md.

Versioning

We follow Semantic Versioning, though APIs are still under active development.

Resources

License

Copyright © 2021 Informal Systems Inc. and ibc-rs authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files in this repository except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Comments
  • Setup IBC

    Setup IBC

    Crate

    • ibc

    Version

    v0.5.0

    Summary

    Hermes fails with TxNoConfirmation error constantly when trying to communicate with a full node that does not have indexing enabled.

    The error can be tracked down using a patched version of Hermes, and looks like this:

    Jun 30 13:39:20.800 TRACE waiting for commit of block(s) Jun 30 13:39:21.001 ERROR query_txs fail: Internal error: transaction indexing is disabled (code: -32603)

    Many thanks to @Fraccaman for helping us uncover this corner-case.

    A separate, related problem was due to misconfiguration (see https://github.com/heliaxdev/ibc-setup/pull/1).

    Acceptance criteria:

    • [ ] Hermes should catch the "transaction indexing is disabled" error and propagate it up the stack (instead of masking it under the hood of TxNoConfirmation)
    • [ ] Ideally, Hermes should be able to detect the health of a full node upon startup (similar to how we plan in #1057), so that the end-user is warned when Hermes is unable to correctly communicate with a full node

    Original discussion

    Summary of Bug

    Probably this is not a bug, but I can't understand whats wrong. I'm trying to open a channel between a cosmos mainnet node and a "own gaia testnet" node. I am able to build the relayer and configure it correctly (It doesn't complain so I'm assuming it is correct) but as soon as I try to run hermes channel handshake id-1 id-2 transfer transfer it throw the following error: {"status":"error","result":"chain runtime/handle error: Light client supervisor error for chain id heliax: empty witness list"}.

    p.s: @andynog suggested to open an issue

    Version

    • v0.1.1

    Steps to Reproduce

    I have created a repository with a series of bash scripts to reproduce this use case here.


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    bug question 
    opened by Fraccaman 65
  • Gaiad manager

    Gaiad manager

    Closes: #902

    Description

    This PR introduces the gm command described in issue #902. All functionality of the issue is implemented with some extras described in the documentation.

    Start with the README!


    For contributor use:

    • [X] Updated the Unreleased section of CHANGELOG.md with the issue.
    • [ ] If applicable: Unit tests written, added test to CI.
    • [X] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
    • [ ] Updated relevant documentation (docs/) and code comments.
    • [X] Re-reviewed Files changed in the Github PR explorer.
    opened by greg-szabo 25
  • Tracking issue for no-std support

    Tracking issue for no-std support

    This is a tracking issue to track the progress of no-std support for ibc-rs to close informalsystems/hermes#29. The change set for PR informalsystems/hermes#1109 is pretty broad, and as a result it is difficult to review and merge the PR all in one go. I would suggest that we split the changes into multiple smaller PRs, so that the changes can be incremental with the goal of eventually supporting no-std.

    Based on the changes in PR informalsystems/hermes#1109, I'd suggest we have separate PRs for the following changes:

    • [x] informalsystems/hermes#1846

    • [x] informalsystems/hermes#1359

    • [x] informalsystems/hermes#1390

    • [x] informalsystems/tendermint-rs/pull/988

    • [x] informalsystems/ibc-proto-rs-tmp#7

    • [x] informalsystems/tendermint-rs/pull/986

    • [x] informalsystems/tendermint-rs/issues/1027

    • [x] informalsystems/hermes#1612

    • [x] informalsystems/hermes#1439

    • [x] informalsystems/tendermint-rs#981

    • [x] informalsystems/tendermint-rs#993

    • [x] informalsystems/tendermint-rs#983

    • [x] informalsystems/tendermint-rs#985

    • [x] informalsystems/tendermint-rs/issues/992

    • [x] Use flex-error to define error types (#988)

      • This is to replace anomaly for fine grained error handling. While not directly related to no-std, the PR removes majority use of std::error::Error and allows different error tracers such as anyhow, eyre, or naive StringTracer to be used, depending on their support in no-std environment.
    • [x] Use core and alloc crates in place of std crate whenever possible (#1156)

      • The crates core and alloc can be accessed by both std and no-std code, and therefore do not require feature flag to switch between importing from core/alloc or std.
      • To use alloc in std mode, we just have to add an extern crate alloc in the root module, and that is automatically linked by Rust in std mode.
      • There are still a small number of imports from std that are not available in core nor alloc. In that case, the PR leaves the use of std in those cases, and have them fixed in follow up PRs.
      • The changes to use core and alloc can be done in a separate PR independent of other changes. While we cannot ensure that the change covers everything, this will reduce the number of changes required in subsequent PRs and make it easier for review.
    • [x] Use a wrapper struct for Box<dyn std::error::Error> for remaining errors not updated by informalsystems/hermes#988.

      • PR informalsystems/hermes#988 have removed most of the uses of Box<dyn std::error::Error>, however there are still a few places remaining that are still using std::error::Error.
      • PR informalsystems/hermes#1109 attempts to polyfill std::error::Error by aliasing it to a DummyError struct in no-std mode. However doing so does not prevent dependencies from constructing Box<dyn std::error::Error>, which would prevent no-std from being supported. On the other hand, if we have control of all places that produce Box<dyn std::error::Error>, we can also modify them to return something other than Box<dyn std::error::Error>.
      • I'd propose that we define a type like LegacyError, which is either a newtype wrapper to Box<dyn std::error::Error> in std mode, or a newtype wrapper to String in no-std mode. By always using a newtype wrapper, we can avoid accidental implicit coercion from Box<dyn std::error::Error> to LegacyError in std mode, which will prevent no-std mode to work.
      • There should be a Cargo separate feature flag to switch between the two modes ot LegacyError. The purpose is to be able to test the two modes of LegacyError without fully activating no-std.
      • This change can be done inside ~#1109~ informalsystems/hermes#988, or a follow up PR to ~#1109~ informalsystems/hermes#988. It is also possible to make this change against master, although there will be much more changes needed.
      • Update: This is no longer needed as all use of std::error::Error are now removed.
    • [x] Find alternative crates that replace missing functionalities in core and alloc.

      • There are still a small number of essential types like SystemTime that are provided by std, but not provided by core nor alloc.
      • PR informalsystems/hermes#1109 attempts to polyfill the types like SystemTime inside no-std mode. However this makes it difficult to maintain two version of the code depending on the std/no-std mode.
      • Ideally we should instead try and find alternative crates that can work in both std and no-std mode.
      • For example, we may want to investigate whether it is possible to use chrono::DateTime directly instead of SystemTime. If we can, then it would reduce our burden of having to maintain the code in different modes.
    • [x] Update Cargo.toml to use updated dependencies that have been published and support no-std, including tendermint-rs crates.

      • PR informalsystems/hermes#1109 has a [patch.crates-io] section that refers to upstream dependencies like tendermint-rs that are also being patched to support no-std. This makes it difficult to review and merge the PR, because we cannot easily see what is being changed in the upstream dependencies. Even if the reviews pass, the PR cannot be merged because we cannot publish Cargo crates with git dependencies inside.
      • We should first make changes in ibc-rs that do not require upstream dependencies to be updated. Even if that do not result in supporting no-std in one go, making independent changes will help reduce the number of changes necessary when the dependencies are updated.
      • The PR for updating upstream dependencies should be done after the other PRs for no-std have been merged, and also when the upstream dependencies have been published. Ideally this PR should have minimal changes, other than updating Cargo.toml.
    • [x] Add Cargo feature flags to activate #![no_std].

      • Other than the issues listed above, there might be other blockers that prevent no-std mode from being enabled. In such case, it is still better to merge the other PRs first, and only activate no-std when everything is fixed.
      • I am listing this as a separate step, so that it does not become a blocker for the other PRs. The point is we do not need to have one or few big PRs that immediately pass when #![no_std] is enabled.
      • The priority for the other PRs is to continue to have ibc-rs work in std mode, and not be concerned with whether they compiles in no-std. We can still maintain our own private branches that activate no-std during development.
      • Ideally, this final PR should have just few line changes to introduce the feature flags and #![no_std].
      • Note that as mentioned in informalsystems/hermes#1164, #![no_std] alone is still not sufficient for true no-std support, as dependencies may still use std behind the scene. The current known way to verify for true no-std support is to compile the crate with the target wasm32-unknown-unknown.
      • This is also the PR that enables the CI checks to ensure that no-std continues to be supported in the future.

    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    no-std 
    opened by soareschen 22
  • Packets stuck due to overflowing Timeout

    Packets stuck due to overflowing Timeout

    Crate

    hermes relayer

    Summary of Bug

    Pending packets are stucked, can't be relayed

    [bitcanna-1:transfer/channel-0 -> osmosis-1] packets that still have commitments on bitcanna-1: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 (first 10 shown here; total=53)
    Oct 08 13:56:25.293 DEBUG ThreadId(01) [bitcanna-1:transfer/channel-0 -> osmosis-1] recv packets to send out to osmosis-1 of the ones with commitments on source bitcanna-1: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 (first 10 shown here; total=52)
    The application panicked (crashed).
    Message:  called `Result::unwrap()` on an `Err` value: 
       0: error converting from u64 to i64
       1: out of range integral type conversion attempted
    
    Location:
       /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/flex-error-0.4.3/src/tracer_impl/eyre.rs:31
    
    Backtrace omitted.
    Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    Location: modules/src/ics04_channel/events.rs:139
    

    Another logs:

    ct 08 14:03:04 BCNA-SentryNode2 hermes[533309]: Oct 08 14:03:04.625  INFO ThreadId(46) [osmosis-1:transfer/channel-41 -> bitcanna-1] clearing pending packets height=Some(Height { revision: 1, height: 1500899 })
    Oct 08 14:03:04 BCNA-SentryNode2 hermes[533309]: Oct 08 14:03:04.638 ERROR ThreadId(46) [osmosis-1:transfer/channel-41 -> bitcanna-1] worker: handling command encountered error:
    Oct 08 14:03:04 BCNA-SentryNode2 hermes[533309]:    0: clearing of old packets failed 
    

    This error is in bucle in the relayer log:

    Oct 08 13:09:22 BCNA-SentryNode2 hermes[533309]: Oct 08 13:09:22.894 ERROR ThreadId(46) [osmosis-1:transfer/channel-41 -> bitcanna-1] worker: handling command encountered error:
    Oct 08 13:09:22 BCNA-SentryNode2 hermes[533309]:    0: clearing of old packets failed
    Oct 08 13:09:22 BCNA-SentryNode2 hermes[533309]: Location:
    Oct 08 13:09:22 BCNA-SentryNode2 hermes[533309]:    /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/flex-error-0.4.3/src/tracer_impl/eyre.rs:10
    Oct 08 13:09:22 BCNA-SentryNode2 hermes[533309]: Backtrace omitted.
    

    image

    hermes 0.7.3+5d53e52 (binary download). chain SDK v.0.44.1 / tendermint v.0.34.13

    Steps to Reproduce

    The stacked packets are there.. stacked in the Osmosis chain. You can see at logs. To get the panic error:

    hermes tx raw packet-recv  osmosis-1 bitcanna-1 transfer channel-0
    Oct 08 21:56:52.931  INFO ThreadId(01) using default configuration from '/home/raul/.hermes/config.toml'
    Oct 08 21:56:52.934 TRACE ThreadId(01) [bitcanna-1] subscribing to query: tm.event = 'Tx'
    Oct 08 21:56:52.935 TRACE ThreadId(01) [bitcanna-1] subscribing to query: tm.event = 'NewBlock'
    Oct 08 21:56:52.935 TRACE ThreadId(01) [bitcanna-1] subscribed to all queries
    Oct 08 21:56:52.936 DEBUG ThreadId(07) [bitcanna-1] starting event monitor
    Oct 08 21:56:52.938 TRACE ThreadId(01) [osmosis-1] subscribing to query: tm.event = 'Tx'
    Oct 08 21:56:52.939 TRACE ThreadId(01) [osmosis-1] subscribing to query: tm.event = 'NewBlock'
    Oct 08 21:56:52.940 TRACE ThreadId(01) [osmosis-1] subscribed to all queries
    Oct 08 21:56:52.940 DEBUG ThreadId(14) [osmosis-1] starting event monitor
    Oct 08 21:56:53.019 DEBUG ThreadId(01) [bitcanna-1:transfer/channel-0 -> osmosis-1] packets that still have commitments on bitcanna-1: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 (first 10 shown here; total=54)
    Oct 08 21:56:53.019 DEBUG ThreadId(01) [bitcanna-1:transfer/channel-0 -> osmosis-1] recv packets to send out to osmosis-1 of the ones with commitments on source bitcanna-1: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 (first 10 shown here; total=54)
    The application panicked (crashed).
    Message:  called `Result::unwrap()` on an `Err` value: 
       0: error converting from u64 to i64
       1: out of range integral type conversion attempted
    
    Location:
       /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/flex-error-0.4.3/src/tracer_impl/eyre.rs:31
    
    Backtrace omitted.
    Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    Location: modules/src/ics04_channel/events.rs:139
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    Error: 
       0: link error
       1: failed with underlying error
       2: failed to receive through channel
       3: receiving on an empty and disconnected channel
    
    Location:
       /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/flex-error-0.4.3/src/tracer_impl/eyre.rs:31
    
    Backtrace omitted.
    Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    

    Info of the client/connection/channel/path:

    CHAIN      CLIENT    		CONNECTION        CHANNEL
    bitcanna-1 07-tendermint-0   	connection-0      channel-0
    osmosis-1  07-tendermint-1456  	connection-1141   channel-41
    

    The healthy check:

    hermes health-check 
    Oct 08 22:02:56.931  INFO ThreadId(01) using default configuration from '/home/raul/.hermes/config.toml'
    Oct 08 22:02:56.933  INFO ThreadId(01) [bitcanna-1] performing health check...
    Oct 08 22:02:56.958  WARN ThreadId(01) Health checkup for chain 'bitcanna-1' failed
    Oct 08 22:02:56.958  WARN ThreadId(01)     Reason: Hermes health check failed while verifying the application compatibility for chain bitcanna-1:http://localhost:9093/; caused by: SDK module at version '0.44.1' does not meet compatibility requirements >=0.41.3, <=0.44.0 for application bcnad:1.1-0740c191bf290b9a6a69976c4a90520e6d4fb7ce
    Oct 08 22:02:56.958  WARN ThreadId(01)     Some Hermes features may not work in this mode!
    Oct 08 22:02:56.958 ERROR ThreadId(01) [bitcanna-1] chain is unhealthy
    Oct 08 22:02:56.960  INFO ThreadId(01) [osmosis-1] performing health check...
    Oct 08 22:02:56.982  INFO ThreadId(01) [osmosis-1] chain is healthy
    

    Connection:

    bcnad query ibc  connection  connections
    connections:
    - client_id: 07-tendermint-0
      counterparty:
        client_id: 07-tendermint-1456
        connection_id: connection-1141
        prefix:
          key_prefix: aWJj
      delay_period: "0"
      id: connection-0
      state: STATE_OPEN
      versions:
      - features:
        - ORDER_ORDERED
        - ORDER_UNORDERED
        identifier: "1"
    height:
      revision_height: "128344"
      revision_number: "1"
    pagination:
      next_key: null
      total: "0"
    

    unreceived-acks

    bcnad query ibc channel unreceived-acks transfer channel-0 --sequences=11,12,13,30,54,65
    height:
      revision_height: "128392"
      revision_number: "1"
    sequences:
    - "11"
    - "12"
    - "13"
    - "30"
    - "54"
    - "65"
    

    Acceptance Criteria

    The relaying of the packets


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    bug relayer code-hygiene user experience 
    opened by RaulBernal 21
  • Hermes always uses `max_gas` for transactions

    Hermes always uses `max_gas` for transactions

    Crate

    Hermes ibc_relayer v0.7.1

    Summary of Bug

    Hermes transaction always use max_gas amount.

    https://www.mintscan.io/osmosis/txs/E742F9EFE2E97A5FCD71FDB3CCDF2FF02BEE47DE5B2D0A51110805736F67C0E4

    Version

    v0.7.1

    Acceptance Criteria

    Hermes use automatic gas adjustment and gas_adjustment from config


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    question relayer user experience 
    opened by Galadrin 21
  • Hermes ports not getting detected

    Hermes ports not getting detected

    Crate

    ibc-rs (Hermes)

    Summary of Bug

    Creating channels between Band Protocol and another chain from it's oracle port for fetching prices, it throws could not resolve channel and port is invalid.

    Version

    hermes - release - v0.11.1

    Steps to Reproduce

    ibc-0 = Band Protocol (band-laozi-testnet4) ibc-1 = Any chain with oracle port*

    * = https://github.com/comdex-official/comdex/tree/oracle-liquidation (This binary and branch contains bandoracle port for fetching prices)

    hermes create channel test-1 band-laozi-testnet4 --port-a bandoracle --port-b oracle

    Logs:

    WARN ThreadId(01) cannot resolve channel version for unknown port id 'oracle'
    Error: channel error: could not resolve channel version because the port is invalid: oracle
    

    Acceptance Criteria

    Port from Band or Comdex getting detected for channel creation.


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    duplicate in progress 
    opened by dhogaivannan 20
  • Support for priority mempool chains

    Support for priority mempool chains

    Summary

    Starting with tm v0.34.20 we may see cosmos-sdk chains using priority enabled mempool. We need to make sure we support these chains.

    Problem Definition

    Here is my understanding about how prio mempool will be used from hermes pov.

    Let’s say hermes submits 2 Tx-es, tx1 and tx2, with incrementing nonces, using broadcast_tx_sync. The application runs checkTx for each of them and returns an abci.ResponseCheckTx that includes a priority. The prio mempool then stores this and when it’s time to create a block it picks Tx-es in priority order. In sdk chains, during checkTx, the priority is set by a TxFeeChecker and the default is defined in the auth module: https://github.com/cosmos/cosmos-sdk/blob/main/x/auth/ante/validator_tx_fee.go.

    In this case the priority is computed based on the Tx fee. Different apps/chains will have the ability to overwrite this handler. But staying with the default behavior for now, it is possible that tx2 will be included in a block before tx1, so deliverTx(tx2) will be executed first and will fail with account sequence mismatch. tx1 will be successful.

    If we try to use multiple wallets to go around the account sequence mismatch we will still see issues, e.g.:

    • tx2 may be rejected if tx1 includes a client update needed for msgs in tx2, or
    • the msgs in the tx-es are for ordered channels.

    While we push for a solution in tendermint or SDK (e.g. to not reorder Tx-es from same account or allow out of order execution during deliverTx), we should remove our assumption that Tx-es are executed in order, figure out all the cases where we are exposed to this and how to handle them.
    For the examples above, include update client in every tx (see also #2191), don’t send multiple Tx-es for ordered channels in same block (i.e. wait for tx1 hash to show up in a block before sending tx2), etc.

    Acceptance Criteria

    hermes works with prio mempool chains

    • [x] depends on #2455
    • [x] update compatibility.rs to mark compat w/ sdk 0.46
      • https://github.com/informalsystems/ibc-rs/blob/5df35478607452baa8db004efb1d7aa38dfd8d89/relayer/src/chain/cosmos/compatibility.rs#L8-L23

    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    P-low 
    opened by ancazamfir 19
  • Replace positional arguments with flags in CLI

    Replace positional arguments with flags in CLI

    Closes: #2239

    Description

    This PR adds flags instead of positional arguments to all CLI commands. Long flags have been used in order to avoid conflicts or confusing flags.

    WIP

    • At commit 51852ae51b91471e24f7b4b57116749b2d24d39c: Some short flags are still present for some commands, but a discussion in order to clarify if all the short flags will be removed or if some strategic short flags will be kept is ongoing.
    • At commit 88474db7e7a2957f9ab0f3b5273f82ec3b2ee544 and a76599fa918e7fc6f55235f1b70a782ebc274b8c: Removed all short flags.

    PR author checklist:

    • [x] Added changelog entry, using unclog.
    • [ ] ~Added tests: integration (for Hermes) or unit/mock tests (for modules).~
    • [x] Linked to GitHub issue.
    • [x] Updated guide (e.g., guide/).

    Reviewer checklist:

    • [ ] Reviewed Files changed in the GitHub PR explorer.
    • [x] Manually tested (in case integration/unit/mock tests are absent).
    opened by ljoss17 19
  • Sequence number caching in Hermes is unreliable

    Sequence number caching in Hermes is unreliable

    Crate

    Hermes

    Summary

    Query the state for every chain in config every X sec for the relayer account's seq number, and update cached seq number with it. Make X a configurable param.

    Problem Definition

    At some point (around height 1008 on Cosmos hub), for some reason, the cached seq number on our relayer instance got incremented, but the actual on-chain seq number wasn't. From there, our relayer hasn't been able to relay, producing the following error:

    Aug 06 15:51:41.681  INFO [irishub-1:transfer/channel-12 -> cosmoshub-4] result events:
        ChainErrorEv(deliver_tx on chain cosmoshub-4 for Tx hash EC50AD139769F2585F351CDE69636B0C82F522A5B29ADDD1C279737088F4E098 reports error: code=Err(32), log=Log("account sequence mismatch, expected 1008, got 1358: incorrect account sequence"))
    

    While we don't know what caused this mismatch to happen, we couldn't detect it and thought our relayer was running properly. It would be good to figure out why the mismatch happened, but it would also be good to have a failsafe that updates the cached seq number with the actual on-chain seq number periodically so that the relayer can recover on its own.


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    bug relayer gravity 
    opened by gamarin2 18
  • Use `#![no_std]` for ibc-proto crate

    Use `#![no_std]` for ibc-proto crate

    Partially Closes: informalsystems/hermes#1158

    Description

    This is a follow up on @romac's comment in informalsystems/hermes#1156

    c) Were the changes in the ibc-proto crate done manually? If so, can we automate that somehow? eg. via a prost flag/feature or within the proto-compiler crate as a post-processing step?

    I just realized ibc-proto crate do not use much of std features, and we can enable #![no_std] for the crate rather easily without modifying the generated code. This PR does the fix separately from informalsystems/hermes#1156.

    One thing I notice: even though the ibc-proto crate successfully compiles with #![no_std], it is in fact not fully no-std-compatible as at least one of its transitive dependencies, socket2, does not work in no_std. I could not find easy way to verify that other than building ibc-proto with the target wasm32-unknown-unknown:

    $ cargo build --target wasm32-unknown-unknown
    error[E0432]: unresolved import `crate::sys`
     --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/sockaddr.rs:5:12
      |
    5 | use crate::sys::{
      |            ^^^ could not find `sys` in the crate root
    ...
    

    The crate socket2 is imported via hyper, which is used by tonic. When inspecting the tonic and socket2 crate, I also find various uses of std::io and std::net, which are not available in no_std.

    This shows that supporting no_std is more tricky than just enabling the #![no_std] flag in our own crate. The no_std flag does not check on the compliance on dependencies, and I cannot find a good way to check on that other than building with the target wasm32-unknown-unknown. Other than tonic, it is also not clear how many other dependencies we have are unsupported in the real no_std environment.

    @DaviRain-Su do you have any experience in how to verify if a crate truly support no-std environment?


    For contributor use:

    • [ ] Updated the Unreleased section of CHANGELOG.md with the issue.
    • [ ] If applicable: Unit tests written, added test to CI.
    • [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
    • [ ] Updated relevant documentation (docs/) and code comments.
    • [ ] Re-reviewed Files changed in the Github PR explorer.
    no-std 
    opened by soareschen 18
  • Repo split

    Repo split

    Summary

    It has been proposed that we split the ibc-rs monorepo into two repos - one for the proto & module crates and the other for the relayer crate (and its associated crates). Additionally, the relayer code must not depend on the ibc crate to have clear boundaries/separation and allow the modules to evolve independently.

    Problem Statement

    The monorepo approach is restrictive and becoming difficult to maintain. (See https://github.com/informalsystems/ibc-rs/discussions/1437#discussioncomment-1458578) Moreover, having the relayer crate depend on the ibc crate makes it difficult to modify one without touching the other, and have resulted in code bloat and unclear boundaries - for e.g. the modules code contains relayer specific code.

    Proposal

    Using the ideas described in https://github.com/informalsystems/ibc-rs/issues/2541 and https://github.com/informalsystems/ibc-rs/discussions/1437, the repo hosting the relayer crates (the relayer repo) would look like so ->

    <relayer>
    ├── CHANGELOG.md
    ├── CONTRIBUTING.md
    ├── Cargo.lock
    ├── Cargo.toml
    │
    ├── crates
    │	├── ibc-relayer
    │	├── ibc-relayer-cli
    │	├── ibc-relayer-rest
    │	├── ibc-telemetry
    │	└── ibc-chain-registry 
    │
    ├── etc...
    

    And the modules repo would look like so ->

    <modules>
    ├── CHANGELOG.md
    ├── CONTRIBUTING.md
    ├── Cargo.toml
    │
    ├── crates
    │	├── ibc
    │	└── proto
    │		├── ibc-proto
    │		└── ibc-proto-compiler 
    │
    ├── etc...
    

    Acceptance Criteria

    The ibc-rs repo is split into two repos as proposed above, ideally preserving history.

    TODOs

    • [ ] Rename the default branches of both repos from master to main
    • [ ] Split gm out of the repository

    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    code-hygiene 
    opened by hu55a1n1 16
  • Bump async-trait from 0.1.59 to 0.1.60

    Bump async-trait from 0.1.59 to 0.1.60

    Bumps async-trait from 0.1.59 to 0.1.60.

    Release notes

    Sourced from async-trait's releases.

    0.1.60

    • Documentation improvements
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump toml from 0.5.9 to 0.5.10

    Bump toml from 0.5.9 to 0.5.10

    Bumps toml from 0.5.9 to 0.5.10.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump serde_json from 1.0.89 to 1.0.91

    Bump serde_json from 1.0.89 to 1.0.91

    Bumps serde_json from 1.0.89 to 1.0.91.

    Release notes

    Sourced from serde_json's releases.

    v1.0.91

    • Opt out of -Zrustdoc-scrape-examples on docs.rs for now

    v1.0.90

    • Documentation improvements
    Commits
    • 26f147f Release 1.0.91
    • d9cdb98 Opt out -Zrustdoc-scrape-examples on docs.rs
    • 331511d Release 1.0.90
    • 8753829 Replace ancient CI service provider in readme
    • 0a43394 Update build status badge
    • 8794844 Prevent build.rs rerunning unnecessarily on all source changes
    • 0b54871 Time out workflows after 45 minutes
    • ecad462 Fix renamed let_underscore_drop lint
    • 9295c96 Resolve needless_borrowed_reference clippy lints
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump serde_yaml from 0.9.14 to 0.9.16

    Bump serde_yaml from 0.9.14 to 0.9.16

    Bumps serde_yaml from 0.9.14 to 0.9.16.

    Release notes

    Sourced from serde_yaml's releases.

    0.9.16

    • Opt out of -Zrustdoc-scrape-examples on docs.rs for now

    0.9.15

    • Documentation improvements
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Clarify the purpose of `ibc-relayer-types` crate compared to `cosmos/ibc-rs`

    Clarify the purpose of `ibc-relayer-types` crate compared to `cosmos/ibc-rs`

    Summary

    Developers who want to build their own relayer may be confused about which crate to use when it comes to importing IBC types. Remarkably, there is not enough context around the core purpose of the ibc-relayer-types crate.

    Problem Definition

    ibc-relayer-types and cosmos/ibc-rs crates have many common functionality and abstractions but with different roles. The role of ibc-relayer-types should be clearly presented from the client's perspective and be introduced as a toolkit for relayer development, with the latter focusing on on-chain operations. It became necessary when you look at it from developers' perspective, specifically those working on non-Cosmos chains. The ibc-relayer-types is the only crate they have to use among the Hermes crates. It’s needed since it enables them to interact with blockchains, while the others are mainly related to relaying logic and could be implemented by them internally.

    Proposal

    Though the reason behind having ibc-relayer-types and cosmos/ibc-rs crates in parallel can be found here, the purpose of each should be clearly explained in the Hermes root README and the README of ibc-relayer-types.Both mentioned repos use the same readme descriptions at the moment.


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate milestone (priority) applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    documentation 
    opened by Farhad-Shabani 0
  • Enabling Hermes to support more diverse relaying use-cases

    Enabling Hermes to support more diverse relaying use-cases

    Background

    Hermes' user base is shifting away from relayer operators towards relayer developers. This is in large part because more non-Cosmos chains are onboarding into the Interchain ecosystem: all these different chains have different relaying use-cases.

    In order to cater to these users, Hermes' architecture needs to be opened up such that it can be extended in a flexible and modular fashion to fit different use-cases and relaying strategies. To that end, the Hermes architecture is evolving from a relayer binary into a relay framework in order to enable this. In addition to flexibility and composability, the relayer framework will also expose presets to cater towards common relaying use-cases. This way, users will have a batteries-included option if their relaying use-case is not unique or does not require bespoke features/components.

    Tasks

    The scope of this work revolves around three key results. It aims to ensure that the new relayer framework:

    1. Is more easily maintainable and better documented than the current iteration of Hermes.
      • [ ] #2952
      • [ ] #2956
    2. Supports basic IBC relaying functionality as part of the v1.5 milestone; more complex relaying functionality will be developed as part of v2.
      • [ ] #2929
      • [ ] #2926
    3. Supports relaying between non-Cosmos chains.
      • [ ] #2924
    relayer-next okr 
    opened by seanchen1991 0
Releases(v1.2.0)
Owner
Informal Systems
Informal Systems
Official Rust implementation of the Nimiq protocol

Nimiq Core implementation in Rust (core-rs) Rust implementation of the Nimiq Blockchain Core Nimiq is a frictionless payment protocol for the web. Thi

Nimiq 72 Sep 23, 2022
Rust implementation of Zcash protocol

The Parity Zcash client. Gitter Blog: Parity teams up with Zcash Foundation for Parity Zcash client Installing from source Installing the snap Running

Parity Technologies 183 Sep 8, 2022
Implementation of the Kademlia DHT protocol in Rust

kademlia-dht Simple implementation of the Kademlia DHT protocol in Rust with state dumping features for educational purposes (not production-ready). T

Leonardo Folgoni 18 Sep 24, 2022
Martinez is vNext Ethereum implementation written in pure Rust with Erigon architecture as design.

?? Martinez ?? Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture. Why run Martinez? Look at

Arthur·Thomas 23 Jul 3, 2022
Minimal implementation of the Mimblewimble protocol.

Grin Grin is an in-progress implementation of the Mimblewimble protocol. Many characteristics are still undefined but the following constitutes a firs

null 5k Dec 28, 2022
Polkadot Node Implementation

Polkadot Implementation of a https://polkadot.network node in Rust based on the Substrate framework. NOTE: In 2018, we split our implementation of "Po

Parity Technologies 6.5k Jan 6, 2023
Official implementation of the YeeCo Root Chain (Layer 1)

yeeroot Official implementation of the YeeCo Root Chain (Layer 1) YeeCo is a permissionless, secure, high performance and scalable public blockchain p

YeeCo 29 Sep 20, 2022
The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)

Holochain License: This repository contains the core Holochain libraries and binaries. This is the most recent and well maintained version of Holochai

Holochain 737 Dec 28, 2022
Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.

Note to readers: On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. A

Diem 16.7k Dec 29, 2022
A Rust library for working with Bitcoin SV

Rust-SV A library to build Bitcoin SV applications in Rust. Documentation Features P2P protocol messages (construction and serialization) Address enco

Brenton Gunning 51 Oct 13, 2022
Coinbase pro client for Rust

Coinbase pro client for Rust Supports SYNC/ASYNC/Websocket-feed data support Features private and public API sync and async support websocket-feed sup

null 126 Dec 30, 2022
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.

Holochain-rust Travis: Circle CI: Codecov: License: This code is loosely based on the previous Golang prototype. Code Status: This Rust version is alp

Holochain 1k Jan 3, 2023
Rust Ethereum 2.0 Client

Lighthouse: Ethereum 2.0 An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prime. Documentation Overview Lighthouse is: Read

Sigma Prime 2.1k Jan 1, 2023
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
Tendermint in Rust!

tendermint.rs Tendermint in Rust with TLA+ specifications. Tendermint is a high-performance blockchain consensus engine for Byzantine fault tolerant a

Informal Systems 439 Jan 1, 2023
A Rust library for generating cryptocurrency wallets

Table of Contents 1. Overview 2. Build Guide 2.1 Install Rust 2.2a Build from Homebrew 2.2b Build from Crates.io 2.2c Build from Source Code 3. Usage

Aleo 554 Dec 31, 2022
Rust port of the Terry Davis' (RIP) "god says" program

RIP Terry A. Davis 1969-2018 god says Rust port of the programmer Terry Davis' "god says" (AKA GodSpeaks) program. Terrence Andrew Davis (December 15,

Orhun Parmaksız 54 Dec 26, 2022
Collection of Key Derivation Functions written in pure Rust

RustCrypto: Key Derivation Functions Collection of Key Derivation Functions (KDF) written in pure Rust. Supported Algorithms Algorithm Crate Crates.io

Rust Crypto 44 Dec 25, 2022