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

--generate-only broke between v0.33 and v0.34 #4131

Closed
4 tasks
davepuchyr opened this issue Apr 16, 2019 · 7 comments
Closed
4 tasks

--generate-only broke between v0.33 and v0.34 #4131

davepuchyr opened this issue Apr 16, 2019 · 7 comments

Comments

@davepuchyr
Copy link

Summary of Bug

gaiacli txs work without the "--generate-only" flag but fail with the "--generate-only" flag yeilding failed to get from fields: decoding bech32 failed: invalid bech32 string length 4.

Example of a successful execution:

[dave@debt hugnet]$ gaiacli tx staking delegate cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl 1000000muon --from debt --chain-id gaia-13003 --gas auto --gas-adjustment 1.1 --fees 2000muon
gas estimate: 102328
{"chain_id":"gaia-13003","account_number":"79","sequence":"102","fee":{"amount":[{"denom":"muon","amount":"2000"}],"gas":"102328"},"msgs":[{"type":"cosmos-sdk/MsgDelegate","value":{"delegator_address":"cosmos1zkupr83hrzkn3up5elktzcq3tuft8nxs76e4yj","validator_address":"cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl","amount":{"denom":"muon","amount":"1000000"}}}],"memo":""}

confirm transaction before signing and broadcasting [Y/n]: y
Password to sign with 'debt':
Response:
  TxHash: CF27CC8C4BEE2A5BFED6057F9615F1480F02E267D5361EFE8C215EA9D8B7A89D

Example of a failed execution with the only difference in the command being the "--generate-only" flag:

[dave@debt hugnet]$ gaiacli tx staking delegate cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl 1000000muon --from debt --chain-id gaia-13003 --gas auto --gas-adjustment 1.1 --fees 2000muon --generate-only
failed to get from fields: decoding bech32 failed: invalid bech32 string length 4[dave@debt hugnet]$ 

Version

[dave@debt us]$ gaiad version --long
cosmos-sdk: 0.34.0
git commit: 0f7877c23b407e24e56056469e90fe6b8a78d84c
vendor hash: b0ee613acca9a3a572b558d0481ec7baa008f732431392af81db3555c92c8dd7
build tags: netgo ledger
go version go1.11.5 linux/amd64

[dave@debt us]$ gaiacli version --long
cosmos-sdk: 0.34.0
git commit: 0f7877c23b407e24e56056469e90fe6b8a78d84c
vendor hash: b0ee613acca9a3a572b558d0481ec7baa008f732431392af81db3555c92c8dd7
build tags: netgo ledger
go version go1.11.5 linux/amd64
[dave@debt us]$ 

Steps to Reproduce

Added the "--generate-only" flag to a gaiacli command.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@zmanian
Copy link
Member

zmanian commented Apr 16, 2019

I can reproduce

@alessio
Copy link
Contributor

alessio commented Apr 16, 2019

90797f5

It's a longstanding problem. We've made confusion between --generate-only and --offline. I think it's right about the time to come up with a better design of the two modes, see #3720 (comment)

@alessio
Copy link
Contributor

alessio commented Apr 16, 2019

@davepuchyr All I can do for now is tentatively recommending a mitigation to your problem. Try the following:

gaiacli tx staking delegate cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl 1000000muon --from `gaiacli keys show --address debt` --chain-id gaia-13003 --gas auto --gas-adjustment 1.1 --fees 2000muon --generate-only

@alexanderbez
Copy link
Contributor

Thanks @davepuchyr, but this is not a bug and is intended behavior, see: #3960. The goal was to have generate-only functionality be consistent across clients, both REST and CLI.

You must provide a valid Bech32 cosmos address as input whenever performing generate-only. If you deem that it should not be consistent across both clients, please open another issue to allow further discourse.

@davepuchyr
Copy link
Author

davepuchyr commented Apr 16, 2019

gaiacli tx staking delegate cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl 1000000muon --from `gaiacli keys show --address debt` --chain-id gaia-13003 --gas auto --gas-adjustment 1.1 --fees 2000muon --generate-only

Thank-you for the quick response and the workaround, I can live with it.

I agree with the goal of consistency.

BTW, I did search for various forms of "generate-only" before submitting the issue. #3960 never came up. Regardless, I owe @alessio a beer!

@alexanderbez
Copy link
Contributor

Thanks @davepuchyr. A valid search came up for me with query: "generate" :)

Enjoy your 🍻

@jjhesk
Copy link

jjhesk commented Jun 13, 2020

There is a similar in #6434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants