babe: pass epoch data via intermediates#4807
Conversation
|
|
||
| let epoch = match intermediate.epoch { | ||
| Some(epoch) => epoch, | ||
| None => { |
There was a problem hiding this comment.
This branch is needed because when proposing blocks, it won't invoke the verifier. In those cases the epoch must be re-fetched.
… sp-babe-intermediate
|
Hmm looks like there's an error in tests. Let me debug. |
andresilva
left a comment
There was a problem hiding this comment.
When authoring blocks we still fetch epoch data from the slot worker in order to author the block. We could change block_import_params to also take EpochData, which we could then use to populate the intermediate. We could then change BabeIntermediate to not use Option. WDYT?
Sounds like a good idea to me. 👍 |
|
Integration test fixed! |
|
PR is ready, but I want to merge it after #4785 is merged. So marking it |
… sp-babe-intermediate
Fixes #4652 (comment)
This passes the epoch data via block import intermediates, avoiding a second call to
epoch_changes.epoch_for_child_of.It does require encoding/decoding of the data when passing, which, under the current design of(Fixed in #4809)BlockImportParams, I don't think is avoidable.