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

Light Node Initialization #293

Closed
ebuchman opened this issue Jun 3, 2020 · 4 comments
Closed

Light Node Initialization #293

ebuchman opened this issue Jun 3, 2020 · 4 comments
Assignees
Labels
light-client Issues/features which involve the light client
Milestone

Comments

@ebuchman
Copy link
Member

ebuchman commented Jun 3, 2020

The light node already support config file and flags through Abscissa.

Configuration file for a light node should include:

  • chain id
  • list of full node urls (prod versions should require them to be https)
  • trust period duration (eg. 1week)
  • trust threshold (numerator and denominator, eg. 1/3)

When starting the light node for the first time, we need to provide subjective initialization in the form of a block height and hash, eg. --height 962118 --hash 28B97BE9F6DE51AC69F70E0B7BFD7E5C9CD1A595B7DC31AFF27C50D4948020CD. See the tendermint lite command.

If we restart the process, we shouldn't need to provide this info, as we should have a trusted state in our db by then.

Of course if the trusted state has expired, the node should fail, and we should be required to re-initialize with a new hash and height.

Another possible situation for initialization is starting from a new blockchain, in which case we can potentially pass in a --genesis flag with a path to a tendermint genesis file to initialize the trusted state from. But we also need to add support for initializing from genesis (see #201).

We might want to separate initialization and normal operation into two distinct commands.

@ebuchman ebuchman added this to the Light Node milestone Jun 3, 2020
@ebuchman ebuchman added the light-client Issues/features which involve the light client label Jun 3, 2020
@brapse brapse self-assigned this Jun 9, 2020
@ebuchman
Copy link
Member Author

ebuchman commented Jun 9, 2020

This isn't just for the Light Node - any use of the Light Client will require some way to subjectively initialize it, so it should expose some initialization method that takes a height and hash and be able to start from there.

Note for off chain uses (eg. light node, relayer), we specify a height and hash and the LC fetches the header and validator set, checks everything matches, and trusts it and starts from there. For on chain uses (eg. IBC on chain), the header and validator set would be provided directly and just trusted (ie. as part of client creation on chain), since on chain logic can't "fetch" things

@romac
Copy link
Member

romac commented Jun 9, 2020

The light client (supervisor) will also need to be provided with a mapping between peer ids and net addresses.

@brapse brapse assigned liamsi and unassigned brapse Jun 9, 2020
@liamsi
Copy link
Member

liamsi commented Jul 8, 2020

We might want to separate initialization and normal operation into two distinct commands.

My current thinking is ideally there would be two commands:

  • light-node initialize --height <trusted height> -- hash <trusted hash> [-f] <- inits the light node subjectively (optionally force overwrite existing initialized store) via verify_to_target and returns (or goes over to main loop?)
  • light-node start [-c] starts main loop (light client handle for verify_to_highest and the rpc server); all options for the light client instances are controllable via a config file (-c)

This was referenced Jul 9, 2020
@brapse
Copy link
Contributor

brapse commented Jul 14, 2020

This landed with #430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
light-client Issues/features which involve the light client
Projects
None yet
Development

No branches or pull requests

4 participants