Skip to content

Commit

Permalink
Merge branch 'main' into colin/1918-remove-SendTransfer-pubclicfunc
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner authored Oct 3, 2022
2 parents c7bb641 + 9fdcf2c commit 1f03958
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 57 deletions.
10 changes: 10 additions & 0 deletions .github/compatibility-test-matrices/release-v6.0.x/client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chain-a": ["release-v6.0.x", "v5.0.0", "v4.1.0", "v3.3.0", "v2.4.0"],
"chain-b": ["release-v6.0.x", "v5.0.0", "v4.1.0", "v3.3.0", "v2.4.0"],
"entrypoint": ["TestClientTestSuite"],
"test": [
"TestClientUpdateProposal_Succeeds"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"chain-a": ["release-v6.0.x", "v5.0.0", "v4.1.0"],
"chain-b": ["release-v6.0.x", "v5.0.0", "v4.1.0"],
"entrypoint": ["TestIncentivizedTransferTestSuite"],
"test": [
"TestMsgPayPacketFee_AsyncSingleSender_Succeeds",
"TestMsgPayPacketFee_InvalidReceiverAccount",
"TestMultiMsg_MsgPayPacketFeeSingleSender",
"TestMsgPayPacketFee_SingleSender_TimesOut",
"TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress",
"TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
14 changes: 14 additions & 0 deletions .github/compatibility-test-matrices/release-v6.0.x/transfer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"chain-a": ["release-v6.0.x", "v5.0.0", "v4.1.0", "v3.3.0", "v2.4.0"],
"chain-b": ["release-v6.0.x", "v5.0.0", "v4.1.0", "v3.3.0", "v2.4.0"],
"entrypoint": ["TestTransferTestSuite"],
"test": [
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
42 changes: 21 additions & 21 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,62 +50,62 @@ pull_request_rules:
backport:
branches:
- release/v2.4.x
- name: backport patches to v3.0.x branch
- name: backport patches to v2.5.x branch
conditions:
- base=main
- label=backport-to-v3.0.x
- label=backport-to-v2.5.x
actions:
backport:
branches:
- release/v3.0.x
- name: backport patches to v3.1.x branch
- release/v2.5.x
- name: backport patches to v3.3.x branch
conditions:
- base=main
- label=backport-to-v3.1.x
- label=backport-to-v3.3.x
actions:
backport:
branches:
- release/v3.1.x
- name: backport patches to v3.2.x branch
- release/v3.3.x
- name: backport patches to v3.4.x branch
conditions:
- base=main
- label=backport-to-v3.2.x
- label=backport-to-v3.4.x
actions:
backport:
branches:
- release/v3.2.x
- name: backport patches to v3.3.x branch
- release/v3.4.x
- name: backport patches to v4.1.x branch
conditions:
- base=main
- label=backport-to-v3.3.x
- label=backport-to-v4.1.x
actions:
backport:
branches:
- release/v3.3.x
- name: backport patches to v4.0.x branch
- release/v4.1.x
- name: backport patches to v4.2.x branch
conditions:
- base=main
- label=backport-to-v4.0.x
- label=backport-to-v4.2.x
actions:
backport:
branches:
- release/v4.0.x
- name: backport patches to v4.1.x branch
- release/v4.2.x
- name: backport patches to v5.0.x branch
conditions:
- base=main
- label=backport-to-v4.1.x
- label=backport-to-v5.0.x
actions:
backport:
branches:
- release/v4.1.x
- name: backport patches to v5.0.x branch
- release/v5.0.x
- name: backport patches to v5.1.x branch
conditions:
- base=main
- label=backport-to-v5.0.x
- label=backport-to-v5.1.x
actions:
backport:
branches:
- release/v5.0.x
- release/v5.1.x
- name: backport patches to v6.0.x branch
conditions:
- base=main
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
type: choice
options:
- release/v5.0.x
- release/v6.0.x

env:
REGISTRY: ghcr.io
Expand Down
14 changes: 1 addition & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Dependencies

* [\#1653](https://github.com/cosmos/ibc-go/pull/1653) Bump SDK version to v0.46
* [\#2124](https://github.com/cosmos/ibc-go/pull/2124) Bump SDK version to v0.46.1

### API Breaking

* (apps/transfer) [\#2446](https://github.com/cosmos/ibc-go/pull/2446) Remove `SendTransfer` function in favor of a private `sendTransfer` function. All IBC transfers must be initiated with `MsgTransfer`.
* (apps/29-fee) [\#2395](https://github.com/cosmos/ibc-go/pull/2395) Remove param space from ics29 NewKeeper function. The field was unused.
* (testing)[\#2028](https://github.com/cosmos/ibc-go/pull/2028) New interface `ibctestingtypes.StakingKeeper` added and set for the testing app `StakingKeeper` setup.
* (core/04-channel) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) `NewPacketId` has been renamed to `NewPacketID` to comply with go linting rules.
* (core/ante) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) `AnteDecorator` has been renamed to `RedundancyDecorator` to comply with go linting rules and to give more clarity to the purpose of the Decorator.
* (core/ante) [\#1820](https://github.com/cosmos/ibc-go/pull/1418) `RedundancyDecorator` has been renamed to `RedundantRelayDecorator` to make the name for explicit.
* (testing) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) `MockIBCApp` has been renamed to `IBCApp` and `MockEmptyAcknowledgement` has been renamed to `EmptyAcknowledgement` to comply with go linting rules.
* (apps/27-interchain-accounts) [\#2058](https://github.com/cosmos/ibc-go/pull/2058) Added `MessageRouter` interface and replaced `*baseapp.MsgServiceRouter` with it. The controller and host keepers of apps/27-interchain-accounts have been updated to use it.
* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) Generates genesis protos in a separate directory to avoid circular import errors. The protobuf package name has changed for the genesis types.
* (light-clients/tendermint)[\#1768](https://github.com/cosmos/ibc-go/pull/1768) Removed `AllowUpdateAfterExpiry`, `AllowUpdateAfterMisbehaviour` booleans as they are deprecated (see ADR026)
* (06-solomachine) [\#1679](https://github.com/cosmos/ibc-go/pull/1679) Remove `types` sub-package from `06-solomachine` lightclient directory.
Expand All @@ -69,14 +60,11 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (transfer) [\#2034](https://github.com/cosmos/ibc-go/pull/2034) Transfer Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper.
* (05-port) [\#2025](https://github.com/cosmos/ibc-go/pull/2025) Port Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper.
* (04-channel) [\#2024](https://github.com/cosmos/ibc-go/pull/2024) Channel Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper.
* (apps/27-interchain-accounts)[\#2302](https://github.com/cosmos/ibc-go/pull/2302) Handle unwrapping of channel version in interchain accounts channel reopening handshake flow. The `host` submodule `Keeper` now requires an `ICS4Wrapper` similarly to the `controller` submodule.

### State Machine Breaking

### Improvements

* (27-interchain-accounts) [\#1352](https://github.com/cosmos/ibc-go/issues/1352) Add support for Cosmos-SDK simulation to ics27 module.
* (linting) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) Fix linting errors, resulting compatiblity with go1.18 linting style, golangci-lint 1.46.2 and the revivie linter. This caused breaking changes in core/04-channel, core/ante, and the testing library.
* (modules/light-clients/07-tendermint) [\#1713](https://github.com/cosmos/ibc-go/pull/1713) Allow client upgrade proposals to update `TrustingPeriod`. See ADR-026 for context.
* (modules/core/02-client) [\#1188](https://github.com/cosmos/ibc-go/pull/1188/files) Routing `MsgSubmitMisbehaviour` to `UpdateClient` keeper function. Deprecating `SubmitMisbehaviour` endpoint.
* (modules/core/02-client) [\#1208](https://github.com/cosmos/ibc-go/pull/1208) Replace `CheckHeaderAndUpdateState` usage in 02-client with calls to `VerifyClientMessage`, `CheckForMisbehaviour`, `UpdateStateOnMisbehaviour` and `UpdateState`.
Expand Down Expand Up @@ -114,10 +102,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* (makefile) [\#1785](https://github.com/cosmos/ibc-go/pull/1785) Fetch the correct versions of protocol buffers dependencies from tendermint, cosmos-sdk, and ics23.
* (light-clients/solomachine) [#1839](https://github.com/cosmos/ibc-go/issues/1839) Fixed usage of the new diversifier in validation of changing diversifiers for the solo machine. The current diversifier must sign over the new diversifier.
* (light-clients/07-tendermint) [\#1674](https://github.com/cosmos/ibc-go/pull/1674) Submitted ClientState is zeroed out before checking the proof in order to prevent the proposal from containing information governance is not actually voting on.
* (modules/core/02-client)[\#1676](https://github.com/cosmos/ibc-go/pull/1676) ClientState must be zeroed out for `UpgradeProposals` to pass validation. This prevents a proposal containing information governance is not actually voting on.
* (modules/core/keeper) [\#2403](https://github.com/cosmos/ibc-go/pull/2403) Added a function in keeper to cater for blank pointers.

## [v4.1.0](https://github.com/cosmos/ibc-go/releases/tag/v4.1.0) - 2022-09-20

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ For an overview of upcoming changes to ibc-go take a look at the [roadmap](./doc

## Releases

The release lines currently supported are v2, v3 and v4. Please refer to the [Stable Release Policy section of RELEASES.md](https://github.com/cosmos/ibc-go/blob/main/RELEASES.md#stable-release-policy) for more details.
The release lines currently supported are v2, v3, v4 and v5. Please refer to the [Stable Release Policy section of RELEASES.md](https://github.com/cosmos/ibc-go/blob/main/RELEASES.md#stable-release-policy) for more details.

## Ecosystem

Expand Down
17 changes: 4 additions & 13 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ Only the following major release series have a stable release status:
|`v2.2.x`|February 01, 2023|
|`v2.3.x`|February 01, 2023|
|`v2.4.x`|February 01, 2023|
|`v3.0.x`|March 15, 2023|
|`v3.1.x`|March 15, 2023|
|`v3.2.x`|March 15, 2023|
|`v3.3.x`|March 15, 2023|
|`v4.0.x`|August 12, 2023|
|`v4.1.x`|August 12, 2023|
|`v5.0.x`|September 28, 2023|

All missing minor release versions have been discontinued.

**Note**: The v1 major release series will reach end of life 6 months after merging this policy. v2 will reach end of life one year after merging this policy.

Expand Down Expand Up @@ -117,17 +116,9 @@ Versions of Golang, Cosmos SDK and Tendermint used by ibc-go in the currently ac
| 1.17 | v2.3.0 | v0.45.4 | v0.34.19 |
| 1.17 | v2.3.1 | v0.45.5 | v0.34.19 |
| 1.18 | v2.4.0 | v0.45.7 | v0.34.20 |
| 1.17 | v3.0.0 | v0.45.1 | v0.34.14 |
| 1.17 | v3.0.1 | v0.45.4 | v0.34.19 |
| 1.17 | v3.0.2 | v0.45.4 | v0.34.19 |
| 1.17 | v3.1.0 | v0.45.4 | v0.34.19 |
| 1.17 | v3.1.1 | v0.45.5 | v0.34.19 |
| 1.18 | v3.2.0 | v0.45.7 | v0.34.20 |
| 1.18 | v3.2.1 | v0.45.8 | v0.34.21 |
| 1.18 | v3.3.0 | v0.45.8 | v0.34.21 |
| 1.18 | v4.0.0 | v0.45.7 | v0.34.20 |
| 1.18 | v4.0.1 | v0.45.8 | v0.34.21 |
| 1.18 | v4.1.0 | v0.45.8 | v0.34.21 |
| 1.18 | v5.0.0 | v0.46.1 | v0.34.21 |

## Graphics

Expand Down
4 changes: 4 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ module.exports = {
label: "v4.1.0",
key: "v4.1.0",
},
{
label: "v5.0.0",
key: "v5.0.0",
},
],
topbar: {
banner: true,
Expand Down
1 change: 1 addition & 0 deletions docs/versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
release/v5.0.x v5.0.0
release/v4.1.x v4.1.0
release/v4.0.x v4.0.0
release/v3.3.x v3.3.0
Expand Down
21 changes: 18 additions & 3 deletions modules/core/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ func NewKeeper(
}

// panic if any of the keepers passed in is empty
if reflect.ValueOf(stakingKeeper).IsZero() {
if isEmpty(stakingKeeper) {
panic(fmt.Errorf("cannot initialize IBC keeper: empty staking keeper"))
}

if reflect.ValueOf(upgradeKeeper).IsZero() {
if isEmpty(upgradeKeeper) {
panic(fmt.Errorf("cannot initialize IBC keeper: empty upgrade keeper"))
}

Expand Down Expand Up @@ -92,3 +91,19 @@ func (k *Keeper) SetRouter(rtr *porttypes.Router) {
k.Router = rtr
k.Router.Seal()
}

// isEmpty checks if the interface is an empty struct or a pointer pointing
// to an empty struct
func isEmpty(keeper interface{}) bool {
switch reflect.TypeOf(keeper).Kind() {
case reflect.Ptr:
if reflect.ValueOf(keeper).Elem().IsZero() {
return true
}
default:
if reflect.ValueOf(keeper).IsZero() {
return true
}
}
return false
}
22 changes: 16 additions & 6 deletions modules/core/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,31 @@ func (suite *KeeperTestSuite) TestNewKeeper() {
malleate func()
expPass bool
}{
{"failure: empty staking keeper", func() {
emptyStakingKeeper := stakingkeeper.Keeper{}
{"failure: empty staking keeper value", func() {
emptyStakingKeeperValue := stakingkeeper.Keeper{}

stakingKeeper = emptyStakingKeeper
stakingKeeper = emptyStakingKeeperValue
}, false},
{"failure: empty staking keeper pointer", func() {
emptyStakingKeeperPointer := &stakingkeeper.Keeper{}

stakingKeeper = emptyStakingKeeperPointer
}, false},
{"failure: empty mock staking keeper", func() {
// use a different implementation of clienttypes.StakingKeeper
emptyMockStakingKeeper := MockStakingKeeper{}

stakingKeeper = emptyMockStakingKeeper
}, false},
{"failure: empty upgrade keeper", func() {
emptyUpgradeKeeper := upgradekeeper.Keeper{}
{"failure: empty upgrade keeper value", func() {
emptyUpgradeKeeperValue := upgradekeeper.Keeper{}

upgradeKeeper = emptyUpgradeKeeperValue
}, false},
{"failure: empty upgrade keeper pointer", func() {
emptyUpgradeKeeperPointer := &upgradekeeper.Keeper{}

upgradeKeeper = emptyUpgradeKeeper
upgradeKeeper = emptyUpgradeKeeperPointer
}, false},
{"failure: empty scoped keeper", func() {
emptyScopedKeeper := capabilitykeeper.ScopedKeeper{}
Expand Down

0 comments on commit 1f03958

Please sign in to comment.