Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starport doesn't generate the code for Update IBC clients by governance #1813

Closed
RaulBernal opened this issue Nov 15, 2021 · 8 comments · Fixed by #1975
Closed

Starport doesn't generate the code for Update IBC clients by governance #1813

RaulBernal opened this issue Nov 15, 2021 · 8 comments · Fixed by #1975
Assignees
Labels
report type:bug Something isn't working
Milestone

Comments

@RaulBernal
Copy link
Contributor

Describe the bug
When you want to send a governance proposal to Update a frozen IBC client, you can't find the command:

bcnad tx gov  submit-proposal 
Error: invalid message: can't proto marshal <nil>
Usage:
  bcnad tx gov submit-proposal [flags]
  bcnad tx gov submit-proposal [command]

Available Commands:
  cancel-software-upgrade Cancel the current software upgrade proposal
  community-pool-spend    Submit a community pool spend proposal
  param-change            Submit a parameter change proposal
  software-upgrade        Submit a software upgrade proposal

It should include a update-client <expired-client-id> <active-client-id> params

To Reproduce
Steps to reproduce the behavior:

  1. bcnad tx gov submit-proposal update-client

Please provide the version output

  • starport version: v.0.18.4
@jhernandezb
Copy link
Contributor

jhernandezb commented Nov 28, 2021

it seems like the router key is also misconfigured in app.go and would be a breaking change for chains

Should be
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

See migration guide https://github.com/cosmos/ibc-go/blob/main/docs/migrations/sdk-to-v1.md#proposal-handler-registration

@RaulBernal
Copy link
Contributor Author

Hi!
I have applied the changes and it show the option now :)

$ bcna2d tx gov submit-proposal 
Error: invalid message: can't proto marshal <nil>
Usage:
  bcna2d tx gov submit-proposal [flags]
  bcna2d tx gov submit-proposal [command]

Available Commands:
  cancel-software-upgrade Cancel the current software upgrade proposal
  community-pool-spend    Submit a community pool spend proposal
  ibc-upgrade             Submit an IBC upgrade proposal
  param-change            Submit a parameter change proposal
  software-upgrade        Submit a software upgrade proposal
  update-client           Submit an update IBC client proposal

I didn't test the update-client yet but I will.

bcna2d tx gov submit-proposal update-client 
Error: accepts 3 arg(s), received 0
Usage:
  bcna2d tx gov submit-proposal update-client [subject-client-id] [substitute-client-id] [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --deposit string           deposit of proposal
[............]

BTW see the error in the output:
Error: invalid message: can't proto marshal <nil>

@RaulBernal
Copy link
Contributor Author

BTW testing the command I found this error msg:

$ bcnad tx gov submit-proposal update-client 07-tendermint-01 07-tendermint-02 --from alice --title "uprade IBC client"  --deposit 1000000ubcna --description "testing update of IBC Client" --fees 1000ubcna --deposit 100000ubcna --chain-id bitcanna-dev-1 
Error: accepts 3 arg(s), received 2
Usage:
  bcnad tx gov submit-proposal update-client [subject-client-id] [substitute-client-id] [flags]

@RaulBernal
Copy link
Contributor Author

Should be AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

Osmosis, in their last update has added the route and modified the old ibchost.
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).

	AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).

@jhernandezb
Copy link
Contributor

Seems like osmosis actually have it duplicated but the official guide says that it should be replaced with ibcclienttypes.RouterKey I guess someone should write an integration test to recover an expired client 😬

@RaulBernal
Copy link
Contributor Author

RaulBernal commented Dec 15, 2021 via email

@jhernandezb
Copy link
Contributor

Going to give it a try and report back

@RaulBernal
Copy link
Contributor Author

RaulBernal commented Dec 28, 2021

Hello :)
I've update to ibc-go/v2 , SDK v.0.44.5 and Tendermint v.34.15

