Skip to content

Commit

Permalink
chore (api!): removal of capabilites module and all references to it. (
Browse files Browse the repository at this point in the history
…#7279)

* chore: remove references to capabilities in comments, plus unused methods

* removed capabilities module and more references

* remove capability workflows and proto

* Changelog
  • Loading branch information
bznein authored Sep 10, 2024
1 parent 59ca335 commit 524ff0d
Show file tree
Hide file tree
Showing 47 changed files with 36 additions and 4,695 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/capability.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (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 Down
2 changes: 0 additions & 2 deletions e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ replace github.com/cosmos/ibc-go/v9 => ../

replace github.com/cosmos/ibc-go/modules/light-clients/08-wasm => ../modules/light-clients/08-wasm

replace github.com/cosmos/ibc-go/modules/capability => ../modules/capability //TODO: remove after capability is tagged

replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
2 changes: 2 additions & 0 deletions e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr
github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0=
github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM=
github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI=
github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI=
github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E=
github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU=
github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0=
github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=
Expand Down
7 changes: 0 additions & 7 deletions e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() {
chainBAddress := chainBWallet.FormattedAddress()

s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks")
// TODO: https://github.com/cosmos/ibc-go/issues/6743
// t.Run("ensure capability module BeginBlock is executed", func(t *testing.T) {
// // by restarting the chain we ensure that the capability module's BeginBlocker is executed.
// s.Require().NoError(chainA.(*cosmos.CosmosChain).StopAllNodes(ctx))
// s.Require().NoError(chainA.(*cosmos.CosmosChain).StartAllNodes(ctx))
// s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks")
// })

t.Run("native IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "", nil)
Expand Down
1 change: 0 additions & 1 deletion go.work.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ toolchain go1.22.3

use (
./
./modules/capability
./modules/apps/callbacks
./modules/light-clients/08-wasm
./e2e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ func newRegisterInterchainAccountCmd() *cobra.Command {
connection id from the source chain. Connection identifier should be for the source chain
and the interchain account will be created on the counterparty chain. Callers are expected to
provide the appropriate application version string via {version} flag and the desired ordering
via the {ordering} flag. Generates a new port identifier using the provided owner string, binds to the port identifier and claims
the associated capability.`),
via the {ordering} flag. Generates a new port identifier using the provided owner string.`),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// RegisterInterchainAccount is the entry point to registering an interchain account:
// - It generates a new port identifier using the provided owner string, binds to the port identifier and claims the associated capability.
// - It generates a new port identifier using the provided owner string.
// - Callers are expected to provide the appropriate application version string.
// - For example, this could be an ICS27 encoded metadata type or an ICS29 encoded metadata type with a nested application version.
// - A new MsgChannelOpenInit is routed through the MsgServiceRouter, executing the OnOpenChanInit callback stack as configured.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import (
// OnChanOpenInit performs basic validation of channel initialization.
// The counterparty port identifier must be the host chain representation as defined in the types package,
// the channel version must be equal to the version in the types package,
// there must not be an active channel for the specified port identifier,
// and the interchain accounts module must be able to claim the channel
// capability.
// there must not be an active channel for the specified port identifier.
func (k Keeper) OnChanOpenInit(
ctx context.Context,
order channeltypes.Order,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,6 @@ func (suite *KeeperTestSuite) TestSubmitTx() {
},
icatypes.ErrActiveChannelNotFound,
},
{
"failure - controller module does not own capability for this channel", func() {
msg.Owner = "invalid-owner"
portID, err := icatypes.NewControllerPortID(msg.Owner)
suite.Require().NoError(err)

// set the active channel with the incorrect portID in order to reach the capability check
suite.chainA.GetSimApp().ICAControllerKeeper.SetActiveChannelID(suite.chainA.GetContext(), path.EndpointA.ConnectionID, portID, path.EndpointA.ChannelID)
},
icatypes.ErrActiveChannelNotFound,
},
}

for _, ordering := range []channeltypes.Order{channeltypes.UNORDERED, channeltypes.ORDERED} {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (
)

// SendTx takes pre-built packet data containing messages to be executed on the host chain from an authentication module and attempts to send the packet.
// The packet sequence for the outgoing packet is returned as a result.
// If the base application has the capability to send on the provided portID. An appropriate
// The packet sequence for the outgoing packet is returned as a result. An appropriate
// absolute timeoutTimestamp must be provided. If the packet is timed out, the channel will be closed.
// In the case of channel closure, a new channel may be reopened to reconnect to the host chain.
//
Expand Down
10 changes: 1 addition & 9 deletions modules/apps/callbacks/testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ var (
)

// SimApp extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
// They are exported for convenience in creating helper functions.
type SimApp struct {
*baseapp.BaseApp
legacyAmino *codec.LegacyAmino
Expand Down Expand Up @@ -510,9 +509,6 @@ func NewSimApp(

// Add host, controller & ica auth modules to IBC router
ibcRouter.
// the ICA Controller middleware needs to be explicitly added to the IBC Router because the
// ICA controller module owns the port capability for ICA. The ICA authentication module
// owns the channel capability.
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack).
AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack)
Expand Down Expand Up @@ -621,7 +617,6 @@ func NewSimApp(
// there is nothing left over in the validator fee pool, so as to keep the
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
app.ModuleManager.SetOrderBeginBlockers(
minttypes.ModuleName,
distrtypes.ModuleName,
Expand Down Expand Up @@ -653,9 +648,6 @@ func NewSimApp(
// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
// NOTE: Capability module must occur first so that it can initialize any capabilities
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
genesisModuleOrder := []string{
authtypes.ModuleName,
banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName,
Expand Down
78 changes: 0 additions & 78 deletions modules/capability/CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 524ff0d

Please sign in to comment.