Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor validation logic into a mutex-free pluggable struct #657

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

masih
Copy link
Member

@masih masih commented Sep 23, 2024

Refactor the validation logic out of Participant and into its own dedicated struct that is mutex-free and listens to the progress made by the participant to infer the correct validation path.

The change above significantly reduces the need for mutex control over current instance, which makes it easier to plug in extra conditional behaviour, e.g. #583.

Fixes #561

@masih masih force-pushed the masih/validation-refactor branch 2 times, most recently from c49ae37 to b387cf7 Compare September 23, 2024 12:14
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 89.50276% with 19 lines in your changes missing coverage. Please review.

Project coverage is 76.72%. Comparing base (f5af3ff) to head (9fad427).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
gpbft/validator.go 90.84% 7 Missing and 7 partials ⚠️
gpbft/options.go 20.00% 4 Missing ⚠️
gpbft/participant.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #657      +/-   ##
==========================================
- Coverage   76.90%   76.72%   -0.18%     
==========================================
  Files          64       65       +1     
  Lines        5451     5487      +36     
==========================================
+ Hits         4192     4210      +18     
- Misses        857      872      +15     
- Partials      402      405       +3     
Files with missing lines Coverage Δ
gpbft/gpbft.go 88.18% <100.00%> (+0.13%) ⬆️
internal/caching/grouped_cache.go 92.30% <100.00%> (-3.53%) ⬇️
gpbft/participant.go 84.35% <87.50%> (-3.51%) ⬇️
gpbft/options.go 62.71% <20.00%> (-3.96%) ⬇️
gpbft/validator.go 90.84% <90.84%> (ø)

... and 4 files with indirect coverage changes

gpbft/gpbft.go Show resolved Hide resolved
gpbft/gpbft.go Outdated Show resolved Hide resolved
gpbft/gpbft_test.go Show resolved Hide resolved
gpbft/validator.go Show resolved Hide resolved
gpbft/gpbft.go Outdated Show resolved Hide resolved
gpbft/gpbft.go Outdated Show resolved Hide resolved
gpbft/gpbft.go Outdated Show resolved Hide resolved
Refactor the validation logic out of `Participant` and into its own
dedicated struct that is mutex-free and listens to the progress made by
the participant to infer the correct validation path.

The change above significantly reduces the need for mutex control over
current instance, which makes it easier to plug in extra conditional
behaviour, e.g. #583.

Fixes #561
@masih masih added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit 76ecca1 Sep 23, 2024
13 checks passed
@masih masih deleted the masih/validation-refactor branch September 23, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor validation logic for a more pluggable functionality
2 participants