name: bcna
server_name: bcnad
version: 1.3-pre3
commit: f1a10f6b347afa7ace5e3cf6f35a9bd89092c896
build_tags: netgo,ledger
go: go version go1.17.5 linux/amd64
build_deps:
- filippo.io/edwards25519@v1.0.0-beta.2
- github.com/99designs/keyring@v1.1.6
- github.com/ChainSafe/go-schnorrkel@v0.0.0-20200405005733-88cbf1b4c40d
- github.com/Workiva/go-datastructures@v1.0.53
- github.com/armon/go-metrics@v0.3.9
- github.com/beorn7/perks@v1.0.1
- github.com/bgentry/speakeasy@v0.1.0
- github.com/btcsuite/btcd@v0.22.0-beta
- github.com/cespare/xxhash/v2@v2.1.2
- github.com/coinbase/rosetta-sdk-go@v0.6.10
- github.com/confio/ics23/go@v0.6.6
- github.com/cosmos/btcutil@v1.0.4
- github.com/cosmos/cosmos-sdk@v0.44.5
- github.com/cosmos/go-bip39@v1.0.0
- github.com/cosmos/iavl@v0.17.3
- github.com/cosmos/ibc-go/v2@v2.0.2
- github.com/cosmos/ledger-cosmos-go@v0.11.1
- github.com/cosmos/ledger-go@v0.9.2
- github.com/davecgh/go-spew@v1.1.1
- github.com/desertbit/timer@v0.0.0-20180107155436-c41aec40b27f
- github.com/dvsekhvalnov/jose2go@v0.0.0-20200901110807-248326c1351b
- github.com/felixge/httpsnoop@v1.0.1
- github.com/fsnotify/fsnotify@v1.5.1
- github.com/go-kit/kit@v0.12.0
- github.com/go-kit/log@v0.2.0
- github.com/go-logfmt/logfmt@v0.5.1
- github.com/godbus/dbus@v0.0.0-20190726142602-4481cbc300e2
- github.com/gogo/gateway@v1.1.0
- github.com/gogo/protobuf@v1.3.3 => github.com/regen-network/protobuf@v1.3.3-alpha.regen.1
- github.com/golang/protobuf@v1.5.2
- github.com/golang/snappy@v0.0.3
- github.com/google/btree@v1.0.0
- github.com/google/orderedcode@v0.0.1
- github.com/gorilla/handlers@v1.5.1
- github.com/gorilla/mux@v1.8.0
- github.com/gorilla/websocket@v1.4.2
- github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0
- github.com/grpc-ecosystem/grpc-gateway@v1.16.0
- github.com/gsterjov/go-libsecret@v0.0.0-20161001094733-a6f4afe4910c
- github.com/gtank/merlin@v0.1.1
- github.com/gtank/ristretto255@v0.1.2
- github.com/hashicorp/go-immutable-radix@v1.3.1
- github.com/hashicorp/golang-lru@v0.5.4
- github.com/hashicorp/hcl@v1.0.0
- github.com/hdevalence/ed25519consensus@v0.0.0-20210204194344-59a8610d2b87
- github.com/improbable-eng/grpc-web@v0.14.1
- github.com/klauspost/compress@v1.13.6
- github.com/lib/pq@v1.10.4
- github.com/libp2p/go-buffer-pool@v0.0.2
- github.com/magiconair/properties@v1.8.5
- github.com/mattn/go-isatty@v0.0.14
- github.com/matttproud/golang_protobuf_extensions@v1.0.1
- github.com/mimoo/StrobeGo@v0.0.0-20181016162300-f8f6d4d2b643
- github.com/minio/highwayhash@v1.0.2
- github.com/mitchellh/go-homedir@v1.1.0
- github.com/mitchellh/mapstructure@v1.4.2
- github.com/mtibben/percent@v0.2.1
- github.com/pelletier/go-toml@v1.9.4
- github.com/pkg/errors@v0.9.1
- github.com/pmezard/go-difflib@v1.0.0
- github.com/prometheus/client_golang@v1.11.0
- github.com/prometheus/client_model@v0.2.0
- github.com/prometheus/common@v0.30.0
- github.com/prometheus/procfs@v0.7.3
- github.com/rakyll/statik@v0.1.7
- github.com/rcrowley/go-metrics@v0.0.0-20200313005456-10cdbea86bc0
- github.com/regen-network/cosmos-proto@v0.3.1
- github.com/rs/cors@v1.8.0
- github.com/rs/zerolog@v1.23.0
- github.com/spf13/afero@v1.6.0
- github.com/spf13/cast@v1.4.1
- github.com/spf13/cobra@v1.2.1
- github.com/spf13/jwalterweatherman@v1.1.0
- github.com/spf13/pflag@v1.0.5
- github.com/spf13/viper@v1.9.0
- github.com/stretchr/testify@v1.7.0
- github.com/subosito/gotenv@v1.2.0
- github.com/syndtr/goleveldb@v1.0.1-0.20200815110645-5c35d600f0ca
- github.com/tendermint/btcd@v0.1.1
- github.com/tendermint/crypto@v0.0.0-20191022145703-50d29ede1e15
- github.com/tendermint/go-amino@v0.16.0
- github.com/tendermint/spm@v0.1.8 => github.com/RaulBernal/spm@v0.1.9-ibc2
- github.com/tendermint/tendermint@v0.34.15
- github.com/tendermint/tm-db@v0.6.6
- github.com/zondax/hid@v0.9.0
- golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272
- golang.org/x/net@v0.0.0-20211005001312-d4b1ae081e3b
- golang.org/x/sys@v0.0.0-20211004093028-2c5d950f24ef
- golang.org/x/term@v0.0.0-20201126162022-7de9c90e9dd1
- golang.org/x/text@v0.3.7
- google.golang.org/genproto@v0.0.0-20211208223120-3a66f561d7aa
- google.golang.org/grpc@v1.43.0 => google.golang.org/grpc@v1.33.2
- google.golang.org/protobuf@v1.27.1
- gopkg.in/ini.v1@v1.63.2
- gopkg.in/yaml.v2@v2.4.0
- gopkg.in/yaml.v3@v3.0.0-20210107192922-496545a6307b
- nhooyr.io/websocket@v1.8.6
cosmos_sdk_version: v0.44.5

