Skip to content

Gap Sync: Skip Body Requests for Non-Archive Nodes#10752

Merged
lrubasze merged 131 commits intomasterfrom
lrubasze/gap-sync-improvements
Feb 13, 2026
Merged

Gap Sync: Skip Body Requests for Non-Archive Nodes#10752
lrubasze merged 131 commits intomasterfrom
lrubasze/gap-sync-improvements

Conversation

@lrubasze
Copy link
Copy Markdown
Contributor

@lrubasze lrubasze commented Jan 8, 2026

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

sistemd and others added 30 commits September 8, 2025 21:17
Base automatically changed from lrubasze/block-import-improvements to master February 13, 2026 10:17
@lrubasze
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience node_dev --audience node_operator --bump patch --force

github-actions Bot and others added 2 commits February 13, 2026 12:39
@lrubasze lrubasze added this pull request to the merge queue Feb 13, 2026
Merged via the queue into master with commit e23e645 Feb 13, 2026
243 of 245 checks passed
@lrubasze lrubasze deleted the lrubasze/gap-sync-improvements branch February 13, 2026 15:35
lrubasze added a commit that referenced this pull request Mar 4, 2026
### 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>
lrubasze added a commit that referenced this pull request Mar 5, 2026
lrubasze added a commit that referenced this pull request Mar 6, 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](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Lukasz Rubaszewski <117115317+lrubasze@users.noreply.github.com>
Co-authored-by: sistemd <enntheprogrammer@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
@lrubasze lrubasze added the A4-backport-stable2603 Pull request must be backported to the stable2603 release branch label Mar 6, 2026
paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Mar 6, 2026
### 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>
(cherry picked from commit e23e645)
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2603:

lrubasze added a commit that referenced this pull request Mar 6, 2026
Backport #10752 into `stable2603` from lrubasze.

This PR 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](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Lukasz Rubaszewski <117115317+lrubasze@users.noreply.github.com>
Co-authored-by: sistemd <enntheprogrammer@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
lexnv added a commit that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2603 Pull request must be backported to the stable2603 release branch T0-node This PR/Issue is related to the topic “node”.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants