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
[Collection] Compliance engine message queues #1270
[Collection] Compliance engine message queues #1270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Codecov Report
@@ Coverage Diff @@
## master #1270 +/- ##
==========================================
+ Coverage 54.58% 54.81% +0.22%
==========================================
Files 500 501 +1
Lines 31659 31721 +62
==========================================
+ Hits 17281 17387 +106
+ Misses 12023 11970 -53
- Partials 2355 2364 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
What really bothers me is the amount of code duplication between the consensus and the collector compliance engine. If golang only had generics ... 😠.
I guess that is technical debt we can address once go 1.18 comes around.
P.S. took the liberty up slightly update some goDoc (commit 26bb30f). No functional changes
@@ -20,6 +21,7 @@ type EventLoop struct { | |||
proposals chan *model.Proposal | |||
votes chan *model.Vote | |||
|
|||
lm *lifecycle.LifecycleManager | |||
unit *engine.Unit // lock for preventing concurrent state transitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like LifecycleManager
and Unit
supply largely redundant functionality here (?)
The only component from unit
that we utilize here seems to be the WaitGroup
:
Line 13 in 1101316
wg sync.WaitGroup // tracks in-progress functions |
Is there any reason to not replace unit
by a WaitGroup
. Would remove some of the clutter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really hope to see one day LifecycleManager
fused with Unit
so that's why I would leave it as it in and just remove unit
completely then.
BTW, I think we can actually have a single implementation of the
My thoughts are that we could:
While it seems doable on a high-level, there are probably a lot of details that would need to be aligned. Not sure if it is worth the effort at this time ... |
I was trying to do the same for sync engine and in the end it appears that it's a good idea for later refactoring especially with go 1.18 but for time being it's not a priority. So I would indeed leave it for later. |
bors merge |
1270: [Collection] Compliance engine message queues r=durkmurder a=durkmurder https://github.com/dapperlabs/flow-go/issues/5807 ### Context This PR implements message queues for collection compliance engine(former proposal engine). Design and implementation is inspired by consensus compliance engine, basically same engine is used with needed modifications for collection clusters. Previously we named it as _proposal_ engine to follow naming of consensus engines I have renamed it to _compliance_ engine Co-authored-by: Yurii Oleksyshyn <yuraolex@gmail.com> Co-authored-by: Yura <yuraolex@gmail.com> Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Build failed: |
bors merge |
https://github.com/dapperlabs/flow-go/issues/5807
Context
This PR implements message queues for collection compliance engine(former proposal engine). Design and implementation is inspired by consensus compliance engine, basically same engine is used with needed modifications for collection clusters.
Previously we named it as proposal engine to follow naming of consensus engines I have renamed it to compliance engine