-
Notifications
You must be signed in to change notification settings - Fork 90
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
app: add aggregation integration test #1150
Conversation
testutil/validatormock/attest.go
Outdated
|
||
return nil | ||
} | ||
|
||
// Aggregate should be called at latest 2/3 into the slot, it does slot attestation aggregations. | ||
func (a *SlotAttester) Aggregate(ctx context.Context) error { | ||
s := a.slot | ||
// Wait for Prepare and Attest to complete | ||
<-a.selectinsOK |
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.
<-a.selectinsOK | |
<-a.selectionsOK |
Codecov ReportBase: 53.12% // Head: 52.92% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1150 +/- ##
==========================================
- Coverage 53.12% 52.92% -0.20%
==========================================
Files 130 131 +1
Lines 15207 15266 +59
==========================================
+ Hits 8078 8079 +1
- Misses 5961 6023 +62
+ Partials 1168 1164 -4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
datas datas | ||
dutiesOK chan struct{} | ||
selectionsOK chan struct{} | ||
datasOK chan struct{} |
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.
why do we need these channels?
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.
what was the problem in the absence of these channels?
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.
It solves concurrency problems.
- SlotAttester does not worry about concurrency
- Prepare, Attest and Aggregate can be called concurrently, especially in testing where slots are only 1s duration.
- But Attest requires data from Prepare
- And Aggregate requires data from Prepare and Attest
- So these channels allow the Attest and Aggregate gorountines to wait for their data to be available.
Adds assertion of aggregations in attestation integration tests.
Also:
testutil. RequireNoError
for improved debugging in testscategory: test
ticket: #1069