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

app: add aggregation integration test #1150

Merged
merged 4 commits into from
Sep 23, 2022
Merged

Conversation

corverroos
Copy link
Contributor

Adds assertion of aggregations in attestation integration tests.

Also:

  • Assert multiple duties types in integration tests
  • Removed unused nolints
  • Add testutil. RequireNoError for improved debugging in tests
  • Make beaconmock stateful wrt attestation data and aggregations
  • Improve validatormock slot attester concurrency

category: test
ticket: #1069


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<-a.selectinsOK
<-a.selectionsOK

@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Base: 53.12% // Head: 52.92% // Decreases project coverage by -0.19% ⚠️

Coverage data is based on head (bef42d3) compared to base (14e6f80).
Patch coverage: 78.26% of modified lines in pull request are covered.

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     
Impacted Files Coverage Δ
testutil/beaconmock/server.go 54.47% <0.00%> (-0.45%) ⬇️
core/bcast/bcast.go 53.84% <20.00%> (-0.77%) ⬇️
testutil/beaconmock/options.go 33.33% <40.00%> (-2.78%) ⬇️
app/expbackoff/expbackoff.go 73.23% <50.00%> (ø)
testutil/beaconmock/attestation.go 82.60% <82.60%> (ø)
testutil/validatormock/attest.go 60.24% <95.65%> (+4.44%) ⬆️
app/app.go 58.01% <100.00%> (-1.53%) ⬇️
app/vmock.go 76.00% <100.00%> (+2.53%) ⬆️
core/validatorapi/router.go 62.87% <100.00%> (ø)
dkg/transport.go 53.70% <0.00%> (-12.97%) ⬇️
... and 9 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

datas datas
dutiesOK chan struct{}
selectionsOK chan struct{}
datasOK chan struct{}
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

@corverroos corverroos Sep 23, 2022

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.

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Sep 23, 2022
@obol-bulldozer obol-bulldozer bot merged commit 04d70c3 into main Sep 23, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/vmockattest branch September 23, 2022 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants