Skip to content

Commit

Permalink
Merge branch 'feat/upgrade-sdk-v0.52' into marko/gomod_change
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Sep 23, 2024
2 parents 2ee5548 + 1a5c739 commit 2bb67b5
Show file tree
Hide file tree
Showing 92 changed files with 385 additions and 5,218 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/capability.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
files: '**/*.md'
separator: ","
- uses: DavidAnson/markdownlint-cli2-action@v16
- uses: DavidAnson/markdownlint-cli2-action@v17
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.40.0
- uses: bufbuild/buf-setup-action@v1.41.0
- uses: bufbuild/buf-push-action@v1
with:
input: "proto"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (core, apps) [\#7213](https://github.com/cosmos/ibc-go/pull/7213) Remove capabilities from `SendPacket`.
* (core, apps) [\#7213](https://github.com/cosmos/ibc-go/pull/7225) Remove capabilities from `WriteAcknowledgement`.
* (core, apps) [\#7232](https://github.com/cosmos/ibc-go/pull/7232) Remove capabilities from channel handshake methods. TODO list all changes
* (core, apps) [\#7270](https://github.com/cosmos/ibc-go/pull/7270) Remove remaining dependencies on capability module.
* (core/04-channel) [\#7239](https://github.com/cosmos/ibc-go/pull/7239) Removed function `LookupModuleByChannel`
* (core/05-port) [\#7252](https://github.com/cosmos/ibc-go/pull/7252) Removed function `LookupModuleByPort`
* (core/24-host) [\#7239](https://github.com/cosmos/ibc-go/pull/7239) Removed function `ChannelCapabilityPath`
* (apps/27-interchain-accounts) [\#7239](https://github.com/cosmos/ibc-go/pull/7239) The following functions have been removed: `AuthenticateCapability`, `ClaimCapability`
* (apps/transfer) [\#7239](https://github.com/cosmos/ibc-go/pull/7239) The following functions have been removed: `BindPort`, `AuthenticateCapability`, `ClaimCapability`
* (capability) [\#7279](https://github.com/cosmos/ibc-go/pull/7279) The module `capability` has been removed

### State Machine Breaking

Expand All @@ -59,6 +61,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* (apps/27-interchain-accounts) [\#7277](https://github.com/cosmos/ibc-go/pull/7277) Use `GogoResolver` when populating module query safe allow list to avoid panics from unresolvable protobuf dependencies.

## v9.0.0 (unreleased)

### Dependencies
Expand Down
79 changes: 66 additions & 13 deletions docs/docs/05-migrations/13-v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func NewKeeper(

### 03-connection

- The [functions `GetState()`, `GetClientID()`, `GetCounterparty()`, `GetVersions()`, and `GetDelayPeriod()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/03-connection/types/connection.go#L25-L48) of the `Connection` type have been removed.
- The [functions `GetClientID()`, `GetConnectionID()`, and `GetPrefix()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/03-connection/types/connection.go#L79-L92) of the `Counterparty` type have been removed.
- The [functions `GetState()`, `GetClientID()`, `GetCounterparty()`, `GetVersions()`, and `GetDelayPeriod()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/03-connection/types/connection.go#L25-L48) of the `Connection` type have been removed. Please access the fields directly.
- The [functions `GetClientID()`, `GetConnectionID()`, and `GetPrefix()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/03-connection/types/connection.go#L79-L92) of the `Counterparty` type have been removed. Please access the fields directly.

#### Removal of self client and consensus state from connection handshake

Expand Down Expand Up @@ -133,7 +133,7 @@ func NewMsgConnectionOpenAck(
### 04-channel

- The utility function [`QueryLatestConsensusState`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/04-channel/client/utils/utils.go#L130) of the CLI has been removed.
- The [functions `GetState()`, `GetOrdering()`, `GetCounterparty()`, `GetConnectionHops()`, `GetVersion()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/04-channel/types/channel.go#L29-L52) of the `Channel` type have been removed.
- The [functions `GetState()`, `GetOrdering()`, `GetCounterparty()`, `GetConnectionHops()`, `GetVersion()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/04-channel/types/channel.go#L29-L52) of the `Channel` type have been removed. Please access the fields directly.
- The [functions `IsOpen()` and `IsClosed()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/04-channel/types/channel.go#L54-L62) of the `Channel` type have been removed.
- The [functions `GetPortID()`, `GetChannelID()`](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/04-channel/types/channel.go#L92-L100) of the `CounterpartyChannel` type have been removed.
- Functions [`ChanCloseConfirmWithCounterpartyUpgradeSequence`](https://github.com/cosmos/ibc-go/blob/v8.1.0/modules/core/04-channel/keeper/handshake.go#L446) and [`TimeoutOnCloseWithCounterpartyUpgradeSequence`](https://github.com/cosmos/ibc-go/blob/v8.1.0/modules/core/04-channel/keeper/timeout.go#L226) have been removed. Please use `ChanCloseConfirm` and `TimeoutOnClose` with the updated signature that takes the counterparty upgrade sequence as extra argument:
Expand All @@ -146,7 +146,7 @@ func (k *Keeper) ChanCloseConfirm(
chanCap *capabilitytypes.Capability,
initProof []byte,
proofHeight exported.Height,
+ counterpartyUpgradeSequence uint64,
+ counterpartyUpgradeSequence uint64,
)

func (k *Keeper) TimeoutOnClose(
Expand All @@ -157,7 +157,7 @@ func (k *Keeper) TimeoutOnClose(
closedProof []byte,
proofHeight exported.Height,
nextSequenceRecv uint64,
+ counterpartyUpgradeSequence uint64,
+ counterpartyUpgradeSequence uint64,
)
```

Expand Down Expand Up @@ -392,6 +392,51 @@ type ContractKeeper interface {

### IBC testing package

- In the `TestChain` struct the field [`LastHeader`](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/chain.go#L59) has been renamed to `LatestCommittedHeader`, the field [`CurrentHeader`](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/chain.go#L60) has been renamed to `ProposedHeader` and the [`QueryServer` interface](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/chain.go#L61) has been removed.

```diff
type TestChain struct {
testing.TB

Coordinator *Coordinator
App TestingApp
ChainID string
- LastHeader *ibctm.Header // header for last block height committed
+ LatestCommittedHeader *ibctm.Header // header for last block height committed
- CurrentHeader cmtproto.Header // header for current block height
+ ProposedHeader cmtproto.Header // proposed (uncommitted) header for current block height
- QueryServer types.QueryServer
TxConfig client.TxConfig
Codec codec.Codec

Vals *cmttypes.ValidatorSet
NextVals *cmttypes.ValidatorSet

// Signers is a map from validator address to the PrivValidator
// The map is converted into an array that is the same order as the validators right before signing commit
// This ensures that signers will always be in correct order even as validator powers change.
// If a test adds a new validator after chain creation, then the signer map must be updated to include
// the new PrivValidator entry.
Signers map[string]cmttypes.PrivValidator

// autogenerated sender private key
SenderPrivKey cryptotypes.PrivKey
SenderAccount sdk.AccountI

SenderAccounts []SenderAccount

// Short-term solution to override the logic of the standard SendMsgs function.
// See issue https://github.com/cosmos/ibc-go/issues/3123 for more information.
SendMsgsOverride func(msgs ...sdk.Msg) (*abci.ExecTxResult, error)
}
```

Submodule query servers can be constructed directly by passing their associated keeper to the appropriate constructor function. For example:

```golang
clientQueryServer := clientkeeper.NewQueryServer(app.IBCKeeper.ClientKeeper)
```

- The `mock.PV` type has been removed in favour of [`cmttypes.MockPV`](https://github.com/cometbft/cometbft/blob/v0.38.5/types/priv_validator.go#L50) in [#5709](https://github.com/cosmos/ibc-go/pull/5709).
- [Functions `ConstructUpdateTMClientHeader` and `ConstructUpdateTMClientHeaderWithTrustedHeight`](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/chain.go#L446-L481) of `TestChain` type have been replaced with `IBCClientHeader` function. This function will construct a 07-tendermint header to update the light client on the counterparty chain. The trusted height must be passed in as a non-zero height.
- [`GetValsAtHeight`](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/chain.go#L401) has been renamed to [`GetTrustedValidators`](https://github.com/cosmos/ibc-go/blob/release/v9.0.x/testing/chain.go#L403).
Expand All @@ -412,12 +457,6 @@ func AssertEvents(
)
```

- The [`QueryServer` interface has been removed from the `TestChain` struct](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/chain.go#L61). Submodule query servers can be constructed directly by passing their associated keeper to the appropriate constructor function. For example:

```golang
clientQueryServer := clientkeeper.NewQueryServer(app.IBCKeeper.ClientKeeper)
```

- The signature of the function `QueryConnectionHandshakeProof` has changed, since the validation of self client and consensus state has been remove from the connection handshake:

```diff
Expand All @@ -431,16 +470,30 @@ func (endpoint *Endpoint) QueryConnectionHandshakeProof() (
- The functions [`GenerateClientStateProof` and `GenerateConsensusStateProof`](https://github.com/cosmos/ibc-go/blob/v8.0.0/testing/solomachine.go#L513-L547)
have been removed.

### API deprecation notice
#### API deprecation notice

- The testing package functions `Setup`, `SetupClients`, `SetupConnections`, `CreateConnections`, and `CreateChannels` of the `Coordinator` type have been deprecated and will be removed in v10. Please use the new functions `Setup`, `SetupClients`, `SetupConnections`, `CreateConnections`, `CreateChannels` of the `Path` type.
- The functions `Setup`, `SetupClients`, `SetupConnections`, `CreateConnections`, and `CreateChannels` of the `Coordinator` type have been deprecated and will be removed in v11. Please use the new functions `Setup`, `SetupClients`, `SetupConnections`, `CreateConnections`, `CreateChannels` of the `Path` type.
- The function `SetChannelState` of the `Path` type has been deprecated and will be removed in v11. Please use the new function `UpdateChannel` of the `Path` type.

## Relayers

### Events

#### 02-client

- The function `CreateClient` of the keeper expects now a string for the client type (e.g. `07-tendermint`) and two `[]byte` for the Protobuf-serialized client and consensus states:

```diff
func (k *Keeper) CreateClient(
ctx sdk.Context,
+ clientType string,
- clientState exported.ClientState,
- consensusState exported.ConsensusState,
+ clientState []byte,
+ consensusState []byte,
) (string, error)
```

- The [`header` attribute](https://github.com/cosmos/ibc-go/blob/v8.0.0/modules/core/02-client/keeper/events.go#L60) has been removed from the `update_client` event in [\#5110](https://github.com/cosmos/ibc-go/pull/5110).

#### 04-channel
Expand Down
1 change: 1 addition & 0 deletions docs/docs/05-migrations/14-v9-to-v10.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ There are four sections based on the four potential user groups of this document
- (TODO: expand later) Removal of capabilities in `SendPacket` [\#7213](https://github.com/cosmos/ibc-go/pull/7213).
- (TODO: expand later) Removal of capabilities in `WriteAcknowledgement` [\#7225](https://github.com/cosmos/ibc-go/pull/7213).
- (TODO: expand later) Removal of capabilities in channel handshake methods [\#7232](https://github.com/cosmos/ibc-go/pull/7232).
- (TODO: expand later) More removal of capabilities in [\#7270](https://github.com/cosmos/ibc-go/pull/7270).

### ICS27 - Interchain Accounts

Expand Down
22 changes: 13 additions & 9 deletions e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
golang.org/x/mod v0.21.0
google.golang.org/grpc v1.66.0
google.golang.org/grpc v1.66.2
gopkg.in/yaml.v2 v2.4.0
)

Expand All @@ -37,12 +37,12 @@ require (
cloud.google.com/go/iam v1.1.9 // indirect
cloud.google.com/go/storage v1.41.0 // indirect
cosmossdk.io/api v0.7.5 // indirect
cosmossdk.io/client/v2 v2.0.0-beta.3 // indirect
cosmossdk.io/client/v2 v2.0.0-beta.4 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.1 // indirect
cosmossdk.io/depinject v1.0.0 // indirect
cosmossdk.io/log v1.4.1 // indirect
cosmossdk.io/store v1.1.0 // indirect
cosmossdk.io/store v1.1.1 // indirect
cosmossdk.io/x/feegrant v0.1.1 // indirect
cosmossdk.io/x/tx v0.13.4 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
Expand All @@ -66,6 +66,7 @@ require (
github.com/bgentry/speakeasy v0.2.0 // indirect
github.com/bits-and-blooms/bitset v1.12.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
Expand Down Expand Up @@ -144,6 +145,7 @@ require (
github.com/hashicorp/go-metrics v0.5.3 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
Expand Down Expand Up @@ -191,6 +193,8 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.27.10 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
Expand Down Expand Up @@ -235,20 +239,20 @@ require (
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/api v0.186.0 // indirect
google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down
Loading

0 comments on commit 2bb67b5

Please sign in to comment.