flow-go
flow-go copied to clipboard
Support Epoch Extensions in HotStuff Committee
This PR updates the Consensus Committee to support epoch extensions. Addresses #5730.
Changes
- Modifies
protocol.EpochFinalViewmethod to account for any extensions. - Modifies
committees.Consensusto handleEpochExtendedprotocol event. When we observe an epoch extension, we simply re-compute the leader selection for the entire epoch, including the new view range added by the extension. This is slightly wasteful, incurring a cost of around 20-30ms per extension on Mainnet, but simplifies the business logic and state quite a bit compared to tracking each extension independently. - Moves internal event processing to a shared channel Now that we can move into and out of EFM several times over the lifecycle of the component, it is easier to reason about correctness if we use a shared channel for events to enforce in-order processing. The event consumer function prepares a (potentially blocking) event handler function to be executed and passes the closure into the channel. The worker goroutine pulls event handler closures off the channel and executes them in order.
Codecov Report
Attention: Patch coverage is 61.15702% with 47 lines in your changes missing coverage. Please review.
Project coverage is 41.70%. Comparing base (
9c3ed48) to head (43754d1).
Additional details and impacted files
@@ Coverage Diff @@
## feature/efm-recovery #6154 +/- ##
========================================================
+ Coverage 41.68% 41.70% +0.01%
========================================================
Files 1975 1975
Lines 139306 139258 -48
========================================================
- Hits 58072 58071 -1
+ Misses 75182 75139 -43
+ Partials 6052 6048 -4
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 41.70% <61.15%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.