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

cluster/manifest: refactor to 65 byte k1 sigs #2468

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented Jul 25, 2023

Refactor manifest K1 sigs to 65 bytes to align with Ethereum standard.

Also improve cluster lock signature verification.

Also fix DKG to respect v1.6.0 config and not support earlier versions.

category: refactor
ticket: none

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 44.92% and project coverage change: -0.15% ⚠️

Comparison is base (748a434) 53.83% compared to head (178b120) 53.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2468      +/-   ##
==========================================
- Coverage   53.83%   53.68%   -0.15%     
==========================================
  Files         198      198              
  Lines       26501    26660     +159     
==========================================
+ Hits        14267    14313      +46     
- Misses      10474    10565      +91     
- Partials     1760     1782      +22     
Files Changed Coverage Δ
cluster/version.go 77.77% <0.00%> (-22.23%) ⬇️
dkg/bcast/impl.go 71.01% <0.00%> (ø)
eth2util/enr/enr.go 72.66% <0.00%> (ø)
cluster/lock.go 56.49% <33.33%> (+0.44%) ⬆️
cluster/manifest/helpers.go 39.49% <50.00%> (ø)
app/k1util/k1util.go 42.04% <57.14%> (+0.58%) ⬆️
cluster/test_cluster.go 98.12% <66.66%> (-1.88%) ⬇️
dkg/dkg.go 58.06% <70.00%> (+0.16%) ⬆️
dkg/nodesigs.go 81.73% <100.00%> (-2.89%) ⬇️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if err != nil {
return errors.Wrap(err, "operator node signature check")
}
// verifyNodeSignatures returns true an error if the node signatures field is not correctly
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
// verifyNodeSignatures returns true an error if the node signatures field is not correctly
// verifyNodeSignatures returns an error if the node signatures field is not correctly

}
}

return nil
}

// verifyBuilderRegistrations returns an error if populated builder registrations from json are invalid.
// verifyBuilderRegistrations returns an error if the populated builder registrations are invalid.
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
// verifyBuilderRegistrations returns an error if the populated builder registrations are invalid.
// verifyBuilderRegistrations returns an error if the builder registrations are not correctly
// populated or otherwise invalid.

Comment on lines +110 to +112
if def.Version != "v1.6.0" && def.Version != "v1.7.0" {
return errors.New("only v1.6.0 and v1.7.0 cluster definition version supported")
}
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 to enforce this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because it fails for earlier versions

// Assert Deposit Data
require.EqualValues(t, val.PubKey, val.DepositData.PubKey)
require.EqualValues(t, 32_000_000_000, val.DepositData.Amount)

if !cluster.SupportPregenRegistrations(lock.Version) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have similar verification for node signatures as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I added that

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jul 25, 2023
@obol-bulldozer obol-bulldozer bot merged commit b290662 into main Jul 25, 2023
14 checks passed
@obol-bulldozer obol-bulldozer bot deleted the corver/improvenodesigs branch July 25, 2023 13:41
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