Closed cmwaters closed 4 years ago
I strongly support. Don't understand the need to initialize clients separately.
To reset them (in case of a fork) - sure, we must provide a command for doing that. Related issue: https://github.com/cosmos/relayer/issues/6
@cmwaters yes this is the case. The lite
commands are mainly for testing and admin purposes.
Good we've cleared this out 👍 So, relayer
initially starts both light clients.
If something goes wrong and one (or both) clients expire (or there's a fork on one of the connected chains), client could be reset with relayer lite reset [chain-id] --trusted-hash=0xaaa --trusted-height=100
OR relayer lite reset [chain-id] --url=https://cosmos.network/hub/trustedsetup
(we should receive hash and height and prompt user if that is what she wanted).
NOTE: If an old data conflicts with new data, confirmation step is also necessary (see lite.ConfirmationFunction
). --force-yes
flag can be used to skip confirmation.
If the user wants to delete all the data (albeit useful info for post analysis might be lost if there was an attack on the light client), she could do so with lite delete [chain-id]
(confirmation step is necessary I believe). --force-yes
flag can be used to skip confirmation.
We will need to add an API to relayer
for both resetting and deleting data. This can be a locally available HTTP API (/lite/reset?chain-id=test&trusted-hash=0xaaa&trusted-height=100
, /lite/delete?chain-id=test
).
IMHO this can be done later.
@melekes adding a HTTP API can def be done later. I'm fine just having the CLI for management now.
Should a lite client for every chain specified in the config file be automatically generated upon startup of the relayer?