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: definition v1.8 #2823

Merged
merged 8 commits into from
Jan 29, 2024
Merged

cluster: definition v1.8 #2823

merged 8 commits into from
Jan 29, 2024

Conversation

pinebit
Copy link
Contributor

@pinebit pinebit commented Jan 25, 2024

Introducing cluster definition v1.8 with partial deposits.

category: feature
ticket: none

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 99 lines in your changes are missing coverage. Please review.

Comparison is base (b47f503) 53.14% compared to head (d85c769) 53.34%.
Report is 7 commits behind head on main.

Files Patch % Lines
cluster/ssz.go 55.90% 46 Missing and 25 partials ⚠️
cluster/definition.go 75.75% 12 Missing and 4 partials ⚠️
cluster/lock.go 79.06% 6 Missing and 3 partials ⚠️
cluster/deposit.go 86.95% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2823      +/-   ##
==========================================
+ Coverage   53.14%   53.34%   +0.20%     
==========================================
  Files         200      200              
  Lines       27705    28004     +299     
==========================================
+ Hits        14723    14939     +216     
- Misses      11151    11204      +53     
- Partials     1831     1861      +30     

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

cmd/createcluster_internal_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@dB2510 dB2510 left a comment

Choose a reason for hiding this comment

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

Please check the testdata/ json artefacts of cluster lock. They are not reflecting the logic properly.

cluster/definition.go Outdated Show resolved Hide resolved
cluster/definition.go Outdated Show resolved Hide resolved
cluster/definition.go Outdated Show resolved Hide resolved
cluster/definition.go Outdated Show resolved Hide resolved
cluster/definition.go Outdated Show resolved Hide resolved
@@ -685,6 +723,37 @@ func unmarshalDefinitionV1x5(data []byte) (def Definition, err error) {
}, nil
}

func unmarshalDefinitionV1x8(data []byte) (def Definition, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we verify deposit amounts here only? 🤔
But that would be more implicit rather than doing it in the run function after unmarshallling definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to revisit verification end-to-end in the "final" integrating PR. The codebase of this PR does not have the verification method accessible yet.

type distValidatorJSONv1x8 struct {
PubKey ethHex `json:"distributed_public_key"`
PubShares []ethHex `json:"public_shares,omitempty"`
DepositData depositDataJSON `json:"deposit_data,omitempty"`
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 have DepositData field here? this isn't used in v1.8.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct, removed.

Comment on lines 53 to 58
"deposit_data": {
"pubkey": "",
"withdrawal_credentials": "",
"amount": "0",
"signature": ""
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be in v1.8.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are very right! My bad, now fixed.

{
"pubkey": "0x1814be823350eab13935f31d84484517e924aef78ae151c00755925836b7075885650c30ec29a3703934bf50a28da102",
"withdrawal_credentials": "0x76b0620556304a3e3eae14c28d0cea39d2901a52720da85ca1e4b38eaf3f44c6",
"amount": "5919415281453547599",
Copy link
Contributor

Choose a reason for hiding this comment

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

this amount doesn't look right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is randomly generated amount. It does not have to be 32ETH for example for the purpose of the test.

Copy link

sonarcloud bot commented Jan 29, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
No data about Coverage
21.8% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@dB2510 dB2510 left a comment

Choose a reason for hiding this comment

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

LGTM

@pinebit pinebit added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jan 29, 2024
@obol-bulldozer obol-bulldozer bot merged commit 15ca030 into main Jan 29, 2024
12 checks passed
@obol-bulldozer obol-bulldozer bot deleted the pinebit/partial-deposits-v18 branch January 29, 2024 11:18
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