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

feat: restructure ibc crate #975

Merged
merged 13 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Move ICS-20 and ICS-27 implementations to the respective part of `ibc-apps`
and `ibc-clients` crates, as part of the `ibc` crate restructuring effort.
([\#716](https://github.com/cosmos/ibc-rs/issues/716))
5 changes: 5 additions & 0 deletions .changelog/unreleased/breaking-changes/965-restructure-ibc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Restructure `ibc-rs` codebase by organizing it into smaller self-contained,
modular libraries, enabling the selective import of specific domain types or
module implementations, either individually or in combination, providing
enhanced flexibility and ease of use.
([\#965](https://github.com/cosmos/ibc-rs/issues/965))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Re-export essential proto types from the underlying `ibc-*-*-types` crates,
removing the necessity for a direct dependency on `ibc-proto` in projects
integrating `ibc-rs` ([\#697](https://github.com/cosmos/ibc-rs/issues/697))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Rename `{submodule}.rs` with corresponding `{submodule}` directory to
`{submodule}/mod.rs` ([\#771](https://github.com/cosmos/ibc-rs/issues/771))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Remove redundant `#[test_log::test]` attributes in test modules
([\#948](https://github.com/cosmos/ibc-rs/issues/948))
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Expose various fields, types and functions in `ibc-rs` as public including:
- `validate` and `execute` handler functions for all the IBC message types.
- `TYPE_URL` constants.
- Any private fields within the domain message types.
- Any private fields within the Tendermint `ClientState` and `ConsensusState`
([\#976](https://github.com/cosmos/ibc-rs/issues/976))
7 changes: 5 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "crates/ibc"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "cargo"
directory: "ci/no-std-check"
schedule:
interval: "weekly"
- package-ecosystem: "cargo"
directory: "ci/cw-check"
schedule:
interval: "weekly"
8 changes: 7 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ on:
- .github/workflows/coverage.yml
- Cargo.toml
- ci/**
- crates/**
- ibc/**
- ibc-core/**
- ibc-apps/**
- ibc-data-types/**
- ibc-clients/**
- ibc-primitives/**
- ibc-query/**
push:
branches:
- main
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/cw-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ on:
- Cargo.toml
- Cargo.lock
- ci/cw-check/**
- crates/**

- ci/**
- ibc/**
- ibc-core/**
- ibc-apps/**
- ibc-data-types/**
- ibc-clients/**
- ibc-primitives/**
- ibc-query/**
- ibc-derive/**
jobs:
cw-check:
runs-on: ubuntu-20.04
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/no-std.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@ on:
- Cargo.toml
- Cargo.lock
- ci/no-std-check/**
- crates/**
- ci/**
- ibc/**
- ibc-core/**
- ibc-apps/**
- ibc-data-types/**
- ibc-clients/**
- ibc-primitives/**
push:
branches: main
paths:
- .github/workflows/no-std.yml
- Cargo.toml
- Cargo.lock
- ci/no-std-check/**
- crates/**

- ci/**
- ibc/**
- ibc-core/**
- ibc-apps/**
- ibc-data-types/**
- ibc-clients/**
- ibc-primitives/**
jobs:
check-no-std-panic-conflict:
name: Check no_std panic conflict
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,31 @@ on:
- .github/workflows/rust.yml
- Cargo.toml
- ci/**
- crates/**
- ibc/**
- ibc-core/**
- ibc-apps/**
- ibc-data-types/**
- ibc-clients/**
- ibc-primitives/**
- ibc-query/**
- ibc-testkit/**
- ibc-derive/**
Comment on lines +8 to +16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do ibc*/**, unless you want to be selective.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, still being able to selectively comment out each crates works better for the development and debugging purposes imo.

push:
branches: main
paths:
- .github/workflows/rust.yml
- Cargo.toml
- ci/**
- crates/**

- ibc/**
- ibc-core/**
- ibc-apps/**
- ibc-data-types/**
- ibc-clients/**
- ibc-primitives/**
- ibc-query/**
- ibc-testkit/**
- ibc-derive/**

env:
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 1
Expand All @@ -31,7 +47,7 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

fmt:
nightly_fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
46 changes: 2 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ repository:
- [Pull Requests](#pull-requests) - what makes a good pull request
- [Forking](#forking) - fork the repo to make pull requests
- [Changelog](#changelog) - changes must be recorded in the changelog
- [Releases](#releases) - how to release new version of the crates

## Decision Making

Expand Down Expand Up @@ -109,7 +108,7 @@ single commit for the PR with all the commit messages.
If the issue you worked on was tagged `A: low-priority`, we'll do our best to
review it in a timely manner, but please expect longer wait times for a review
in general. If a low priority issue is important to you, please leave a comment
explaining why, and we will reprioritize it!
explaining why, and we will re-prioritize it!

## Responsibilities of a PR Reviewer

Expand Down Expand Up @@ -200,7 +199,7 @@ See those changelogs for examples.
We currently split changes for a given release between these four sections: Breaking
Changes, Features, Improvements, Bug Fixes.

Entries in the changelog should initially be logged in the __Unreleased__ section, which
Entries in the changelog should initially be logged in the **Unreleased** section, which
represents a "staging area" for accumulating all the changes throughout a
release (see [Pull Requests](#pull-requests) below). With each release,
the entries then move from this section into their permanent place under a
Expand Down Expand Up @@ -232,44 +231,3 @@ Any change that effects multiple APIs/users should be recorded multiply - for
instance, a change to some core protocol data structure might need to be
reflected both as breaking the core protocol but also breaking any APIs where core data structures are
exposed.

## Releases

Our release process is as follows:

1. In a new branch `release/vX.Y.Z`, update the [changelog](#changelog) to reflect and summarize all changes in
the release. This involves:
1. Running `unclog build -u` and copy pasting the output at the top
of the `CHANGELOG.md` file, making sure to update the header with
the new version.
2. Running `unclog release --editor <editor> --version vX.Y.Z` to create a summary of all of the changes
in this release.
1. Your text editor will open. Write the release summary, and close the editor.
1. Make sure to include a comment on whether or not the release contains consensus-breaking changes.
2. Add this same summary to `CHANGELOG.md` as well.
3. Committing the updated `CHANGELOG.md` file and `.changelog` directory to the repo.
2. Push this to a branch `release/vX.Y.Z` according to the version number of
the anticipated release (e.g. `release/v0.18.0`) and open a **draft PR**.
3. If there were changes in the `ibc-derive` crate, we need to publish a new version of that crate.
1. bump the version in `crates/ibc-derive/Cargo.toml`
2. Publish `ibc-derive` with `cargo publish -p ibc-derive`
4. Bump the versions of relevant crates (`ibc` and `ibc-query`) in their
`Cargo.toml` to the new version, and push these changes to the release PR.
- If you released a new version of `ibc-derive` in step 3, make sure to update that dependency.
5. Run `cargo doc -p ibc --all-features --open` locally to double-check that all the
documentation compiles and seems up-to-date and coherent. Fix any potential
issues here and push them to the release PR.
6. Run `cargo publish -p ibc --dry-run` to double-check that publishing will work. Fix
any potential issues here and push them to the release PR.
7. Mark the PR as **Ready for Review** and incorporate feedback on the release.
8. Once approved, merge the PR, and pull the `main` branch.
9. Run `cargo publish -p ibc` and `cargo publish -p ibc-query` to publish the crates.
10. Create a signed tag and push it to GitHub: `git tag -s -a vX.Y.Z`. In the
tag message, write the version and the link to the corresponding section of
the changelog.
- Push the tag with `git push --tags`
11. Once the tag is pushed, create a GitHub release and append
`[📖CHANGELOG](https://github.com/cosmos/ibc-rs/blob/main/CHANGELOG.md#vXYZ)`
to the release description.

All done! 🎉
110 changes: 77 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
[workspace]
resolver = "2"
members = [
"crates/ibc",
"crates/ibc-derive",
"crates/ibc-testkit",
"crates/ibc-query",
"ibc",
"ibc-data-types",
"ibc-primitives",
"ibc-core",
"ibc-clients",
"ibc-apps",
"ibc-testkit",
"ibc-query",
"ibc-derive",
"ibc-core/ics02-client",
"ibc-core/ics02-client/types",
"ibc-core/ics03-connection",
"ibc-core/ics03-connection/types",
"ibc-core/ics04-channel",
"ibc-core/ics04-channel/types",
"ibc-core/ics23-commitment/types",
"ibc-core/ics24-host",
"ibc-core/ics24-host/types",
"ibc-core/ics24-host/cosmos",
"ibc-core/ics25-handler",
"ibc-core/ics25-handler/types",
"ibc-core/ics26-routing",
"ibc-core/ics26-routing/types",
"ibc-clients/ics07-tendermint",
"ibc-clients/ics07-tendermint/types",
"ibc-apps/ics20-transfer",
"ibc-apps/ics20-transfer/types",
]
exclude = [
"ci/cw-check",
Expand All @@ -22,41 +45,62 @@ authors = ["Informal Systems <[email protected]>"]

[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"] }
num-traits = { version = "0.2.17", 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_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false }
subtle-encoding = { version = "0.5", default-features = false }
time = { version = ">=0.3.0, <0.3.31", default-features = false }

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

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

ibc-core-client-context = { version = "0.47.0", path = "./ibc-core/ics02-client/context", default-features = false }
ibc-core-client-types = { version = "0.47.0", path = "./ibc-core/ics02-client/types", default-features = false }
ibc-core-channel-types = { version = "0.47.0", path = "./ibc-core/ics04-channel/types", default-features = false }
ibc-core-connection-types = { version = "0.47.0", path = "./ibc-core/ics03-connection/types", default-features = false }
ibc-core-commitment-types = { version = "0.47.0", path = "./ibc-core/ics23-commitment/types", default-features = false }
ibc-core-host-cosmos = { version = "0.47.0", path = "./ibc-core/ics24-host/cosmos", default-features = false }
ibc-core-host-types = { version = "0.47.0", path = "./ibc-core/ics24-host/types", default-features = false }
ibc-core-handler-types = { version = "0.47.0", path = "./ibc-core/ics25-handler/types", default-features = false }
ibc-core-router-types = { version = "0.47.0", path = "./ibc-core/ics26-routing/types", default-features = false }
ibc-client-tendermint-types = { version = "0.47.0", path = "./ibc-clients/ics07-tendermint/types", default-features = false }
ibc-app-transfer-types = { version = "0.47.0", path = "./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"] }
Loading
Loading