Skip to content

Commit

Permalink
feat: migrate core, clients modules into ibc-core, `ibc-clients…
Browse files Browse the repository at this point in the history
…` crates (#969)

* feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `core` module under the `ibc` crate into `ibc-core`

feat: migrate `applications` module under the `ibc` crate into `ibc-apps` (#967)

* feat: restructure and split off applications codebase into ibc-apps dir

* imp: rename transfer dir to ics20_transfer

* feat: add ibc-apps crate

* fix: remove redundant dep + fix cargo doc

* docs: add README and descriptions

* docs: update main README page

* nit: docstrings

* nit: docstrings

* imp: rename folder to ics20-transfer

* chore: move serializers into ics20-transfer/types

* fix: apply reviewer comments

* imp: add docstring for cosmos_adr028_escrow_address

* fix: add missing features + use workspace deps for ibc crates

* imp: place re-exports under mod

* nit: apply suggestions from code review

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>

* fix: cargo fmt

---------

Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>

feat: restructure and split off applications codebase into ibc-apps dir

refactor: nits from nightly clippy (#962)

* use enum tuple variants directly

* use first() over get(0)

* use infallible conversion

* rm redundant export

* cargo fmt

ci: spell check on GitHub workflows (#964)

* typos github action

* cutom config for typos

* fix spelling to counterparty

* fix spelling to transfer

imp: rename transfer dir to ics20_transfer

feat: add ibc-apps crate

fix: remove redundant dep + fix cargo doc

docs: add README and descriptions

docs: update main README page

nit: docstrings

nit: docstrings

imp: rename folder to ics20-transfer

chore: move serializers into ics20-transfer/types

fix: apply reviewer comments

imp: add docstring for cosmos_adr028_escrow_address

fix: add missing features + use workspace deps for ibc crates

imp: place re-exports under mod

feat: ibc core codebase overhaul (part-1)

feat: ibc core codebase overhaul (part-2)

chore: comment out ibc-query & ibc-testkit

fix: add missing features

nit

* fix: re-export ibc_apps in the ibc crate

* chore: adjust features + add description for crates

* fix: CI catches

* fix: no_std

* imp: define ics25-handler + move tendermint-specific impls into ibc-core-host-tendermint

* fix: cargo doc

* docs: add and edit READMEs

* fix: cargo hack catches

* fix: cargo udeps catches

* chore: ajdust README tables

* docs: further README adjustments

* fix: typo

* chore: another review of comments & READMEs

* imp: move Any and Protobuf to ibc-primitives

* fix: missing std features

* Split out ibc-clients crate (#971)

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Migrate crates/ibc-clients

* Fix dependencies in types directory

* Fix dependencies in ibc-clients crate

* Delete ibc/ics07_tendermint directory

* Resolve dependencies in ibc crate

* Resolve dependencies in ibc-clients crate

* Wrap ClientState type in a newtype wrapper

* Address all compilation errors

* Add default feature `std` for ibc-clients crate

* Change cfg derivation

* Fixing import paths

* Fix import paths for ibc-client-tendermint crate

* Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Fix remaining compilation errors in ics07-tendermint crate

* chore: adjust import paths, features and READMEs

* fix: CI catches

* fix: add serde dep for ibc-client-tendermint

* fix: serde_tests

* imp: rename ClientState to ClientStateWrapper

---------

Co-authored-by: Farhad Shabani <farhad.shabani@gmail.com>

* docs: improve crates descriptions

* fix: apply reviewer comments

* Delete some unused modules and add some documentation

* Add TODO to use u64::dev_ceil

* Formatting of ibc-primitives README

* fix: ibc-primitives serde feature

---------

Co-authored-by: Sean Chen <seanchen11235@gmail.com>
  • Loading branch information
Farhad-Shabani and seanchen1991 authored Nov 21, 2023
1 parent 55038aa commit 3cc9753
Show file tree
Hide file tree
Showing 287 changed files with 7,005 additions and 4,125 deletions.
114 changes: 81 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@
resolver = "2"
members = [
"crates/ibc",
"crates/ibc-data-types",
"crates/ibc-primitives",
"crates/ibc-core",
"crates/ibc-clients",
"crates/ibc-apps",
"crates/ibc-derive",
"crates/ibc-testkit",
"crates/ibc-query",
"crates/ibc-core/ics02-client",
"crates/ibc-core/ics02-client/types",
"crates/ibc-core/ics03-connection",
"crates/ibc-core/ics03-connection/types",
"crates/ibc-core/ics04-channel",
"crates/ibc-core/ics04-channel/types",
"crates/ibc-core/ics23-commitment/types",
"crates/ibc-core/ics24-host",
"crates/ibc-core/ics24-host/types",
"crates/ibc-core/ics24-host/tendermint",
"crates/ibc-core/ics25-handler",
"crates/ibc-core/ics25-handler/types",
"crates/ibc-core/ics26-routing",
"crates/ibc-core/ics26-routing/types",
"crates/ibc-apps/ics20-transfer",
"crates/ibc-apps/ics20-transfer/types",
"crates/ibc-clients/ics07-tendermint",
"crates/ibc-clients/ics07-tendermint/types",
"crates/ibc-derive",
"crates/ibc-testkit",
"crates/ibc-query",
"crates/ibc-clients",
]
exclude = [
"ci/cw-check",
Expand All @@ -25,45 +49,69 @@ authors = ["Informal Systems <hello@informal.systems>"]

[workspace.dependencies]
# external dependencies
borsh = {version = "0.10", default-features = false }
bytes = { version = "1.5.0", default-features = false }
displaydoc = { version = "0.2", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] }
env_logger = "0.10.0"
num-traits = { version = "0.2.17", default-features = false }
parking_lot = { version = "0.12.1", default-features = false }
primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] }
prost = { version = "0.12", default-features = false }
rstest = "0.18.2"
schemars = { version = "0.8.15"}
sha2 = { version = "0.10.8", default-features = false }
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", default-features = false }
serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false }
subtle-encoding = { version = "0.5", default-features = false }
test-log = { version = "0.2.13", features = ["trace"] }
time = { version = ">=0.3.0, <0.3.31", default-features = false }
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"] }
typed-builder = { version = "0.18.0"}
borsh = {version = "0.10", default-features = false }
bytes = { version = "1.5.0", default-features = false }
displaydoc = { version = "0.2", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] }
env_logger = "0.10.0"
num-traits = { version = "0.2.17", default-features = false }
parking_lot = { version = "0.12.1", default-features = false }
primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] }
prost = { version = "0.12", default-features = false }
rstest = "0.18.2"
schemars = { version = "0.8.15" }
sha2 = { version = "0.10.8", default-features = false }
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", default-features = false }
serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false }
subtle-encoding = { version = "0.5", default-features = false }
test-log = { version = "0.2.13", features = ["trace"] }
time = { version = ">=0.3.0, <0.3.31", default-features = false }
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"] }
typed-builder = { version = "0.18.0" }

