Skip to content

Store uncle headers on the receive path, so a synced node can serve the sync it just did #270

Open

Description

@SDL-A1

Migrated from SergioDemianLerner/rustock#270 (issue by @SDL-A1, 2026-10-05).
Original: SergioDemianLerner/rustock#270

A node that keeps every trunk header to genesis and discards the uncles is the one storage configuration that does not cohere. It pays ~10.1 GB for a chain it can neither sum nor serve.

What happens today

BlockHeadersWithUncles (RSKIP-698) delivers the uncle headers. Both client paths verify them, take the difficulty, and drop them:

  • manager.rs::note_proven_difficulties — records the figure, returns bare headers
  • snap/forward.rs — put_header_with_hash only

Freezer::put_uncles() and Freezer::uncles() already exist — a purpose-built parallel uncle store. Nothing on the receive path calls put_uncles. The only writer is the freezer's own body-derived path, which is why a snap-synced node logs "froze N header(s) whose body was already gone, so their uncle headers could not be captured" for everything below its body window.

What it costs us

  • It cannot compute its own chain's cumulative difficulty. It holds a number it was told. That is the weakness RSKIP-699 was withdrawn over, baked into storage.
  • It cannot serve rsk/63. Every rustock node is a freeloader on the capability rustock invented, and an ascending sync can only be served by an archive node that kept bodies. The feature cannot spread.

Measured directly: the client that completed an ascending sync on 2026-10-05 could not then act as a server for the scaling test — all four servers had to come off the production database.

The change

Write uncles to the freezer's uncle store as blocks are committed, on both paths. The ascent commits runs in strict ascending order, which is what the append wants.

~10.5 GB on a node already carrying 10.1 GB for headers alone, and it turns every synced node into a usable rsk/63 server.

Part of settling on two coherent modes: normal (headers and uncles, serves both protocols) and fully pruned (#271). "Headers but not uncles" should not be reachable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions