flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

Support Epoch Extensions in HotStuff Committee

Open jordanschalm opened this issue 8 months ago • 1 comments

This PR updates the Consensus Committee to support epoch extensions. Addresses #5730.

Changes

  • Modifies protocol.Epoch FinalView method to account for any extensions.
  • Modifies committees.Consensus to handle EpochExtended protocol 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.

jordanschalm avatar Jun 25 '24 22:06 jordanschalm