# ibc dependencies
ibc = { version = "0.47.0", path = "./crates/ibc", default-features = false }
ibc-testkit = { version = "0.47.0", path = "./crates/ibc-testkit", default-features = false}
ibc-app-transfer = { version = "0.47.0", path = "./crates/ibc-apps/ics20-transfer", default-features = false }
ibc-app-transfer-types = { version = "0.47.0", path = "./crates/ibc-apps/ics20-transfer/types", default-features = false }
ibc-derive = { version = "0.3.0", path = "./crates/ibc-derive" }
ibc = { version = "0.47.0", path = "./crates/ibc", default-features = false }
ibc-core = { version = "0.47.0", path = "./crates//ibc-core", default-features = false }
ibc-clients = { version = "0.47.0", path = "./crates/ibc-clients", default-features = false }
ibc-apps = { version = "0.47.0", path = "./crates/ibc-apps", default-features = false }
ibc-primitives = { version = "0.47.0", path = "./crates/ibc-primitives", default-features = false }
ibc-testkit = { version = "0.47.0", path = "./crates/ibc-testkit" }
ibc-derive = { version = "0.3.0", path = "./crates/ibc-derive" }

ibc-core-client = { version = "0.47.0", path = "./crates/ibc-core/ics02-client", default-features = false }
ibc-core-connection = { version = "0.47.0", path = "./crates/ibc-core/ics03-connection", default-features = false }
ibc-core-channel = { version = "0.47.0", path = "./crates/ibc-core/ics04-channel", default-features = false }
ibc-core-host = { version = "0.47.0", path = "./crates/ibc-core/ics24-host", default-features = false }
ibc-core-handler = { version = "0.47.0", path = "./crates/ibc-core/ics25-handler", default-features = false }
ibc-core-router = { version = "0.47.0", path = "./crates/ibc-core/ics26-routing", default-features = false }
ibc-client-tendermint = { version = "0.47.0", path = "./crates/ibc-clients/ics07-tendermint", default-features = false }
ibc-app-transfer = { version = "0.47.0", path = "./crates/ibc-apps/ics20-transfer", default-features = false }

ibc-core-client-context = { version = "0.47.0", path = "./crates/ibc-core/ics02-client/context", default-features = false }
ibc-core-client-types = { version = "0.47.0", path = "./crates/ibc-core/ics02-client/types", default-features = false }
ibc-core-channel-types = { version = "0.47.0", path = "./crates/ibc-core/ics04-channel/types", default-features = false }
ibc-core-connection-types = { version = "0.47.0", path = "./crates/ibc-core/ics03-connection/types", default-features = false }
ibc-core-commitment-types = { version = "0.47.0", path = "./crates/ibc-core/ics23-commitment/types", default-features = false }
ibc-core-host-tendermint = { version = "0.47.0", path = "./crates/ibc-core/ics24-host/tendermint", default-features = false }
ibc-core-host-types = { version = "0.47.0", path = "./crates/ibc-core/ics24-host/types", default-features = false }
ibc-core-handler-types = { version = "0.47.0", path = "./crates/ibc-core/ics25-handler/types", default-features = false }
ibc-core-router-types = { version = "0.47.0", path = "./crates/ibc-core/ics26-routing/types", default-features = false }
ibc-client-tendermint-types = { version = "0.47.0", path = "./crates/ibc-clients/ics07-tendermint/types", default-features = false }
ibc-app-transfer-types = { version = "0.47.0", path = "./crates/ibc-apps/ics20-transfer/types", default-features = false }

