Closed masih closed 6 days ago
Attention: Patch coverage is 94.73684%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 76.19%. Comparing base (
12c0356
) to head (e30c8aa
). Report is 1 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
host.go | 50.00% | 2 Missing :warning: |
gpbft/participant.go | 95.65% | 0 Missing and 1 partial :warning: |
The host implementation needs to know the progress of the current instance for certificate storage and catch up purposes. As a result the current instance must be safe to read from multiple goroutines. This was achieved by a dedicated mutex that synchronised all access to the current instanceID.
Separately, validation logic requires to know how far the current instance has progressed in order to effectively validate incoming messages.
The changes here simplify the locking by unifying the logic for checking the progress of an instance: both validator and host can now get the latest progress from the participant that is safe for concurrent use. This is achieved by moving the progress observer mechanism out of validator and into the participant, while introducing the concept of
gpbft.Progress
a function that returns the current instance, round and phase.As part of this change, Lotus integration can now get the current round and phase as well as current instance, which is useful for self equivocation checking as well as debugging purposes.
Fixes #658 Relates to #599