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

[EFM] Epoch State Machine operates on current state

Open durkmurder opened this issue 1 year ago • 1 comments

https://github.com/onflow/flow-go/issues/6019

Context

Previously epoch state machines were working relying on parent state to implement theirs logic, this resulted in complicated logic and nasty edge cases when processing multiple events at the some block.

This PR fixes this by using current state instead of parent. To implement that I have refactored epoch state entries to separate epoch events from identities, effectively having more modularity across epoch state entries.

Additionally ejection logic has been moved to a dedicated component.

durkmurder avatar Jul 01 '24 05:07 durkmurder

Codecov Report

Attention: Patch coverage is 55.87302% with 139 lines in your changes missing coverage. Please review.

Project coverage is 41.70%. Comparing base (427a1a8) to head (eec0e76).

Files Patch % Lines
utils/unittest/fixtures.go 0.00% 46 Missing :warning:
model/flow/protocol_state.go 57.53% 23 Missing and 8 partials :warning:
...otocol/protocol_state/epochs/mock/state_machine.go 0.00% 13 Missing :warning:
storage/mock/epoch_protocol_state_entries.go 0.00% 12 Missing :warning:
...col/protocol_state/epochs/fallback_statemachine.go 62.50% 5 Missing and 4 partials :warning:
...rotocol/protocol_state/epochs/base_statemachine.go 85.00% 3 Missing and 3 partials :warning:
...l/protocol_state/epochs/happy_path_statemachine.go 62.50% 4 Missing and 2 partials :warning:
state/protocol/mock/epoch_protocol_state.go 0.00% 4 Missing :warning:
..._state/epochs/mock/state_machine_factory_method.go 0.00% 4 Missing :warning:
storage/badger/epoch_protocol_state.go 82.60% 3 Missing and 1 partial :warning:
... and 2 more
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/efm-recovery    #6168      +/-   ##
========================================================
+ Coverage                 41.69%   41.70%   +0.01%     
========================================================
  Files                      1975     1976       +1     
  Lines                    139267   139327      +60     
========================================================
+ Hits                      58061    58109      +48     
- Misses                    75154    75158       +4     
- Partials                   6052     6060       +8     
Flag Coverage Δ
unittests 41.70% <55.87%> (+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.

codecov-commenter avatar Jul 01 '24 05:07 codecov-commenter