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

Weak-subjectivity resistant synchronization #1

Open
rphmeier opened this issue Jan 21, 2019 · 1 comment
Open

Weak-subjectivity resistant synchronization #1

rphmeier opened this issue Jan 21, 2019 · 1 comment
Labels
U4-some_day_maybe Issue might be worth doing eventually.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Jan 21, 2019

Here are our considerations:

  • full nodes need to execute all blocks
  • full nodes are somewhat limited in reorganization capability
  • we don't have warp sync
  • it's difficult to evaluate the fork-choice until we've already synced a bunch.
  • the Polkadot light client has some kind of protection against weak subjectivity that we want to extend to our parachain.

Let's say we are synchronizing a generalized Substrate chain called Local.

Nodes on Local should attach a little piece of metadata (an inclusion-proof) to every Nth Local block called an "inclusion proof". It's a small state proof of the storage changing for the parachain head. There might be multiple of these blocks.

Light and full polkadot nodes can easily tell you the block hash of the ancestor of the finalized block, so the inclusion proofs will be useful.

Who generates these proofs? Any node at the head of the chain can probably do it. After we import a Polkadot block which updated the Local head, we want a merkle proof of the new storage entry. This is easy to check. We keep a list for every Local block with number % N == 0. These lists can be pruned on finality.

On block import of a Local block LB with number % N == 0, we query inclusion proofs for that block where the Polkadot block within is in the finalized chain. If there are none or the Polkadot block is not finalized, we simply import (for now). This is fine assuming that there is not a larger lag in finality than the client can cope with reorganizations.

@rphmeier
Copy link
Contributor Author

rphmeier commented Apr 24, 2019

WIth log2 ancestors (paritytech/substrate#2053):

  1. Find latest finalized parachain block hash by querying the relay chain light client
  2. Act as a light client of the parachain and use log2 ancestors to find older canonical block hashes
  3. make sure sync service is downloading these blocks

@rphmeier rphmeier changed the title Safer Synchronization Weak-synchrony resistant synchronization Apr 24, 2019
@rphmeier rphmeier changed the title Weak-synchrony resistant synchronization Weak-subjectivity resistant synchronization Apr 24, 2019
coriolinus pushed a commit that referenced this issue Mar 24, 2020
@the-right-joyce the-right-joyce added U2-some_time_soon Issue is worth doing soon. U4-some_day_maybe Issue might be worth doing eventually. and removed P9-somedaymaybe U2-some_time_soon Issue is worth doing soon. labels Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
U4-some_day_maybe Issue might be worth doing eventually.
Projects
None yet
Development

No branches or pull requests

2 participants