Skip to content

feat!: proof gossiping - #1115

Draft
agureev wants to merge 73 commits into
devfrom
artem/proof-gossip
Draft

agureev wants to merge 73 commits into
devfrom
artem/proof-gossip

Conversation

@agureev

@agureev agureev commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

🎯 Purpose

Previously, each block carried an entire R0 proof with it uncompressed if a pptx emerged in a block. This occupied a significant amount of space and minimized block space while maximizing pptx cost.

Instead, we now post a sha2 hash of the proofs onchain, while gossiping the plaintext of the proof to the connected peers.

An honest sequencer is incentivized to gossip the plaintext as it wants to be rewarded by the other sequencers for block producing. A dishonest sequencer either stalls the block production by not sharing the proof (as can be done now by just skipping blocks) or sharing wrong proofs which can be slashable.

Note, however, that the PR does not introduce a DA mechanism for keeping proofs around to restore history. In order to replay history, there needs to be another coordinated mechanism now, one cannot just read the Bedrock data.

Currently the node code does store the proofs locally.

⚙️ Approach

  • Change block format by adding proof digests
  • Local proof storage for received proofs
  • Proof exchange via gossip channels
  • Introduce rules for recognizing honest blocks and skipping those that do not have proof info gossiped

🔜 Future Work

Consider integration with Logos Storage and other DA providers/mechanisms

📋 PR Completion Checklist

Mark only completed items. A complete PR should have all boxes ticked.

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

…ofs by digest

BREAKING!

Before: The hash of a privacy-preserving transaction was SHA-256 over
its full borsh bytes, proof included, and a block hash covered the full
bytes of every transaction.

After: A privacy-preserving transaction hashes with its proof replaced by
a 32-byte digest of that proof, and a block hashes over its transactions
in that digest form, so both can be computed without the proof bytes.
The hash of every privacy-preserving transaction, and of every block that
carries one, changes. Sequencers keep the proofs of the transactions they
admit and fetch a missing proof from their peers by its digest.

Mitigation: Start from a fresh genesis and channel, and look transactions
up by the new hash. Cross-zone peers must run the same version, since
they recompute each other's block hashes.
BREAKING!

Before: Every block was inscribed in full, each private transaction with
its proof of about 223 KB, so a block of the default size held at most
four private transactions. Every finalized channel block was applied at
L1 finality: sequencers, the indexer and cross-zone readers each took the
first finalized block that linked to their tip. A private transaction was
charged 224,063 storage gas.

After: A block is inscribed with each proof replaced by its SHA-256
digest. Sequencers get proofs by gossip and fetch missing ones from
peers; indexers fetch them from the sequencers in `proof_sources`. Blocks
are selected by the skip rule: within the channel's new `skip_window`, a
writer may build on the parent of a private block in the previous
writer's unconfirmed run, which cuts that block and everything after it.
Plain blocks settle at L1 finality; private blocks settle once another
signer builds after them or the window passes. A node that lacks a
block's proofs folds only what those proofs cannot change, and waits for
them; one starting from an empty store stalls at the first private block
whose proofs no live peer still holds. The indexer stores, and the
cross-zone readers deliver from, only settled blocks; the readers fold
each peer's channel on structure alone. Cut blocks, late skips and blocks
on unknown parents are not offences. A private transaction is charged 544
storage gas: its 32-byte proof digest plus its 512-byte payload. The
persisted view and the indexer cursor have new formats.

Mitigation: Start a new channel from a fresh genesis, with fresh
sequencer and indexer stores. Add `skip_window` to every sequencer's
`channel_params`: 0 keeps a zone single-writer and settling at L1
finality, otherwise `posting_timeframe + 4 * posting_timeout`. Give every
indexer at least one sequencer RPC address in `proof_sources`, and add
each peer zone's `skip_window` to that peer's `cross_zone` config.
Rebuild the `sequencer_stake` program and wallets.
@agureev
agureev marked this pull request as ready for review November 16, 2026 10:08
BREAKING!

Before: Sequencers gossiped private transactions in full, proofs
included, on the transaction topic.

After: A sequencer that admits a private transaction seeds its proof in
Logos Storage and announces the digest form with the proof's CID on
`/lez/{channel}/v1/private-announcements`. A peer screens the fee by
the manifest's declared length before downloading anything, fetches the
proof within per-peer and global bounds, verifies the receipt, admits
the transaction, and only then serves the proof. Full private
transactions on the transaction topic are rejected.

Mitigation: Upgrade every sequencer of a zone together; mixed versions
do not exchange private transactions.
BREAKING!

Before: A sequencer missing a proof asked its peers for the proof bytes
over `/lez/{channel}/v1/proofs`.

After: It fetches the proof from Logos Storage at the CID its block
inscribes, and otherwise asks peers over
`/lez/{channel}/v1/proof-locators` for the CID of their own verified
copy, trying the next peer after a miss, a failed fetch or a wrong
proof. Recovery is deduplicated and retried with backoff. A named CID
is only a hint: the proof is kept under this node's own CID once its
digest matches.

Mitigation: Upgrade every sequencer of a zone together; the proof
exchange protocol is gone.
…bility quorum

BREAKING!

Before: A producer published every block as soon as it was built,
whether or not any other sequencer could serve its proofs.

After: In a committee of two or more, a block carrying private
transactions is seeded, proposed on `/lez/{channel}/v1/availability`
and published only once two thirds of the committee at its parent,
the producer included, approve that they hold and serve its proofs.
At the private cutoff, half the posting timeout, or when seeding
fails, the producer defers the private transactions to the mempool
and publishes the public remainder in the same turn. A single writer
publishes after seeding; public-only blocks are unchanged.

Mitigation: Upgrade every sequencer of a zone together, each beside a
reachable Logos Storage node; a zone whose committee cannot reach the
quorum carries only public transactions.
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.

2 participants