ibc-proto = { version = "0.38.0", default-features = false }
ics23 = { version = "0.11", default-features = false }
ics23 = { version = "0.11", default-features = false }

# cosmos dependencies
tendermint = { version = "0.34.0", default-features = false }
tendermint-light-client = { version = "0.34.0", default-features = false }
tendermint = { version = "0.34.0", default-features = false }
tendermint-light-client = { version = "0.34.0", default-features = false }
tendermint-light-client-verifier = { version = "0.34.0", default-features = false }
tendermint-proto = { version = "0.34.0", default-features = false }
tendermint-rpc = { version = "0.34.0", default-features = false }
tendermint-testgen = { version = "0.34.0", default-features = false }
tendermint-proto = { version = "0.34.0", default-features = false }
tendermint-rpc = { version = "0.34.0", default-features = false }
tendermint-testgen = { version = "0.34.0", default-features = false }

# parity dependencies
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"] }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
55 changes: 32 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,32 @@
</div>
</div>

Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project hosts
the `ibc` rust crate which defines the main data structures and on-chain logic for the IBC protocol.

## Libraries

- [ibc](crates/ibc/README.md) - Data structures and on-chain logic for the IBC protocol.
- [ibc-apps](crates/ibc-apps/README.md) - Contains implementations of various IBC applications.
- [ibc-derive](crates/ibc-derive/README.md) - Derive macros for `ClientState`
and `ConsensusState` traits, reducing boilerplate.
- [ibc-testkit](crates/ibc-testkit/README.md) - Testing toolkit to aid `ibc-rs` and host chains in writing integration tests.
- [ibc-query](crates/ibc-query/README.md) - Utility traits and implementations for querying the
state of an `ibc-rs` enabled chain.
Rust implementation of the Inter-Blockchain Communication (IBC) protocol that
hosts all the data structures and on-chain logic implementations of various IBC
core, clients and applications. This repository organized as a collection of
sub-crates that can be used independently or together.

## Project Structure

| <div style="width:100px">Crate</div> | Description |
| ---------------------------------------- | ----------- |
|[ibc](crates/ibc) | Re-exports all the data structures and on-chain logic of various IBC core, clients and applications. |
|[ibc-data-types](crates/ibc-data-types) | Re-exports all the IBC data types that are shared across different IBC implementations. |
|[ibc-core](crate/ibc) | Contains data structures and implementations of all the IBC core specifications. |
|[ibc-client](crates/ibc-client) | Contains data structures and implementations of various IBC light clients. |
|[ibc-apps](crates/ibc-apps) | Contains data structures and implementations of various IBC applications. |
|[ibc-testkit](crates/ibc-testkit) | Provides testing toolkit to aid `ibc-rs` and host chains in writing integration tests. |
|[ibc-query](crates/ibc-query) | Contains utility traits and implementations for querying states of an integrated IBC module. |
|[ibc-derive](crates/ibc-derive) | Derive macros for `ClientState` and `ConsensusState` traits, reducing boilerplate. |

## Contributing

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

This repo contains the Rust implementation for the IBC modules. If you're interested in
contributing, please comment on an issue or open a new one!
IBC is specified in English in the [cosmos/ibc repo][ibc]. Any protocol changes
or clarifications should be contributed there.

See also [CONTRIBUTING.md](./CONTRIBUTING.md).
If you're interested in contributing, please take a look at the
[CONTRIBUTING](./CONTRIBUTING.md) guidelines. We welcome and appreciate
community contributions!

## Community calls

Expand All @@ -58,26 +62,30 @@ receive a calendar invitation for the monthly meeting.

## Versioning

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

## Resources

- [IBC Website][ibc-homepage]
- [IBC Specification][ibc]
- [IBC Go implementation][ibc-go]
- [Protobuf definitions in Rust][ibc-proto-rs]

## License

Copyright © 2022 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
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.
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.

[//]: # (badges)
[docs-image]: https://docs.rs/ibc/badge.svg
Expand All @@ -95,6 +103,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the speci
[//]: # (general links)
[ibc]: https://github.com/cosmos/ibc
[ibc-go]: https://github.com/cosmos/ibc-go
[ibc-proto-rs]: https://github.com/cosmos/ibc-proto-rs
[ibc-homepage]: https://cosmos.network/ibc
[cosmos-link]: https://cosmos.network
[semver]: https://semver.org/
Expand Down
Loading

0 comments on commit 3cc9753

Please sign in to comment.