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

*: compounding flag #3520

Merged
merged 3 commits into from
Feb 12, 2025
Merged

*: compounding flag #3520

merged 3 commits into from
Feb 12, 2025

Conversation

pinebit
Copy link
Collaborator

@pinebit pinebit commented Feb 10, 2025

Added --compounding flag enabling compounding rewards for validators by using 0x02 withdrawal credentials.

When enabled, create cluster|dkg commands generate deposit datas with 0x02 withdrawal credentials and the maximum deposit amount can be up to 2048ETH, otherwise 0x01 withdrawal credentials are generated and the max amount is limited to 32ETH.

Examples for various use cases:

create cluster ... --deposit-amounts=16

Fatal error: sum of partial deposit amounts must be at least 32ETH {"sum": 16000000000}

create cluster ... --deposit-amounts=64

Fatal error: single partial deposit amount is too big {"amount": 64000000000, "max": 32000000000}

create cluster ... --deposit-amounts=4,16,32

Ok, generated three entries with 0x01, for 4, 16 & 32eth

create cluster ... --deposit-amounts=16,16,16

Ok, generated single entry with 0x01, for 16eth

create cluster ... -- no amounts specified

Ok, generated two entries with 0x01, for 1eth and 32eth

create cluster ... --compounding -- no amounts specified

Ok, generated two entries with 0x02, for 1eth and 32eth

create cluster ... --compounding --deposit-amounts=32

Ok, generated single entry with 0x02, for 32eth

create cluster ... --compounding --deposit-amounts=8,4

Fatal error: sum of partial deposit amounts must be at least 32ETH {"sum": 12000000000}

create cluster ... --compounding --deposit-amounts=2049

Fatal error: single partial deposit amount is too big {"amount": 2049000000000, "max": 2048000000000}

category: feature
ticket: #3278

@github-actions github-actions bot added the electra PR targeting electra upgrade label Feb 10, 2025
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 76.11940% with 16 lines in your changes missing coverage. Please review.

Please upload report for BASE (electra@807016e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
cluster/definition.go 27.27% 4 Missing and 4 partials ⚠️
cluster/manifestpb/v1/manifest.pb.go 0.00% 5 Missing ⚠️
cmd/createcluster.go 77.77% 1 Missing and 1 partial ⚠️
dkg/disk.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             electra    #3520   +/-   ##
==========================================
  Coverage           ?   57.52%           
==========================================
  Files              ?      218           
  Lines              ?    33749           
  Branches           ?        0           
==========================================
  Hits               ?    19413           
  Misses             ?    12292           
  Partials           ?     2044           

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

@OisinKyne
Copy link
Contributor

Sorry for not commenting at the appropriate parts of the code, but going to make some feedback/suggestions on your examples because they are convenient :)

create cluster ... --deposit-amounts=64

Fatal error: single partial deposit amount is too big {"amount": 64000000000, "max": 32000000000}

Maybe hint to them how to fix it:

Fatal error: single partial deposit amount is too large unless --compounding validators are used {"amount": 64000000000, "max": 32000000000}

create cluster ... -- no amounts specified

Ok, generated two entries with 0x01, for 1eth and 32eth

This one actually made me change my mind on what i was about to say. I like doing the default of 32 and 1 0x01 creds, because its not a breaking change (why we're moving away from how it was in the electra branch), but new default of 1 extra eth deposit will still allow people to convert to 0x02 later, and have a (i hope) valid 0x01 deposit for it, so they can add ether to the validator in the lowest allowable increment later. I like it.

generated three entries with
generated single entry with 0x01

generated three deposits of type 0x02 for 4, 16, & 32 eth
generated single deposit of type 0x01 for 32 eth

Can we rename entry/entries to deposit/deposits in all of the success logs?

create cluster ... --compounding --deposit-amounts=8,4

Fatal error: sum of partial deposit amounts must be at least 32ETH {"sum": 12000000000}

Fatal error: sum of partial deposit amounts must be at least 32ETH, repetition is allowed {"sum": 12000000000}

Technically you can use the same deposit multiple times to get to the 32 eth minimum. We put the === 32 requirement as a sanity check, I guess we keep it? or do we go more permissive and just log a warning? (no strong feeling about either approach)

@pinebit
Copy link
Collaborator Author

pinebit commented Feb 10, 2025

Sorry for not commenting at the appropriate parts of the code, but going to make some feedback/suggestions on your examples because they are convenient :)

Addressed all wording changes. Answered other questions internally.

@pinebit pinebit merged commit 09f1fd6 into electra Feb 12, 2025
10 of 11 checks passed
@pinebit pinebit deleted the pinebit/compounding-flag branch February 12, 2025 10:34
KaloyanTanev pushed a commit that referenced this pull request Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electra PR targeting electra upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants