Skip to content

State sync restart: Potential long-range attack #1540

@turuslan

Description

@turuslan

Description
Parachain state sync completes successfully,
but then it repeatedy restarts after "Potential long-range attack" message.

Steps to Reproduce

  1. Download release and unpack astar-collator
  2. Run validator, wait until some blocks are finalized
./astar-collator \
  --collator \
  --no-hardware-benchmarks --no-mdns --no-telemetry \
  --state-pruning archive --blocks-pruning archive \
  --base-path data1-1 --chain dev \
  --node-key f8dfdb0f1103d9fb2905204ac32529d5f148761c4321b2865b0a40e15be75f57 \
  --listen-addr /ip4/127.0.0.1/tcp/10000 --rpc-port 10002 --prometheus-port 10003 \
  --force-authoring --alice \
  -lverbose \
  -- \
  --state-pruning archive --blocks-pruning archive \
  --base-path data1-2 --chain dev \
  --node-key 96c891b8726cb18c781aefc082dbafcb827e16c8f18f22d461e83eabd618e780 \
  --listen-addr /ip4/127.0.0.1/tcp/10010 --rpc-port 10012 --prometheus-port 10013 \
  --force-authoring --alice \
  -lverbose \
  2>&1 | tee -a data1.log
  1. Run sync node
RUST_LOG="verbose,sync=trace" ./astar-collator \
  --collator \
  --bootnodes /ip4/127.0.0.1/tcp/10000/p2p/12D3KooWT3CsfuervgduMG6RdjVq66z9JnN1GcsRBCWZPxPSBZSV \
  --no-hardware-benchmarks --no-mdns --no-telemetry \
  --base-path data2-1 --chain dev \
  --node-key 619d5e68139f714ee8e7892ce5afd8fbe7a4172a675fea5c5a06fb94fe3d797d \
  --listen-addr /ip4/127.0.0.1/tcp/10020 --rpc-port 10022 --prometheus-port 10023 \
  --sync fast \
  -- \
  --bootnodes /ip4/127.0.0.1/tcp/10010/p2p/12D3KooWNgqk3v24c2Qvi3ZrkJVLayPeUmGbqnNuyt4hHmtxMghk \
  --base-path data2-2 --chain dev \
  --node-key 8d0c5f498a763eaa8c04861cac06289784140b4bbfa814fef898f1f4095de4a3 \
  --listen-addr /ip4/127.0.0.1/tcp/10030 --rpc-port 10032 --prometheus-port 10033 \
  2>&1 | tee -a data2.log

Expected vs. Actual Behavior
Expected: state sync doesn't restart after completion.
Actual: state sync restarts.

Environment

  • Operating system: macos, ubuntu
  • Project version/tag: v5.46.0
  • Rust version (run rustup show): -

Logs, Errors or Screenshots

2025-09-11 11:45:36.027 DEBUG tokio-runtime-worker sync: Starting state sync for #19 (0x434e…ea1c)
2025-09-11 11:45:36.050 DEBUG tokio-runtime-worker sync: State download is complete. Import is queued
2025-09-11 11:45:36.058  WARN tokio-runtime-worker sc_client_db: Potential safety failure: reverting finalized block (19, 0x434e9dca592d07ac335eceacca227af046275cc879e29ab58d950886e80aea1c)
2025-09-11 11:45:36.059  WARN tokio-runtime-worker sc_service::client::client: Block import error: Potential long-range attack: block not in finalized chain.
2025-09-11 11:45:37.080 DEBUG tokio-runtime-worker sync: Starting state sync for #20 (0xb8ca…1662)
2025-09-11 11:45:37.106 DEBUG tokio-runtime-worker sync: State download is complete. Import is queued
2025-09-11 11:45:37.116  WARN tokio-runtime-worker sc_client_db: Potential safety failure: reverting finalized block (20, 0xb8ca82d2368b1298da82d436052151e53f7a1f5c655341339f998541874a1662)
2025-09-11 11:45:37.116  WARN tokio-runtime-worker sc_service::client::client: Block import error: Potential long-range attack: block not in finalized chain.

Additional Information
This behaviour was observed on both dev and astar (*) chain.
(*) Currenlty state sync may crash with OOM, but we were testing our branch with OOM fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions