feat(prover): batch_splitter — split sealed batches into two Airbender pieces - #4861
Open
deniallugo-claude wants to merge 1 commit into
Open
feat(prover): batch_splitter — split sealed batches into two Airbender pieces#4861deniallugo-claude wants to merge 1 commit into
deniallugo-claude wants to merge 1 commit into
Conversation
Boojum can prove heavier batches than Airbender's geometry allows. This adds a `batch_splitter` binary that splits a sealed L1 batch N into two independently-provable Airbender pieces (and, via the caller's retry loop, into quarters/eighths/...), until each piece fits Airbender's geometry. The split is witness-input level and non-invasive: it reads node Postgres (MVCC) and the immutable object-store witness blobs only, never touches the canonical chain or the Merkle-tree RocksDB. It re-executes each half of the batch's L2 blocks, reconstructs a sparse binary Merkle tree from batch N's own `WitnessInputMerklePaths` to regenerate each piece's paths and the intermediate root, and emits two self-contained `AirbenderVerifierInput` blobs. Two root self-checks (reconstructed N-1 root == previous_batch_hash, post-B root == committed root) validate the reconstruction. Commitment chaining for piece B is gated behind --commitment-chaining; without it, pieces are emitted with commitment_input=None for geometry- feasibility checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Boojum can prove heavier batches than Airbender's geometry allows. To migrate such batches to Airbender we want to: prove the whole batch, and on failure split it into two pieces and prove each — recursively, until each piece fits Airbender's geometry.
This PR adds a
batch_splitterbinary (core/bin/batch_splitter) that splits a sealed L1 batchNinto two independently-provableAirbenderVerifierInputpieces.What it does
For batch
Nspanning L2 blocks[first, last], it cuts at the midpoint (even by block count, whole blocks only) into piece A[first, mid)and piece B[mid, last], such thatold_root_N →(A) root_A →(B) new_root_N.BasicWitnessInputProducer/AirbenderVerifierInput::verify), seeded from the in-witness storage snapshot (piece B overlaid with A's writes).WitnessInputMerklePathsblob — the only non-invasive source. A sparse binary Merkle tree is reconstructed from it (N-1 leaf values from each key's first occurrence; off-trie siblings are invariant during N), then A's and B's writes are re-applied to regenerate each piece's paths +root_A. Hashing reusesBlake2Hasher'shash_leaf/hash_branch/empty_subtree_hash, so roots/paths match exactly.AirbenderVerifierInputCBOR blobs (airbender_split_input_{N}_a.cbor/_b.cbor).Correctness self-checks
Two root checks bracket the reconstruction and fail loudly rather than emitting a bad witness:
previous_batch_hash;Scope / follow-ups
--commitment-chaining. Off by default, B is emitted withcommitment_input = None, which is enough to verify each half fits Airbender's geometry — the immediate goal. The fullL1BatchCommitmentassembly for the intermediate batch is the one piece left for a follow-up (clearly isolated incommitment.rs).See
core/bin/batch_splitter/README.mdfor the full design.Usage
🤖 Generated with Claude Code