Would it be a security risk if the CLI determines the chain-id itself so that user don't have to provide it as a cli flag?
If you trust the full node, this should be fine. If you don't trust the full node, you need to start from a local root-of-trust to verify proofs.
Rather than this, how about shipping gaiacli with common genesis files (now in this repository anyways) built in as options from which the user can select?
How is this for the ui for when --chain-id isn't entered:
$ gaiacli send <flags>
Defaulting to the following chain-id: gaia-6002.
Please enter [y/n] or another chain-id option. Other known chain-ids: [gaia-5001, gaia-5002]
We used to have an init sequence that we should bring back. Eg:
gaiacli init --chain-id gaia-7000 --node coinculture.net:46657
This information should be persisted so we never have to enter it again!
It will also require some additional input from the user for "weak subsjectivity initialization". Either:
Another alternative is to be able to specify multiple nodes (of course over HTTPS !) and ask all of them for the validator set hash and only if they all agree do we move forward with it.
Of course if that set is malicious, they can conspire to screw the light client ...
Sounds like the only thing blocking here is a plan for how exactly to persist these CLI settings. I'm going to change this issue name to reflect that.
Seems related to #1613 ?
Yup! We should circle up on this.