-
Notifications
You must be signed in to change notification settings - Fork 79
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
Conversation
Codecov ReportBase: 53.01% // Head: 52.70% // Decreases project coverage by
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
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. |
core/parsigdb/memory.go
Outdated
@@ -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) { |
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.
godoc please
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.
result ordering []core.ParSignedData, bool, error
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.
rename to calculateOutput
core/parsigdb/memory.go
Outdated
@@ -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 |
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 was len(sigs) == threshold
previously
core/parsigdb/memory.go
Outdated
return len(sigs) >= threshold, sigs, nil | ||
} | ||
|
||
data := make(map[string][]core.ParSignedData) |
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.
no need for string key, use eth2p0.Root
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.
rename sigsByRoot
core/parsigdb/memory.go
Outdated
if err != nil { | ||
return err | ||
} | ||
if !ok { |
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.
else if
Adds support for
DutySyncMessage
to parsigdb.category: feature
ticket: #1192