Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@svyatonik
Copy link
Contributor

There's currently issue with light client startup, similar to what has been fixed in #1130 - during Client initialization we try to read genesis storage or execute code at genesis. And since it is initialization, the network is not yet started => no remote nodes can respond with remote call/read results.

The fix is to read genesis storage/execute code at genesis block locally - that's what this PR is about. It adds two main structures - OnDemandOrGenesisState (replaces OnDemandState on light client) and RemoteOrLocalCallExecutor (replaces RemoteCallExecutor on light client). So when we start light client for first time (with empty db) - Aura, GRANDPA (in future PRs) and everything else has an access to full genesis state => has a chance to initialize.

Later improvements:

  • (optional?) for cases when LC has started, but Aura/GRANDPA/... initialization hasn't finished (crash or smth similar), make genesis state available again (i.e. it'll be available always, not only on first start);
  • integration tests (iirc there has been tracking issue for these).

@svyatonik svyatonik added the A0-please_review Pull request needs code review. label Jan 30, 2019
@gavofyork gavofyork merged commit d680881 into master Feb 1, 2019
@gavofyork gavofyork deleted the light_genesis_state branch February 1, 2019 09:27
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Apr 12, 2019
* make genesis state available on light client

* RemoteOrLocalCallExecutor

* code_is_executed_locally_or_remotely

* OnDemandOrGenesisState tests

* some comments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants