HotShot
HotShot copied to clipboard
Lr/optimistic vid
Closes #3028
This PR:
-
DaTaskState
now optimistically calculates VID shares and updatesConsensus
state when handlingDaProposalValidated
event and the primary network is down. - moves
calculate_vid_disperse
fromcrates/task-impls/src/helpers.rs
crate tocrates/types/src/data.rs
crate. - adds
calculate_and_update_vid
method toConsensus
to keep the code DRY (now used inDaTaskState
andNetworkResponseState
)
This PR does not:
Does not dramatically lower the pessimistic scenario (VID is calculated only when the request arrives) hit rate. This is because we reset the primary network state to up on every view update. This change needs to be implemented to visibly improve the situation.
Key places to review:
crates/task-impls/src/da.rs crates/task-impls/src/response.rs crates/types/src/consensus.rs
How to test this PR:
All the tests should pass.