chore: Misc followups for block validation#1402
Conversation
| body: BlockBody, | ||
| block_proof: BlockProof, | ||
| ) -> Result<ProvenBlock, BuildBlockError> { | ||
| // SAFETY: The header and body are assumed valid and consistent with the proof. |
There was a problem hiding this comment.
This fn doesn't need to be async anymore. I'm actually surprised clippy doesn't complain about this but maybe we've disabled the lint.
There was a problem hiding this comment.
Would mean I have to wrap it in a future manually in the call chain, probably prefer to keep it in fn signature?
.and_then(|(proposed_block, header, body, block_proof)| async {self.construct_proven_block(proposed_block, header, body, block_proof)})There was a problem hiding this comment.
I've done it similarly in the batch builder
Though I also did consider just saying screw it and keeping the async. I think its up to you, at the time I thought its worth indicating to the reader that the function is not async (e.g. it stood out to me on reading just the fn now).
There was a problem hiding this comment.
If you want it to be shorter, you can always leave the tuple in place
.and_then(|args| async {self.construct_proven_block(args.0, args.1, args.2, args.3)})Its a pity rust doesn't have a spread operator so one could do args...
Closes #1395.
Follows up comments from #1381.