refactor(store): move sync and proving to block producer#2155
refactor(store): move sync and proving to block producer#2155Mirko-von-Leipzig wants to merge 7 commits into
Conversation
| max_txs_per_batch: self.block_producer.batch.max_txs, | ||
| max_batches_per_block: self.block_producer.block.max_batches, | ||
| max_concurrent_proofs: self.block_producer.block.max_concurrent_proofs, | ||
| mempool_tx_capacity: self.block_producer.mempool.tx_capacity, |
There was a problem hiding this comment.
nit: Maybe the self.block_producer and Sequencer could use the same struct for these shared fields?
There was a problem hiding this comment.
I'm not quite sure how, unless you mean the block producer should own the clap representation directly?
I'd prefer not to do that since how we organise the CLI isn't necessarily how things work in the block producer, so I don't want to couple them.
Or put differently, ideally we would keep the code type separate from the interface boundary, in this case the CLI API.
sergerad
left a comment
There was a problem hiding this comment.
LGTM just a nit and some dedupe we should be able to do in the comments.
| block_store.commit_proof(next, &proof_bytes).await?; | ||
| proof_cache.push(next, ProofNotification::new(next, proof_bytes)); | ||
| proven_tip.advance(next); | ||
| state.apply_proof(next, proof_bytes).await?; |
There was a problem hiding this comment.
The docs of apply_proof needs an update, since the sequencers is using it too
| pub fn spawn(self) -> tokio::task::JoinHandle<anyhow::Result<()>> { | ||
| tokio::spawn(self.run()) | ||
| } |
There was a problem hiding this comment.
Is this being used?
This PR moves the replica sync and proof scheduling to the block-producer.
This leaves
storeas 99%Statemanagement, with no spawned tasks outside of the disk monitor which will be invoked manually by the CLI.I've also added a name-task
JoinSetwrapper for supervising tasks - this is fairly common across the code base.I elected to this now because I found it made wiring up the CLI much easier since the store no longer has spawned tasks internally.