Now I can send the proposal but a new issue raises:

build/bcnad tx gov submit-proposal update-client 07-tendermint-01 07-tendermint-02 --from validator --title "uprade IBC client"  --deposit 1000000ubcna --description "testing update of IBC Client" --fees 1000ubcna --deposit 100000ubcna --chain-id bitcanna-dev-1
Enter keyring passphrase:
{"body":{"messages":[{"@type":"/cosmos.gov.v1beta1.MsgSubmitProposal","content":{"@type":"/ibc.core.client.v1.ClientUpdateProposal","title":"uprade IBC client","description":"testing update of IBC Client","subject_client_id":"07-tendermint-01","substitute_client_id":"07-tendermint-02"},"initial_deposit":[{"denom":"ubcna","amount":"100000"}],"proposer":"bcna1kqjfuakxwmjpgr7psw66z6pd7xq6l0w7mn6k7a"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"ubcna","amount":"1000"}],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: 7FD93E1AB21B82F65D21BBA099B3DEF6CE3D33432B4B8D9F0DB0F509ECBD2F27 

If I query the TX, the proposal is not generated:

build/bcnad query tx 41F58F447941608A3FB55147A2B00B9FB465F48932762344A94DB4738B30D5A2
code: 9
codespace: gov
data: ""
events: []
gas_used: "50511"
gas_wanted: "200000"
height: "1312749"
info: ""
logs: []
raw_log: 'failed to execute message; message index: 0: client: no handler exists for
  proposal type'
timestamp: "2021-12-28T10:40:28Z"
tx:
  '@type': /cosmos.tx.v1beta1.Tx
  auth_info:
    fee:
      amount:
      - amount: "1000"
        denom: ubcna
      gas_limit: "200000"
      granter: ""
      payer: ""
    signer_infos:
    - mode_info:
        single:
          mode: SIGN_MODE_DIRECT
      public_key:
        '@type': /cosmos.crypto.secp256k1.PubKey
        key: ArZiMlzonNQSzLwAojwe2LLfkpbeSvvzAPuhRu9ozpVD
      sequence: "20"
  body:
    extension_options: []
    memo: ""
    messages:
    - '@type': /cosmos.gov.v1beta1.MsgSubmitProposal
      content:
        '@type': /ibc.core.client.v1.ClientUpdateProposal
        description: testing update of IBC Client
        subject_client_id: 07-tendermint-1
        substitute_client_id: 07-tendermint-2
        title: uprade IBC client
      initial_deposit:
      - amount: "100000"
        denom: ubcna
      proposer: bcna1kqjfuakxwmjpgr7psw66z6pd7xq6l0w7mn6k7a
    non_critical_extension_options: []
    timeout_height: "0"
  signatures:
  - S8JZ95V7nI8/p+ZYJMbD2QebThrQMln1sPFeJAQGKG0OQZK9yKUvTMP1XjNfNuA8MfuL+daslDPQeZXGzvbifw==
txhash: 41F58F447941608A3FB55147A2B00B9FB465F48932762344A94DB4738B30D5A2 

@ilgooz ilgooz added the type:bug Something isn't working label Jan 3, 2022
@ilgooz ilgooz added this to the v0.19.2 milestone Jan 3, 2022
@ilgooz ilgooz self-assigned this Jan 4, 2022
@ilgooz ilgooz linked a pull request Jan 7, 2022 that will close this issue
@ilgooz ilgooz closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
report type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants