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

chainSpec: Add Checkpoint extension to the chainSpec #3271

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Feb 8, 2024

The Checkpoint extension is needed for the lightclient to synchronize faster to the head of the chain.

This is a replacement for the current lightSyncState, which doesn't expose directly any particular data about the grandpa or babe; and therefore doesn't cause a breaking change when switching consensus mechanisms (sassafras).

Instead, the finalized block's :code section is exposed indirectly in a storage proof. Then, the user of the checkpoint will regenerate the state of the consensus using the runtime APIs.

The checkpoint is a Merkle proof that consists of:

  • :code and :heappages storage proofs
  • BabeApi_current_epoch, BabeApi_next_epoch, BabeApi_configuration, GrandpaApi_grandpa_authorities, and GrandpaApi_current_set_id call proofs
"checkpoint": {
    "header": "...",
    "callProof": "..."
}

For now, the checkpoint extension is added next to the lightSyncState. A future PR will deprecate and remove the lightSyncState.

This PR validates the proposal from: #60; as well as unblocks the chainSpec V2 method which awaits a consensus on the checkpoint format: paritytech/json-rpc-interface-spec#124.

Testing Done

  • Checked that the storage proof contains the :code section needed for users to regenerate the consensus state.

@lexnv lexnv added A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). R0-silent Changes should not be mentioned in any release notes I5-enhancement An additional feature request. D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. labels Feb 8, 2024
@lexnv lexnv self-assigned this Feb 8, 2024
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5162372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. I5-enhancement An additional feature request. R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants