Skip to content

Conversation

@deuszx
Copy link
Contributor

@deuszx deuszx commented Jan 5, 2026

Motivation

When syncing chain information for blobs between validators, we were sending more data than necessary. The previous implementation would send all blocks up to the height where a blob was published, even when only the specific block containing that blob was needed.

For sparse chains (chains with gaps in block heights), this meant sending many unnecessary blocks, wasting network bandwidth and validator processing time.

Addresses #5205 (comment)

Proposal

This PR changes the blob synchronization strategy from "send all blocks up to height N" to "send only blocks at specific heights":

  1. Modified send_chain_info_for_blobs: Instead of tracking the maximum height per chain, now collects a BTreeSet of all specific heights where blobs exist
  2. New method send_chain_info_at_heights: Sends chain information only for the exact block heights specified, not all blocks leading up to those heights
  3. Updated documentation: Clarifies that this optimization specifically benefits sparse chains

Example Impact

Previously, if blobs existed at heights [5, 10, 15] on a chain:

  • Sent blocks 0-5, 0-10, 0-15 (up to 30 blocks sent, with significant duplication)

Now:

  • Sends only blocks at heights 5, 10, 15 (exactly 3 blocks)

Test Plan

  • CI

Release Plan

  • Nothing to do / These changes follow the usual release cycle.
  • Backport to main.

Links

@deuszx deuszx force-pushed the sparse-chains-send-specific-heights branch from c9cafde to 75a8dd9 Compare January 5, 2026 19:40
@deuszx deuszx marked this pull request as draft January 5, 2026 19:59
@deuszx deuszx force-pushed the sparse-chains-send-specific-heights branch from 75a8dd9 to d0b36e3 Compare January 6, 2026 12:07
@deuszx deuszx requested review from afck and bart-linera January 6, 2026 12:09
@deuszx deuszx marked this pull request as ready for review January 6, 2026 12:31
Copy link
Contributor

@bart-linera bart-linera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@deuszx deuszx merged commit 4414903 into testnet_conway Jan 7, 2026
33 checks passed
@deuszx deuszx deleted the sparse-chains-send-specific-heights branch January 7, 2026 13:51
deuszx added a commit that referenced this pull request Jan 7, 2026
When syncing chain information for blobs between validators, we were
sending more data than necessary. The previous implementation would send
**all blocks up to the height** where a blob was published, even when
only the specific block containing that blob was needed.

For sparse chains (chains with gaps in block heights), this meant
sending many unnecessary blocks, wasting network bandwidth and validator
processing time.

Addresses
#5205 (comment)

  ## Proposal

This PR changes the blob synchronization strategy from "send all blocks
up to height N" to "send only blocks at specific heights":

1. **Modified `send_chain_info_for_blobs`**: Instead of tracking the
maximum height per chain, now collects a `BTreeSet` of all specific
heights where blobs exist
2. **New method `send_chain_info_at_heights`**: Sends chain information
only for the exact block heights specified, not all blocks leading up to
those heights
3. **Updated documentation**: Clarifies that this optimization
specifically benefits sparse chains

  ### Example Impact

  Previously, if blobs existed at heights [5, 10, 15] on a chain:
- Sent blocks 0-5, 0-10, 0-15 (up to 30 blocks sent, with significant
duplication)

  Now:
  - Sends only blocks at heights 5, 10, 15 (exactly 3 blocks)

  ## Test Plan

  - CI

  ## Release Plan

  - Nothing to do / These changes follow the usual release cycle.
  - Backport to `main`.

  ## Links

- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
github-merge-queue bot pushed a commit that referenced this pull request Jan 7, 2026
Backport of #5206 
## Motivation

When syncing chain information for blobs between validators, we were
sending more data than necessary. The previous implementation would send
**all blocks up to the height** where a blob was published, even when
only the specific block containing that blob was needed.

For sparse chains (chains with gaps in block heights), this meant
sending many unnecessary blocks, wasting network bandwidth and validator
processing time.

Addresses

#5205 (comment)

## Proposal

This PR changes the blob synchronization strategy from "send all blocks
up to height N" to "send only blocks at specific heights":

1. **Modified `send_chain_info_for_blobs`**: Instead of tracking the
maximum height per chain, now collects a `BTreeSet` of all specific
heights where blobs exist
2. **New method `send_chain_info_at_heights`**: Sends chain information
only for the exact block heights specified, not all blocks leading up to
those heights
3. **Updated documentation**: Clarifies that this optimization
specifically benefits sparse chains

### Example Impact

  Previously, if blobs existed at heights [5, 10, 15] on a chain:
- Sent blocks 0-5, 0-10, 0-15 (up to 30 blocks sent, with significant
duplication)

  Now:
  - Sends only blocks at heights 5, 10, 15 (exactly 3 blocks)

## Test Plan

  - CI

## Release Plan

  - Nothing to do / These changes follow the usual release cycle.

## Links

- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
Backport of #5206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants