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

createdkg: validate inputs #2136

Merged
merged 2 commits into from
May 7, 2023
Merged

createdkg: validate inputs #2136

merged 2 commits into from
May 7, 2023

Conversation

xenowits
Copy link
Contributor

Adds checks to validate inputs for create dkg command.

Fixes OBOL-19 and OBOL-20 of sigp audit.

category: feature
ticket: #2093

@xenowits xenowits self-assigned this Apr 26, 2023
func isMainNetwork(network string) bool {
// validateConfig returns an error if any of the provided config parameter is invalid.
func validateConfig(threshold, numOperators int, network string) error {
if threshold > numOperators {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix for #2093

return errors.Wrap(err, "invalid withdrawal address", z.Str("addr", addr))
} else if checksumAddr != addr {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix for #2094

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Patch coverage: 78.12% and project coverage change: +0.03 🎉

Comparison is base (e43db51) 53.37% compared to head (e146be9) 53.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2136      +/-   ##
==========================================
+ Coverage   53.37%   53.41%   +0.03%     
==========================================
  Files         174      174              
  Lines       22799    22815      +16     
==========================================
+ Hits        12170    12186      +16     
- Misses       9167     9168       +1     
+ Partials     1462     1461       -1     
Impacted Files Coverage Δ
cmd/createcluster.go 59.40% <0.00%> (ø)
cmd/createdkg.go 73.01% <77.77%> (+10.73%) ⬆️
testutil/compose/define.go 39.22% <100.00%> (ø)
testutil/compose/lock.go 76.03% <100.00%> (ø)

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -36,8 +36,9 @@ import (
)

const (
// zeroAddress is not owned by any user, is often associated with token burn & mint/genesis events and used as a generic null address.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-04-27 at 09 30 15

@xenowits xenowits added sigp audit Issues identified by sigma prime audit merge when ready Indicates bulldozer bot may merge when all checks pass labels May 7, 2023
@obol-bulldozer obol-bulldozer bot merged commit 5ec25c8 into main May 7, 2023
@obol-bulldozer obol-bulldozer bot deleted the xenowits/obol-19 branch May 7, 2023 17:31
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 sigp audit Issues identified by sigma prime audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants