-
Notifications
You must be signed in to change notification settings - Fork 117
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
feat(blockchain): introducing validator size cap size #2119
base: fix-maximum-number-withdrawals
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix-maximum-number-withdrawals #2119 +/- ##
==================================================================
+ Coverage 26.41% 26.58% +0.16%
==================================================================
Files 357 357
Lines 16075 16097 +22
Branches 12 12
==================================================================
+ Hits 4247 4280 +33
+ Misses 11560 11547 -13
- Partials 268 270 +2
|
eb0a88d
to
c6c68c3
Compare
if uint32(len(deposits)) > sp.cs.GetValidatorsSetCapSize() { | ||
return nil, fmt.Errorf("validator set cap %d, deposits count %d: %w", | ||
sp.cs.GetValidatorsSetCapSize(), | ||
len(deposits), | ||
ErrHitValidatorsSetCap, | ||
) | ||
} |
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.
here I assume deposits in genesis maps one to one with genesis validators and we do not have two different updates for the same validator.
Is it a fair assumption @chuck-bear, @itsdevbear?
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.
may be necessary to allow multiple deposits per genesis validator if each deposit is capped to some amount like 32
63c2092
to
37542a0
Compare
if sp.cs.DepositEth1ChainID() == bArtioChainID { | ||
return st.AddValidatorBartio(val) | ||
} |
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.
replicating here the fix from #2111 to avoid double counting Bartio Validators balances (done implicitly in AddValidatorBartio)
// TODO: This is a bug that lives on bArtio. Delete this eventually. | ||
if sp.cs.DepositEth1ChainID() == bArtioChainID { | ||
if err := st.AddValidatorBartio(val); err != nil { | ||
if !sp.processingGenesis { |
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.
minor optimization which we may drop for readability.
Currently I chose to fail node initialization if genesis has more validators than the validator set cap, so here I can skip the check.
However we may chose to allow genesis have more validators than cap and immediately mark the ready for eviction.
@itsdevbear @chuck-bear thoughts?
838c2a7
to
af43b93
Compare
39fc15e
to
43b1eb4
Compare
2778c79
to
09eee8e
Compare
6e64587
to
561f95f
Compare
@@ -183,6 +183,8 @@ type Spec[ | |||
// GetCometBFTConfigForSlot retrieves the CometBFT config for a specific | |||
// slot. | |||
GetCometBFTConfigForSlot(slot SlotT) CometBFTConfigT | |||
|
|||
GetValidatorsSetCapSize() uint32 |
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.
GetValidatorsSetCapSize() uint32 | |
// GetValidatorSetCap retrieves the maximum number of validators allowed in the active set. | |
GetValidatorSetCap() uint32 |
nit + comment
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 seems comment was changed, but function name still needs to be changed to GetValidatorSetCap
// allowed in the active set. | ||
func (c chainSpec[ | ||
DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, | ||
]) GetValidatorsSetCapSize() uint32 { |
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.
nit: GetValidatorSetCap
This PR:
This PR currently fails e2e tests since it's based on #2110