Skip to content

Why request block body for fast sync? #5406

@liuchengxu

Description

@liuchengxu

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

If I read correctly, the docs https://github.com/paritytech/polkadot-sdk/blob/3fe22d17c4904c5ae016034b6ec2c335464b4165/substrate/client/network/README.md#fast-sync indicates that the fast sync is expected only to download and verify the header chain, and the subsequent state snapshot.

But the inline docs are contradictory, saying Downloading blocks:

/// Download blocks without executing them. Download latest state with proofs.
Fast,
/// Download blocks without executing them. Download latest state without proofs.
FastUnsafe,

and the block body is indeed requested for --sync fast and --sync fast-unsafe.

ChainSyncMode::LightState { storage_chain_mode: false, .. } =>
BlockAttributes::HEADER | BlockAttributes::JUSTIFICATION | BlockAttributes::BODY,
ChainSyncMode::LightState { storage_chain_mode: true, .. } =>
BlockAttributes::HEADER |
BlockAttributes::JUSTIFICATION |
BlockAttributes::INDEXED_BODY,

I'm looking for a sync mode that only downloads the headers and the state snapshot. I initially assumed that the --sync fast/fast-unsafe options would fulfill this requirement. This looks like a bug to me, could you please clarify this confusion?

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    I10-unconfirmedIssue might be valid, but it's not yet known.I2-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions