Skip to content

Vouch for the blocks a block refers to#6602

Closed
afck wants to merge 4 commits into
linera-io:afck/recertify-descendantsfrom
afck:vouch-referenced-blocks
Closed

Vouch for the blocks a block refers to#6602
afck wants to merge 4 commits into
linera-io:afck/recertify-descendantsfrom
afck:vouch-referenced-blocks

Conversation

@afck

@afck afck commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Motivation

Re-certifying a revoked-epoch block by walking its descendants means downloading every block in between, even though almost none of them are needed: on a sparse chain, a receiver may care about two message blocks a thousand heights apart.

Proposal

Blocks already commit to the hashes of the blocks they refer to: previous_message_blocks points at the last block that sent a message to a given recipient, previous_event_blocks at the last block that emitted an event on a given stream. Treat those the same way as the parent hash: when a block is accepted, vouch for everything it commits to. A receiver can then re-certify an old sender block by downloading only the message-bearing blocks, and a subscriber only the event-bearing ones — preprocessing them newest-first, so each block vouches for the next-older one.

A block that commits to a different hash than the one already accepted at that height is proof that a committee equivocated. Reject it before it is written to storage, and log the conflict at ERROR level.

Test Plan

CI, plus unit tests that re-certify a revoked-epoch block through a previous_message_blocks link and through a previous_event_blocks link, asserting in both cases that the blocks in between are never downloaded. Conflicting certified blocks are covered by a worker test.

Release Plan

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

Links

afck added 4 commits July 13, 2026 10:48
Rename pre_checkpoint_block_trust to vouched_blocks and generalize it:
whenever a block is accepted (executed or preprocessed), the hashes it
commits to via previous_block_hash and previous_message_blocks are
recorded as vouched, unless the referenced block is already in
block_hashes. A certificate whose hash is vouched is accepted regardless
of its possibly revoked epoch, and the mark is consumed on acceptance.

The eager marks subsume the child-block lookup in ensure_epoch_trusted,
which now only checks for an earlier acceptance of the same block.

This lets a receiver re-certify a sender's old messages by downloading
only the message-bearing blocks: when the oldest block collected by
download_sender_block_with_sending_ancestors is from a revoked epoch,
the client preprocesses the collected chain in decreasing height order
first, so that each block vouches for the previous message block it
commits to — instead of falling back to downloading all contiguous
descendants.
A block committing to a different hash at a height where we already accepted
a block is proof that a committee equivocated. Reject it with
ChainError::ConflictingCertifiedBlocks before it is written to storage, and
log the conflict at ERROR level: it means the network is in trouble.
Accepting a block now also vouches for the event blocks it commits to, and
the sparse event-block download preprocesses newest-first when the oldest
collected block's epoch has been revoked. Subscribers can therefore re-certify
an old event without downloading the publisher's intermediate blocks.
Wrap the epoch-revocation lookup in a helper instead of repeating the storage
call and its error mapping, and let vouch_for_block_references compute the
block hash itself.
@afck afck requested review from deuszx, ma2bd and ndr-ds July 13, 2026 11:43
@afck afck closed this Jul 13, 2026
@afck afck deleted the vouch-referenced-blocks branch July 13, 2026 11:44
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.

1 participant