Skip to content

chore: Move proving inputs from DB to file#2068

Open
sergerad wants to merge 7 commits into
nextfrom
sergerad-proving-inputs
Open

chore: Move proving inputs from DB to file#2068
sergerad wants to merge 7 commits into
nextfrom
sergerad-proving-inputs

Conversation

@sergerad
Copy link
Copy Markdown
Collaborator

@sergerad sergerad commented May 12, 2026

Closes #2014.

Summary

Moves block proving inputs out of the database and into the file-based block store, and decouples their persistence from the apply_block pipeline.

Proving inputs storage

  • Proving inputs (BlockProofRequest) are now written to the block store as files alongside blocks, rather than being stored in the database. This avoids holding large serialized blobs in SQLite and keeps proving inputs co-located with the block data they reference.
  • The proof is now saved before proving inputs are deleted, ensuring the scheduler can never lose track of a block that still needs proving.

Decoupling from apply_block

  • State::apply_block no longer accepts proving_inputs: Option<BlockProofRequest>. Saving proving inputs is now the caller's responsibility, via the new State::save_proving_inputs method. Note that replicas apply blocks and do not store proving inputs.
  • In BlockProducerApi::apply_block, proving inputs are saved eagerly (before spawning the block-application task).

@sergerad sergerad added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label May 13, 2026
@sergerad sergerad marked this pull request as ready for review May 13, 2026 02:45
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Some minor questions/nits but otherwise lgtm

Comment thread crates/store/src/proven_tip.rs Outdated
Comment thread crates/store/src/server/block_producer.rs
Comment thread crates/store/src/server/mod.rs Outdated
Comment thread crates/store/src/server/proof_scheduler.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move Proving Inputs out of the Database

2 participants