Skip to content

Commit

Permalink
Feature: Interchain accounts v1 (cosmos#380)
Browse files Browse the repository at this point in the history
* migrate ibc-account module to ibc-go

* Add @seantking to CODEOWNERS for interchain accounts module

* rename ibc-account -> interchain-accounts (cosmos#280)

* rename ibc-account -> interchain-accounts

* fix codeowner file

* Integrate ICA into testing package, add simple keeper tests (cosmos#282)

* add ica to simapp

* add simple keeper tests

* Add interchain account OnChanOpenInit and InitInterchainAccount tests (cosmos#287)

* add OnChanOpenInit test

* add InitInterchainAccount test

* Update modules/apps/27-interchain-accounts/keeper/relay.go

* feat: ica proto (cosmos#305)

* feat: adding proto files for interchain accounts & updating references of IBCAccount -> InterchainAccount

* doc: updating comments

* docs: update comment

* fix: updating proto yaml, query name, query params, comments

* ICA OnChanOpenTry update + tests (cosmos#299)

* update OnChanOpenTry to match ICS specs

* write OnChanOpenTry and OnChanOpenAck tests

* update comment

* test: adding test for OnChanOpenConfirm (cosmos#312)

* fix: updating port-id & fixing OnChanOpenInit bug (cosmos#321)

* fix: updating port-id & fixing OnChanOpenInit bug

* Update modules/apps/27-interchain-accounts/keeper/handshake.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Add counterparty port ID to controller portID (cosmos#319)

* refactor! move GeneratePortID to types, add counterpartyConnection sequence

change all PortId -> PortID
move GeneratePortID to types package
add counterparty connection sequence argument
utilize connectiontypes connectionID parsing function

* refactor! use counterparty portID in interchain account address gRPC

Remove existing args from gRPC request for interchain account address
Use counterparty portID

* tests add generate port id tests

* apply self-review fixes

* test: check active channel is correct (cosmos#324)

* test: check active channel is correct

* test: adding version string check

* Removed memkey from ICA keeper (cosmos#342)

* Removed memkey from ICA keeper

* Removed memkey arg in call to NewKeeper from simapp

* moving stateless GenerateAddress func to types (cosmos#352)

* update ica branch codeowners (cosmos#353)

* move Get/SetInterchainAccount to keeper.go, add tests (cosmos#355)

* moving setter/getter funcs to keeper.go, adding tests

* removing redundant var

* fixing test assertion string typo

* updating Get/SetInterchainAccount func signatures, tests and adding godocs

* grouping imports according, updating suite.FailNow() -> suite.Require().NoError()

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* chore: interchain accounts cleanup, cli alias (cosmos#362)

* adding ica alias for interchain-accounts queries

* refactoring bind port and claim capability functionality, code cleanup and godocs

* updating interchain accounts pkg naming (cosmos#364)

* adding ica grpc query tests (cosmos#368)

* updating grpc query tests, removing queryClient on KeeperTestSuite (cosmos#379)

* ICA: Adding tests for relay.go (cosmos#337)

* test: adding test for TrySendTx

* test: adding tests for data check

* test: adding check for SendTx with []sdk.Message

* chore: seperate imports

* test: add helper function for creating ICA path

* test: adding cases for incorrect outgoing data & channel does not exist

* Update ICA on main + add app version negotiation stub  (cosmos#403)

* Bump github.com/cosmos/cosmos-sdk from 0.43.0-rc1 to 0.43.0-rc2 (cosmos#269)

Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.43.0-rc1 to 0.43.0-rc2.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-rc2/CHANGELOG.md)
- [Commits](cosmos/cosmos-sdk@v0.43.0-rc1...v0.43.0-rc2)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* generate swagger files (cosmos#267)

* Reject Redundant Tx Antedecorator (cosmos#235)

* writeup simple antedecorator

* only do antehandler on checkTx

* Update modules/core/04-channel/ante.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* enable 2 antehandler strategies, and write tests

* remove strict decorator and pass on non-packet/update type

* move ante logic into its own package

* changelog

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* perform a no-op on redundant relay messages (cosmos#268)

* create initial changes for delivertx handling

* handle closed channel no-ops, fix tests

* self review nits

* add changelog

* add events for no op messages

* add back comment

* Bump codecov/codecov-action from 1.5.2 to 2.0.1 (cosmos#273)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.2 to 2.0.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-action@v1.5.2...v2.0.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* remove ChanCloseInit function from transfer keeper (cosmos#275)

* remove CloseChanInit from transfer

* add changelog

Co-authored-by: Aditya <adityasripal@gmail.com>

* Bump codecov/codecov-action from 2.0.1 to 2.0.2 (cosmos#296)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-action@v2.0.1...v2.0.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/spf13/cast from 1.3.1 to 1.4.0 (cosmos#301)

Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/spf13/cast/releases)
- [Commits](spf13/cast@v1.3.1...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump technote-space/get-diff-action from 4.2 to 5 (cosmos#306)

Bumps [technote-space/get-diff-action](https://github.com/technote-space/get-diff-action) from 4.2 to 5.
- [Release notes](https://github.com/technote-space/get-diff-action/releases)
- [Changelog](https://github.com/technote-space/get-diff-action/blob/main/.releasegarc)
- [Commits](technote-space/get-diff-action@v4.2...v5)

---
updated-dependencies:
- dependency-name: technote-space/get-diff-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* bump to SDK v0.43.0-rc3 (cosmos#308)

* SDK v0.43.0-rc3

* add capability fixes

* add @seantking as codeowner to interchain accounts (cosmos#309)

* Bump google.golang.org/grpc from 1.39.0 to 1.39.1 (cosmos#320)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.39.0 to 1.39.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.39.0...v1.39.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/cosmos/cosmos-sdk from 0.43.0-rc3 to 0.43.0 (cosmos#325)

Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.43.0-rc3 to 0.43.0.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/master/CHANGELOG.md)
- [Commits](cosmos/cosmos-sdk@v0.43.0-rc3...v0.43.0)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* module: improve 04-channel logging (cosmos#323)

* module: improve 04-channel logging

* update log

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* update changelog (cosmos#326)

* Bump google.golang.org/grpc from 1.39.1 to 1.40.0 (cosmos#332)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.39.1 to 1.40.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.39.1...v1.40.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/spf13/cast from 1.4.0 to 1.4.1 (cosmos#338)

Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/spf13/cast/releases)
- [Commits](spf13/cast@v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/tendermint/tendermint from 0.34.11 to 0.34.12 (cosmos#341)

Bumps [github.com/tendermint/tendermint](https://github.com/tendermint/tendermint) from 0.34.11 to 0.34.12.
- [Release notes](https://github.com/tendermint/tendermint/releases)
- [Changelog](https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md)
- [Commits](tendermint/tendermint@v0.34.11...v0.34.12)

---
updated-dependencies:
- dependency-name: github.com/tendermint/tendermint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* fix broken links in integration.md (cosmos#340)

* fix broken link in integration.md

* fix: broken link to simulator.md file in cosmos-sdk docs

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>

* Created helper functions for emitting packet events (cosmos#343)

* Created helper functions for emitting packet events

* Fixed comments and re-ordered helper functions

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Merge pull request from GHSA-qrhq-96mh-q8jv

* Bump codecov/codecov-action from 2.0.2 to 2.0.3 (cosmos#346)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-action@v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Bump actions/setup-go from 2.1.3 to 2.1.4 (cosmos#349)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v2.1.3...v2.1.4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* increase port identifier limit to 128 characters (cosmos#344)

* increase port identifier limit to 128 characters

increase port limit and add tests for port validation

* add changelog

* fix tests

* update codeowners to include new team members and granular ownership (cosmos#354)

* update codeowners

* add proto files to ownership

* bump SDK dependency (cosmos#367)

* update SDK dependency and fix changes

Removes tests from sdk_test.go which are no longer needed to upstream changes in the SDK
Fixes client_test.go due to inclusion of the fee in tx events

* bump SDK version to v0.44.0

* adding client status cli query (cosmos#372)

* adding client status cli query

* adding query client status cli to changelog

* updating long CLI help usage

* adding markdown link checker to ci workflows (cosmos#377)

* packet acknowledgment filtering (cosmos#375)

* adding packet commitments to QueryPacketAcknowledgementsRequest for filtering

* adding testcase for filtered packet ack query

* adding changelog entry for packet ack filtering

* updating packet sequences type to repeated uint64

* updating to query specific packet acks outside bounds of paginated req

* updating changelog field naming, removing redundant pagination in query test

* continue in favour of returning an error on query PacketAcknowledgements

* updating to return empty array of acks if none of the provided commitments are found

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Bump github.com/tendermint/tendermint from 0.34.12 to 0.34.13 (cosmos#386)

Bumps [github.com/tendermint/tendermint](https://github.com/tendermint/tendermint) from 0.34.12 to 0.34.13.
- [Release notes](https://github.com/tendermint/tendermint/releases)
- [Changelog](https://github.com/tendermint/tendermint/blob/v0.34.13/CHANGELOG.md)
- [Commits](tendermint/tendermint@v0.34.12...v0.34.13)

---
updated-dependencies:
- dependency-name: github.com/tendermint/tendermint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Change ICS 20 packet data amount to be string (cosmos#350)

* modify proto defintions

* fix non string usage in code and various tests

* fix mbt tests

* fix bug in data validation

* fix various build issues

fix unaddressed issues from changing amount from uint64 to string

* add changelog entry

* apply review suggestions

Add check that amount is strictly positive
Construct granular error messages to indicate invalid amount value or failure to parse amount

* verify and fix telemetry bug

Verify msg panics on amounts > int64 by adding tests
Add checks to telemetry emission of transfer amounts to handle when the amount cannot be casted to float32

* fix: ibc build docs (cosmos#361)

* initial fix commit

* add release v1.0.1 to versions

* improvements for docs website

* add new version

* address review comments

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* feat: scalable version queries (cosmos#384)

* adding protos for port query interface

* adding NegotiateAppVersion method to IBCModule interface

* adding grpc port query implementation and module surrounds

* adding NegotiateAppVersion implementation to apps/transfer and mocks

* updating ErrInvalidVersion error code

* adding grpc query tests for 05-port

* updating grpc naming, adding godocs, removing redundant query cli

* updating grpc query tests

* adding changelog entry for cosmos#384 app version negotiation

* fixing error formatting in transfer version negotiation

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* removing client/cli query

* updating grpc query naming, adding new fields and associated surrounds

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Bump codecov/codecov-action from 2.0.3 to 2.1.0 (cosmos#399)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-action@v2.0.3...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: adding fn stub for version negotiation

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <crodveg@yahoo.es>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Luke Rhoads <51463884+lukerhoads@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: Charly <charly@interchain.berlin>

* fix err message (cosmos#419)

* feat: ica app version negotiation (cosmos#410)

* adding NegotiateAppVersion implementation and tests

* updating GenerateAddress to return sdk.AccAddress, fixing tests

* updating ica handshake flow to parse address from version string, fixing associated tests

* updating module_tests

* derive ica addresses from module account addr

* removing unused keys

* adding improved version validation, updating tests

* removing redundant local var - owner

* updating Delimiter godoc

* updating validation logic

* adding test cases for ValidateVersion

* adding additional validation testcase, updating godocs

* updating Version -> VersionPrefix, error msgs, validation tests

* updating NewAppVersion func sig and usage

* updating NewAppVersion args and returning more appropriate errors for handshake

* Update modules/apps/27-interchain-accounts/keeper/handshake.go

Co-authored-by: Sean King <seantking@users.noreply.github.com>

* updating ValidateVersion godoc

Co-authored-by: Sean King <seantking@users.noreply.github.com>

* test: adding tests for OnRecvPacket (cosmos#412)

* test: adding tests for OnRecvPacket

* test: adding further test cases for onRecvPacket

* chore: merge latest main to interchain-accounts (cosmos#435)

* chore: update ica prefix for port identifiers (cosmos#434)

* removing ICAPrefix const in favour of VersionPrefix

* updating tests

* test: account/keeper tests for ICA (cosmos#420)

* test: adding tests for account type

* tests: adding test for keeper & account

* fix: updating channel closing capabilities

* fix: updating to use test library instead of hardcoded values

* fix: updating error handling for account

* test: adding test for account string comparison

* fix: updating marshal yaml

* feat: module account address derivation (cosmos#428)

* adding module account to interchain-accounts with associated changes

* configuring ica module account in simapp

* Update modules/apps/27-interchain-accounts/keeper/keeper.go

Co-authored-by: Sean King <seantking@users.noreply.github.com>

* updating godoc and import alias

Co-authored-by: Sean King <seantking@users.noreply.github.com>

* ICA: tests for module.go  (cosmos#424)

* test

* test: adding module.go test with handshake callback tests

* tests: adding key tests

* additional code cov and clean up (cosmos#440)

* split ica module.go into ibc_module.go (cosmos#453)

Splits IBCModule logic into separate ibc_module.go file and updates app.go registration

* Rename IBCAccountPacketData, Remove TxRaw  (cosmos#456)

* rename IBCAccountPacketData, remove txRaw type

* Update proto/ibc/applications/interchain_accounts/v1/types.proto

* Rename DeserializeTx, enforce []sdk.Msg usage in SerializeCosmosTx (cosmos#457)

* rename DeserializeTx to DeserializeCosmosTx, simply serialization logic

* improve godoc wording

* remove computeVirtualTxHash (cosmos#473)

* chore: ctrl port connection id validation (cosmos#454)

* adding pipe char | to identifier regex

* updating GeneratePortID to use pipe delimiter in favour of dash, ParseAddressFromVersion to use Split in favour of TrimPrefix

* adding CounterpartyHops method to expected channel keeper interface

* updating tests to satisy delimiter updates

* adding connection seq validation of ctrl port id and updating tests

* cleanup

* adding defensive check for ParseAddressFromVersion

* adding conn sequence parsing funcs to pkg types

* moving conn sequence validation to reusable func

* updating error msgs, adding tests for conn seq parsers

* adding expected sequence to error msgs

* updating ParseCtrlConnSequence to ParseControllerConnSequence

* fixing counterparty port error

* Update modules/apps/27-interchain-accounts/keeper/handshake.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Update modules/apps/27-interchain-accounts/keeper/handshake.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Update modules/apps/27-interchain-accounts/types/account.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* removing pipe from valid identifier regex

* adding error returns to parsing funcs, updating tests, error messages

* separting imports in keys.go

* updating handshake tests

* Update modules/apps/27-interchain-accounts/types/keys.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* renaming validation func, removing parenthesis in error msgs

* renaming func validateControllerPort -> validateControllerPortParams

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* chore: correctly set/delete active channels (cosmos#463)

* correctly set active channels, implement delete OnChanCloseConfirm callback

* removing active channel on packet timeout

* remove ica hooks (cosmos#480)

* chore: minor nits - renaming and error msgs (cosmos#464)

* update ErrPortAlreadyBound error string - remove for address

* rename RegisterInterchainAccount api portID -> counterpartyPortID

* wrap claim capability errors in handshake

* Update modules/apps/27-interchain-accounts/keeper/account.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* adding channel and port id in error msg

* correcting error wording

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* chore: update portkey to include port ID (cosmos#467)

* update port key to use prefix, separate key prefixes to vars

* updating godoc

* Update modules/apps/27-interchain-accounts/keeper/keeper.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* adding todo with ica genesis issue ref

* fixing failing test from browser commit

* removing GetPort in favour of GetAllPorts

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* ICA: Rename TxBody, Remove serialization logic from controller, introduce CosmosTx type (cosmos#474)

* remove ICA TxBody type, use repeated Any in packet data

* adjust SerializeCosmosTx, fix tests

* apply self nits

* add memo length validation

* chore(spec): remove old specification

* ica: unspecified type enum for interchain account packet data (cosmos#487)

* adding unspecified type enum, adding defensive check to ValidateBasic

* Update modules/apps/27-interchain-accounts/types/packet_test.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* chore: ica audit nitpicks (cosmos#483)

* updating version validation with corrections

* removing unused methods from expected keeper interfaces

* updating validate version error msg

* update to use ErrInvalidVersion in favour of ErrInvalidAccountAddress

* fixed typo (cosmos#507)

* ica: move Serialize/DeserializeCosmosTx to package types (cosmos#493)

* moving SerializeCosmosTx and DeserializeCosmosTx to types pkg

* removing dead code

* adding mockSdkMsg message type for failing codec test scenarios

* Update modules/apps/27-interchain-accounts/types/codec_test.go

* ica: TrySendTx error handling nits (cosmos#491)

* updating error handling and msgs for TrySendTx flow

* renaming active channel ID getter/setters, adding comment re indeterminate errs

* renaming DeleteActiveChannel -> DeleteActiveChannelID

* chore: adding damo to codeowners (cosmos#520)

* ica: AuthenticateTx/executeTx clean up (cosmos#490)

* cleaning up AuthenticateTx and executeTx to reduce unnecessary complexity

* adding error wrapping to AuthenticateTx

* updating err msg to include expected signer

* ICA Controller Side Middleware (cosmos#417)

* initial draft for ica middleware

* add capability handling, fix build and tests

* split module.go into ibc_module.go

* add middleware handshake tests

* fix app.go wiring and various tests

* godoc self nits

* remove unnecessary error

* update comment

* fix testing build

* split channel keeper interface

splits ChannelKeeper interface into ics4Wrapper and core ChannelKeeper

* fix tests

* remove comments

* add callback for timeouts

* Apply suggestions from code review

Co-authored-by: Sean King <seantking@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* fix test and update testing README

apply test fix pointed out by Sean.
Update testing README to reflect how to test with the mock module for middleware

* add OnRecvPacket test

Add test cases for OnRecvPacket, reused structure in relay_test.go

* add failing test case for NegotiateAppVersion

Co-authored-by: Sean King <seantking@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* ica: genesis state implementation (cosmos#481)

* initial genesis state draft

* updating protos

* including yaml tags, sorting proto file structure

* updating to use range queries for active channels/interchain accounts

* updating GetAllPorts test

* moving test strings to expected vars

* test: relay tests for TrySendTx/OnRecvPacket (cosmos#531)

* adding various sdk.Msg type tests and cleaning up relay_test.go

* cleaning up tests to make consistent

* adding missing godoc for OnRecvPacket

* adding ica test for transfertypes.MsgTranfer

* updating hardcoded strings to use sdk.DefaultBondDenom

* Update modules/apps/27-interchain-accounts/keeper/relay_test.go

Co-authored-by: Sean King <seantking@users.noreply.github.com>

* removing staking test for insufficient funds

Co-authored-by: Sean King <seantking@users.noreply.github.com>

* ICA controller/host submodules (cosmos#541)

* go mod tidy

* creating new genesis types for controller and host submodules

* removing dead root module code

* updating genesis helpers and adding newly generated types

* adding interchain-accounts controller submodule

* adding interchain-accounts host submodule

* updating simapp to include controller and host ica submodules

* adding errors returns for disallowed handshake directions, removing embedded app from host module, updating simapp to conform

* updating simapp to remove nil arg to ica host ibc module

* removing ics4Wrapper arg from ica host submodule

* cleaning up module.go for controller and host submodules

* removing commented out tests

* commit with broken tests to rebase

* disabling app version negotation on controller submodule

* fixing tests - now passing

* various cleanup, godocs and moving code

* updating error msgs to conform to pkg split

* removing commented out code

* adding combined ica genesis, consolidating to single ica AppModule, updating app.go

* adding missing godocs

* clean up, godocs, rename validate.go -> version.go, move version related funcs

* updating godocs and code organization

* removing controller module acc, using icatypes module name for module acc in host submodule

* correcting panic error msg

* Update modules/apps/27-interchain-accounts/controller/ibc_module.go

* Update modules/apps/27-interchain-accounts/types/genesis.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* updating logger kvs, and simplifying OnRecvPacket

* address nits on error strings and godocs

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* chore: ica submodules minor improvements and cleanup

* test: adding test for RegisterInterchainAccount & adding check to rel… (cosmos#552)

* test: adding test for RegisterInterchainAccount & adding check to relay_test

* Update modules/apps/27-interchain-accounts/host/keeper/relay_test.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Update modules/apps/27-interchain-accounts/host/keeper/relay_test.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Update modules/apps/27-interchain-accounts/host/keeper/account_test.go

* Update modules/apps/27-interchain-accounts/host/keeper/account_test.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* ICA Code Hygiene  (cosmos#553)

* chore: re-creating account.go for controller side for consitency

* chore: remove comment

* Update modules/apps/27-interchain-accounts/controller/keeper/account.go

* ica: wrong handshake flow tests (cosmos#538)

* add tests for testing wrong handshake flow

Adds tests for each handshake test attempting to initialize the handshake using the wrong flow.
Adds an additional portID check to OnChanOpenAck.

* remove unnecessary comment

* readjust tests based on new layout

* Add tests provided by Damian

* add tests for OnChanCloseInit and OnChanCloseConfirm on host side

* add OnChanCloseInit/Confirm and NegotiateAppVersion tests to controller side

* fix failing test

* ica: genesis state validation (cosmos#554)

* adding genesis state validation

* adding genesis state validation tests

* Update modules/apps/27-interchain-accounts/types/genesis_test.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Update modules/apps/27-interchain-accounts/types/genesis_test.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* adding ValidateAccountAddress helper to reduce code duplication

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Rename imports within host/controller (cosmos#571)

* alias ica types import to  for host submodule

* alias ica types import to  for controller submodule

* Add Enable/Disable controller/host on-chain params (cosmos#566)

* add ica params

Add new Params type to ICA. A single test is added to check defaults and validation.
Usage within the ICA keepers is still needed

* regenerate params proto into host and controller submodules

* split params implementation into host/controller

* add keeper params logic

* Apply suggestions from code review

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* add host genesis init/export params test case

* add genesis validation for controller and host params

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Disable usage of controller and host submodules based on on-chain params (cosmos#575)

* add usage of enabling/disabling controller and host submodules

Adds if statement checks in controller/host ibc_module.go. Adds tests for each added if statements.
Tests not added for controller ack/timeout since tests do not exist for those functions yet.

* Update modules/apps/27-interchain-accounts/controller/ibc_module_test.go

* add grpc query for controller and host params (cosmos#574)

Adds gRPC routes for controller params and host params. Add tests and registers the gRPC gateways on the ica module

* modify ica portid to be interchain-account instead of ibcaccount (cosmos#577)

* feat: allowlist host param using msg typeURLs (cosmos#576)

* add ica params

Add new Params type to ICA. A single test is added to check defaults and validation.
Usage within the ICA keepers is still needed

* regenerate params proto into host and controller submodules

* split params implementation into host/controller

* add keeper params logic

* Apply suggestions from code review

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* add host genesis init/export params test case

* updating host proto params to include msg allowlist

* adding surrounds for new allowlist host param

* enforcing msg is present in allowlist in AuthenticateTx, updating tests

* regenerating protos post merge conflict

* applying suggestinons from review

* adding strings.Trimspace as suggested

Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com>

* Add cli query for host and controller params (cosmos#578)

* add cli query commands for host/controller params

* Update modules/apps/27-interchain-accounts/client/cli/cli.go

* Update modules/apps/27-interchain-accounts/controller/client/cli/query.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Update modules/apps/27-interchain-accounts/host/client/cli/query.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* renmaing ModuleName to SubModuleName for ica controller/host (cosmos#579)

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* add tests/code coverage for OnRecv, OnTimeout and OnAck for controller submodule (cosmos#585)

Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Luke Rhoads <51463884+lukerhoads@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <crodveg@yahoo.es>
Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: Charly <charly@interchain.berlin>
  • Loading branch information
10 people committed Dec 7, 2021
1 parent cad7b02 commit b89e03b
Show file tree
Hide file tree
Showing 89 changed files with 12,106 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@

# CODEOWNERS for interchain-accounts module

/modules/apps/27-interchain-accounts/ @seantking @colin-axner @AdityaSripal
/proto/applications/interchain_accounts/ @seantking @colin-axner @AdityaSripal
/modules/apps/27-interchain-accounts/ @seantking @colin-axner @AdityaSripal @damiannolan
/proto/applications/interchain_accounts/ @seantking @colin-axner @AdityaSripal @damiannolan
209 changes: 209 additions & 0 deletions docs/ibc/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@

## Table of Contents

- [ibc/applications/interchain_accounts/v1/account.proto](#ibc/applications/interchain_accounts/v1/account.proto)
- [InterchainAccount](#ibc.applications.interchain_accounts.v1.InterchainAccount)

- [ibc/applications/interchain_accounts/v1/genesis.proto](#ibc/applications/interchain_accounts/v1/genesis.proto)
- [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel)
- [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState)
- [GenesisState](#ibc.applications.interchain_accounts.v1.GenesisState)
- [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState)
- [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount)

- [ibc/applications/interchain_accounts/v1/types.proto](#ibc/applications/interchain_accounts/v1/types.proto)
- [CosmosTx](#ibc.applications.interchain_accounts.v1.CosmosTx)
- [InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData)

- [Type](#ibc.applications.interchain_accounts.v1.Type)

- [ibc/applications/transfer/v1/transfer.proto](#ibc/applications/transfer/v1/transfer.proto)
- [DenomTrace](#ibc.applications.transfer.v1.DenomTrace)
- [Params](#ibc.applications.transfer.v1.Params)
Expand Down Expand Up @@ -254,6 +270,199 @@



<a name="ibc/applications/interchain_accounts/v1/account.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## ibc/applications/interchain_accounts/v1/account.proto



<a name="ibc.applications.interchain_accounts.v1.InterchainAccount"></a>

### InterchainAccount
An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | |
| `account_owner` | [string](#string) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="ibc/applications/interchain_accounts/v1/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## ibc/applications/interchain_accounts/v1/genesis.proto



<a name="ibc.applications.interchain_accounts.v1.ActiveChannel"></a>

### ActiveChannel
ActiveChannel contains a pairing of port ID and channel ID for an active interchain accounts channel


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `port_id` | [string](#string) | | |
| `channel_id` | [string](#string) | | |






<a name="ibc.applications.interchain_accounts.v1.ControllerGenesisState"></a>

### ControllerGenesisState
ControllerGenesisState defines the interchain accounts controller genesis state


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | |
| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | |
| `ports` | [string](#string) | repeated | |
| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | |






<a name="ibc.applications.interchain_accounts.v1.GenesisState"></a>

### GenesisState
GenesisState defines the interchain accounts genesis state


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState) | | |
| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState) | | |






<a name="ibc.applications.interchain_accounts.v1.HostGenesisState"></a>

### HostGenesisState
HostGenesisState defines the interchain accounts host genesis state


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | |
| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | |
| `port` | [string](#string) | | |
| `params` | [ibc.applications.interchain_accounts.host.v1.Params](#ibc.applications.interchain_accounts.host.v1.Params) | | |






<a name="ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount"></a>

### RegisteredInterchainAccount
RegisteredInterchainAccount contains a pairing of controller port ID and associated interchain account address


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `port_id` | [string](#string) | | |
| `account_address` | [string](#string) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="ibc/applications/interchain_accounts/v1/types.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## ibc/applications/interchain_accounts/v1/types.proto



<a name="ibc.applications.interchain_accounts.v1.CosmosTx"></a>

### CosmosTx
CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | |






<a name="ibc.applications.interchain_accounts.v1.InterchainAccountPacketData"></a>

### InterchainAccountPacketData
InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `type` | [Type](#ibc.applications.interchain_accounts.v1.Type) | | |
| `data` | [bytes](#bytes) | | |
| `memo` | [string](#string) | | |





<!-- end messages -->


<a name="ibc.applications.interchain_accounts.v1.Type"></a>

### Type
Type defines a classification of message issued from a controller chain to its associated interchain accounts
host

| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNSPECIFIED | 0 | Default zero value enumeration |
| TYPE_EXECUTE_TX | 1 | Execute a transaction on an interchain accounts host chain |


<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="ibc/applications/transfer/v1/transfer.proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1
github.com/spf13/cast v1.4.1
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.9.0
Expand All @@ -23,6 +24,7 @@ require (
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71
google.golang.org/grpc v1.42.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v2 v2.4.0
)

require (
Expand Down Expand Up @@ -92,7 +94,6 @@ require (
github.com/prometheus/common v0.29.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/rs/zerolog v1.23.0 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
Expand All @@ -113,7 +114,6 @@ require (
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.6 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
nhooyr.io/websocket v1.8.6 // indirect
)
26 changes: 26 additions & 0 deletions modules/apps/27-interchain-accounts/client/cli/cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cli

import (
"github.com/spf13/cobra"

controllercli "github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/controller/client/cli"
hostcli "github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/host/client/cli"
)

// GetQueryCmd returns the query commands for the interchain-accounts submodule
func GetQueryCmd() *cobra.Command {
icaQueryCmd := &cobra.Command{
Use: "interchain-accounts",
Aliases: []string{"ica"},
Short: "interchain-accounts subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
}

icaQueryCmd.AddCommand(
controllercli.GetQueryCmd(),
hostcli.GetQueryCmd(),
)

return icaQueryCmd
}
21 changes: 21 additions & 0 deletions modules/apps/27-interchain-accounts/controller/client/cli/cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cli

import (
"github.com/spf13/cobra"
)

// GetQueryCmd returns the query commands for the ICA controller submodule
func GetQueryCmd() *cobra.Command {
queryCmd := &cobra.Command{
Use: "controller",
Short: "interchain-accounts controller subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
}

queryCmd.AddCommand(
GetCmdParams(),
)

return queryCmd
}
37 changes: 37 additions & 0 deletions modules/apps/27-interchain-accounts/controller/client/cli/query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package cli

import (
"fmt"

"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/controller/types"
)

// GetCmdParams returns the command handler for the controller submodule parameter querying.
func GetCmdParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "Query the current interchain-accounts controller submodule parameters",
Long: "Query the current interchain-accounts controller submodule parameters",
Args: cobra.NoArgs,
Example: fmt.Sprintf("%s query interchain-accounts controller params", version.AppName),
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

res, _ := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
return clientCtx.PrintProto(res.Params)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}
Loading

0 comments on commit b89e03b

Please sign in to comment.