Conversation
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you!
One thing to think through: what are the implications of this from an external user standpoint? I think there may be a couple:
- The
GetBlockByNumberendpoint would return aSignedBlockfor the genesis block andProvenBlockfor everything else, right? If so, we probably should make theMaybeBlockmessage more structured to contain this information. If that's not the case (e.g., if we always get theSignedBlockfrom this endpoint), we should document this explicitly and maybe add a separate endpoint for retrieving block proofs (in a different PR). Or maybe we can change this endpoint to return both theSignedBlockand theBlockProof? - Does this impact the
GetBlockHeaderByNumberin any way? I don't think it should, but let's double-check. - Nothing else comes to mind, but maybe there is some other implication?
let signed_block_bytes = signed_block.to_bytes();
let store = Arc::clone(&self.block_store);
let block_save_task = tokio::spawn(
async move { store.save_block(block_num, &signed_block_bytes).await }.in_current_span(),
);
Would have to be
I don't think there is an impact to consider here (boils down to
Nothing comes to mind. It would have to be a code path involving deserialization of blocks from bytes for it to not have been caught by the compiler during the type change. And I think the only relevant path in that regard is the raw block data which you raised. |
Ah - nice! We should then update the doc comments for
Yeah - I think adding this to |
There was a problem hiding this comment.
Looks good, maybe in some other PR but the TODO in crates/store/src/server/block_producer.rs:105 can be addressed now.
let signed_block = SignedBlock::new_unchecked(header.clone(), body, signature); // TODO(sergerad): Use `SignedBlock::new()` when available.
It makes sense to me to have a separate |
Closes #1844.