diff --git a/app/app.go b/app/app.go index 4573be686..d25bc5583 100644 --- a/app/app.go +++ b/app/app.go @@ -900,7 +900,13 @@ func New( icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) - interchainQueriesModule := interchainqueries.NewAppModule(appCodec, app.InterchainQueriesKeeper, app.AccountKeeper, app.BankKeeper) + interchainQueriesModule := interchainqueries.NewAppModule( + appCodec, + keys[interchainqueriesmoduletypes.StoreKey], + app.InterchainQueriesKeeper, + app.AccountKeeper, + app.BankKeeper, + ) interchainTxsModule := interchaintxs.NewAppModule(appCodec, app.InterchainTxsKeeper, app.AccountKeeper, app.BankKeeper) contractManagerModule := contractmanager.NewAppModule(appCodec, app.ContractManagerKeeper) ibcHooksModule := ibchooks.NewAppModule(app.AccountKeeper) diff --git a/go.mod b/go.mod index f6e7b7368..837db6d47 100644 --- a/go.mod +++ b/go.mod @@ -20,11 +20,11 @@ require ( github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.9 - github.com/cosmos/gogoproto v1.6.0 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 github.com/cosmos/ibc-go/modules/capability v1.0.1 - github.com/cosmos/ibc-go/v8 v8.4.0 - github.com/cosmos/ics23/go v0.10.0 + github.com/cosmos/ibc-go/v8 v8.5.0 + github.com/cosmos/ics23/go v0.11.0 github.com/cosmos/interchain-security/v5 v5.1.1 github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.6.0 @@ -53,11 +53,11 @@ require ( ) require ( - cloud.google.com/go v0.114.0 // indirect - cloud.google.com/go/auth v0.5.1 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect - cloud.google.com/go/iam v1.1.8 // indirect + 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/collections v0.4.0 // indirect @@ -124,7 +124,7 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.4 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect @@ -201,12 +201,12 @@ require ( golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.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/time v0.5.0 // indirect - google.golang.org/api v0.180.0 // indirect - google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/api v0.186.0 // indirect + google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 389be92c2..4e52f6f9f 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= -cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -46,8 +46,8 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= -cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= @@ -111,8 +111,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0= -cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE= +cloud.google.com/go/iam v1.1.9 h1:oSkYLVtVme29uGYrOcKcvJRht7cHJpYD09GM9JaR0TE= +cloud.google.com/go/iam v1.1.9/go.mod h1:Nt1eDWNYH9nGQg3d/mY7U1hvfGmsaG9o/kLGoLoLXjQ= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -367,18 +367,18 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.6.0 h1:Xm0F/96O5Ox4g6xGgjA41rWaaPjYtOdTi59uBcV2qEE= -github.com/cosmos/gogoproto v1.6.0/go.mod h1:Y+g956rcUf2vr4uwtCcK/1Xx9BWVluCtcI9vsh0GHmk= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +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-apps/middleware/packet-forward-middleware/v8 v8.0.2 h1:dyLNlDElY6+5zW/BT/dO/3Ad9FpQblfh+9dQpYQodbA= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= 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/ibc-go/v8 v8.4.0 h1:K2PfX0AZ+1XKZytHGEMuSjQXG/MZshPb83RSTQt2+cE= -github.com/cosmos/ibc-go/v8 v8.4.0/go.mod h1:zh6x1osR0hNvEcFrC/lhGD08sMfQmr9wHVvZ/mRWMCs= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ibc-go/v8 v8.5.0 h1:OjaSXz480JT8ZuMrASxGgS7XzloZ2NuuJPwZB/fKDgE= +github.com/cosmos/ibc-go/v8 v8.5.0/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +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/interchain-security/v5 v5.0.0-20240802125602-fa1e09444aae h1:/EWV9qryltapge0v4ctvl2jV3Nne5nsbd+GYblj/jWA= github.com/cosmos/interchain-security/v5 v5.0.0-20240802125602-fa1e09444aae/go.mod h1:P3TM8JmE9Q20Jfch3jnFcQ4IXJp5twueRnUudi6XEGI= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -633,8 +633,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= -github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -1363,8 +1363,8 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1508,8 +1508,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.180.0 h1:M2D87Yo0rGBPWpo1orwfCLehUUL6E7/TYe5gvMQWDh4= -google.golang.org/api v0.180.0/go.mod h1:51AiyoEg1MJPSZ9zvklA8VnRILPXxn1iVen9v25XHAE= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1625,8 +1625,8 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWhkkZGohVC6KRrc1oJNr4jwtQMOQXw= -google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= diff --git a/proto/neutron/interchainqueries/params.proto b/proto/neutron/interchainqueries/params.proto index 0dca4a206..7b05c1f58 100644 --- a/proto/neutron/interchainqueries/params.proto +++ b/proto/neutron/interchainqueries/params.proto @@ -23,4 +23,10 @@ message Params { // balance between network cleaning speed and EndBlock duration. A zero value // means no limit. uint64 tx_query_removal_limit = 3; + + // Maximum amount of keys in a registered key value query + uint64 max_kv_query_keys_count = 4; + + // max_transactions_filters defines maximum allowed amount of tx filters in msgRegisterInterchainQuery + uint64 max_transactions_filters = 5; } diff --git a/proto/neutron/interchaintxs/v1/tx.proto b/proto/neutron/interchaintxs/v1/tx.proto index ef59d3075..a2bb14202 100644 --- a/proto/neutron/interchaintxs/v1/tx.proto +++ b/proto/neutron/interchaintxs/v1/tx.proto @@ -9,6 +9,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/api/http.proto"; import "google/protobuf/any.proto"; +import "ibc/core/channel/v1/channel.proto"; import "neutron/feerefunder/fee.proto"; import "neutron/interchaintxs/v1/params.proto"; @@ -36,6 +37,7 @@ message MsgRegisterInterchainAccount { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + ibc.core.channel.v1.Order ordering = 5; } // MsgRegisterInterchainAccountResponse is the response type for diff --git a/third_party/proto/ibc/applications/fee/v1/ack.proto b/third_party/proto/ibc/applications/fee/v1/ack.proto deleted file mode 100644 index cc12f3b58..000000000 --- a/third_party/proto/ibc/applications/fee/v1/ack.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; - -// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware -message IncentivizedAcknowledgement { - // the underlying app acknowledgement bytes - bytes app_acknowledgement = 1 [(gogoproto.moretags) = "yaml:\"app_acknowledgement\""]; - // the relayer address which submits the recv packet message - string forward_relayer_address = 2 [(gogoproto.moretags) = "yaml:\"forward_relayer_address\""]; - // success flag of the base application callback - bool underlying_app_success = 3 [(gogoproto.moretags) = "yaml:\"underlying_app_successl\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/fee.proto b/third_party/proto/ibc/applications/fee/v1/fee.proto deleted file mode 100644 index 4ef626d41..000000000 --- a/third_party/proto/ibc/applications/fee/v1/fee.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Fee defines the ICS29 receive, acknowledgement and timeout fees -message Fee { - // the packet receive fee - repeated cosmos.base.v1beta1.Coin recv_fee = 1 [ - (gogoproto.moretags) = "yaml:\"recv_fee\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // the packet acknowledgement fee - repeated cosmos.base.v1beta1.Coin ack_fee = 2 [ - (gogoproto.moretags) = "yaml:\"ack_fee\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // the packet timeout fee - repeated cosmos.base.v1beta1.Coin timeout_fee = 3 [ - (gogoproto.moretags) = "yaml:\"timeout_fee\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers -message PacketFee { - // fee encapsulates the recv, ack and timeout fees associated with an IBC packet - Fee fee = 1 [(gogoproto.nullable) = false]; - // the refund address for unspent fees - string refund_address = 2 [(gogoproto.moretags) = "yaml:\"refund_address\""]; - // optional list of relayers permitted to receive fees - repeated string relayers = 3; -} - -// PacketFees contains a list of type PacketFee -message PacketFees { - // list of packet fees - repeated PacketFee packet_fees = 1 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; -} - -// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId -message IdentifiedPacketFees { - // unique packet identifier comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; - // list of packet fees - repeated PacketFee packet_fees = 2 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/genesis.proto b/third_party/proto/ibc/applications/fee/v1/genesis.proto deleted file mode 100644 index 245525ca1..000000000 --- a/third_party/proto/ibc/applications/fee/v1/genesis.proto +++ /dev/null @@ -1,66 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/fee/v1/fee.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// GenesisState defines the ICS29 fee middleware genesis state -message GenesisState { - // list of identified packet fees - repeated IdentifiedPacketFees identified_fees = 1 - [(gogoproto.moretags) = "yaml:\"identified_fees\"", (gogoproto.nullable) = false]; - // list of fee enabled channels - repeated FeeEnabledChannel fee_enabled_channels = 2 - [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; - // list of registered payees - repeated RegisteredPayee registered_payees = 3 - [(gogoproto.moretags) = "yaml:\"registered_payees\"", (gogoproto.nullable) = false]; - // list of registered counterparty payees - repeated RegisteredCounterpartyPayee registered_counterparty_payees = 4 - [(gogoproto.moretags) = "yaml:\"registered_counterparty_payees\"", (gogoproto.nullable) = false]; - // list of forward relayer addresses - repeated ForwardRelayerAddress forward_relayers = 5 - [(gogoproto.moretags) = "yaml:\"forward_relayers\"", (gogoproto.nullable) = false]; -} - -// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel -message FeeEnabledChannel { - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// RegisteredPayee contains the relayer address and payee address for a specific channel -message RegisteredPayee { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 2; - // the payee address - string payee = 3; -} - -// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used -// for recv fee distribution) -message RegisteredCounterpartyPayee { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 2; - // the counterparty payee address - string counterparty_payee = 3 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; -} - -// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements -message ForwardRelayerAddress { - // the forward relayer address - string address = 1; - // unique packet identifer comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/metadata.proto b/third_party/proto/ibc/applications/fee/v1/metadata.proto deleted file mode 100644 index 8d9879f35..000000000 --- a/third_party/proto/ibc/applications/fee/v1/metadata.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; - -// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring -// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning -message Metadata { - // fee_version defines the ICS29 fee version - string fee_version = 1 [(gogoproto.moretags) = "yaml:\"fee_version\""]; - // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring - string app_version = 2 [(gogoproto.moretags) = "yaml:\"app_version\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/query.proto b/third_party/proto/ibc/applications/fee/v1/query.proto deleted file mode 100644 index 7d54bcd01..000000000 --- a/third_party/proto/ibc/applications/fee/v1/query.proto +++ /dev/null @@ -1,222 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/applications/fee/v1/fee.proto"; -import "ibc/applications/fee/v1/genesis.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Query defines the ICS29 gRPC querier service. -service Query { - // IncentivizedPackets returns all incentivized packets and their associated fees - rpc IncentivizedPackets(QueryIncentivizedPacketsRequest) returns (QueryIncentivizedPacketsResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/incentivized_packets"; - } - - // IncentivizedPacket returns all packet fees for a packet given its identifier - rpc IncentivizedPacket(QueryIncentivizedPacketRequest) returns (QueryIncentivizedPacketResponse) { - option (google.api.http).get = - "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/" - "{packet_id.sequence}/incentivized_packet"; - } - - // Gets all incentivized packets for a specific channel - rpc IncentivizedPacketsForChannel(QueryIncentivizedPacketsForChannelRequest) - returns (QueryIncentivizedPacketsForChannelResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/incentivized_packets"; - } - - // TotalRecvFees returns the total receive fees for a packet given its identifier - rpc TotalRecvFees(QueryTotalRecvFeesRequest) returns (QueryTotalRecvFeesResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" - "sequences/{packet_id.sequence}/total_recv_fees"; - } - - // TotalAckFees returns the total acknowledgement fees for a packet given its identifier - rpc TotalAckFees(QueryTotalAckFeesRequest) returns (QueryTotalAckFeesResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" - "sequences/{packet_id.sequence}/total_ack_fees"; - } - - // TotalTimeoutFees returns the total timeout fees for a packet given its identifier - rpc TotalTimeoutFees(QueryTotalTimeoutFeesRequest) returns (QueryTotalTimeoutFeesResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" - "sequences/{packet_id.sequence}/total_timeout_fees"; - } - - // Payee returns the registered payee address for a specific channel given the relayer address - rpc Payee(QueryPayeeRequest) returns (QueryPayeeResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/payee"; - } - - // CounterpartyPayee returns the registered counterparty payee for forward relaying - rpc CounterpartyPayee(QueryCounterpartyPayeeRequest) returns (QueryCounterpartyPayeeResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/counterparty_payee"; - } - - // FeeEnabledChannels returns a list of all fee enabled channels - rpc FeeEnabledChannels(QueryFeeEnabledChannelsRequest) returns (QueryFeeEnabledChannelsResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/fee_enabled"; - } - - // FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel - rpc FeeEnabledChannel(QueryFeeEnabledChannelRequest) returns (QueryFeeEnabledChannelResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/fee_enabled"; - } -} - -// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc -message QueryIncentivizedPacketsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; - // block height at which to query - uint64 query_height = 2; -} - -// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc -message QueryIncentivizedPacketsResponse { - // list of identified fees for incentivized packets - repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1 [(gogoproto.nullable) = false]; -} - -// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc -message QueryIncentivizedPacketRequest { - // unique packet identifier comprised of channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; - // block height at which to query - uint64 query_height = 2; -} - -// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc -message QueryIncentivizedPacketResponse { - // the identified fees for the incentivized packet - ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packet = 1 [(gogoproto.nullable) = false]; -} - -// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets -// for a specific channel -message QueryIncentivizedPacketsForChannelRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; - string port_id = 2; - string channel_id = 3; - // Height to query at - uint64 query_height = 4; -} - -// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC -message QueryIncentivizedPacketsForChannelResponse { - // Map of all incentivized_packets - repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1; -} - -// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc -message QueryTotalRecvFeesRequest { - // the packet identifier for the associated fees - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; -} - -// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc -message QueryTotalRecvFeesResponse { - // the total packet receive fees - repeated cosmos.base.v1beta1.Coin recv_fees = 1 [ - (gogoproto.moretags) = "yaml:\"recv_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc -message QueryTotalAckFeesRequest { - // the packet identifier for the associated fees - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; -} - -// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc -message QueryTotalAckFeesResponse { - // the total packet acknowledgement fees - repeated cosmos.base.v1beta1.Coin ack_fees = 1 [ - (gogoproto.moretags) = "yaml:\"ack_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc -message QueryTotalTimeoutFeesRequest { - // the packet identifier for the associated fees - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; -} - -// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc -message QueryTotalTimeoutFeesResponse { - // the total packet timeout fees - repeated cosmos.base.v1beta1.Coin timeout_fees = 1 [ - (gogoproto.moretags) = "yaml:\"timeout_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// QueryPayeeRequest defines the request type for the Payee rpc -message QueryPayeeRequest { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address to which the distribution address is registered - string relayer = 2; -} - -// QueryPayeeResponse defines the response type for the Payee rpc -message QueryPayeeResponse { - // the payee address to which packet fees are paid out - string payee_address = 1 [(gogoproto.moretags) = "yaml:\"payee_address\""]; -} - -// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc -message QueryCounterpartyPayeeRequest { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address to which the counterparty is registered - string relayer = 2; -} - -// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc -message QueryCounterpartyPayeeResponse { - // the counterparty payee address used to compensate forward relaying - string counterparty_payee = 1 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; -} - -// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc -message QueryFeeEnabledChannelsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; - // block height at which to query - uint64 query_height = 2; -} - -// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc -message QueryFeeEnabledChannelsResponse { - // list of fee enabled channels - repeated ibc.applications.fee.v1.FeeEnabledChannel fee_enabled_channels = 1 - [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; -} - -// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc -message QueryFeeEnabledChannelRequest { - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc -message QueryFeeEnabledChannelResponse { - // boolean flag representing the fee enabled channel status - bool fee_enabled = 1 [(gogoproto.moretags) = "yaml:\"fee_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/tx.proto b/third_party/proto/ibc/applications/fee/v1/tx.proto deleted file mode 100644 index 63e591617..000000000 --- a/third_party/proto/ibc/applications/fee/v1/tx.proto +++ /dev/null @@ -1,112 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/fee/v1/fee.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Msg defines the ICS29 Msg service. -service Msg { - // RegisterPayee defines a rpc handler method for MsgRegisterPayee - // RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional - // payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on - // the source chain from which packets originate as this is where fee distribution takes place. This function may be - // called more than once by a relayer, in which case, the latest payee is always used. - rpc RegisterPayee(MsgRegisterPayee) returns (MsgRegisterPayeeResponse); - - // RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee - // RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty - // payee address before relaying. This ensures they will be properly compensated for forward relaying since - // the destination chain must include the registered counterparty payee address in the acknowledgement. This function - // may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. - rpc RegisterCounterpartyPayee(MsgRegisterCounterpartyPayee) returns (MsgRegisterCounterpartyPayeeResponse); - - // PayPacketFee defines a rpc handler method for MsgPayPacketFee - // PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to - // incentivize the relaying of the packet at the next sequence - // NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows - // initiates the lifecycle of the incentivized packet - rpc PayPacketFee(MsgPayPacketFee) returns (MsgPayPacketFeeResponse); - - // PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync - // PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to - // incentivize the relaying of a known packet (i.e. at a particular sequence) - rpc PayPacketFeeAsync(MsgPayPacketFeeAsync) returns (MsgPayPacketFeeAsyncResponse); -} - -// MsgRegisterPayee defines the request type for the RegisterPayee rpc -message MsgRegisterPayee { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 3; - // the payee address - string payee = 4; -} - -// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc -message MsgRegisterPayeeResponse {} - -// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc -message MsgRegisterCounterpartyPayee { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 3; - // the counterparty payee address - string counterparty_payee = 4 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; -} - -// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc -message MsgRegisterCounterpartyPayeeResponse {} - -// MsgPayPacketFee defines the request type for the PayPacketFee rpc -// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be -// paid for -message MsgPayPacketFee { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // fee encapsulates the recv, ack and timeout fees associated with an IBC packet - ibc.applications.fee.v1.Fee fee = 1 [(gogoproto.nullable) = false]; - // the source port unique identifier - string source_port_id = 2 [(gogoproto.moretags) = "yaml:\"source_port_id\""]; - // the source channel unique identifer - string source_channel_id = 3 [(gogoproto.moretags) = "yaml:\"source_channel_id\""]; - // account address to refund fee if necessary - string signer = 4; - // optional list of relayers permitted to the receive packet fees - repeated string relayers = 5; -} - -// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc -message MsgPayPacketFeeResponse {} - -// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc -// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) -message MsgPayPacketFeeAsync { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // unique packet identifier comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 - [(gogoproto.moretags) = "yaml:\"packet_id\"", (gogoproto.nullable) = false]; - // the packet fee associated with a particular IBC packet - PacketFee packet_fee = 2 [(gogoproto.moretags) = "yaml:\"packet_fee\"", (gogoproto.nullable) = false]; -} - -// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc -message MsgPayPacketFeeAsyncResponse {} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto deleted file mode 100644 index 0974b9d9b..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; - -import "gogoproto/gogo.proto"; - -// Params defines the set of on-chain interchain accounts parameters. -// The following parameters may be used to disable the controller submodule. -message Params { - // controller_enabled enables or disables the controller submodule. - bool controller_enabled = 1 [(gogoproto.moretags) = "yaml:\"controller_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto deleted file mode 100644 index 3779ed387..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; - -import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; - -// Query provides defines the gRPC querier service. -service Query { - // InterchainAccount returns the interchain account address for a given owner address on a given connection - rpc InterchainAccount(QueryInterchainAccountRequest) returns (QueryInterchainAccountResponse) { - option (google.api.http).get = - "/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}"; - } - - // Params queries all parameters of the ICA controller submodule. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/interchain_accounts/controller/v1/params"; - } -} - -// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. -message QueryInterchainAccountRequest { - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; -} - -// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. -message QueryInterchainAccountResponse { - string address = 1; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto deleted file mode 100644 index 11fb3cfdc..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/interchain_accounts/v1/packet.proto"; - -// Msg defines the 27-interchain-accounts/controller Msg service. -service Msg { - // RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. - rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) returns (MsgRegisterInterchainAccountResponse); - // SendTx defines a rpc handler for MsgSendTx. - rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); -} - -// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount -message MsgRegisterInterchainAccount { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string version = 3; -} - -// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount -message MsgRegisterInterchainAccountResponse { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; -} - -// MsgSendTx defines the payload for Msg/SendTx -message MsgSendTx { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 3 - [(gogoproto.moretags) = "yaml:\"packet_data\"", (gogoproto.nullable) = false]; - // Relative timeout timestamp provided will be added to the current block time during transaction execution. - // The timeout timestamp must be non-zero. - uint64 relative_timeout = 4 [(gogoproto.moretags) = "yaml:\"relative_timeout\""]; -} - -// MsgSendTxResponse defines the response for MsgSendTx -message MsgSendTxResponse { - uint64 sequence = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto deleted file mode 100644 index f0fd73ede..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.genesis.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "ibc/applications/interchain_accounts/host/v1/host.proto"; - -// GenesisState defines the interchain accounts genesis state -message GenesisState { - ControllerGenesisState controller_genesis_state = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"controller_genesis_state\""]; - HostGenesisState host_genesis_state = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"host_genesis_state\""]; -} - -// ControllerGenesisState defines the interchain accounts controller genesis state -message ControllerGenesisState { - repeated ActiveChannel active_channels = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"active_channels\""]; - repeated RegisteredInterchainAccount interchain_accounts = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interchain_accounts\""]; - repeated string ports = 3; - ibc.applications.interchain_accounts.controller.v1.Params params = 4 [(gogoproto.nullable) = false]; -} - -// HostGenesisState defines the interchain accounts host genesis state -message HostGenesisState { - repeated ActiveChannel active_channels = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"active_channels\""]; - repeated RegisteredInterchainAccount interchain_accounts = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interchain_accounts\""]; - string port = 3; - ibc.applications.interchain_accounts.host.v1.Params params = 4 [(gogoproto.nullable) = false]; -} - -// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to -// indicate if the channel is middleware enabled -message ActiveChannel { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bool is_middleware_enabled = 4 [(gogoproto.moretags) = "yaml:\"is_middleware_enabled\""]; -} - -// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address -message RegisteredInterchainAccount { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string account_address = 3 [(gogoproto.moretags) = "yaml:\"account_address\""]; -} \ No newline at end of file diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto deleted file mode 100644 index 2247e2fe0..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.host.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; - -import "gogoproto/gogo.proto"; - -// Params defines the set of on-chain interchain accounts parameters. -// The following parameters may be used to disable the host submodule. -message Params { - // host_enabled enables or disables the host submodule. - bool host_enabled = 1 [(gogoproto.moretags) = "yaml:\"host_enabled\""]; - // allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. - repeated string allow_messages = 2 [(gogoproto.moretags) = "yaml:\"allow_messages\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto deleted file mode 100644 index 6f206a14c..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.host.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; - -import "google/api/annotations.proto"; -import "ibc/applications/interchain_accounts/host/v1/host.proto"; - -// Query provides defines the gRPC querier service. -service Query { - // Params queries all parameters of the ICA host submodule. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/interchain_accounts/host/v1/params"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto deleted file mode 100644 index 85d4e5828..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -message InterchainAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "ibc.applications.interchain_accounts.v1.InterchainAccountI"; - - cosmos.auth.v1beta1.BaseAccount base_account = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - string account_owner = 2 [(gogoproto.moretags) = "yaml:\"account_owner\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto deleted file mode 100644 index 5984ba4d6..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; - -import "gogoproto/gogo.proto"; - -// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring -// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning -message Metadata { - // version defines the ICS27 protocol version - string version = 1; - // controller_connection_id is the connection identifier associated with the controller chain - string controller_connection_id = 2 [(gogoproto.moretags) = "yaml:\"controller_connection_id\""]; - // host_connection_id is the connection identifier associated with the host chain - string host_connection_id = 3 [(gogoproto.moretags) = "yaml:\"host_connection_id\""]; - // address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step - // NOTE: the address field is empty on the OnChanOpenInit handshake step - string address = 4; - // encoding defines the supported codec format - string encoding = 5; - // tx_type defines the type of transactions the interchain account can execute - string tx_type = 6; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto deleted file mode 100644 index f75a1463e..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; - -// Type defines a classification of message issued from a controller chain to its associated interchain accounts -// host -enum Type { - option (gogoproto.goproto_enum_prefix) = false; - - // Default zero value enumeration - TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Execute a transaction on an interchain accounts host chain - TYPE_EXECUTE_TX = 1 [(gogoproto.enumvalue_customname) = "EXECUTE_TX"]; -} - -// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. -message InterchainAccountPacketData { - Type type = 1; - bytes data = 2; - string memo = 3; -} - -// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. -message CosmosTx { - repeated google.protobuf.Any messages = 1; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/authz.proto b/third_party/proto/ibc/applications/transfer/v1/authz.proto index df1ee24ed..e7561b070 100644 --- a/third_party/proto/ibc/applications/transfer/v1/authz.proto +++ b/third_party/proto/ibc/applications/transfer/v1/authz.proto @@ -11,14 +11,17 @@ import "cosmos/base/v1beta1/coin.proto"; // Allocation defines the spend limit for a particular port and channel message Allocation { // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 1; // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 2; // spend limitation on the channel repeated cosmos.base.v1beta1.Coin spend_limit = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // allow list of receivers, an empty allow list permits any receiver address repeated string allow_list = 4; + // allow list of packet data keys, an empty list prohibits all packet data keys; + // a list only with "*" permits any packet data key + repeated string allowed_packet_data = 5; } // TransferAuthorization allows the grantee to spend up to spend_limit coins from diff --git a/third_party/proto/ibc/applications/transfer/v1/genesis.proto b/third_party/proto/ibc/applications/transfer/v1/genesis.proto index 578c2242e..f7d707f6c 100644 --- a/third_party/proto/ibc/applications/transfer/v1/genesis.proto +++ b/third_party/proto/ibc/applications/transfer/v1/genesis.proto @@ -10,18 +10,11 @@ import "gogoproto/gogo.proto"; // GenesisState defines the ibc-transfer genesis state message GenesisState { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - repeated DenomTrace denom_traces = 2 [ - (gogoproto.castrepeated) = "Traces", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"denom_traces\"" - ]; - Params params = 3 [(gogoproto.nullable) = false]; + string port_id = 1; + repeated DenomTrace denom_traces = 2 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; + Params params = 3 [(gogoproto.nullable) = false]; // total_escrowed contains the total amount of tokens escrowed // by the transfer module - repeated cosmos.base.v1beta1.Coin total_escrowed = 4 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"total_escrowed\"" - ]; + repeated cosmos.base.v1beta1.Coin total_escrowed = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/applications/transfer/v1/transfer.proto b/third_party/proto/ibc/applications/transfer/v1/transfer.proto index 0c13a48ce..7f7723762 100644 --- a/third_party/proto/ibc/applications/transfer/v1/transfer.proto +++ b/third_party/proto/ibc/applications/transfer/v1/transfer.proto @@ -4,8 +4,6 @@ package ibc.applications.transfer.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; -import "gogoproto/gogo.proto"; - // DenomTrace contains the base denomination for ICS20 fungible tokens and the // source tracing information path. message DenomTrace { @@ -23,8 +21,8 @@ message DenomTrace { message Params { // send_enabled enables or disables all cross-chain token transfers from this // chain. - bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""]; + bool send_enabled = 1; // receive_enabled enables or disables all cross-chain token transfers to this // chain. - bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""]; + bool receive_enabled = 2; } diff --git a/third_party/proto/ibc/applications/transfer/v1/tx.proto b/third_party/proto/ibc/applications/transfer/v1/tx.proto index 02466eab7..42c70d3be 100644 --- a/third_party/proto/ibc/applications/transfer/v1/tx.proto +++ b/third_party/proto/ibc/applications/transfer/v1/tx.proto @@ -4,46 +4,76 @@ package ibc.applications.transfer.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; import "ibc/core/client/v1/client.proto"; +import "ibc/applications/transfer/v1/transfer.proto"; // Msg defines the ibc/transfer Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Transfer defines a rpc handler method for MsgTransfer. rpc Transfer(MsgTransfer) returns (MsgTransferResponse); + + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between // ICS20 enabled chains. See ICS Spec here: // https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures message MsgTransfer { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgTransfer"; + option (cosmos.msg.v1.signer) = "sender"; + option (gogoproto.goproto_getters) = false; // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 1; // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 2; // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // the sender address string sender = 4; // the recipient address on the destination chain string receiver = 5; // Timeout height relative to the current block height. // The timeout is disabled when set to 0. - ibc.core.client.v1.Height timeout_height = 6 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + ibc.core.client.v1.Height timeout_height = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // Timeout timestamp in absolute nanoseconds since unix epoch. // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + uint64 timeout_timestamp = 7; // optional memo string memo = 8; } // MsgTransferResponse defines the Msg/Transfer response type. message MsgTransferResponse { + option (gogoproto.goproto_getters) = false; + // sequence number of the transfer packet sent uint64 sequence = 1; } + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the transfer parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/third_party/proto/ibc/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto index eb073fd18..05a18fefb 100644 --- a/third_party/proto/ibc/core/channel/v1/channel.proto +++ b/third_party/proto/ibc/core/channel/v1/channel.proto @@ -21,9 +21,12 @@ message Channel { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; // list of connection identifiers, in order, along which packets sent on // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + repeated string connection_hops = 4; // opaque channel version, which is agreed upon during the handshake string version = 5; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 6; } // IdentifiedChannel defines a channel with additional port and channel @@ -39,17 +42,20 @@ message IdentifiedChannel { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; // list of connection identifiers, in order, along which packets sent on // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + repeated string connection_hops = 4; // opaque channel version, which is agreed upon during the handshake string version = 5; // port identifier string port_id = 6; // channel identifier string channel_id = 7; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 8; } // State defines if a channel is in one of the following states: -// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. enum State { option (gogoproto.goproto_enum_prefix) = false; @@ -65,6 +71,10 @@ enum State { // A channel has been closed and can no longer be used to send or receive // packets. STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; + // A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"]; + // A channel has just completed flushing any in-flight packets. + STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"]; } // Order defines if a channel is ORDERED or UNORDERED @@ -85,9 +95,9 @@ message Counterparty { option (gogoproto.goproto_getters) = false; // port on the counterparty chain which owns the other end of the channel. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel end on the counterparty chain - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // Packet defines a type that carries data across different chains through IBC @@ -99,20 +109,19 @@ message Packet { // with a later sequence number. uint64 sequence = 1; // identifies the port on the sending chain. - string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 2; // identifies the channel end on the sending chain. - string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 3; // identifies the port on the receiving chain. - string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; + string destination_port = 4; // identifies the channel end on the receiving chain. - string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; + string destination_channel = 5; // actual opaque bytes transferred directly to the application module bytes data = 6; // block height after which the packet times out - ibc.core.client.v1.Height timeout_height = 7 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + ibc.core.client.v1.Height timeout_height = 7 [(gogoproto.nullable) = false]; // block timestamp (in nanoseconds) after which the packet times out - uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + uint64 timeout_timestamp = 8; } // PacketState defines the generic type necessary to retrieve and store @@ -123,9 +132,9 @@ message PacketState { option (gogoproto.goproto_getters) = false; // channel port identifier. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel unique identifier. - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // packet sequence. uint64 sequence = 3; // embedded data that represents packet state. @@ -139,9 +148,9 @@ message PacketId { option (gogoproto.goproto_getters) = false; // channel port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel unique identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // packet sequence uint64 sequence = 3; } @@ -160,3 +169,19 @@ message Acknowledgement { string error = 22; } } + +// Timeout defines an execution deadline structure for 04-channel handlers. +// This includes packet lifecycle handlers as well as the upgrade handshake handlers. +// A valid Timeout contains either one or both of a timestamp and block height (sequence). +message Timeout { + // block height after which the packet or upgrade times out + ibc.core.client.v1.Height height = 1 [(gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet or upgrade times out + uint64 timestamp = 2; +} + +// Params defines the set of IBC channel parameters. +message Params { + // the relative timeout after which channel upgrades will time out. + Timeout upgrade_timeout = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/ibc/core/channel/v1/genesis.proto b/third_party/proto/ibc/core/channel/v1/genesis.proto index 813e98f36..665b2b156 100644 --- a/third_party/proto/ibc/core/channel/v1/genesis.proto +++ b/third_party/proto/ibc/core/channel/v1/genesis.proto @@ -13,20 +13,18 @@ message GenesisState { repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; - repeated PacketSequence send_sequences = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""]; - repeated PacketSequence recv_sequences = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""]; - repeated PacketSequence ack_sequences = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""]; + repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; + repeated PacketSequence recv_sequences = 6 [(gogoproto.nullable) = false]; + repeated PacketSequence ack_sequences = 7 [(gogoproto.nullable) = false]; // the sequence for the next generated channel identifier - uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""]; + uint64 next_channel_sequence = 8; + Params params = 9 [(gogoproto.nullable) = false]; } // PacketSequence defines the genesis type necessary to retrieve and store // next send and receive sequences. message PacketSequence { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 1; + string channel_id = 2; uint64 sequence = 3; } diff --git a/third_party/proto/ibc/core/channel/v1/query.proto b/third_party/proto/ibc/core/channel/v1/query.proto index 0170a2aac..f89d21273 100644 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ b/third_party/proto/ibc/core/channel/v1/query.proto @@ -10,6 +10,7 @@ import "ibc/core/channel/v1/channel.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/upgrade.proto"; // Query provides defines the gRPC querier service service Query { @@ -98,6 +99,29 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" "ports/{port_id}/next_sequence"; } + + // NextSequenceSend returns the next send sequence for a given channel. + rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence_send"; + } + + // UpgradeError returns the error receipt if the upgrade handshake failed. + rpc UpgradeError(QueryUpgradeErrorRequest) returns (QueryUpgradeErrorResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade_error"; + } + + // Upgrade returns the upgrade for a given port and channel id. + rpc Upgrade(QueryUpgradeRequest) returns (QueryUpgradeResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade"; + } + + // ChannelParams queries all parameters of the ibc channel submodule. + rpc ChannelParams(QueryChannelParamsRequest) returns (QueryChannelParamsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/params"; + } } // QueryChannelRequest is the request type for the Query/Channel RPC method @@ -364,7 +388,7 @@ message QueryNextSequenceReceiveRequest { string channel_id = 2; } -// QuerySequenceResponse is the request type for the +// QuerySequenceResponse is the response type for the // Query/QueryNextSequenceReceiveResponse RPC method message QueryNextSequenceReceiveResponse { // next sequence receive number @@ -374,3 +398,62 @@ message QueryNextSequenceReceiveResponse { // height at which the proof was retrieved ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; } + +// QueryNextSequenceSendRequest is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryNextSequenceSendResponse is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendResponse { + // next sequence send number + uint64 next_sequence_send = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorResponse { + ErrorReceipt error_receipt = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method +message QueryUpgradeRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method +message QueryUpgradeResponse { + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +message QueryChannelParamsRequest {} + +// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +message QueryChannelParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} \ No newline at end of file diff --git a/third_party/proto/ibc/core/channel/v1/tx.proto b/third_party/proto/ibc/core/channel/v1/tx.proto index d0918eaff..3f30e8b8c 100644 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ b/third_party/proto/ibc/core/channel/v1/tx.proto @@ -5,11 +5,15 @@ package ibc.core.channel.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/core/channel/v1/channel.proto"; +import "ibc/core/channel/v1/upgrade.proto"; // Msg defines the ibc/channel Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); @@ -40,6 +44,33 @@ service Msg { // Acknowledgement defines a rpc handler method for MsgAcknowledgement. rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); + + // ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. + rpc ChannelUpgradeInit(MsgChannelUpgradeInit) returns (MsgChannelUpgradeInitResponse); + + // ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. + rpc ChannelUpgradeTry(MsgChannelUpgradeTry) returns (MsgChannelUpgradeTryResponse); + + // ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. + rpc ChannelUpgradeAck(MsgChannelUpgradeAck) returns (MsgChannelUpgradeAckResponse); + + // ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. + rpc ChannelUpgradeConfirm(MsgChannelUpgradeConfirm) returns (MsgChannelUpgradeConfirmResponse); + + // ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. + rpc ChannelUpgradeOpen(MsgChannelUpgradeOpen) returns (MsgChannelUpgradeOpenResponse); + + // ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. + rpc ChannelUpgradeTimeout(MsgChannelUpgradeTimeout) returns (MsgChannelUpgradeTimeoutResponse); + + // ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. + rpc ChannelUpgradeCancel(MsgChannelUpgradeCancel) returns (MsgChannelUpgradeCancelResponse); + + // UpdateChannelParams defines a rpc handler method for MsgUpdateParams. + rpc UpdateChannelParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + rpc PruneAcknowledgements(MsgPruneAcknowledgements) returns (MsgPruneAcknowledgementsResponse); } // ResponseResultType defines the possible outcomes of the execution of a message @@ -52,22 +83,27 @@ enum ResponseResultType { RESPONSE_RESULT_TYPE_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"]; // The message was executed successfully RESPONSE_RESULT_TYPE_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"]; + // The message was executed unsuccessfully + RESPONSE_RESULT_TYPE_FAILURE = 3 [(gogoproto.enumvalue_customname) = "FAILURE"]; } // MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It // is called by a relayer on Chain A. message MsgChannelOpenInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; Channel channel = 2 [(gogoproto.nullable) = false]; string signer = 3; } // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. message MsgChannelOpenInitResponse { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; string version = 2; } @@ -75,41 +111,46 @@ message MsgChannelOpenInitResponse { // on Chain B. The version field within the Channel field has been deprecated. Its // value will be ignored by core IBC. message MsgChannelOpenTry { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. - string previous_channel_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_channel_id\""]; + string previous_channel_id = 2 [deprecated = true]; // NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. Channel channel = 3 [(gogoproto.nullable) = false]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string counterparty_version = 4; + bytes proof_init = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; } // MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. message MsgChannelOpenTryResponse { + option (gogoproto.goproto_getters) = false; + string version = 1; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. +// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +// in the same block as executing this message otherwise the counterparty will +// be incapable of opening. message MsgChannelOpenAck { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string port_id = 1; + string channel_id = 2; + string counterparty_channel_id = 3; + string counterparty_version = 4; + bytes proof_try = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; } // MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. @@ -118,15 +159,15 @@ message MsgChannelOpenAckResponse {} // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. message MsgChannelOpenConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + string port_id = 1; + string channel_id = 2; + bytes proof_ack = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; } // MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response @@ -136,11 +177,12 @@ message MsgChannelOpenConfirmResponse {} // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. message MsgChannelCloseInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 1; + string channel_id = 2; string signer = 3; } @@ -150,15 +192,16 @@ message MsgChannelCloseInitResponse {} // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. message MsgChannelCloseConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + string port_id = 1; + string channel_id = 2; + bytes proof_init = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; + uint64 counterparty_upgrade_sequence = 6; } // MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response @@ -167,14 +210,14 @@ message MsgChannelCloseConfirmResponse {} // MsgRecvPacket receives incoming IBC packet message MsgRecvPacket { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_commitment = 2 [(gogoproto.moretags) = "yaml:\"proof_commitment\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; + bytes proof_commitment = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; } // MsgRecvPacketResponse defines the Msg/RecvPacket response type. @@ -186,15 +229,15 @@ message MsgRecvPacketResponse { // MsgTimeout receives timed-out packet message MsgTimeout { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 5; + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 4; + string signer = 5; } // MsgTimeoutResponse defines the Msg/Timeout response type. @@ -206,16 +249,17 @@ message MsgTimeoutResponse { // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. message MsgTimeoutOnClose { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 6; + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + bytes proof_close = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 5; + string signer = 6; + uint64 counterparty_upgrade_sequence = 7; } // MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. @@ -227,15 +271,15 @@ message MsgTimeoutOnCloseResponse { // MsgAcknowledgement receives incoming IBC acknowledgement message MsgAcknowledgement { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; Packet packet = 1 [(gogoproto.nullable) = false]; bytes acknowledgement = 2; - bytes proof_acked = 3 [(gogoproto.moretags) = "yaml:\"proof_acked\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + bytes proof_acked = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; } // MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. @@ -244,3 +288,182 @@ message MsgAcknowledgementResponse { ResponseResultType result = 1; } + +// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +// WARNING: Initializing a channel upgrade in the same block as opening the channel +// may result in the counterparty being incapable of opening. +message MsgChannelUpgradeInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + UpgradeFields fields = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type +message MsgChannelUpgradeInitResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; +} + +// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +message MsgChannelUpgradeTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + repeated string proposed_upgrade_connection_hops = 3; + UpgradeFields counterparty_upgrade_fields = 4 [(gogoproto.nullable) = false]; + uint64 counterparty_upgrade_sequence = 5; + bytes proof_channel = 6; + bytes proof_upgrade = 7; + ibc.core.client.v1.Height proof_height = 8 [(gogoproto.nullable) = false]; + string signer = 9; +} + +// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type +message MsgChannelUpgradeTryResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; + ResponseResultType result = 3; +} + +// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +message MsgChannelUpgradeAck { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + Upgrade counterparty_upgrade = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + bytes proof_upgrade = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type +message MsgChannelUpgradeAckResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +message MsgChannelUpgradeConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + Upgrade counterparty_upgrade = 4 [(gogoproto.nullable) = false]; + bytes proof_channel = 5; + bytes proof_upgrade = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; + string signer = 8; +} + +// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type +message MsgChannelUpgradeConfirmResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +message MsgChannelUpgradeOpen { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + uint64 counterparty_upgrade_sequence = 4; + bytes proof_channel = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type +message MsgChannelUpgradeOpenResponse {} + +// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +message MsgChannelUpgradeTimeout { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + Channel counterparty_channel = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +message MsgChannelUpgradeTimeoutResponse {} + +// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +message MsgChannelUpgradeCancel { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + ErrorReceipt error_receipt = 3 [(gogoproto.nullable) = false]; + bytes proof_error_receipt = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type +message MsgChannelUpgradeCancelResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + option (gogoproto.goproto_getters) = false; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + + // params defines the channel parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} + +// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgements { + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + uint64 limit = 3; + string signer = 4; +} + +// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgementsResponse { + // Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + uint64 total_pruned_sequences = 1; + // Number of sequences left after pruning. + uint64 total_remaining_sequences = 2; +} diff --git a/third_party/proto/ibc/core/channel/v1/upgrade.proto b/third_party/proto/ibc/core/channel/v1/upgrade.proto new file mode 100644 index 000000000..81530ed2a --- /dev/null +++ b/third_party/proto/ibc/core/channel/v1/upgrade.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Upgrade is a verifiable type which contains the relevant information +// for an attempted upgrade. It provides the proposed changes to the channel +// end, the timeout for this upgrade attempt and the next packet sequence +// which allows the counterparty to efficiently know the highest sequence it has received. +// The next sequence send is used for pruning and upgrading from unordered to ordered channels. +message Upgrade { + option (gogoproto.goproto_getters) = false; + + UpgradeFields fields = 1 [(gogoproto.nullable) = false]; + Timeout timeout = 2 [(gogoproto.nullable) = false]; + uint64 next_sequence_send = 3; +} + +// UpgradeFields are the fields in a channel end which may be changed +// during a channel upgrade. +message UpgradeFields { + option (gogoproto.goproto_getters) = false; + + Order ordering = 1; + repeated string connection_hops = 2; + string version = 3; +} + +// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the +// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the +// next sequence. +message ErrorReceipt { + option (gogoproto.goproto_getters) = false; + + // the channel upgrade sequence + uint64 sequence = 1; + // the error message detailing the cause of failure + string message = 2; +} diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto index b9f6b1ca1..7a09e360a 100644 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ b/third_party/proto/ibc/core/client/v1/client.proto @@ -4,18 +4,18 @@ package ibc.core.client.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; // IdentifiedClientState defines a client state with an additional client // identifier field. message IdentifiedClientState { // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + google.protobuf.Any client_state = 2; } // ConsensusStateWithHeight defines a consensus state with an additional height @@ -24,26 +24,58 @@ message ConsensusStateWithHeight { // consensus state height Height height = 1 [(gogoproto.nullable) = false]; // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + google.protobuf.Any consensus_state = 2; } // ClientConsensusStates defines all the stored consensus states for a given // client. message ClientConsensusStates { // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; +} + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1; + // the height within the given revision + uint64 revision_height = 2; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types which can be created + // and interacted with. If a client type is removed from the allowed clients list, usage + // of this client will be disabled until it is added again to the list. + repeated string allowed_clients = 1; } -// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute // client's latest consensus state is copied over to the subject client. The proposal // handler may fail if the subject and the substitute do not match in client and // chain parameters (with exception to latest height, frozen height, and chain-id). +// +// Deprecated: Please use MsgRecoverClient in favour of this message type. message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.goproto_getters) = false; + // the title of the update proposal string title = 1; // the description of the proposal @@ -57,11 +89,15 @@ message ClientUpdateProposal { // UpgradeProposal is a gov Content type for initiating an IBC breaking // upgrade. +// +// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. message UpgradeProposal { + option deprecated = true; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = true; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; string description = 2; @@ -75,31 +111,3 @@ message UpgradeProposal { // planned chain upgrades google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } - -// Height is a monotonically increasing data type -// that can be compared against another Height for the purposes of updating and -// freezing clients -// -// Normally the RevisionHeight is incremented at each height while keeping -// RevisionNumber the same. However some consensus algorithms may choose to -// reset the height in certain conditions e.g. hard forks, state-machine -// breaking changes In these cases, the RevisionNumber is incremented so that -// height continues to be monitonically increasing even as the RevisionHeight -// gets reset -message Height { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // the revision that the client is currently on - uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""]; - // the height within the given revision - uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""]; -} - -// Params defines the set of IBC light client parameters. -message Params { - // allowed_clients defines the list of allowed client state types which can be created - // and interacted with. If a client type is removed from the allowed clients list, usage - // of this client will be disabled until it is added again to the list. - repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; -} diff --git a/third_party/proto/ibc/core/client/v1/genesis.proto b/third_party/proto/ibc/core/client/v1/genesis.proto deleted file mode 100644 index b09ff1eaf..000000000 --- a/third_party/proto/ibc/core/client/v1/genesis.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; - -import "ibc/core/client/v1/client.proto"; -import "gogoproto/gogo.proto"; - -// GenesisState defines the ibc client submodule's genesis state. -message GenesisState { - // client states with their corresponding identifiers - repeated IdentifiedClientState clients = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; - // consensus states from each client - repeated ClientConsensusStates clients_consensus = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "ClientsConsensusStates", - (gogoproto.moretags) = "yaml:\"clients_consensus\"" - ]; - // metadata from each client - repeated IdentifiedGenesisMetadata clients_metadata = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"clients_metadata\""]; - Params params = 4 [(gogoproto.nullable) = false]; - // create localhost on initialization - bool create_localhost = 5 [(gogoproto.moretags) = "yaml:\"create_localhost\""]; - // the sequence for the next generated client identifier - uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""]; -} - -// GenesisMetadata defines the genesis type for metadata that clients may return -// with ExportMetadata -message GenesisMetadata { - option (gogoproto.goproto_getters) = false; - - // store key of metadata without clientID-prefix - bytes key = 1; - // metadata value - bytes value = 2; -} - -// IdentifiedGenesisMetadata has the client metadata with the corresponding -// client id. -message IdentifiedGenesisMetadata { - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - repeated GenesisMetadata client_metadata = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_metadata\""]; -} diff --git a/third_party/proto/ibc/core/client/v1/query.proto b/third_party/proto/ibc/core/client/v1/query.proto deleted file mode 100644 index 0032306ec..000000000 --- a/third_party/proto/ibc/core/client/v1/query.proto +++ /dev/null @@ -1,207 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/client/v1/client.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "gogoproto/gogo.proto"; - -// Query provides defines the gRPC querier service -service Query { - // ClientState queries an IBC light client. - rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}"; - } - - // ClientStates queries all the IBC light clients of a chain. - rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_states"; - } - - // ConsensusState queries a consensus state associated with a client state at - // a given height. - rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/" - "{client_id}/revision/{revision_number}/" - "height/{revision_height}"; - } - - // ConsensusStates queries all the consensus state associated with a given - // client. - rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}"; - } - - // ConsensusStateHeights queries the height of every consensus states associated with a given client. - rpc ConsensusStateHeights(QueryConsensusStateHeightsRequest) returns (QueryConsensusStateHeightsResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}/heights"; - } - - // Status queries the status of an IBC client. - rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}"; - } - - // ClientParams queries all parameters of the ibc client submodule. - rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { - option (google.api.http).get = "/ibc/core/client/v1/params"; - } - - // UpgradedClientState queries an Upgraded IBC light client. - rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states"; - } - - // UpgradedConsensusState queries an Upgraded IBC consensus state. - rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states"; - } -} - -// QueryClientStateRequest is the request type for the Query/ClientState RPC -// method -message QueryClientStateRequest { - // client state unique identifier - string client_id = 1; -} - -// QueryClientStateResponse is the response type for the Query/ClientState RPC -// method. Besides the client state, it includes a proof and the height from -// which the proof was retrieved. -message QueryClientStateResponse { - // client state associated with the request identifier - google.protobuf.Any client_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryClientStatesRequest is the request type for the Query/ClientStates RPC -// method -message QueryClientStatesRequest { - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryClientStatesResponse is the response type for the Query/ClientStates RPC -// method. -message QueryClientStatesResponse { - // list of stored ClientStates of the chain. - repeated IdentifiedClientState client_states = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryConsensusStateRequest is the request type for the Query/ConsensusState -// RPC method. Besides the consensus state, it includes a proof and the height -// from which the proof was retrieved. -message QueryConsensusStateRequest { - // client identifier - string client_id = 1; - // consensus state revision number - uint64 revision_number = 2; - // consensus state revision height - uint64 revision_height = 3; - // latest_height overrrides the height field and queries the latest stored - // ConsensusState - bool latest_height = 4; -} - -// QueryConsensusStateResponse is the response type for the Query/ConsensusState -// RPC method -message QueryConsensusStateResponse { - // consensus state associated with the client identifier at the given height - google.protobuf.Any consensus_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -// RPC method. -message QueryConsensusStatesRequest { - // client identifier - string client_id = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConsensusStatesResponse is the response type for the -// Query/ConsensusStates RPC method -message QueryConsensusStatesResponse { - // consensus states associated with the identifier - repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights -// RPC method. -message QueryConsensusStateHeightsRequest { - // client identifier - string client_id = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConsensusStateHeightsResponse is the response type for the -// Query/ConsensusStateHeights RPC method -message QueryConsensusStateHeightsResponse { - // consensus state heights - repeated Height consensus_state_heights = 1 [(gogoproto.nullable) = false]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC -// method -message QueryClientStatusRequest { - // client unique identifier - string client_id = 1; -} - -// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC -// method. It returns the current status of the IBC client. -message QueryClientStatusResponse { - string status = 1; -} - -// QueryClientParamsRequest is the request type for the Query/ClientParams RPC -// method. -message QueryClientParamsRequest {} - -// QueryClientParamsResponse is the response type for the Query/ClientParams RPC -// method. -message QueryClientParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} - -// QueryUpgradedClientStateRequest is the request type for the -// Query/UpgradedClientState RPC method -message QueryUpgradedClientStateRequest {} - -// QueryUpgradedClientStateResponse is the response type for the -// Query/UpgradedClientState RPC method. -message QueryUpgradedClientStateResponse { - // client state associated with the request identifier - google.protobuf.Any upgraded_client_state = 1; -} - -// QueryUpgradedConsensusStateRequest is the request type for the -// Query/UpgradedConsensusState RPC method -message QueryUpgradedConsensusStateRequest {} - -// QueryUpgradedConsensusStateResponse is the response type for the -// Query/UpgradedConsensusState RPC method. -message QueryUpgradedConsensusStateResponse { - // Consensus state associated with the request identifier - google.protobuf.Any upgraded_consensus_state = 1; -} diff --git a/third_party/proto/ibc/core/client/v1/tx.proto b/third_party/proto/ibc/core/client/v1/tx.proto deleted file mode 100644 index 752718c11..000000000 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ /dev/null @@ -1,100 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// Msg defines the ibc/client Msg service. -service Msg { - // CreateClient defines a rpc handler method for MsgCreateClient. - rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); - - // UpdateClient defines a rpc handler method for MsgUpdateClient. - rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); - - // UpgradeClient defines a rpc handler method for MsgUpgradeClient. - rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); - - // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); -} - -// MsgCreateClient defines a message to create an IBC client -message MsgCreateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // light client state - google.protobuf.Any client_state = 1 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // consensus state associated with the client that corresponds to a given - // height. - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // signer address - string signer = 3; -} - -// MsgCreateClientResponse defines the Msg/CreateClient response type. -message MsgCreateClientResponse {} - -// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given client message. -message MsgUpdateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // client message to update the light client - google.protobuf.Any client_message = 2; - // signer address - string signer = 3; -} - -// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -message MsgUpdateClientResponse {} - -// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client -// state -message MsgUpgradeClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // upgraded client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // upgraded consensus state, only contains enough information to serve as a - // basis of trust in update logic - google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // proof that old chain committed to new client - bytes proof_upgrade_client = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade_client\""]; - // proof that old chain committed to new consensus state - bytes proof_upgrade_consensus_state = 5 [(gogoproto.moretags) = "yaml:\"proof_upgrade_consensus_state\""]; - // signer address - string signer = 6; -} - -// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -message MsgUpgradeClientResponse {} - -// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -// light client misbehaviour. -// Warning: DEPRECATED -message MsgSubmitMisbehaviour { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\"", deprecated = true]; - // misbehaviour used for freezing the light client - google.protobuf.Any misbehaviour = 2 [deprecated = true]; - // signer address - string signer = 3 [deprecated = true]; -} - -// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -// type. -message MsgSubmitMisbehaviourResponse {} diff --git a/third_party/proto/ibc/core/commitment/v1/commitment.proto b/third_party/proto/ibc/core/commitment/v1/commitment.proto deleted file mode 100644 index 60abc5d1c..000000000 --- a/third_party/proto/ibc/core/commitment/v1/commitment.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -package ibc.core.commitment.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/ics23/v1/proofs.proto"; - -// MerkleRoot defines a merkle root hash. -// In the Cosmos SDK, the AppHash of a block header becomes the root. -message MerkleRoot { - option (gogoproto.goproto_getters) = false; - - bytes hash = 1; -} - -// MerklePrefix is merkle path prefixed to the key. -// The constructed key from the Path and the key will be append(Path.KeyPath, -// append(Path.KeyPrefix, key...)) -message MerklePrefix { - bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""]; -} - -// MerklePath is the path used to verify commitment proofs, which can be an -// arbitrary structured object (defined by a commitment type). -// MerklePath is represented from root-to-leaf -message MerklePath { - option (gogoproto.goproto_stringer) = false; - - repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""]; -} - -// MerkleProof is a wrapper type over a chain of CommitmentProofs. -// It demonstrates membership or non-membership for an element or set of -// elements, verifiable in conjunction with a known commitment root. Proofs -// should be succinct. -// MerkleProofs are ordered from leaf-to-root -message MerkleProof { - repeated cosmos.ics23.v1.CommitmentProof proofs = 1; -} diff --git a/third_party/proto/ibc/core/connection/v1/connection.proto b/third_party/proto/ibc/core/connection/v1/connection.proto index 2cec817a0..852f3999b 100644 --- a/third_party/proto/ibc/core/connection/v1/connection.proto +++ b/third_party/proto/ibc/core/connection/v1/connection.proto @@ -17,7 +17,7 @@ import "ibc/core/commitment/v1/commitment.proto"; message ConnectionEnd { option (gogoproto.goproto_getters) = false; // client associated with this connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // IBC version which can be utilised to determine encodings or protocols for // channels or packets utilising this connection. repeated Version versions = 2; @@ -28,7 +28,7 @@ message ConnectionEnd { // delay period that must pass before a consensus state can be used for // packet-verification NOTE: delay period logic is only implemented by some // clients. - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 5; } // IdentifiedConnection defines a connection with additional connection @@ -36,9 +36,9 @@ message ConnectionEnd { message IdentifiedConnection { option (gogoproto.goproto_getters) = false; // connection identifier. - string id = 1 [(gogoproto.moretags) = "yaml:\"id\""]; + string id = 1; // client associated with this connection. - string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 2; // IBC version which can be utilised to determine encodings or protocols for // channels or packets utilising this connection repeated Version versions = 3; @@ -47,7 +47,7 @@ message IdentifiedConnection { // counterparty chain associated with this connection. Counterparty counterparty = 5 [(gogoproto.nullable) = false]; // delay period associated with this connection. - uint64 delay_period = 6 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 6; } // State defines if a connection is in one of the following states: @@ -72,10 +72,10 @@ message Counterparty { // identifies the client on the counterparty chain associated with a given // connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // identifies the connection end on the counterparty chain associated with a // given connection. - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 2; // commitment merkle prefix of the counterparty chain. ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; } @@ -89,7 +89,7 @@ message ClientPaths { // ConnectionPaths define all the connection paths for a given client state. message ConnectionPaths { // client state unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // list of connection paths repeated string paths = 2; } @@ -110,5 +110,5 @@ message Params { // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the // largest amount of time that the chain might reasonably take to produce the next block under normal operating // conditions. A safe choice is 3-5x the expected time per block. - uint64 max_expected_time_per_block = 1 [(gogoproto.moretags) = "yaml:\"max_expected_time_per_block\""]; + uint64 max_expected_time_per_block = 1; } diff --git a/third_party/proto/ibc/core/connection/v1/genesis.proto b/third_party/proto/ibc/core/connection/v1/genesis.proto index 830bbe138..a5eb6b3a1 100644 --- a/third_party/proto/ibc/core/connection/v1/genesis.proto +++ b/third_party/proto/ibc/core/connection/v1/genesis.proto @@ -10,9 +10,8 @@ import "ibc/core/connection/v1/connection.proto"; // GenesisState defines the ibc connection submodule's genesis state. message GenesisState { repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false]; - repeated ConnectionPaths client_connection_paths = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_connection_paths\""]; + repeated ConnectionPaths client_connection_paths = 2 [(gogoproto.nullable) = false]; // the sequence for the next generated connection identifier - uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""]; + uint64 next_connection_sequence = 3; Params params = 4 [(gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/core/connection/v1/query.proto b/third_party/proto/ibc/core/connection/v1/query.proto index d1e120c92..c0f1a6f57 100644 --- a/third_party/proto/ibc/core/connection/v1/query.proto +++ b/third_party/proto/ibc/core/connection/v1/query.proto @@ -106,7 +106,7 @@ message QueryClientConnectionsResponse { // Query/ConnectionClientState RPC method message QueryConnectionClientStateRequest { // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; } // QueryConnectionClientStateResponse is the response type for the @@ -124,7 +124,7 @@ message QueryConnectionClientStateResponse { // Query/ConnectionConsensusState RPC method message QueryConnectionConsensusStateRequest { // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; uint64 revision_number = 2; uint64 revision_height = 3; } diff --git a/third_party/proto/ibc/core/connection/v1/tx.proto b/third_party/proto/ibc/core/connection/v1/tx.proto index d2ef2b914..3ba8ff456 100644 --- a/third_party/proto/ibc/core/connection/v1/tx.proto +++ b/third_party/proto/ibc/core/connection/v1/tx.proto @@ -5,12 +5,15 @@ package ibc.core.connection.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "google/protobuf/any.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/core/connection/v1/connection.proto"; // Msg defines the ibc/connection Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); @@ -23,18 +26,23 @@ service Msg { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); + + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + rpc UpdateConnectionParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgConnectionOpenInit defines the msg sent by an account on Chain A to // initialize a connection with Chain B. message MsgConnectionOpenInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; Counterparty counterparty = 2 [(gogoproto.nullable) = false]; Version version = 3; - uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 4; string signer = 5; } @@ -45,28 +53,27 @@ message MsgConnectionOpenInitResponse {} // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. message MsgConnectionOpenTry { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. - string previous_connection_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_connection_id\""]; - google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""]; - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; - repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; - ibc.core.client.v1.Height proof_height = 7 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string previous_connection_id = 2 [deprecated = true]; + google.protobuf.Any client_state = 3; + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + uint64 delay_period = 5; + repeated Version counterparty_versions = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain A: `UNITIALIZED -> // INIT` - bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + bytes proof_init = 8; // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 9; // proof of client consensus state - bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 11 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 12; + bytes proof_consensus = 10; + ibc.core.client.v1.Height consensus_height = 11 [(gogoproto.nullable) = false]; + string signer = 12; // optional proof data for host state machines that are unable to introspect their own consensus state bytes host_consensus_state_proof = 13; } @@ -77,25 +84,24 @@ message MsgConnectionOpenTryResponse {} // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. message MsgConnectionOpenAck { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; - Version version = 3; - google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; - ibc.core.client.v1.Height proof_height = 5 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string connection_id = 1; + string counterparty_connection_id = 2; + Version version = 3; + google.protobuf.Any client_state = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain B: `UNITIALIZED -> // TRYOPEN` - bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + bytes proof_try = 6; // proof of client state included in message - bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 7; // proof of client consensus state - bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 9 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 10; + bytes proof_consensus = 8; + ibc.core.client.v1.Height consensus_height = 9 [(gogoproto.nullable) = false]; + string signer = 10; // optional proof data for host state machines that are unable to introspect their own consensus state bytes host_consensus_state_proof = 11; } @@ -106,17 +112,35 @@ message MsgConnectionOpenAckResponse {} // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. message MsgConnectionOpenConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; // proof for the change of the connection state on Chain A: `INIT -> OPEN` - bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; + bytes proof_ack = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; } // MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm // response type. message MsgConnectionOpenConfirmResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/third_party/proto/ibc/core/types/v1/genesis.proto b/third_party/proto/ibc/core/types/v1/genesis.proto index 51c227916..4b34f6889 100644 --- a/third_party/proto/ibc/core/types/v1/genesis.proto +++ b/third_party/proto/ibc/core/types/v1/genesis.proto @@ -12,12 +12,9 @@ import "ibc/core/channel/v1/genesis.proto"; // GenesisState defines the ibc module's genesis state. message GenesisState { // ICS002 - Clients genesis state - ibc.core.client.v1.GenesisState client_genesis = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_genesis\""]; + ibc.core.client.v1.GenesisState client_genesis = 1 [(gogoproto.nullable) = false]; // ICS003 - Connections genesis state - ibc.core.connection.v1.GenesisState connection_genesis = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""]; + ibc.core.connection.v1.GenesisState connection_genesis = 2 [(gogoproto.nullable) = false]; // ICS004 - Channel genesis state - ibc.core.channel.v1.GenesisState channel_genesis = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""]; + ibc.core.channel.v1.GenesisState channel_genesis = 3 [(gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto b/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto deleted file mode 100644 index 635db8521..000000000 --- a/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.localhost.v2; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost;localhost"; - -import "ibc/core/client/v1/client.proto"; -import "gogoproto/gogo.proto"; - -// ClientState defines the 09-localhost client state -message ClientState { - option (gogoproto.goproto_getters) = false; - - // the latest block height - ibc.core.client.v1.Height latest_height = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto deleted file mode 100644 index fb2f076a4..000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ /dev/null @@ -1,189 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v2; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7"; - -import "ibc/core/connection/v1/connection.proto"; -import "ibc/core/channel/v1/channel.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// ClientState defines a solo machine client that tracks the current consensus -// state and if the client is frozen. -message ClientState { - option (gogoproto.goproto_getters) = false; - // latest sequence of the client state - uint64 sequence = 1; - // frozen sequence of the solo machine - bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // when set to true, will allow governance to update a solo machine client. - // The client will be unfrozen if it is frozen. - bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; -} - -// ConsensusState defines a solo machine consensus state. The sequence of a -// consensus state is contained in the "height" key used in storing the -// consensus state. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; - // diversifier allows the same public key to be re-used across different solo - // machine clients (potentially on different chains) without being considered - // misbehaviour. - string diversifier = 2; - uint64 timestamp = 3; -} - -// Header defines a solo machine consensus header -message Header { - option (gogoproto.goproto_getters) = false; - // sequence to update solo machine public key at - uint64 sequence = 1; - uint64 timestamp = 2; - bytes signature = 3; - google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// Misbehaviour defines misbehaviour for a solo machine which consists -// of a sequence and two signatures over different messages at that sequence. -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; -} - -// SignatureAndData contains a signature and the data signed over to create that -// signature. -message SignatureAndData { - option (gogoproto.goproto_getters) = false; - bytes signature = 1; - DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; - bytes data = 3; - uint64 timestamp = 4; -} - -// TimestampedSignatureData contains the signature data and the timestamp of the -// signature. -message TimestampedSignatureData { - option (gogoproto.goproto_getters) = false; - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; - uint64 timestamp = 2; -} - -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - uint64 timestamp = 2; - string diversifier = 3; - // type of the data used - DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; - // marshaled data - bytes data = 5; -} - -// DataType defines the type of solo machine proof being created. This is done -// to preserve uniqueness of different data sign byte encodings. -enum DataType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Data type for client state verification - DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; - // Data type for consensus state verification - DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; - // Data type for connection state verification - DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; - // Data type for channel state verification - DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; - // Data type for packet commitment verification - DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; - // Data type for packet acknowledgement verification - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; - // Data type for packet receipt absence verification - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; - // Data type for next sequence recv verification - DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; - // Data type for header verification - DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; -} - -// HeaderData returns the SignBytes data for update verification. -message HeaderData { - option (gogoproto.goproto_getters) = false; - - // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; - // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// ClientStateData returns the SignBytes data for client state verification. -message ClientStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateData returns the SignBytes data for consensus state -// verification. -message ConsensusStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConnectionStateData returns the SignBytes data for connection state -// verification. -message ConnectionStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.connection.v1.ConnectionEnd connection = 2; -} - -// ChannelStateData returns the SignBytes data for channel state -// verification. -message ChannelStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.channel.v1.Channel channel = 2; -} - -// PacketCommitmentData returns the SignBytes data for packet commitment -// verification. -message PacketCommitmentData { - bytes path = 1; - bytes commitment = 2; -} - -// PacketAcknowledgementData returns the SignBytes data for acknowledgement -// verification. -message PacketAcknowledgementData { - bytes path = 1; - bytes acknowledgement = 2; -} - -// PacketReceiptAbsenceData returns the SignBytes data for -// packet receipt absence verification. -message PacketReceiptAbsenceData { - bytes path = 1; -} - -// NextSequenceRecvData returns the SignBytes data for verification of the next -// sequence to be received. -message NextSequenceRecvData { - bytes path = 1; - uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto deleted file mode 100644 index 38f9328c7..000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v3; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine;solomachine"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// ClientState defines a solo machine client that tracks the current consensus -// state and if the client is frozen. -message ClientState { - option (gogoproto.goproto_getters) = false; - // latest sequence of the client state - uint64 sequence = 1; - // frozen sequence of the solo machine - bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConsensusState defines a solo machine consensus state. The sequence of a -// consensus state is contained in the "height" key used in storing the -// consensus state. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; - // diversifier allows the same public key to be re-used across different solo - // machine clients (potentially on different chains) without being considered - // misbehaviour. - string diversifier = 2; - uint64 timestamp = 3; -} - -// Header defines a solo machine consensus header -message Header { - option (gogoproto.goproto_getters) = false; - - uint64 timestamp = 1; - bytes signature = 2; - google.protobuf.Any new_public_key = 3 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 4 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// Misbehaviour defines misbehaviour for a solo machine which consists -// of a sequence and two signatures over different messages at that sequence. -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - SignatureAndData signature_one = 2 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 3 [(gogoproto.moretags) = "yaml:\"signature_two\""]; -} - -// SignatureAndData contains a signature and the data signed over to create that -// signature. -message SignatureAndData { - option (gogoproto.goproto_getters) = false; - - bytes signature = 1; - bytes path = 2; - bytes data = 3; - uint64 timestamp = 4; -} - -// TimestampedSignatureData contains the signature data and the timestamp of the -// signature. -message TimestampedSignatureData { - option (gogoproto.goproto_getters) = false; - - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; - uint64 timestamp = 2; -} - -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - // the sequence number - uint64 sequence = 1; - // the proof timestamp - uint64 timestamp = 2; - // the public key diversifier - string diversifier = 3; - // the standardised path bytes - bytes path = 4; - // the marshaled data bytes - bytes data = 5; -} - -// HeaderData returns the SignBytes data for update verification. -message HeaderData { - option (gogoproto.goproto_getters) = false; - - // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; - // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} diff --git a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto deleted file mode 100644 index bb21775dc..000000000 --- a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.tendermint.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint;tendermint"; - -import "tendermint/types/validator.proto"; -import "tendermint/types/types.proto"; -import "cosmos/ics23/v1/proofs.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/commitment/v1/commitment.proto"; -import "gogoproto/gogo.proto"; - -// ClientState from Tendermint tracks the current validator set, latest height, -// and a possible frozen height. -message ClientState { - option (gogoproto.goproto_getters) = false; - - string chain_id = 1; - Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""]; - // duration of the period since the LastestTimestamp during which the - // submitted headers are valid for upgrade - google.protobuf.Duration trusting_period = 3 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""]; - // duration of the staking unbonding period - google.protobuf.Duration unbonding_period = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"unbonding_period\"" - ]; - // defines how much new (untrusted) header's Time can drift into the future. - google.protobuf.Duration max_clock_drift = 5 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""]; - // Block height when the client was frozen due to a misbehaviour - ibc.core.client.v1.Height frozen_height = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""]; - // Latest height the client was updated to - ibc.core.client.v1.Height latest_height = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""]; - - // Proof specifications used in verifying counterparty state - repeated cosmos.ics23.v1.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; - - // Path at which next upgraded client will be committed. - // Each element corresponds to the key for a single CommitmentProof in the - // chained proof. NOTE: ClientState must stored under - // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored - // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using - // the default upgrade module, upgrade_path should be []string{"upgrade", - // "upgradedIBCState"}` - repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""]; - - // allow_update_after_expiry is deprecated - bool allow_update_after_expiry = 10 [deprecated = true, (gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""]; - // allow_update_after_misbehaviour is deprecated - bool allow_update_after_misbehaviour = 11 - [deprecated = true, (gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""]; -} - -// ConsensusState defines the consensus state from Tendermint. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - - // timestamp that corresponds to the block height in which the ConsensusState - // was stored. - google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - // commitment root (i.e app hash) - ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; - bytes next_validators_hash = 3 [ - (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes", - (gogoproto.moretags) = "yaml:\"next_validators_hash\"" - ]; -} - -// Misbehaviour is a wrapper over two conflicting Headers -// that implements Misbehaviour interface expected by ICS-02 -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - - // ClientID is deprecated - string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; - Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""]; - Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""]; -} - -// Header defines the Tendermint client consensus Header. -// It encapsulates all the information necessary to update from a trusted -// Tendermint ConsensusState. The inclusion of TrustedHeight and -// TrustedValidators allows this update to process correctly, so long as the -// ConsensusState for the TrustedHeight exists, this removes race conditions -// among relayers The SignedHeader and ValidatorSet are the new untrusted update -// fields for the client. The TrustedHeight is the height of a stored -// ConsensusState on the client that will be used to verify the new untrusted -// header. The Trusted ConsensusState must be within the unbonding period of -// current time in order to correctly verify, and the TrustedValidators must -// hash to TrustedConsensusState.NextValidatorsHash since that is the last -// trusted validator set at the TrustedHeight. -message Header { - .tendermint.types.SignedHeader signed_header = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""]; - - .tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""]; - ibc.core.client.v1.Height trusted_height = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""]; - .tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""]; -} - -// Fraction defines the protobuf message type for tmmath.Fraction that only -// supports positive values. -message Fraction { - uint64 numerator = 1; - uint64 denominator = 2; -} diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index da2822237..8d6e2d0f4 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -77,6 +77,7 @@ type RegisterInterchainAccount struct { ConnectionId string `json:"connection_id"` InterchainAccountId string `json:"interchain_account_id"` RegisterFee sdk.Coins `json:"register_fee,omitempty"` + Ordering string `json:"ordering,omitempty"` } // RegisterInterchainAccountResponse holds response for RegisterInterchainAccount. diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index bcdd0144b..1c1de935c 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -7,6 +7,8 @@ import ( "strings" "time" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "github.com/cosmos/gogoproto/proto" "golang.org/x/exp/maps" @@ -857,11 +859,25 @@ func (m *CustomMessenger) registerInterchainAccount(ctx sdk.Context, contractAdd } func (m *CustomMessenger) performRegisterInterchainAccount(ctx sdk.Context, contractAddr sdk.AccAddress, reg *bindings.RegisterInterchainAccount) (*ictxtypes.MsgRegisterInterchainAccountResponse, error) { + // parse incoming ordering. If nothing passed, use ORDERED by default + var orderValue channeltypes.Order + if reg.Ordering == "" { + orderValue = channeltypes.ORDERED + } else { + orderValueInt, ok := channeltypes.Order_value[reg.Ordering] + + if !ok { + return nil, fmt.Errorf("failed to register interchain account: incorrect order value passed: %s", reg.Ordering) + } + orderValue = channeltypes.Order(orderValueInt) + } + msg := ictxtypes.MsgRegisterInterchainAccount{ FromAddress: contractAddr.String(), ConnectionId: reg.ConnectionId, InterchainAccountId: reg.InterchainAccountId, RegisterFee: getRegisterFee(reg.RegisterFee), + Ordering: orderValue, } response, err := m.Ictxmsgserver.RegisterInterchainAccount(ctx, &msg) diff --git a/wasmbinding/test/custom_message_test.go b/wasmbinding/test/custom_message_test.go index 459c56286..958be7831 100644 --- a/wasmbinding/test/custom_message_test.go +++ b/wasmbinding/test/custom_message_test.go @@ -5,6 +5,8 @@ import ( "fmt" "testing" + contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "cosmossdk.io/math" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" admintypes "github.com/cosmos/admin-module/v2/x/adminmodule/types" @@ -105,13 +107,23 @@ func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { } bankKeeper := suite.neutron.BankKeeper + channelKeeper := suite.neutron.IBCKeeper.ChannelKeeper senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) suite.NoError(err) // Dispatch RegisterInterchainAccount message - _, err = suite.executeNeutronMsg(suite.contractAddress, msg) + data, err := suite.executeNeutronMsg(suite.contractAddress, msg) + suite.NoError(err) + suite.NotEmpty(data) + + // default method should be ordered + var response ictxtypes.MsgRegisterInterchainAccountResponse + err = response.Unmarshal(data) suite.NoError(err) + channel, found := channelKeeper.GetChannel(suite.ctx, response.PortId, response.ChannelId) + suite.True(found) + suite.Equal(channel.Ordering, ibcchanneltypes.ORDERED) } func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { @@ -133,6 +145,43 @@ func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) } +func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountUnordered() { + err := suite.neutron.FeeBurnerKeeper.SetParams(suite.ctx, feeburnertypes.Params{ + NeutronDenom: "untrn", + TreasuryAddress: "neutron13jrwrtsyjjuynlug65r76r2zvfw5xjcq6532h2", + }) + suite.Require().NoError(err) + + // Craft RegisterInterchainAccount message + msg := bindings.NeutronMsg{ + RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ + ConnectionId: suite.Path.EndpointA.ConnectionID, + InterchainAccountId: testutil.TestInterchainID, + RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))), + Ordering: ibcchanneltypes.Order_name[int32(ibcchanneltypes.UNORDERED)], + }, + } + + bankKeeper := suite.neutron.BankKeeper + channelKeeper := suite.neutron.IBCKeeper.ChannelKeeper + senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() + err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) + suite.NoError(err) + + // Dispatch RegisterInterchainAccount message + data, err := suite.executeNeutronMsg(suite.contractAddress, msg) + suite.NoError(err) + suite.NotEmpty(data) + + // default method should be ordered + var response ictxtypes.MsgRegisterInterchainAccountResponse + err = response.Unmarshal(data) + suite.NoError(err) + channel, found := channelKeeper.GetChannel(suite.ctx, response.PortId, response.ChannelId) + suite.True(found) + suite.Equal(channel.Ordering, ibcchanneltypes.UNORDERED) +} + func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) suite.Require().NoError(err) @@ -499,7 +548,7 @@ func (suite *CustomMessengerTestSuite) TestSubmitTx() { suite.NoError(err) var response ictxtypes.MsgSubmitTxResponse - err = json.Unmarshal(data, &response) + err = response.Unmarshal(data) suite.NoError(err) suite.Equal(uint64(1), response.SequenceId) suite.Equal("channel-2", response.Channel) @@ -550,11 +599,10 @@ func (suite *CustomMessengerTestSuite) TestSoftwareUpgradeProposal() { data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err := json.Marshal(&admintypes.MsgSubmitProposalResponse{ - ProposalId: 1, - }) + var expected admintypes.MsgSubmitProposalResponse + err = expected.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected.ProposalId, uint64(1)) // Test with other proposer that is not admin should return failure _, err = suite.executeNeutronMsg(anotherContract, msg) @@ -579,11 +627,10 @@ func (suite *CustomMessengerTestSuite) TestSoftwareUpgradeProposal() { data, err = suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err = json.Marshal(&admintypes.MsgSubmitProposalResponse{ - ProposalId: 2, - }) + var expected2 admintypes.MsgSubmitProposalResponse + err = expected2.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected2.ProposalId, uint64(2)) } func (suite *CustomMessengerTestSuite) TestTooMuchProposals() { @@ -667,9 +714,10 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) + var expected contractmanagertypes.Failure + err = expected.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected.Id, failureID) } func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { @@ -691,9 +739,10 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) + var expected contractmanagertypes.Failure + err = expected.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected.Id, failureID) } func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { diff --git a/wasmbinding/testdata/reflect.wasm b/wasmbinding/testdata/reflect.wasm index 174232f4b..808c6572b 100644 Binary files a/wasmbinding/testdata/reflect.wasm and b/wasmbinding/testdata/reflect.wasm differ diff --git a/x/interchainqueries/keeper/migrations.go b/x/interchainqueries/keeper/migrations.go new file mode 100644 index 000000000..a036ea33e --- /dev/null +++ b/x/interchainqueries/keeper/migrations.go @@ -0,0 +1,25 @@ +package keeper + +import ( + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + v3 "github.com/neutron-org/neutron/v4/x/interchainqueries/migrations/v3" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey +} + +// NewMigrator returns a new Migrator. +func NewMigrator(cdc codec.BinaryCodec, storeKey storetypes.StoreKey) Migrator { + return Migrator{storeKey: storeKey, cdc: cdc} +} + +// Migrate2to3 migrates from version 2 to 3. +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + return v3.MigrateParams(ctx, m.cdc, m.storeKey) +} diff --git a/x/interchainqueries/keeper/msg_server.go b/x/interchainqueries/keeper/msg_server.go index 57dc93f46..5b3cc345a 100644 --- a/x/interchainqueries/keeper/msg_server.go +++ b/x/interchainqueries/keeper/msg_server.go @@ -35,14 +35,14 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { func (m msgServer) RegisterInterchainQuery(goCtx context.Context, msg *types.MsgRegisterInterchainQuery) (*types.MsgRegisterInterchainQueryResponse, error) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), LabelRegisterInterchainQuery) + ctx := sdk.UnwrapSDKContext(goCtx) + ctx.Logger().Debug("RegisterInterchainQuery", "msg", msg) + params := m.GetParams(ctx) - if err := msg.Validate(); err != nil { + if err := msg.Validate(params); err != nil { return nil, errors.Wrap(err, "failed to validate MsgRegisterInterchainQuery") } - ctx := sdk.UnwrapSDKContext(goCtx) - ctx.Logger().Debug("RegisterInterchainQuery", "msg", msg) - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { m.Logger(ctx).Debug("RegisterInterchainQuery: failed to parse sender address", "sender_address", msg.Sender) @@ -62,8 +62,6 @@ func (m msgServer) RegisterInterchainQuery(goCtx context.Context, msg *types.Msg lastID := m.GetLastRegisteredQueryKey(ctx) lastID++ - params := m.GetParams(ctx) - registeredQuery := &types.RegisteredQuery{ Id: lastID, Owner: msg.Sender, @@ -122,12 +120,13 @@ func (m msgServer) RemoveInterchainQuery(goCtx context.Context, msg *types.MsgRe } func (m msgServer) UpdateInterchainQuery(goCtx context.Context, msg *types.MsgUpdateInterchainQueryRequest) (*types.MsgUpdateInterchainQueryResponse, error) { - if err := msg.Validate(); err != nil { - return nil, errors.Wrap(err, "failed to validate MsgUpdateInterchainQueryRequest") - } - ctx := sdk.UnwrapSDKContext(goCtx) ctx.Logger().Debug("UpdateInterchainQuery", "msg", msg) + params := m.GetParams(ctx) + + if err := msg.Validate(params); err != nil { + return nil, errors.Wrap(err, "failed to validate MsgUpdateInterchainQueryRequest") + } query, err := m.GetQueryByID(ctx, msg.GetQueryId()) if err != nil { diff --git a/x/interchainqueries/keeper/msg_server_test.go b/x/interchainqueries/keeper/msg_server_test.go index 0471a360d..ce8f9fe60 100644 --- a/x/interchainqueries/keeper/msg_server_test.go +++ b/x/interchainqueries/keeper/msg_server_test.go @@ -99,7 +99,7 @@ func TestMsgRegisterInterchainQueryValidate(t *testing.T) { "too many keys", types.MsgRegisterInterchainQuery{ QueryType: string(types.InterchainQueryTypeKV), - Keys: make([]*types.KVKey, types.MaxKVQueryKeysCount+1), + Keys: make([]*types.KVKey, types.DefaultMaxKvQueryKeysCount+1), TransactionsFilter: "[]", ConnectionId: "connection-0", UpdatePeriod: 1, @@ -394,7 +394,7 @@ func TestMsgUpdateInterchainQueryRequestValidate(t *testing.T) { "too many keys", types.MsgUpdateInterchainQueryRequest{ QueryId: 1, - NewKeys: make([]*types.KVKey, types.MaxKVQueryKeysCount+1), + NewKeys: make([]*types.KVKey, types.DefaultMaxKvQueryKeysCount+1), NewUpdatePeriod: 0, Sender: testutil.TestOwnerAddress, }, diff --git a/x/interchainqueries/migrations/v3/migration.go b/x/interchainqueries/migrations/v3/migration.go new file mode 100644 index 000000000..a77e4bed8 --- /dev/null +++ b/x/interchainqueries/migrations/v3/migration.go @@ -0,0 +1,28 @@ +package v3 + +import ( + "fmt" + + store "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v4/x/interchainqueries/types" +) + +func MigrateParams(ctx sdk.Context, cdc codec.BinaryCodec, storeKey store.StoreKey) error { + var params types.Params + st := ctx.KVStore(storeKey) + bz := st.Get(types.ParamsKey) + if bz == nil { + return fmt.Errorf("no params stored in %s", types.ParamsKey) + } + + cdc.MustUnmarshal(bz, ¶ms) + params.MaxTransactionsFilters = types.DefaultMaxTransactionsFilters + params.MaxKvQueryKeysCount = types.DefaultMaxKvQueryKeysCount + bz = cdc.MustMarshal(¶ms) + st.Set(types.ParamsKey, bz) + return nil +} diff --git a/x/interchainqueries/migrations/v3/migration_test.go b/x/interchainqueries/migrations/v3/migration_test.go new file mode 100644 index 000000000..c36014df8 --- /dev/null +++ b/x/interchainqueries/migrations/v3/migration_test.go @@ -0,0 +1,83 @@ +package v3_test + +import ( + "testing" + + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + "gopkg.in/yaml.v2" + + "github.com/neutron-org/neutron/v4/testutil" + v3 "github.com/neutron-org/neutron/v4/x/interchainqueries/migrations/v3" + "github.com/neutron-org/neutron/v4/x/interchainqueries/types" +) + +type V3ICQMigrationTestSuite struct { + testutil.IBCConnectionTestSuite +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(V3ICQMigrationTestSuite)) +} + +// ParamsV2 defines the parameters for the module v2. +type ParamsV2 struct { + // Defines amount of blocks required before query becomes available for + // removal by anybody + QuerySubmitTimeout uint64 `protobuf:"varint,1,opt,name=query_submit_timeout,json=querySubmitTimeout,proto3" json:"query_submit_timeout,omitempty"` + // Amount of coins deposited for the query. + QueryDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=query_deposit,json=queryDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"query_deposit"` + // Amount of tx hashes to be removed during a single EndBlock. Can vary to + // balance between network cleaning speed and EndBlock duration. A zero value + // means no limit. + TxQueryRemovalLimit uint64 `protobuf:"varint,3,opt,name=tx_query_removal_limit,json=txQueryRemovalLimit,proto3" json:"tx_query_removal_limit,omitempty"` +} + +func (p *ParamsV2) Reset() { *p = ParamsV2{} } +func (p *ParamsV2) ProtoMessage() {} + +// String implements the Stringer interface. +func (p ParamsV2) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} + +func (suite *V3ICQMigrationTestSuite) TestParamsMigration() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + storeKey = app.GetKey(types.StoreKey) + ctx = suite.ChainA.GetContext() + cdc = app.AppCodec() + ) + + // preinitialize v2 params + p := ParamsV2{ + QuerySubmitTimeout: types.DefaultQuerySubmitTimeout, + QueryDeposit: types.DefaultQueryDeposit, + TxQueryRemovalLimit: types.DefaultTxQueryRemovalLimit, + } + store := ctx.KVStore(storeKey) + bz, err := cdc.Marshal(&p) + suite.Require().NoError(err) + store.Set(types.ParamsKey, bz) + + paramsOld := app.InterchainQueriesKeeper.GetParams(ctx) + suite.Require().Equal(paramsOld.TxQueryRemovalLimit, p.TxQueryRemovalLimit) + suite.Require().Equal(paramsOld.QuerySubmitTimeout, p.QuerySubmitTimeout) + suite.Require().Equal(paramsOld.QueryDeposit, p.QueryDeposit) + suite.Require().Equal(paramsOld.MaxTransactionsFilters, uint64(0)) + suite.Require().Equal(paramsOld.MaxKvQueryKeysCount, uint64(0)) + + err = v3.MigrateParams(ctx, cdc, storeKey) + suite.Require().NoError(err) + + paramsNew := app.InterchainQueriesKeeper.GetParams(ctx) + params := types.Params{ + QuerySubmitTimeout: types.DefaultQuerySubmitTimeout, + QueryDeposit: types.DefaultQueryDeposit, + TxQueryRemovalLimit: types.DefaultTxQueryRemovalLimit, + MaxKvQueryKeysCount: types.DefaultMaxKvQueryKeysCount, + MaxTransactionsFilters: types.DefaultMaxTransactionsFilters, + } + suite.Require().Equal(params, paramsNew) +} diff --git a/x/interchainqueries/module.go b/x/interchainqueries/module.go index 4f9910975..cf1572bd7 100644 --- a/x/interchainqueries/module.go +++ b/x/interchainqueries/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" @@ -103,6 +105,7 @@ var _ appmodule.AppModule = AppModule{} type AppModule struct { AppModuleBasic + storeKey storetypes.StoreKey keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper @@ -110,12 +113,14 @@ type AppModule struct { func NewAppModule( cdc codec.Codec, + storeKey storetypes.StoreKey, keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), + storeKey: storeKey, keeper: keeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, @@ -141,6 +146,12 @@ func (AppModule) QuerierRoute() string { return types.QuerierRoute } // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { + m := keeper.NewMigrator(am.cdc, am.storeKey) + + if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { + panic(fmt.Sprintf("failed to migrate x/interchainqueries from version 2 to 3: %v", err)) + } + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) } diff --git a/x/interchainqueries/types/constants.go b/x/interchainqueries/types/constants.go index 4c93fbeff..fef80f236 100644 --- a/x/interchainqueries/types/constants.go +++ b/x/interchainqueries/types/constants.go @@ -1,3 +1,3 @@ package types -const ConsensusVersion = 2 +const ConsensusVersion = 3 diff --git a/x/interchainqueries/types/genesis.go b/x/interchainqueries/types/genesis.go index c00668e58..29cc30ae1 100644 --- a/x/interchainqueries/types/genesis.go +++ b/x/interchainqueries/types/genesis.go @@ -34,14 +34,14 @@ func (gs GenesisState) Validate() error { switch val.QueryType { case string(InterchainQueryTypeTX): - if err := ValidateTransactionsFilter(val.TransactionsFilter); err != nil { + if err := ValidateTransactionsFilter(val.TransactionsFilter, gs.Params.MaxTransactionsFilters); err != nil { return errors.Wrap(ErrInvalidTransactionsFilter, err.Error()) } case string(InterchainQueryTypeKV): if len(val.Keys) == 0 { return errors.Wrap(ErrEmptyKeys, "keys cannot be empty") } - if err := validateKeys(val.GetKeys()); err != nil { + if err := validateKeys(val.GetKeys(), gs.Params.MaxKvQueryKeysCount); err != nil { return err } default: diff --git a/x/interchainqueries/types/params.go b/x/interchainqueries/types/params.go index ce52e3689..063cefc28 100644 --- a/x/interchainqueries/types/params.go +++ b/x/interchainqueries/types/params.go @@ -14,12 +14,14 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) var ( - KeyQuerySubmitTimeout = []byte("QuerySubmitTimeout") - DefaultQuerySubmitTimeout = uint64(1036800) // One month, with block_time = 2.5s - KeyQueryDeposit = []byte("QueryDeposit") - DefaultQueryDeposit = sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(int64(1_000_000)))) - KeyTxQueryRemovalLimit = []byte("TxQueryRemovalLimit") - DefaultTxQueryRemovalLimit = uint64(10_000) + KeyQuerySubmitTimeout = []byte("QuerySubmitTimeout") + DefaultQuerySubmitTimeout = uint64(1036800) // One month, with block_time = 2.5s + KeyQueryDeposit = []byte("QueryDeposit") + DefaultQueryDeposit = sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(int64(1_000_000)))) + KeyTxQueryRemovalLimit = []byte("TxQueryRemovalLimit") + DefaultTxQueryRemovalLimit = uint64(10_000) + DefaultMaxKvQueryKeysCount = uint64(32) + DefaultMaxTransactionsFilters = uint64(32) ) // ParamKeyTable the param key table for launch module @@ -32,17 +34,19 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(querySubmitTimeout uint64, queryDeposit sdk.Coins, txQueryRemovalLimit uint64) Params { +func NewParams(querySubmitTimeout uint64, queryDeposit sdk.Coins, txQueryRemovalLimit, maxKvQueryKeysCount, maxTransactionsFilters uint64) Params { return Params{ - QuerySubmitTimeout: querySubmitTimeout, - QueryDeposit: queryDeposit, - TxQueryRemovalLimit: txQueryRemovalLimit, + QuerySubmitTimeout: querySubmitTimeout, + QueryDeposit: queryDeposit, + TxQueryRemovalLimit: txQueryRemovalLimit, + MaxKvQueryKeysCount: maxKvQueryKeysCount, + MaxTransactionsFilters: maxTransactionsFilters, } } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(DefaultQuerySubmitTimeout, DefaultQueryDeposit, DefaultTxQueryRemovalLimit) + return NewParams(DefaultQuerySubmitTimeout, DefaultQueryDeposit, DefaultTxQueryRemovalLimit, DefaultMaxKvQueryKeysCount, DefaultMaxTransactionsFilters) } // ParamSetPairs get the params.ParamSet diff --git a/x/interchainqueries/types/params.pb.go b/x/interchainqueries/types/params.pb.go index 5afc785e0..18d044b6f 100644 --- a/x/interchainqueries/types/params.pb.go +++ b/x/interchainqueries/types/params.pb.go @@ -36,6 +36,10 @@ type Params struct { // balance between network cleaning speed and EndBlock duration. A zero value // means no limit. TxQueryRemovalLimit uint64 `protobuf:"varint,3,opt,name=tx_query_removal_limit,json=txQueryRemovalLimit,proto3" json:"tx_query_removal_limit,omitempty"` + // Maximum amount of keys in a registered key value query + MaxKvQueryKeysCount uint64 `protobuf:"varint,4,opt,name=max_kv_query_keys_count,json=maxKvQueryKeysCount,proto3" json:"max_kv_query_keys_count,omitempty"` + // max_transactions_filters defines maximum allowed amount of tx filters in msgRegisterInterchainQuery + MaxTransactionsFilters uint64 `protobuf:"varint,5,opt,name=max_transactions_filters,json=maxTransactionsFilters,proto3" json:"max_transactions_filters,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -91,6 +95,20 @@ func (m *Params) GetTxQueryRemovalLimit() uint64 { return 0 } +func (m *Params) GetMaxKvQueryKeysCount() uint64 { + if m != nil { + return m.MaxKvQueryKeysCount + } + return 0 +} + +func (m *Params) GetMaxTransactionsFilters() uint64 { + if m != nil { + return m.MaxTransactionsFilters + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "neutron.interchainqueries.Params") } @@ -100,28 +118,32 @@ func init() { } var fileDescriptor_752a5f3346da64b1 = []byte{ - // 331 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4e, 0xf3, 0x30, - 0x10, 0xc7, 0x93, 0xaf, 0x55, 0x87, 0x7c, 0xb0, 0x84, 0x0a, 0xb5, 0x1d, 0xdc, 0x8a, 0x01, 0x75, - 0xa9, 0xdd, 0x52, 0x26, 0xd8, 0x0a, 0x23, 0x03, 0x14, 0x58, 0x58, 0xa2, 0x24, 0xb5, 0x52, 0x8b, - 0x3a, 0x17, 0xec, 0x4b, 0xd5, 0xbe, 0x05, 0x23, 0x23, 0x33, 0x4f, 0xd2, 0xb1, 0x23, 0x13, 0xa0, - 0x76, 0xe0, 0x35, 0x50, 0xec, 0x20, 0x21, 0xc1, 0xe4, 0x93, 0x7f, 0x77, 0xfe, 0xff, 0x74, 0xf6, - 0x0e, 0x53, 0x9e, 0xa3, 0x82, 0x94, 0x89, 0x14, 0xb9, 0x8a, 0xa7, 0xa1, 0x48, 0x1f, 0x72, 0xae, - 0x04, 0xd7, 0x2c, 0x0b, 0x55, 0x28, 0x35, 0xcd, 0x14, 0x20, 0xf8, 0xcd, 0xb2, 0x8f, 0xfe, 0xea, - 0x6b, 0x91, 0x18, 0xb4, 0x04, 0xcd, 0xa2, 0x50, 0x73, 0x36, 0x1f, 0x44, 0x1c, 0xc3, 0x01, 0x8b, - 0x41, 0xa4, 0x76, 0xb4, 0x55, 0x4f, 0x20, 0x01, 0x53, 0xb2, 0xa2, 0xb2, 0xb7, 0x07, 0x9f, 0xae, - 0x57, 0xbb, 0x34, 0x09, 0x7e, 0xdf, 0xab, 0x17, 0x6f, 0x2d, 0x03, 0x9d, 0x47, 0x52, 0x60, 0x80, - 0x42, 0x72, 0xc8, 0xb1, 0xe1, 0x76, 0xdc, 0x6e, 0x75, 0xec, 0x1b, 0x76, 0x6d, 0xd0, 0x8d, 0x25, - 0x7e, 0xe6, 0xed, 0xda, 0x89, 0x09, 0xcf, 0x40, 0x0b, 0x6c, 0xfc, 0xeb, 0x54, 0xba, 0xff, 0x8f, - 0x9a, 0xd4, 0xaa, 0xd0, 0x42, 0x85, 0x96, 0x2a, 0xf4, 0x0c, 0x44, 0x3a, 0xea, 0xaf, 0xde, 0xda, - 0xce, 0xcb, 0x7b, 0xbb, 0x9b, 0x08, 0x9c, 0xe6, 0x11, 0x8d, 0x41, 0xb2, 0xd2, 0xdb, 0x1e, 0x3d, - 0x3d, 0xb9, 0x67, 0xb8, 0xcc, 0xb8, 0x36, 0x03, 0x7a, 0xbc, 0x63, 0x12, 0xce, 0x6d, 0x80, 0x3f, - 0xf4, 0xf6, 0x71, 0x11, 0xd8, 0x50, 0xc5, 0x25, 0xcc, 0xc3, 0x59, 0x30, 0x13, 0x52, 0x60, 0xa3, - 0x62, 0x2c, 0xf7, 0x70, 0x71, 0x55, 0xc0, 0xb1, 0x65, 0x17, 0x05, 0x3a, 0xa9, 0x3e, 0x3d, 0xb7, - 0x9d, 0xd1, 0xed, 0x6a, 0x43, 0xdc, 0xf5, 0x86, 0xb8, 0x1f, 0x1b, 0xe2, 0x3e, 0x6e, 0x89, 0xb3, - 0xde, 0x12, 0xe7, 0x75, 0x4b, 0x9c, 0xbb, 0xd3, 0x1f, 0x32, 0xe5, 0x7e, 0x7b, 0xa0, 0x92, 0xef, - 0x9a, 0xcd, 0x8f, 0xd9, 0xe2, 0x8f, 0x8f, 0x31, 0x96, 0x51, 0xcd, 0xec, 0x71, 0xf8, 0x15, 0x00, - 0x00, 0xff, 0xff, 0xc7, 0x61, 0x00, 0x43, 0xc2, 0x01, 0x00, 0x00, + // 397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x31, 0x8f, 0xd3, 0x30, + 0x14, 0xc7, 0x93, 0xbb, 0x72, 0x43, 0x80, 0x25, 0x9c, 0x8e, 0x5c, 0x87, 0xb4, 0x62, 0x40, 0x5d, + 0x1a, 0xb7, 0xb4, 0x03, 0x82, 0xad, 0x45, 0x2c, 0x65, 0x80, 0x52, 0x16, 0x96, 0xc8, 0x49, 0x4d, + 0x6a, 0xb5, 0xf6, 0x0b, 0xf6, 0x4b, 0x94, 0x7c, 0x0b, 0x46, 0x46, 0x66, 0x3e, 0x49, 0xc7, 0x6e, + 0x30, 0x01, 0x6a, 0xbf, 0x08, 0x8a, 0x1d, 0xa4, 0x4a, 0xdc, 0x94, 0xa7, 0xfc, 0xfc, 0xcb, 0xff, + 0x9f, 0xbc, 0x78, 0x4f, 0x25, 0x2b, 0x50, 0x81, 0x24, 0x5c, 0x22, 0x53, 0xe9, 0x86, 0x72, 0xf9, + 0xb9, 0x60, 0x8a, 0x33, 0x4d, 0x72, 0xaa, 0xa8, 0xd0, 0x51, 0xae, 0x00, 0xc1, 0xbf, 0x6d, 0xcf, + 0x45, 0xff, 0x9d, 0xeb, 0x86, 0x29, 0x68, 0x01, 0x9a, 0x24, 0x54, 0x33, 0x52, 0x8e, 0x13, 0x86, + 0x74, 0x4c, 0x52, 0xe0, 0xd2, 0xaa, 0xdd, 0xeb, 0x0c, 0x32, 0x30, 0x23, 0x69, 0x26, 0x7b, 0xf7, + 0xc9, 0x8f, 0x0b, 0xef, 0xea, 0xad, 0x49, 0xf0, 0x47, 0xde, 0x75, 0xf3, 0xac, 0x3a, 0xd6, 0x45, + 0x22, 0x38, 0xc6, 0xc8, 0x05, 0x83, 0x02, 0x03, 0xb7, 0xef, 0x0e, 0x3a, 0x4b, 0xdf, 0xb0, 0xf7, + 0x06, 0xad, 0x2c, 0xf1, 0x73, 0xef, 0xa1, 0x35, 0xd6, 0x2c, 0x07, 0xcd, 0x31, 0xb8, 0xe8, 0x5f, + 0x0e, 0xee, 0x3f, 0xbb, 0x8d, 0x6c, 0x95, 0xa8, 0xa9, 0x12, 0xb5, 0x55, 0xa2, 0x39, 0x70, 0x39, + 0x1b, 0xed, 0x7f, 0xf5, 0x9c, 0xef, 0xbf, 0x7b, 0x83, 0x8c, 0xe3, 0xa6, 0x48, 0xa2, 0x14, 0x04, + 0x69, 0x7b, 0xdb, 0xcb, 0x50, 0xaf, 0xb7, 0x04, 0xeb, 0x9c, 0x69, 0x23, 0xe8, 0xe5, 0x03, 0x93, + 0xf0, 0xca, 0x06, 0xf8, 0x13, 0xef, 0x06, 0xab, 0xd8, 0x86, 0x2a, 0x26, 0xa0, 0xa4, 0xbb, 0x78, + 0xc7, 0x05, 0xc7, 0xe0, 0xd2, 0xb4, 0x7c, 0x84, 0xd5, 0xbb, 0x06, 0x2e, 0x2d, 0x7b, 0xd3, 0x20, + 0x7f, 0xea, 0x3d, 0x16, 0xb4, 0x8a, 0xb7, 0x65, 0x2b, 0x6e, 0x59, 0xad, 0xe3, 0x14, 0x0a, 0x89, + 0x41, 0xc7, 0x5a, 0x82, 0x56, 0x8b, 0xd2, 0x88, 0x0b, 0x56, 0xeb, 0x79, 0x83, 0xfc, 0xe7, 0x5e, + 0xd0, 0x58, 0xa8, 0xa8, 0xd4, 0x34, 0x45, 0x0e, 0x52, 0xc7, 0x9f, 0xf8, 0x0e, 0x99, 0xd2, 0xc1, + 0x3d, 0xa3, 0xdd, 0x08, 0x5a, 0xad, 0xce, 0xf0, 0x6b, 0x4b, 0x5f, 0x74, 0xbe, 0x7e, 0xeb, 0x39, + 0xb3, 0x0f, 0xfb, 0x63, 0xe8, 0x1e, 0x8e, 0xa1, 0xfb, 0xe7, 0x18, 0xba, 0x5f, 0x4e, 0xa1, 0x73, + 0x38, 0x85, 0xce, 0xcf, 0x53, 0xe8, 0x7c, 0x7c, 0x79, 0xf6, 0xf2, 0xed, 0x3e, 0x87, 0xa0, 0xb2, + 0x7f, 0x33, 0x29, 0xa7, 0xa4, 0xba, 0xe3, 0x47, 0x30, 0x5f, 0x25, 0xb9, 0x32, 0x7b, 0x9b, 0xfc, + 0x0d, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x38, 0x73, 0xdc, 0x32, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -144,6 +166,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MaxTransactionsFilters != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxTransactionsFilters)) + i-- + dAtA[i] = 0x28 + } + if m.MaxKvQueryKeysCount != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxKvQueryKeysCount)) + i-- + dAtA[i] = 0x20 + } if m.TxQueryRemovalLimit != 0 { i = encodeVarintParams(dAtA, i, uint64(m.TxQueryRemovalLimit)) i-- @@ -200,6 +232,12 @@ func (m *Params) Size() (n int) { if m.TxQueryRemovalLimit != 0 { n += 1 + sovParams(uint64(m.TxQueryRemovalLimit)) } + if m.MaxKvQueryKeysCount != 0 { + n += 1 + sovParams(uint64(m.MaxKvQueryKeysCount)) + } + if m.MaxTransactionsFilters != 0 { + n += 1 + sovParams(uint64(m.MaxTransactionsFilters)) + } return n } @@ -310,6 +348,44 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxKvQueryKeysCount", wireType) + } + m.MaxKvQueryKeysCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxKvQueryKeysCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTransactionsFilters", wireType) + } + m.MaxTransactionsFilters = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTransactionsFilters |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/interchainqueries/types/tx.go b/x/interchainqueries/types/tx.go index f77c3b4f3..7e1fbb766 100644 --- a/x/interchainqueries/types/tx.go +++ b/x/interchainqueries/types/tx.go @@ -11,10 +11,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -const ( - MaxKVQueryKeysCount = 32 -) - var ( _ sdk.Msg = &MsgSubmitQueryResult{} _ codectypes.UnpackInterfacesMessage = MsgSubmitQueryResult{} @@ -86,7 +82,7 @@ func (msg MsgRegisterInterchainQuery) Type() string { return "register-interchain-query" } -func (msg MsgRegisterInterchainQuery) Validate() error { +func (msg MsgRegisterInterchainQuery) Validate(params Params) error { if msg.UpdatePeriod == 0 { return errors.Wrap(ErrInvalidUpdatePeriod, "update period can not be equal to zero") } @@ -111,13 +107,13 @@ func (msg MsgRegisterInterchainQuery) Validate() error { if len(msg.Keys) == 0 { return errors.Wrap(ErrEmptyKeys, "keys cannot be empty") } - if err := validateKeys(msg.GetKeys()); err != nil { + if err := validateKeys(msg.GetKeys(), params.MaxKvQueryKeysCount); err != nil { return err } } if InterchainQueryType(msg.QueryType).IsTX() { - if err := ValidateTransactionsFilter(msg.TransactionsFilter); err != nil { + if err := ValidateTransactionsFilter(msg.TransactionsFilter, params.MaxTransactionsFilters); err != nil { return errors.Wrap(ErrInvalidTransactionsFilter, err.Error()) } } @@ -140,7 +136,7 @@ func (msg MsgRegisterInterchainQuery) GetSigners() []sdk.AccAddress { var _ sdk.Msg = &MsgUpdateInterchainQueryRequest{} -func (msg MsgUpdateInterchainQueryRequest) Validate() error { +func (msg MsgUpdateInterchainQueryRequest) Validate(params Params) error { if msg.GetQueryId() == 0 { return errors.Wrap(ErrInvalidQueryID, "query_id cannot be empty or equal to 0") } @@ -163,13 +159,13 @@ func (msg MsgUpdateInterchainQueryRequest) Validate() error { } if len(newKeys) != 0 { - if err := validateKeys(newKeys); err != nil { + if err := validateKeys(newKeys, params.MaxKvQueryKeysCount); err != nil { return err } } if newTxFilter != "" { - if err := ValidateTransactionsFilter(newTxFilter); err != nil { + if err := ValidateTransactionsFilter(newTxFilter, params.MaxTransactionsFilters); err != nil { return errors.Wrap(ErrInvalidTransactionsFilter, err.Error()) } } @@ -226,9 +222,9 @@ func (msg *MsgUpdateParams) Validate() error { return nil } -func validateKeys(keys []*KVKey) error { - if uint64(len(keys)) > MaxKVQueryKeysCount { - return errors.Wrapf(ErrTooManyKVQueryKeys, "keys count cannot be more than %d", MaxKVQueryKeysCount) +func validateKeys(keys []*KVKey, maxKVQueryKeysCount uint64) error { + if uint64(len(keys)) > maxKVQueryKeysCount { + return errors.Wrapf(ErrTooManyKVQueryKeys, "keys count cannot be more than %d", maxKVQueryKeysCount) } duplicates := make(map[string]struct{}) diff --git a/x/interchainqueries/types/types.go b/x/interchainqueries/types/types.go index dafa661f3..be94cc357 100644 --- a/x/interchainqueries/types/types.go +++ b/x/interchainqueries/types/types.go @@ -43,9 +43,6 @@ const ( // AttributeValueQueryRemoved represents the value for the 'action' event attribute. AttributeValueQueryRemoved = "query_removed" - - // maxTransactionsFilters defines maximum allowed amount of tx filters in msgRegisterInterchainQuery - maxTransactionsFilters = 32 ) const ( @@ -107,13 +104,13 @@ type TransactionsFilterItem struct { } // ValidateTransactionsFilter checks if the passed string is a valid TransactionsFilter value. -func ValidateTransactionsFilter(s string) error { +func ValidateTransactionsFilter(s string, maxTransactionsFilters uint64) error { const forbiddenCharacters = "\t\n\r\\()\"'=><" filters := TransactionsFilter{} if err := json.Unmarshal([]byte(s), &filters); err != nil { return fmt.Errorf("failed to unmarshal transactions filter: %w", err) } - if len(filters) > maxTransactionsFilters { + if uint64(len(filters)) > maxTransactionsFilters { return fmt.Errorf("too many transactions filters, provided=%d, max=%d", len(filters), maxTransactionsFilters) } diff --git a/x/interchainqueries/types/types_test.go b/x/interchainqueries/types/types_test.go index 202c8c531..f062a310e 100644 --- a/x/interchainqueries/types/types_test.go +++ b/x/interchainqueries/types/types_test.go @@ -10,37 +10,37 @@ import ( func TestTransactionFilterValidation(t *testing.T) { t.Run("Valid", func(t *testing.T) { // several conditions - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"},{"field":"tx.height","op":"Gte","value":100}]`)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"},{"field":"tx.height","op":"Gte","value":100}]`, DefaultMaxTransactionsFilters)) // all supported operations with a whole operand - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Eq","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gt","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lt","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lte","value":1000}]`)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Eq","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gt","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lt","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lte","value":1000}]`, DefaultMaxTransactionsFilters)) }) t.Run("Invalid", func(t *testing.T) { // invalid json - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":`), "unexpected end of JSON input") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":`, DefaultMaxTransactionsFilters), "unexpected end of JSON input") // empty operation - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), "op '' is expected to be one of: eq, gt, gte, lt, lte") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), "op '' is expected to be one of: eq, gt, gte, lt, lte") // empty field - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), "field couldn't be empty") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), "field couldn't be empty") // field with forbidden symbols const specialSymbolsAreNotAllowed = "special symbols \t\n\r\\()\"'=>< are not allowed" - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\t","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\n","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\r","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\\","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.(","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.)","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.'","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.=","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.>","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.<","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\t","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\n","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\r","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\\","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.(","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.)","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.'","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.=","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.>","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.<","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) // decimal number - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":15.5}]`), "can't be a decimal number") - assert.ErrorContains(t, ValidateTransactionsFilter(lotsOfTxFilters(t, 40)), "too many transactions filters") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":15.5}]`, DefaultMaxTransactionsFilters), "can't be a decimal number") + assert.ErrorContains(t, ValidateTransactionsFilter(lotsOfTxFilters(t, 40), DefaultMaxTransactionsFilters), "too many transactions filters") }) } diff --git a/x/interchaintxs/keeper/msg_server.go b/x/interchaintxs/keeper/msg_server.go index ed1dcc9ed..53f47483d 100644 --- a/x/interchaintxs/keeper/msg_server.go +++ b/x/interchaintxs/keeper/msg_server.go @@ -66,7 +66,8 @@ func (k Keeper) RegisterInterchainAccount(goCtx context.Context, msg *ictxtypes. Owner: icaOwner, ConnectionId: msg.ConnectionId, Version: "", // FIXME: empty version string doesn't look good - Ordering: channeltypes.ORDERED, + // underlying controller uses ORDER_ORDERED as default in case msg's ordering is NONE // TODO: check now + Ordering: msg.Ordering, }) if err != nil { k.Logger(ctx).Debug("RegisterInterchainAccount: failed to RegisterInterchainAccount:", "error", err, "owner", icaOwner, "msg", &msg) diff --git a/x/interchaintxs/keeper/msg_server_test.go b/x/interchaintxs/keeper/msg_server_test.go index afd182224..a04afe5bb 100644 --- a/x/interchaintxs/keeper/msg_server_test.go +++ b/x/interchaintxs/keeper/msg_server_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "cosmossdk.io/math" "github.com/neutron-org/neutron/v4/app/params" @@ -12,7 +14,6 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" @@ -32,6 +33,10 @@ import ( const TestFeeCollectorAddr = "neutron1dua3d89szsmd3vwg0y5a2689ah0g4x68ps8vew" +const channelID = "channel-0" + +var portID = "icacontroller-" + testutil.TestOwnerAddress + ICAId + func TestMsgRegisterInterchainAccountValidate(t *testing.T) { icak, ctx := testkeeper.InterchainTxsKeeper(t, nil, nil, nil, nil, nil, nil, func(_ sdk.Context) string { return TestFeeCollectorAddr @@ -114,6 +119,7 @@ func TestRegisterInterchainAccount(t *testing.T) { FromAddress: testutil.TestOwnerAddress, ConnectionId: "connection-0", InterchainAccountId: "ica0", + Ordering: channeltypes.ORDERED, } contractAddress := sdk.MustAccAddressFromBech32(msgRegAcc.FromAddress) icaOwner := types.NewICAOwnerFromAddress(contractAddress, msgRegAcc.InterchainAccountId) @@ -155,8 +161,61 @@ func TestRegisterInterchainAccount(t *testing.T) { require.ErrorContains(t, err, "failed to charge fees to pay for RegisterInterchainAccount msg") require.Nil(t, resp) - channelID := "channel-0" - portID := "icacontroller-" + testutil.TestOwnerAddress + ICAId + wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) + wmKeeper.EXPECT().GetContractInfo(ctx, contractAddress).Return(&wasmtypes.ContractInfo{CodeID: 1}) + bankKeeper.EXPECT().SendCoins(ctx, sdk.MustAccAddressFromBech32(msgRegAcc.FromAddress), sdk.MustAccAddressFromBech32(TestFeeCollectorAddr), msgRegAcc.RegisterFee) + icaMsgServer.EXPECT().RegisterInterchainAccount(ctx, msgRegICA).Return(&icacontrollertypes.MsgRegisterInterchainAccountResponse{ + ChannelId: channelID, + PortId: portID, + }, nil) + icaKeeper.EXPECT().SetMiddlewareEnabled(ctx, portID, msgRegAcc.ConnectionId) + resp, err = icak.RegisterInterchainAccount(ctx, &msgRegAcc) + require.NoError(t, err) + require.Equal(t, types.MsgRegisterInterchainAccountResponse{ + ChannelId: channelID, + PortId: portID, + }, *resp) +} + +func TestRegisterInterchainAccountUnordered(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + icaKeeper := mock_types.NewMockICAControllerKeeper(ctrl) + icaMsgServer := mock_types.NewMockICAControllerMsgServer(ctrl) + wmKeeper := mock_types.NewMockWasmKeeper(ctrl) + bankKeeper := mock_types.NewMockBankKeeper(ctrl) + icak, ctx := testkeeper.InterchainTxsKeeper(t, wmKeeper, nil, icaKeeper, icaMsgServer, nil, bankKeeper, func(_ sdk.Context) string { + return TestFeeCollectorAddr + }) + + msgRegAcc := types.MsgRegisterInterchainAccount{ + FromAddress: testutil.TestOwnerAddress, + ConnectionId: "connection-0", + InterchainAccountId: "ica0", + Ordering: channeltypes.UNORDERED, // return unordered + } + contractAddress := sdk.MustAccAddressFromBech32(msgRegAcc.FromAddress) + icaOwner := types.NewICAOwnerFromAddress(contractAddress, msgRegAcc.InterchainAccountId) + + wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(false) + resp, err := icak.RegisterInterchainAccount(ctx, &msgRegAcc) + require.ErrorContains(t, err, "is not a contract address") + require.Nil(t, resp) + + wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) + wmKeeper.EXPECT().GetContractInfo(ctx, contractAddress).Return(&wasmtypes.ContractInfo{CodeID: 1}) + resp, err = icak.RegisterInterchainAccount(ctx, &msgRegAcc) + require.ErrorContains(t, err, "failed to charge fees to pay for RegisterInterchainAccount msg") + require.Nil(t, resp) + + msgRegAcc.RegisterFee = sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))) + + msgRegICA := &icacontrollertypes.MsgRegisterInterchainAccount{ + Owner: icaOwner.String(), + ConnectionId: msgRegAcc.ConnectionId, + Version: "", + Ordering: channeltypes.UNORDERED, + } wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) wmKeeper.EXPECT().GetContractInfo(ctx, contractAddress).Return(&wasmtypes.ContractInfo{CodeID: 1}) @@ -439,7 +498,6 @@ func TestSubmitTx(t *testing.T) { require.ErrorContains(t, err, "MsgSubmitTx contains more messages than allowed") submitMsg.Msgs = []*codectypes.Any{&cosmosMsg} - portID := "icacontroller-" + testutil.TestOwnerAddress + ICAId wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) icaKeeper.EXPECT().GetActiveChannelID(ctx, "connection-0", portID).Return("", false) resp, err = icak.SubmitTx(ctx, &submitMsg) diff --git a/x/interchaintxs/types/tx.pb.go b/x/interchaintxs/types/tx.pb.go index 8b7fb7755..8db65cb59 100644 --- a/x/interchaintxs/types/tx.pb.go +++ b/x/interchaintxs/types/tx.pb.go @@ -7,7 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" + types2 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -15,7 +15,8 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + types1 "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + types3 "github.com/neutron-org/neutron/v4/x/feerefunder/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -42,6 +43,7 @@ type MsgRegisterInterchainAccount struct { ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` InterchainAccountId string `protobuf:"bytes,3,opt,name=interchain_account_id,json=interchainAccountId,proto3" json:"interchain_account_id,omitempty" yaml:"interchain_account_id"` RegisterFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=register_fee,json=registerFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"register_fee"` + Ordering types1.Order `protobuf:"varint,5,opt,name=ordering,proto3,enum=ibc.core.channel.v1.Order" json:"ordering,omitempty"` } func (m *MsgRegisterInterchainAccount) Reset() { *m = MsgRegisterInterchainAccount{} } @@ -126,11 +128,11 @@ type MsgSubmitTx struct { // claim our capability for. InterchainAccountId string `protobuf:"bytes,2,opt,name=interchain_account_id,json=interchainAccountId,proto3" json:"interchain_account_id,omitempty"` ConnectionId string `protobuf:"bytes,3,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - Msgs []*types1.Any `protobuf:"bytes,4,rep,name=msgs,proto3" json:"msgs,omitempty"` + Msgs []*types2.Any `protobuf:"bytes,4,rep,name=msgs,proto3" json:"msgs,omitempty"` Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` // timeout in seconds after which the packet times out Timeout uint64 `protobuf:"varint,6,opt,name=timeout,proto3" json:"timeout,omitempty"` - Fee types2.Fee `protobuf:"bytes,7,opt,name=fee,proto3" json:"fee"` + Fee types3.Fee `protobuf:"bytes,7,opt,name=fee,proto3" json:"fee"` } func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } @@ -332,60 +334,63 @@ func init() { func init() { proto.RegisterFile("neutron/interchaintxs/v1/tx.proto", fileDescriptor_50f087790e59c806) } var fileDescriptor_50f087790e59c806 = []byte{ - // 839 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xbf, 0x6f, 0xfb, 0x44, - 0x14, 0x8f, 0x93, 0x7c, 0x53, 0x72, 0x09, 0x42, 0xb8, 0xa9, 0xea, 0x44, 0x6d, 0x92, 0x1a, 0x2a, - 0x85, 0x4a, 0xb1, 0x9b, 0x80, 0x8a, 0x14, 0x09, 0xa4, 0xa6, 0x52, 0xa5, 0x0c, 0x91, 0x8a, 0x5b, - 0x16, 0x96, 0xe8, 0x62, 0x5f, 0x1c, 0x8b, 0xf8, 0xce, 0xf8, 0xce, 0x51, 0xb2, 0x21, 0x26, 0xc4, - 0xc4, 0xc2, 0xde, 0x11, 0x31, 0xa0, 0x0e, 0xfc, 0x01, 0x8c, 0x1d, 0x2b, 0x26, 0xa6, 0x02, 0xed, - 0x50, 0xe6, 0x0e, 0xcc, 0xe8, 0xec, 0x73, 0x7e, 0xa9, 0x89, 0xaa, 0xef, 0x92, 0xdc, 0x7b, 0xef, - 0x73, 0xef, 0xbd, 0xfb, 0x7c, 0xee, 0x9d, 0xc1, 0x01, 0x46, 0x01, 0xf3, 0x09, 0xd6, 0x1d, 0xcc, - 0x90, 0x6f, 0x0e, 0xa1, 0x83, 0xd9, 0x84, 0xea, 0xe3, 0x86, 0xce, 0x26, 0x9a, 0xe7, 0x13, 0x46, - 0x64, 0x45, 0x40, 0xb4, 0x25, 0x88, 0x36, 0x6e, 0x94, 0xde, 0x87, 0xae, 0x83, 0x89, 0x1e, 0xfe, - 0x46, 0xe0, 0x52, 0xd9, 0x24, 0xd4, 0x25, 0x54, 0xef, 0x43, 0x8a, 0xf4, 0x71, 0xa3, 0x8f, 0x18, - 0x6c, 0xe8, 0x26, 0x71, 0xb0, 0x88, 0xef, 0x8a, 0xb8, 0x4b, 0x6d, 0x5e, 0xc4, 0xa5, 0xb6, 0x08, - 0x14, 0xa3, 0x40, 0x2f, 0xb4, 0xf4, 0xc8, 0x10, 0xa1, 0x82, 0x4d, 0x6c, 0x12, 0xf9, 0xf9, 0x4a, - 0x78, 0xf7, 0x6c, 0x42, 0xec, 0x11, 0xd2, 0xa1, 0xe7, 0xe8, 0x10, 0x63, 0xc2, 0x20, 0x73, 0x08, - 0x8e, 0xf7, 0xec, 0x2c, 0x44, 0x87, 0x8c, 0x79, 0x71, 0x15, 0xe1, 0x0e, 0xad, 0x7e, 0x30, 0xd0, - 0x21, 0x9e, 0x8a, 0xd0, 0x7e, 0xcc, 0xc4, 0x00, 0x21, 0x1f, 0x0d, 0x02, 0x6c, 0x21, 0x9f, 0xaf, - 0x45, 0xf8, 0x70, 0x2d, 0x51, 0x1e, 0xf4, 0xa1, 0x2b, 0xea, 0xaa, 0xff, 0x24, 0xc1, 0x5e, 0x97, - 0xda, 0x06, 0xb2, 0x1d, 0xca, 0x90, 0xdf, 0x99, 0x81, 0x4f, 0x4d, 0x93, 0x04, 0x98, 0xc9, 0x07, - 0x20, 0x3f, 0xf0, 0x89, 0xdb, 0x83, 0x96, 0xe5, 0x23, 0x4a, 0x15, 0xa9, 0x2a, 0xd5, 0xb2, 0x46, - 0x8e, 0xfb, 0x4e, 0x23, 0x97, 0xfc, 0x19, 0x78, 0xd7, 0x24, 0x18, 0x23, 0x93, 0x1f, 0xa8, 0xe7, - 0x58, 0x4a, 0x92, 0x63, 0xda, 0xca, 0xf3, 0x7d, 0xa5, 0x30, 0x85, 0xee, 0xa8, 0xa5, 0x2e, 0x85, - 0x55, 0x23, 0x3f, 0xb7, 0x3b, 0x96, 0x7c, 0x05, 0x76, 0xe6, 0x3d, 0xf6, 0x60, 0x54, 0x97, 0xa7, - 0x49, 0x85, 0x69, 0xaa, 0xcf, 0xf7, 0x95, 0xbd, 0x28, 0xcd, 0x8b, 0x30, 0xd5, 0xd8, 0x76, 0x56, - 0xbb, 0xee, 0x58, 0x32, 0x06, 0x79, 0x5f, 0x1c, 0xaa, 0x37, 0x40, 0x48, 0x49, 0x57, 0x53, 0xb5, - 0x5c, 0xb3, 0xa8, 0x09, 0xa5, 0xb8, 0xde, 0x9a, 0xd0, 0x5b, 0x3b, 0x23, 0x0e, 0x6e, 0x1f, 0xdf, - 0xde, 0x57, 0x12, 0xbf, 0xfc, 0x55, 0xa9, 0xd9, 0x0e, 0x1b, 0x06, 0x7d, 0xcd, 0x24, 0xae, 0x90, - 0x55, 0xfc, 0xd5, 0xa9, 0xf5, 0xb5, 0xce, 0xa6, 0x1e, 0xa2, 0xe1, 0x06, 0x6a, 0xe4, 0xe2, 0x02, - 0xe7, 0x08, 0xb5, 0x8a, 0xdf, 0x5f, 0x57, 0x12, 0xff, 0x5e, 0x57, 0x12, 0xdf, 0x3d, 0xdd, 0x1c, - 0x2d, 0x51, 0xa6, 0x5a, 0xe0, 0xc3, 0x4d, 0x14, 0x1b, 0x88, 0x7a, 0x04, 0x53, 0x24, 0xef, 0x03, - 0x60, 0x0e, 0x21, 0xc6, 0x68, 0xc4, 0x4f, 0x1f, 0x11, 0x9d, 0x15, 0x9e, 0x8e, 0x25, 0xef, 0x82, - 0x2d, 0x8f, 0xf8, 0x6c, 0x46, 0xb0, 0x91, 0xe1, 0x66, 0xc7, 0x6a, 0xa5, 0x79, 0x69, 0xf5, 0xd7, - 0x24, 0xc8, 0x75, 0xa9, 0x7d, 0x19, 0xf4, 0x5d, 0x87, 0x5d, 0x4d, 0x5e, 0x23, 0x5c, 0x73, 0x1d, - 0xf3, 0x51, 0xfe, 0x17, 0x79, 0xfd, 0x60, 0x55, 0xec, 0x50, 0xa5, 0x15, 0x49, 0x6b, 0x20, 0xed, - 0x52, 0x9b, 0x0a, 0xd2, 0x0b, 0x5a, 0x74, 0x8b, 0xb5, 0xf8, 0x16, 0x6b, 0xa7, 0x78, 0x6a, 0x84, - 0x08, 0x59, 0x06, 0x69, 0x17, 0xb9, 0x44, 0x79, 0x13, 0x66, 0x09, 0xd7, 0xb2, 0x02, 0xb6, 0x98, - 0xe3, 0x22, 0x12, 0x30, 0x25, 0x53, 0x95, 0x6a, 0x69, 0x23, 0x36, 0xe5, 0x63, 0x90, 0xe2, 0x5a, - 0x6e, 0x55, 0xa5, 0x5a, 0xae, 0xa9, 0x68, 0xf1, 0xa0, 0x2f, 0x4c, 0x80, 0x76, 0x8e, 0x50, 0x3b, - 0xcd, 0xa5, 0x34, 0x38, 0x74, 0x93, 0x2c, 0x17, 0x60, 0x7b, 0x81, 0xaf, 0x99, 0x0a, 0x15, 0x90, - 0xa3, 0xe8, 0x9b, 0x00, 0x61, 0x13, 0xc5, 0x32, 0xa4, 0x0d, 0x10, 0xbb, 0x3a, 0x16, 0x6f, 0x4f, - 0x88, 0x22, 0x78, 0x8a, 0x4d, 0xf5, 0x77, 0x09, 0xbc, 0xd7, 0xa5, 0xf6, 0x97, 0x9e, 0x05, 0x19, - 0xba, 0x08, 0xc7, 0x4c, 0x3e, 0x01, 0x59, 0x18, 0xb0, 0x21, 0xf1, 0x1d, 0x36, 0x8d, 0x34, 0x68, - 0x2b, 0x7f, 0xfc, 0x56, 0x2f, 0x88, 0x7b, 0x28, 0xa4, 0xb8, 0x64, 0xbe, 0x83, 0x6d, 0x63, 0x0e, - 0x95, 0xcf, 0x40, 0x26, 0x1a, 0xd4, 0xb0, 0x48, 0xae, 0x59, 0xd5, 0xd6, 0x3d, 0x6b, 0x5a, 0x54, - 0xa9, 0x9d, 0xe5, 0xa7, 0xfe, 0xf9, 0xe9, 0xe6, 0x48, 0x32, 0xc4, 0xd6, 0xd6, 0x31, 0x3f, 0xf5, - 0x3c, 0xe9, 0x0f, 0x4f, 0x37, 0x47, 0xfb, 0xcb, 0xef, 0xc1, 0x4a, 0xbb, 0x6a, 0x11, 0xec, 0xae, - 0xb8, 0x62, 0x62, 0x9a, 0xff, 0x25, 0x41, 0xaa, 0x4b, 0x6d, 0xf9, 0x27, 0x09, 0x14, 0xd7, 0xbf, - 0x17, 0x27, 0xeb, 0xfb, 0xdc, 0x34, 0x04, 0xa5, 0xcf, 0xdf, 0x6e, 0x5f, 0xdc, 0x9d, 0x9a, 0x90, - 0xfb, 0xe0, 0x9d, 0xd9, 0xe5, 0x3f, 0xdc, 0x98, 0x2d, 0x86, 0x95, 0xea, 0xaf, 0x82, 0x2d, 0xd4, - 0x18, 0x81, 0xfc, 0x92, 0xba, 0x1f, 0x6d, 0x4c, 0xb0, 0x08, 0x2d, 0x35, 0x5e, 0x0d, 0x8d, 0xeb, - 0x95, 0xde, 0x7c, 0xcb, 0xd5, 0x6c, 0x7f, 0x71, 0xfb, 0x50, 0x96, 0xee, 0x1e, 0xca, 0xd2, 0xdf, - 0x0f, 0x65, 0xe9, 0xc7, 0xc7, 0x72, 0xe2, 0xee, 0xb1, 0x9c, 0xf8, 0xf3, 0xb1, 0x9c, 0xf8, 0xea, - 0xd3, 0x85, 0xb7, 0x4a, 0x64, 0xaf, 0x13, 0xdf, 0x8e, 0xd7, 0xfa, 0xf8, 0x13, 0x7d, 0xb2, 0xf2, - 0x01, 0x08, 0x1f, 0xb0, 0x7e, 0x26, 0x1c, 0xc5, 0x8f, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xd9, - 0x95, 0xf0, 0x9e, 0x4f, 0x07, 0x00, 0x00, + // 891 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x31, 0x6f, 0x23, 0x45, + 0x14, 0xf6, 0xc6, 0xbe, 0xe4, 0x3c, 0x0e, 0x20, 0xf6, 0x72, 0xca, 0xda, 0x4a, 0x6c, 0x67, 0xe1, + 0x24, 0x13, 0x29, 0xb3, 0xb1, 0x41, 0x41, 0x8a, 0x04, 0x52, 0x7c, 0xd2, 0x49, 0x2e, 0x22, 0x8e, + 0xbd, 0xa3, 0xa1, 0xb1, 0x66, 0x77, 0xc7, 0xeb, 0x11, 0xd9, 0x19, 0x33, 0x33, 0x6b, 0xc5, 0x1d, + 0xa2, 0x42, 0x54, 0x34, 0x14, 0x74, 0x57, 0x22, 0x0a, 0x94, 0x82, 0x1f, 0x40, 0x79, 0xe5, 0x89, + 0x8a, 0x2a, 0xa0, 0xa4, 0x08, 0xf5, 0x15, 0xd4, 0x68, 0x76, 0x67, 0x1c, 0xdb, 0x3a, 0x5b, 0x11, + 0x8d, 0x3d, 0xef, 0xbd, 0x6f, 0xde, 0x7b, 0xf3, 0xbe, 0xf7, 0xde, 0x82, 0x3d, 0x8a, 0x53, 0xc9, + 0x19, 0xf5, 0x08, 0x95, 0x98, 0x87, 0x43, 0x44, 0xa8, 0x3c, 0x17, 0xde, 0xb8, 0xed, 0xc9, 0x73, + 0x38, 0xe2, 0x4c, 0x32, 0xdb, 0xd1, 0x10, 0x38, 0x07, 0x81, 0xe3, 0x76, 0xed, 0x5d, 0x94, 0x10, + 0xca, 0xbc, 0xec, 0x37, 0x07, 0xd7, 0xea, 0x21, 0x13, 0x09, 0x13, 0x5e, 0x80, 0x04, 0xf6, 0xc6, + 0xed, 0x00, 0x4b, 0xd4, 0xf6, 0x42, 0x46, 0xa8, 0xb6, 0x6f, 0x6b, 0x7b, 0x22, 0x62, 0x15, 0x24, + 0x11, 0xb1, 0x36, 0x54, 0x73, 0x43, 0x3f, 0x93, 0xbc, 0x5c, 0xd0, 0xa6, 0xad, 0x98, 0xc5, 0x2c, + 0xd7, 0xab, 0x93, 0xd6, 0xee, 0xc4, 0x8c, 0xc5, 0x67, 0xd8, 0x43, 0x23, 0xe2, 0x21, 0x4a, 0x99, + 0x44, 0x92, 0x30, 0x6a, 0xee, 0x3c, 0x9c, 0xb1, 0x0e, 0xa5, 0x1c, 0x99, 0x28, 0x5a, 0x9d, 0x49, + 0x41, 0x3a, 0xf0, 0x10, 0x9d, 0x68, 0xd3, 0x1e, 0x09, 0x42, 0x2f, 0x64, 0x1c, 0x7b, 0xe1, 0x10, + 0x51, 0x8a, 0xcf, 0x54, 0x7e, 0xfa, 0xa8, 0x21, 0xbb, 0xa6, 0x58, 0x03, 0x8c, 0x39, 0x1e, 0xa4, + 0x34, 0xc2, 0x5c, 0x9d, 0xb5, 0xf9, 0xd1, 0xd2, 0x5a, 0x8e, 0x10, 0x47, 0x89, 0x4e, 0xcd, 0xfd, + 0xa9, 0x08, 0x76, 0x4e, 0x45, 0xec, 0xe3, 0x98, 0x08, 0x89, 0x79, 0x6f, 0x0a, 0x3e, 0x09, 0x43, + 0x96, 0x52, 0x69, 0xef, 0x81, 0xcd, 0x01, 0x67, 0x49, 0x1f, 0x45, 0x11, 0xc7, 0x42, 0x38, 0x56, + 0xd3, 0x6a, 0x95, 0xfd, 0x8a, 0xd2, 0x9d, 0xe4, 0x2a, 0xfb, 0x13, 0xf0, 0x56, 0xc8, 0x28, 0xc5, + 0xa1, 0x7a, 0x73, 0x9f, 0x44, 0xce, 0x9a, 0xc2, 0x74, 0x9d, 0xd7, 0x97, 0x8d, 0xad, 0x09, 0x4a, + 0xce, 0x8e, 0xdd, 0x39, 0xb3, 0xeb, 0x6f, 0xde, 0xca, 0xbd, 0xc8, 0x7e, 0x0e, 0x1e, 0xde, 0xe6, + 0xd8, 0x47, 0x79, 0x5c, 0xe5, 0xa6, 0x98, 0xb9, 0x69, 0xbe, 0xbe, 0x6c, 0xec, 0xe4, 0x6e, 0xde, + 0x08, 0x73, 0xfd, 0x07, 0x64, 0x31, 0xeb, 0x5e, 0x64, 0x53, 0xb0, 0xc9, 0xf5, 0xa3, 0xfa, 0x03, + 0x8c, 0x9d, 0x52, 0xb3, 0xd8, 0xaa, 0x74, 0xaa, 0x50, 0x93, 0xa9, 0x5a, 0x02, 0xea, 0x96, 0x80, + 0x8f, 0x19, 0xa1, 0xdd, 0xc3, 0x97, 0x97, 0x8d, 0xc2, 0x2f, 0x7f, 0x35, 0x5a, 0x31, 0x91, 0xc3, + 0x34, 0x80, 0x21, 0x4b, 0x34, 0xf3, 0xfa, 0xef, 0x40, 0x44, 0x5f, 0x79, 0x72, 0x32, 0xc2, 0x22, + 0xbb, 0x20, 0xfc, 0x8a, 0x09, 0xf0, 0x04, 0x63, 0xfb, 0x08, 0xdc, 0x67, 0x3c, 0xc2, 0x9c, 0xd0, + 0xd8, 0xb9, 0xd7, 0xb4, 0x5a, 0x6f, 0x77, 0x6a, 0x90, 0x04, 0x21, 0x54, 0x24, 0x42, 0xc3, 0xdc, + 0xb8, 0x0d, 0x3f, 0x53, 0x20, 0x7f, 0x8a, 0x3d, 0xae, 0x7e, 0xf7, 0xa2, 0x51, 0xf8, 0xe7, 0x45, + 0xa3, 0xf0, 0xed, 0xcd, 0xc5, 0xfe, 0x5c, 0xa9, 0xdd, 0x08, 0xbc, 0xbf, 0x8a, 0x1a, 0x1f, 0x8b, + 0x11, 0xa3, 0x02, 0xdb, 0xbb, 0x00, 0xe8, 0x00, 0xaa, 0x6a, 0x39, 0x41, 0x65, 0xad, 0xe9, 0x45, + 0xf6, 0x36, 0xd8, 0x18, 0x31, 0x2e, 0xa7, 0xc4, 0xf8, 0xeb, 0x4a, 0xec, 0x45, 0xc7, 0x25, 0x15, + 0xda, 0xfd, 0x75, 0x0d, 0x54, 0x4e, 0x45, 0xfc, 0x2c, 0x0d, 0x12, 0x22, 0x9f, 0x9f, 0xdf, 0x85, + 0xf0, 0xce, 0x32, 0xc6, 0x72, 0xff, 0x6f, 0xe4, 0xe3, 0xbd, 0xc5, 0x26, 0xc9, 0xd8, 0x5d, 0x68, + 0x85, 0x16, 0x28, 0x25, 0x22, 0x16, 0x9a, 0xac, 0x2d, 0x98, 0x0f, 0x08, 0x34, 0x03, 0x02, 0x4f, + 0xe8, 0xc4, 0xcf, 0x10, 0xb6, 0x0d, 0x4a, 0x09, 0x4e, 0x58, 0x56, 0xea, 0xb2, 0x9f, 0x9d, 0x6d, + 0x07, 0x6c, 0x48, 0x92, 0x60, 0x96, 0x4a, 0x67, 0xbd, 0x69, 0xb5, 0x4a, 0xbe, 0x11, 0xed, 0x43, + 0x50, 0x54, 0x3d, 0xb0, 0xd1, 0xb4, 0x5a, 0x95, 0x8e, 0x03, 0xcd, 0x0e, 0x99, 0x99, 0x1c, 0xf8, + 0x04, 0xe3, 0x6e, 0x49, 0xb5, 0x80, 0xaf, 0xa0, 0xab, 0x68, 0x79, 0x0a, 0x1e, 0xcc, 0xd4, 0x6b, + 0xca, 0x42, 0x03, 0x54, 0x04, 0xfe, 0x3a, 0xc5, 0x34, 0xc4, 0x86, 0x86, 0x92, 0x0f, 0x8c, 0xaa, + 0x17, 0xa9, 0xf4, 0x34, 0x29, 0xba, 0x4e, 0x46, 0x74, 0x7f, 0xb7, 0xc0, 0x3b, 0xa7, 0x22, 0xfe, + 0x62, 0x14, 0x21, 0x89, 0x9f, 0x66, 0xe3, 0x69, 0x1f, 0x81, 0x32, 0x4a, 0xe5, 0x90, 0x71, 0x22, + 0x27, 0x39, 0x07, 0x5d, 0xe7, 0x8f, 0xdf, 0x0e, 0xb6, 0x74, 0xff, 0x6a, 0x2a, 0x9e, 0x49, 0xd5, + 0x44, 0xfe, 0x2d, 0xd4, 0x7e, 0x0c, 0xd6, 0xf3, 0x01, 0xcf, 0x82, 0x54, 0x3a, 0x4d, 0xb8, 0x6c, + 0x63, 0xc2, 0x3c, 0x52, 0xb7, 0xac, 0x5e, 0xfd, 0xf3, 0xcd, 0xc5, 0xbe, 0xe5, 0xeb, 0xab, 0xc7, + 0x87, 0xea, 0xd5, 0xb7, 0x4e, 0xbf, 0xbf, 0xb9, 0xd8, 0xdf, 0x9d, 0xdf, 0x23, 0x0b, 0xe9, 0xba, + 0x55, 0xb0, 0xbd, 0xa0, 0x32, 0x85, 0xe9, 0xfc, 0xbb, 0x06, 0x8a, 0xa7, 0x22, 0xb6, 0x7f, 0xb4, + 0x40, 0x75, 0xf9, 0x9e, 0x39, 0x5a, 0x9e, 0xe7, 0xaa, 0x21, 0xa8, 0x7d, 0xfa, 0xff, 0xee, 0x99, + 0xec, 0xdc, 0x82, 0x1d, 0x80, 0xfb, 0xd3, 0xe6, 0x7f, 0xb4, 0xd2, 0x9b, 0x81, 0xd5, 0x0e, 0xee, + 0x04, 0x9b, 0x89, 0x71, 0x06, 0x36, 0xe7, 0xd8, 0xfd, 0x60, 0xa5, 0x83, 0x59, 0x68, 0xad, 0x7d, + 0x67, 0xa8, 0x89, 0x57, 0xbb, 0xf7, 0x8d, 0x62, 0xb3, 0xfb, 0xf9, 0xcb, 0xab, 0xba, 0xf5, 0xea, + 0xaa, 0x6e, 0xfd, 0x7d, 0x55, 0xb7, 0x7e, 0xb8, 0xae, 0x17, 0x5e, 0x5d, 0xd7, 0x0b, 0x7f, 0x5e, + 0xd7, 0x0b, 0x5f, 0x7e, 0x3c, 0xb3, 0xe3, 0xb4, 0xf7, 0x03, 0xc6, 0x63, 0x73, 0xf6, 0xc6, 0x1f, + 0x79, 0xe7, 0x0b, 0x1f, 0x8e, 0x6c, 0xf1, 0x05, 0xeb, 0xd9, 0x28, 0x7e, 0xf8, 0x5f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xda, 0x2c, 0x63, 0xb9, 0xaa, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -560,6 +565,11 @@ func (m *MsgRegisterInterchainAccount) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.Ordering != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Ordering)) + i-- + dAtA[i] = 0x28 + } if len(m.RegisterFee) > 0 { for iNdEx := len(m.RegisterFee) - 1; iNdEx >= 0; iNdEx-- { { @@ -848,6 +858,9 @@ func (m *MsgRegisterInterchainAccount) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + if m.Ordering != 0 { + n += 1 + sovTx(uint64(m.Ordering)) + } return n } @@ -1109,6 +1122,25 @@ func (m *MsgRegisterInterchainAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ordering", wireType) + } + m.Ordering = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ordering |= types1.Order(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1398,7 +1430,7 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msgs = append(m.Msgs, &types1.Any{}) + m.Msgs = append(m.Msgs, &types2.Any{}) if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err }