Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Aug 6, 2024
2 parents 8373d09 + e6a27c1 commit 8a4e81a
Show file tree
Hide file tree
Showing 177 changed files with 40,113 additions and 4,163 deletions.
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,*.sum,*.mod,*_test.go
ignore-words-list = userA,users,create,crate
count =
quiet-level = 3
5 changes: 4 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ ibc-hooks:
- modules/ibc-hooks/**

packet-forward-middleware:
- middleware/packet-forward-middleware/**
- middleware/packet-forward-middleware/**

rate-limit:
- modules/rate-limit/**
10 changes: 10 additions & 0 deletions .github/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"timeout": "20s",
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [
200,
206
]
}
14 changes: 7 additions & 7 deletions .github/workflows/async-icq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: async-icq
on:
pull_request:
paths:
- 'modules/async-icq/**'
- '.github/workflows/async-icq.yml'
- "modules/async-icq/**"
- ".github/workflows/async-icq.yml"

env:
LINT_VERSION: v1.55.2
GO_VERSION: 1.21.0
GO_VERSION: 1.22.1
WORKING_DIRECTORY: modules/async-icq

HOST_TAR_PATH: /tmp/icq-host.tar
Expand All @@ -33,9 +33,9 @@ jobs:
args: --timeout=5m

test:
runs-on: ubuntu-latest
name: test
steps:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
Expand Down Expand Up @@ -131,4 +131,4 @@ jobs:
docker image ls -a
- name: Run Test
run: make ${{ matrix.test }}
run: make ${{ matrix.test }}
23 changes: 12 additions & 11 deletions .github/workflows/ibc-hooks.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: ibc-hooks
on:
on:
pull_request:
paths:
- 'modules/ibc-hooks/**'
- '.github/workflows/ibc-hooks.yml'
- "modules/ibc-hooks/**"
- ".github/workflows/ibc-hooks.yml"

env:
LINT_VERSION: v1.52
GO_VERSION: 1.21.0
LINT_VERSION: v1.57.1
GO_VERSION: 1.22.1
WORKING_DIRECTORY: modules/ibc-hooks

jobs:
golangci:
name: Linter
runs-on: ubuntu-latest
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -25,9 +25,9 @@ jobs:
args: --timeout=5m

test:
runs-on: ubuntu-latest
name: test
steps:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
Expand All @@ -37,4 +37,5 @@ jobs:

- name: Test
run: go test ./...
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ env.WORKING_DIRECTORY }}

13 changes: 13 additions & 0 deletions .github/workflows/markdown-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Check Markdown links
on:
pull_request:
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/[email protected]
with:
# markdown-link-check .github/markdown-link-check-config.json *.md
config-file: '.github/markdown-link-check-config.json'
folder-path: '.'
17 changes: 17 additions & 0 deletions .github/workflows/mispell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: typos

on:
pull_request:

jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run codespell
continue-on-error: true
run: |
# .codespellrc is used
sudo apt-get install codespell -y
codespell -w --config .codespellrc
exit $?
24 changes: 12 additions & 12 deletions .github/workflows/packet-forward-middleware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: packet-forward-middleware
on:
pull_request:
paths:
- 'middleware/packet-forward-middleware/**'
- '.github/workflows/packet-forward-middleware.yml'
- "middleware/packet-forward-middleware/**"
- ".github/workflows/packet-forward-middleware.yml"

env:
LINT_VERSION: v1.55.2
GO_VERSION: 1.21.0
WORKING_DIRECTORY: middleware/packet-forward-middleware
LINT_VERSION: v1.57.1
GO_VERSION: 1.22.1
WORKING_DIRECTORY: middleware/packet-forward-middleware

DOCKER_TAG: pfm:local
TAR_PATH: /tmp/pfm-docker-image.tar
IMAGE_NAME: pfm-docker-image
DOCKER_TAG: pfm:local
TAR_PATH: /tmp/pfm-docker-image.tar
IMAGE_NAME: pfm-docker-image

jobs:
golangci:
Expand All @@ -29,9 +29,9 @@ jobs:
args: --timeout=5m

test:
runs-on: ubuntu-latest
name: test
steps:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
Expand Down Expand Up @@ -105,4 +105,4 @@ jobs:
docker image ls -a
- name: Run Test
run: make ${{ matrix.test }}
run: make ${{ matrix.test }}
46 changes: 46 additions & 0 deletions .github/workflows/rate-limiting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: rate-limiting
on:
pull_request:
paths:
- "modules/rate-limiting/**"
- ".github/workflows/rate-limiting.yml"

env:
LINT_VERSION: v1.57.1
GO_VERSION: 1.22.1
WORKING_DIRECTORY: modules/rate-limiting

DOCKER_TAG: rate-limiting:local
TAR_PATH: /tmp/rate-limiting-image.tar
IMAGE_NAME: rate-limiting-image

jobs:
golangci:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: ${{ env.LINT_VERSION }}
working-directory: ${{ env.WORKING_DIRECTORY }}
args: --timeout=5m

test:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- uses: actions/checkout@v4

- name: Test
run: go test ./...
working-directory: ${{ env.WORKING_DIRECTORY }}

# TODO: build docker & run e2e tests (ref: pfm matrix)
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ target/
go.work.sum
go.work

build/
build/

.idea
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ For features, every module should have [interchain-test](https://github.com/stra
For modules, ensure full test coverage and compatibility with the main branch.


## New contributer approval process
## New contributor approval process
- [ ] Submit a Github issue titled "I should be a maintainer because..."
- [ ] After approval, write privileges will be granted to a member of an external team.
- [ ] Merging PRs will require approval from more than one team

Privileges will be revoked in case of failure to comply with the [Code of Conduct](../CODE_OF_CONDUCT.md)
Privileges will be revoked in case of failure to comply with the [Code of Conduct](./CODE_OF_CONDUCT.md)


## Versioning
Expand Down
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ IBC applications and middleware for Cosmos SDK blockchains
🌌 Why have an ibc-apps repo?
================================

Early IBC work started in the [ibc-go](https://github.com/cosmos/ibc-go) repo. As the repo grew, the need arose to parallelize the work among many teams.
Early IBC work started in the [ibc-go](https://github.com/cosmos/ibc-go) repo. As the repo grew, the need arose to parallelize the work among many teams.

The ibc-apps repo is meant to be an easily discoverable, navigable, central place for modules and middleware.

🌌🌌 Who's it for?
===================

IBC-Apps is for:
IBC-Apps is for:
- _Core **ibc-go** contributors_; it frees them from having to maintain IBC Apps,

- _Publishers of **ibc apps**_, so their apps can be easily found, and
- _Publishers of **ibc apps**_, so their apps can be easily found, and

- _Everyone who uses IBC_ and wants to benefit from the full range of its capabilities.

Expand All @@ -40,49 +40,47 @@ IBC apps can be split into two categories - modules and middleware.

IBC Modules are self-contained applications that enable packets to be sent to and received from other IBC-enabled chains. IBC application developers do not need to concern themselves with the low-level details of clients, connections, and proof verification.

IBC Middleware are self-contained modules that sit between core IBC and an underlying IBC application. This allows developers to customize lower-level packet handling. Multiple middleware modules can be chained together.
IBC Middleware are self-contained modules that sit between core IBC and an underlying IBC application. This allows developers to customize lower-level packet handling. Multiple middleware modules can be chained together.


🌌🌌🌌🌌 How to Use this repo
=============================

If you'd like to include software in this repo, please see [contributing](../ibc-apps/CONTRIBUTING.md).
If you'd like to include software in this repo, please see [contributing](CONTRIBUTING.md).

🌌🌌🌌🌌🌌 Bonus Content
=============================

## Hello World

An [example IBC app](./examples/hello-world/)

## Maintained Branches

| **Branch Name** | **IBC-Go** |
|:----------------------------------------------------------------:|:----------:|
| [main](https://github.com/cosmos/ibc-apps) | v7 |
| [main](https://github.com/cosmos/ibc-apps) | v8 |
| [release/v7](https://github.com/cosmos/ibc-apps/tree/release/v7) | v7 |
| [release/v6](https://github.com/cosmos/ibc-apps/tree/release/v6) | v6 |
| [release/v5](https://github.com/cosmos/ibc-apps/tree/release/v5) | v5 |
| [release/v4](https://github.com/cosmos/ibc-apps/tree/release/v4) | v4 |

## List of Apps

| Name | Type | Example | Stakeholders | Description |
| ---- | ---- | ------- | ------------ | ----------- |
| ---- | ---- | ------- | ------------ | ----------- |
| [Async Interchain Query](./modules/async-icq/) | Module | Link | [Strangelove](https://github.com/strangelove-ventures/) | Interchain Queries enable blockchains to query the state of an account on another chain without the need for ICA auth. |
| [IBC Hooks](./modules/ibc-hooks/) | Module | [Link](./modules/ibc-hooks/simapp/app.go) | [Osmosis](https://github.com/osmosis-labs) | The IBC hooks module is an IBC middleware that enables ICS-20 token transfers to initiate contract calls. |
| [Packet Forward Middleware](./middleware/packet-forward-middleware) | Middleware | Link | [Strangelove](https://github.com/strangelove-ventures/) | Middleware for forwarding IBC packets. |
| [Rate Limit](./modules/rate-limiting/) | Module | Link | [Stride](https://github.com/Stride-Labs/) | Module for rate limiting ingress/egress of packets. |

## Ecosystem Apps

Modules and middleware developed by other awesome teams in the ecosystem:

| Name | Type | Stakeholders | Description |
| ---- | ---- | ------------ | ----------- |
| ---- | ---- | ------------ | ----------- |
| [Interchain KV Queries](https://github.com/ingenuity-build/interchain-queries) | Module | [Ingenuity](https://github.com/ingenuity-build) | An application that enables on chain querying of another IBC enabled chains state without the need for the chain being queried to implement the application. |
| [query](https://github.com/defund-labs/defund/tree/main/x/query) | Module | [Defund Labs](https://github.com/defund-labs) | An application that enables on chain querying of another IBC enabled chains state without the need for the chain being queried to implement the application. Similar to the interchain-queries application in the row above but without callbacks. |
| [NFT Transfer (ICS 721)](https://github.com/bianjieai/nft-transfer) | Module | [Bianjieai](https://github.com/bianjieai) | An application that enables cross chain NFT transfer. |
| [CosmWasm NFT Transfer (ICS 721)](https://github.com/public-awesome/cw-ics721) | WASM Contract | [Public Awesome (Stargaze)](https://github.com/public-awesome), [Ark Protocol](https://twitter.com/ArkProtocol) | An application that enables cross chain NFT transfer. CosmWasm implementation of the above, written in Rust. |
| [recovery](https://github.com/evmos/evmos/tree/main/x/recovery) | Middleware | [Evmos](https://github.com/evmos) | Middleware enabling the recovery of tokens sent to unsupported addresses. |
| [ibc-rate-limit](https://github.com/osmosis-labs/osmosis/tree/main/x/ibc-rate-limit) | Middleware | [Osmosis Labs](https://github.com/osmosis-labs) | Middleware that limits the in or out flow of an asset in a certain time period to minimise the risks of cross chain token transfers. This is implemented as a middleware wrapping ICS20 with the rate limiting logic implemented by cosmwasm contracts. |
| [Interchain Atomic Swap](https://github.com/sideprotocol/ibcswap-wasm/tree/main/contracts/ics100) | WASM Contract | [Side Labs](https://github.com/sideprotocol) | An application that facilitates inter-blockchain peer-to-peer asset swaps. |
| [Interchain Liquidity](https://github.com/sideprotocol/ibcswap-wasm/tree/main/contracts/ics101) | WASM Contract | [Side Labs](https://github.com/sideprotocol) | An application that splits the state of a weighted liquidity pool between two chains, enabling inter-blockchain automated asset swaps. |
| <!-- markdown-link-check-disable-line --> [CosmWasm NFT Transfer (ICS 721)](https://github.com/public-awesome/cw-ics721) | Wasm Contract | [Public Awesome (Stargaze)](https://github.com/public-awesome), [Ark Protocol](https://x.com/ArkProtocol) | An application that enables cross chain NFT transfer. CosmWasm implementation of the above, written in Rust. |
| [recovery](https://github.com/evmos/evmos/tree/v15.0.0/x/recovery) | Middleware | [Evmos](https://github.com/evmos) | Middleware enabling the recovery of tokens sent to unsupported addresses. |
| [cw-ibc-rate-limit](https://github.com/osmosis-labs/osmosis/tree/main/x/ibc-rate-limit) | Middleware | [Osmosis Labs](https://github.com/osmosis-labs) | Middleware that limits the in or out flow of an asset in a certain time period to minimise the risks of cross chain token transfers. This is implemented as a middleware wrapping ICS20 with the rate limiting logic implemented by CosmWasm contracts. |
| [Interchain Atomic Swap](https://github.com/sideprotocol/mesh-liquidity-wasm/tree/v0.1.0/contracts/ics100) | Wasm Contract | [Side Labs](https://github.com/sideprotocol) | An application that facilitates inter-blockchain peer-to-peer asset swaps. |
| [Interchain Liquidity](https://github.com/sideprotocol/ibcswap-wasm/tree/main/contracts/ics101) | Wasm Contract | [Side Labs](https://github.com/sideprotocol) | An application that splits the state of a weighted liquidity pool between two chains, enabling inter-blockchain automated asset swaps. |
14 changes: 11 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ Because chains are on different versions of ibc-go, we strive to have app compat

To do this, we maintain several branches each targeting a different version of ibc-go. You can view our maintained branches [here](https://github.com/cosmos/ibc-apps/tree/main#maintained-branches)


[`Mergify`](https://mergify.com/) has been integrated into this repo to help keep these branches in sync.


Please add the `BACKPORT` label to your PR if it should be cherry-picked into our maintained branches.


Note:

You can target any of the maintained branches. For example, if you target branch `release/v5` and add the label, the merge commit will be cherry-picked into `main` and any other maintained branch.

## Adding a new Repo

- Copy in the files from the original repo.
- Find and replace all the namespace to `github.com/cosmos/ibc-apps/modules/<MODULE_NAME>/v#` *(where # is the IBC major version)*
- Add the name to .github/labeler.yml
- Keep original proto files paths the same, unless the team wishes to move to a new namespace.
> i.e. keep `/Stride-Labs/ibc-rate-limiting/...` instead of changing to `/cosmos/rate-limit/...` so other tools still work
> If this is a new repo with no one using it yet in prod, you can change this without issue.
- Create that same name label in <https://github.com/cosmos/ibc-apps/labels>
- Add to the root [ReadMe](../README.md) in `List of Apps`
- Create workflow for the linting, unit testing, and e2e. The file must match the application name.
3 changes: 1 addition & 2 deletions middleware/packet-forward-middleware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ cosmovisor:
.PHONY: build build-linux build-simd-all build-simd-linux cosmovisor

mocks: $(MOCKS_DIR)
go install go.uber.org/mock/mockgen@v0.2.0
go install go.uber.org/mock/mockgen@v0.4.0
mockgen -package=mock -destination=./test/mock/transfer_keeper.go $(GOMOD)/packetforward/types TransferKeeper
mockgen -package=mock -destination=./test/mock/distribution_keeper.go $(GOMOD)/packetforward/types DistributionKeeper
mockgen -package=mock -destination=./test/mock/bank_keeper.go $(GOMOD)/packetforward/types BankKeeper
mockgen -package=mock -destination=./test/mock/channel_keeper.go $(GOMOD)/packetforward/types ChannelKeeper
mockgen -package=mock -destination=./test/mock/ics4_wrapper.go github.com/cosmos/ibc-go/v8/modules/core/05-port/types ICS4Wrapper
Expand Down
Loading

0 comments on commit 8a4e81a

Please sign in to comment.