Skip to content

perf(sync-service): warm-start parachains from restored database state #3218

@replghost

Description

@replghost

Summary

On warm restart, skip the relay chain parachain head fetch and consensus bootstrap when the database already contains known consensus parameters (Aura authorities, slot duration).

Context

PR #3210 fixes the root cause of parachain warm-start hangs (using the initial finalized block from subscribe_all instead of waiting for a new notification). However, even with that fix, cold-path logic still runs on warm start:

  1. Fetch parachain head from relay chain via PersistedValidationData runtime call
  2. Download ~2 MiB :code from a P2P peer
  3. Compile WASM and verify Aura consensus parameters via call proofs

When the database already has valid consensus info (not ChainInformationConsensus::Unknown), steps 1-3 can be skipped entirely.

Proposed approach

  • Add restored_chain_information: Option<ValidChainInformation> parameter to start_parachain
  • If present and consensus is known, use it directly — skip relay fetch + bootstrap
  • If present but consensus is Unknown, still bootstrap (download runtime + verify Aura)
  • Verify restored state against the relay chain (confirm parachain head matches or is ahead) rather than blindly trusting the database

Prior work

This was originally part of #3210 but was split out to keep that PR focused on the root cause fix. The implementation existed across these commits:

  • fix(light-base): warm-start parachains from database state
  • fix(light-base): preserve parachain db state alongside checkpoints

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions