Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Light-client sync for contract-based PoA #6370

Merged
merged 19 commits into from
Sep 4, 2017
Merged

Light-client sync for contract-based PoA #6370

merged 19 commits into from
Sep 4, 2017

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Aug 24, 2017

Closes #5427

Summary of changes:

  • Generalize state-dependent proofs
  • Check for signals.
  • Store pending and finalized epoch changes in the light client's header chain.
  • Separate EngineClient from BlockChainClient and implement EngineClient for light client.
  • Fetch and check epoch change proofs from the network on demand during light sync.

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Aug 24, 2017
@rphmeier rphmeier requested review from keorn and arkpar August 24, 2017 14:32
@rphmeier
Copy link
Contributor Author

rphmeier commented Aug 31, 2017

just a note: the only proof that the light client actually needs to go to the network for is when the transition to the contract first begins. Transitions within the contract just require receipts to be fetched.

@@ -53,6 +59,9 @@ const HISTORY: u64 = 2048;
/// The best block key. Maps to an RLP list: [best_era, last_era]
const CURRENT_KEY: &'static [u8] = &*b"best_and_latest";

/// Key storing the last canonical epoch transition.
const LAST_CANONICAL_TRANSITION: &'static [u8] = &*b"canonical_transition";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require a database upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the most recent version of the code instantiates this key if it doesn't exist already. Only chains which don't use epochs can be synced by the light client right now anyway. When running the new version, their genesis epoch data will be populated correctly.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Sep 4, 2017
@rphmeier rphmeier merged commit 3c60f99 into master Sep 4, 2017
@rphmeier rphmeier deleted the light-poa branch September 4, 2017 19:20
debris added a commit that referenced this pull request Sep 5, 2017
This reverts commit 3c60f99, reversing
changes made to b731cce.
@debris debris mentioned this pull request Sep 5, 2017
arkpar pushed a commit that referenced this pull request Sep 5, 2017
* fixed master

* Revert "Merge pull request #6370 from paritytech/light-poa"

This reverts commit 3c60f99, reversing
changes made to b731cce.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants