Skip to content

Conversation

@hopinheimer
Copy link

🗒️ Description

This PR introduces dynamic validator set. The current assumption is the validator entry/exit requests would received over wire but it definitely up for discussion like all the other parts of the PR.

  • Ran tox checks to avoid unnecessary CI fails:
    uvx tox
  • Considered adding appropriate tests for the changes.
  • Considered updating the online docs in the ./docs/ directory.

Copy link
Collaborator

@tcoratger tcoratger left a comment

Choose a reason for hiding this comment

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

This looks nice, I've left couple of comments and I think that for some reasons the test vectors are failing in the CI, probably due to some changes inside the PR.


# --- Validator Lifecycle Parameters ---

MIN_ACTIVATION_DELAY: Final = Uint64(8)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
MIN_ACTIVATION_DELAY: Final = Uint64(8)
MIN_ACTIVATION_DELAY: Slot = Slot(8)

3. Time for validation and consensus on the new validator
"""

MIN_EXIT_DELAY: Final = Uint64(8)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
MIN_EXIT_DELAY: Final = Uint64(8)
MIN_EXIT_DELAY: Slot = Slot(8)

Comment on lines +95 to +96
min_activation_delay: Uint64
min_exit_delay: Uint64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
min_activation_delay: Uint64
min_exit_delay: Uint64
min_activation_delay: Slot
min_exit_delay: Slot

class ValidatorDeposits(SSZList[ValidatorDeposit]):
"""List of validator deposits included in a block."""

ELEMENT_TYPE = ValidatorDeposit
Copy link
Collaborator

Choose a reason for hiding this comment

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

With #259

Suggested change
ELEMENT_TYPE = ValidatorDeposit

class ValidatorExits(SSZList[ValidatorExit]):
"""List of validator exit requests included in a block."""

ELEMENT_TYPE = ValidatorExit
Copy link
Collaborator

Choose a reason for hiding this comment

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

With #259

Suggested change
ELEMENT_TYPE = ValidatorExit

Comment on lines +917 to +918
from ..deposit import ValidatorDeposits
from ..exit import ValidatorExits
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this to the top of the file?

class PendingDeposits(SSZList[PendingDeposit]):
"""Queue of validators awaiting activation."""

ELEMENT_TYPE = PendingDeposit
Copy link
Collaborator

Choose a reason for hiding this comment

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

With #259

Suggested change
ELEMENT_TYPE = PendingDeposit

class ExitQueue(SSZList[ExitRequest]):
"""Queue of validators awaiting removal."""

ELEMENT_TYPE = ExitRequest
Copy link
Collaborator

Choose a reason for hiding this comment

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

With #259

Suggested change
ELEMENT_TYPE = ExitRequest

Comment on lines +18 to +22
min_activation_delay: Uint64 = Uint64(8)
"""Minimum slots before a validator deposit activates."""

min_exit_delay: Uint64 = Uint64(8)
"""Minimum slots before a validator exit is removed."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
min_activation_delay: Uint64 = Uint64(8)
"""Minimum slots before a validator deposit activates."""
min_exit_delay: Uint64 = Uint64(8)
"""Minimum slots before a validator exit is removed."""
min_activation_delay: Slot = Slot(8)
"""Minimum slots before a validator deposit activates."""
min_exit_delay: Slot = Slot(8)
"""Minimum slots before a validator exit is removed."""

)

encode = state.encode_bytes()
expected_value = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess that you removed the expected value because now it changed with the new fields added?

@unnawut
Copy link
Collaborator

unnawut commented Jan 8, 2026

Just my 2 cents. I think it might be too early to take dynamic validators now, i.e.

  • Activation delays, exit delays, activations per slot, etc. their existence and their parameters are quite specific to beacon chain's design
  • We havn't planned out other dependent features e.g. validator role segregation, 3SF-mini is not the final mechanism
  • Having deposit/activate/exit mechanisms now will also make devnets harder to setup & debug

So to me if these aren't part of any upcoming lean experimentation or some unknowns we want to explore, we might not want to include it yet? Otherwise it's quite a lot of context to maintain.

Or unless we start shipping a modular leanSpec where components can be mixed & matched for different experimentations. In that case then maybe this could go as a separate lean_spec/subspecs module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants