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

core/parsigdb: add support for DutySyncMessage to parsigdb #1219

Merged
merged 3 commits into from
Oct 4, 2022

Conversation

dB2510
Copy link
Contributor

@dB2510 dB2510 commented Oct 3, 2022

Adds support for DutySyncMessage to parsigdb.

category: feature
ticket: #1192

@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Base: 53.01% // Head: 52.70% // Decreases project coverage by -0.30% ⚠️

Coverage data is based on head (0d1b7d1) compared to base (8bc41ee).
Patch coverage: 29.41% of modified lines in pull request are covered.

❗ Current head 0d1b7d1 differs from pull request most recent head 27ed08f. Consider uploading reports for the commit 27ed08f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1219      +/-   ##
==========================================
- Coverage   53.01%   52.70%   -0.31%     
==========================================
  Files         133      136       +3     
  Lines       15784    15988     +204     
==========================================
+ Hits         8368     8427      +59     
- Misses       6198     6326     +128     
- Partials     1218     1235      +17     
Impacted Files Coverage Δ
core/signeddata.go 40.34% <0.00%> (-0.55%) ⬇️
core/types.go 31.16% <0.00%> (-1.05%) ⬇️
core/parsigdb/memory.go 9.09% <45.45%> (ø)
p2p/sender.go 43.95% <0.00%> (-12.95%) ⬇️
cmd/createdkg.go 65.65% <0.00%> (-4.56%) ⬇️
cluster/helpers.go 61.80% <0.00%> (-3.17%) ⬇️
cmd/createcluster.go 46.60% <0.00%> (-1.27%) ⬇️
core/qbft/qbft.go 81.11% <0.00%> (-0.86%) ⬇️
core/scheduler/scheduler.go 73.13% <0.00%> (-0.54%) ⬇️
cluster/definition.go 53.35% <0.00%> (-0.43%) ⬇️
... and 8 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.

@dB2510 dB2510 linked an issue Oct 4, 2022 that may be closed by this pull request
@@ -125,6 +130,31 @@ func (db *MemDB) StoreExternal(ctx context.Context, duty core.Duty, signedSet co
return nil
}

func shouldOutput(duty core.Duty, sigs []core.ParSignedData, threshold int) (bool, []core.ParSignedData, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

godoc please

Copy link
Contributor

Choose a reason for hiding this comment

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

result ordering []core.ParSignedData, bool, error

Copy link
Contributor

Choose a reason for hiding this comment

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

rename to calculateOutput

@@ -125,6 +130,31 @@ func (db *MemDB) StoreExternal(ctx context.Context, duty core.Duty, signedSet co
return nil
}

func shouldOutput(duty core.Duty, sigs []core.ParSignedData, threshold int) (bool, []core.ParSignedData, error) {
if duty.Type != core.DutySyncMessage {
return len(sigs) >= threshold, sigs, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

it was len(sigs) == threshold previously

return len(sigs) >= threshold, sigs, nil
}

data := make(map[string][]core.ParSignedData)
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for string key, use eth2p0.Root

Copy link
Contributor

Choose a reason for hiding this comment

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

rename sigsByRoot

if err != nil {
return err
}
if !ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

else if

@dB2510 dB2510 added the merge when ready Indicates bulldozer bot may merge when all checks pass label Oct 4, 2022
@obol-bulldozer obol-bulldozer bot merged commit c2ab851 into main Oct 4, 2022
@obol-bulldozer obol-bulldozer bot deleted the dhruv/syncparsigdb branch October 4, 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.

Add support for SyncCommitteeMessage to parsigdb
2 participants