Skip to content

[stable2603] Backport #10373#11267

Merged
lrubasze merged 10 commits intostable2603from
backport-10373-to-stable2603
Mar 6, 2026
Merged

[stable2603] Backport #10373#11267
lrubasze merged 10 commits intostable2603from
backport-10373-to-stable2603

Conversation

@paritytech-release-backport-bot
Copy link
Copy Markdown

@paritytech-release-backport-bot paritytech-release-backport-bot Bot commented Mar 4, 2026

Backport #10373 into stable2603 from lrubasze.

This PR is needed for #10752, which allows to significantly optimize DB and network usage when Gap sync is used (bodies are no longer requested). It also reduces gap sync duration.

See the documentation on how to use this bot.

This PR fixes block import during Warp sync, which was silently failing
due to "Unknown parent" errors - a typical case during Warp sync and the
`full_node_warp_sync` test was not detecting such failure.

Changes
 - Relaxed verification for Warp synced blocks:
The fix relaxes verification requirements for Warp synced blocks by not
performing full verification, with the assumption that these blocks are
part of the finalized chain and have already been verified using the
provided warp sync proof.
- New `BlockOrigin` variants:
For improved clarity, two additional `BlockOrigin` items have been
introduced:
  - `WarpSync`
  - `GapSync`
- Gap sync improvements:
Warp synced blocks are now skipped during the gap sync block import
phase, which required improvements to gap handling when committing the
block import operation in the database.
- Enhanced testing:
The Warp sync zombienet test has been modified to more thoroughly assert
both warp and gap sync phases.

This PR builds on changes by @sistemd in #9678

---------

Co-authored-by: sistemd <enntheprogrammer@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit b2a4296)
@github-actions github-actions Bot added the A3-backport Pull request is already reviewed well in another branch. label Mar 4, 2026
@github-actions github-actions Bot requested a review from lrubasze March 4, 2026 15:43
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@lrubasze lrubasze requested a review from skunert March 4, 2026 18:03
lrubasze and others added 3 commits March 4, 2026 18:06
### Summary
This PR optimizes gap sync bandwidth usage by skipping body requests for
non-archive nodes. Bodies are unnecessary during gap sync when the node
doesn't maintain full block history, while archive nodes continue to
request bodies to preserve complete history.
It reduces bandwidth consumption and database size significantly for
typical validator/full nodes.

Additionally added some gap sync statistics for observability:
- Introduced `GapSyncStats` to track bandwidth usage: header bytes, body
bytes, justification bytes
- Logged on gap sync completion to provide visibility into bandwidth
savings

---------

Co-authored-by: sistemd <enntheprogrammer@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
While warp syncing a node, I saw some huge stalls. What happens:

- During warp sync we store warp proofs
- After warp sync we start gap sync
- Problem: Once gap sync finishes, node starts looking for displaced
leaves from all the warp proof blocks, which was over 2500 in my
observed case. This led to a 30minutes stall.

In this PR I propose to import the blocks during warp sync with a
Disconnected state, which does not add them as leaves. This fixes the
downtime.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@lrubasze lrubasze changed the title [stable2603] Backport #10373 [stable2603] Backport #10373 #10752 #11152 Mar 4, 2026
@lrubasze
Copy link
Copy Markdown
Contributor

lrubasze commented Mar 4, 2026

Actually I am not sure if this is ok what I am trying to do here.
First I've created backport for #10373, then for easier handling cherry-picked #10752 and #11152.
And then bypassed the validation for major crate updates - which is strongly discouraged.

Not sure if this is way to go.

@lrubasze lrubasze requested a review from EgorPopelyaev March 5, 2026 09:34
@lrubasze
Copy link
Copy Markdown
Contributor

lrubasze commented Mar 5, 2026

Actually I am not sure if this is ok what I am trying to do here. First I've created backport for #10373, then for easier handling cherry-picked #10752 and #11152. And then bypassed the validation for major crate updates - which is strongly discouraged.

Not sure if this is way to go.

Decided to backport one PR after another

@lrubasze lrubasze changed the title [stable2603] Backport #10373 #10752 #11152 [stable2603] Backport #10373 Mar 5, 2026
@lrubasze lrubasze enabled auto-merge (squash) March 5, 2026 10:29
@lrubasze lrubasze disabled auto-merge March 6, 2026 11:23
@lrubasze lrubasze merged commit 73f122e into stable2603 Mar 6, 2026
241 of 245 checks passed
@lrubasze lrubasze deleted the backport-10373-to-stable2603 branch March 6, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3-backport Pull request is already reviewed well in another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants