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

in VC, extract all fork versions/epochs instead of just altair epoch #5956

Closed
wants to merge 1 commit into from

Conversation

etan-status
Copy link
Contributor

In the past, VC needed to know ALTAIR_FORK_EPOCH to determine whether sync committee duties need to be performed. Now, with EIP-7044, it additionally needs to know CAPELLA_FORK_VERSION and DENEB_FORK_EPOCH to create VoluntaryExit signatures post-Deneb.

These specific constants need to be accessed by name. They cannot be derived from the /eth/v1/config/fork_schedule endpoint, because that endpoint only provides the information needed for regular signatures. Notably, it does not state what Fork belongs to which ConsensusFork, and also does not indicate whether the underlying schedule is canonical, or whether it may be from a completely unsupported network, e.g., devnet for Verkle which currently uses a Verkle fork on top of Capella instead of Deneb. So, a heuristic which simply assumes that the fifth fork is Deneb is not reliable.

As it seems to be recurring practice that VC needs to access fork config related config.yaml keys, extend ValidatorRuntimeConfig to extract all ConsensusFork specific constants. Further validate that the retrieved info is consistent (monotonically increasing _FORK_EPOCH) and avoid extracting information about forks that are still subject to change (scheduled at FAR_FUTURE_EPOCH).

Note that this is a pre-requisite for implementing EIP-7044 into keymanager. Submitted separately due to the size of this patch.

In the past, VC needed to know `ALTAIR_FORK_EPOCH` to determine whether
sync committee duties need to be performed. Now, with EIP-7044, it
additionally needs to know `CAPELLA_FORK_VERSION` and `DENEB_FORK_EPOCH`
to create `VoluntaryExit` signatures post-Deneb.

These specific constants need to be accessed by name. They cannot be
derived from the `/eth/v1/config/fork_schedule` endpoint, because that
endpoint only provides the information needed for regular signatures.
Notably, it does not state what `Fork` belongs to which `ConsensusFork`,
and also does not indicate whether the underlying schedule is canonical,
or whether it may be from a completely unsupported network, e.g., devnet
for Verkle which currently uses a Verkle fork on top of Capella instead
of Deneb. So, a heuristic which simply assumes that the fifth fork is
Deneb is not reliable.

As it seems to be recurring practice that VC needs to access fork config
related config.yaml keys, extend `ValidatorRuntimeConfig` to extract all
`ConsensusFork` specific constants. Further validate that the retrieved
info is consistent (monotonically increasing `_FORK_EPOCH`) and avoid
extracting information about forks that are still subject to change
(scheduled at `FAR_FUTURE_EPOCH`).

Note that this is a pre-requisite for implementing EIP-7044 into
keymanager. Submitted separately due to the size of this patch.
@etan-status
Copy link
Contributor Author

Preferrable to only extract the CAPELLA_FORK_VERSION and DENEB_FORK_EPOCH.

@etan-status etan-status deleted the dev/etan/vc-forkconfig branch February 25, 2024 17:44
etan-status added a commit that referenced this pull request Feb 25, 2024
When trying to sign `VoluntaryExit` via keymanager API, the logic is not
yet aware of EIP-7044 (part of Deneb). This patch adds missing EIP-7044
support to the keymanager API as well.

As part of this, the VC needs to become aware about:

- `CAPELLA_FORK_VERSION`: To correctly form the EIP-7044 signing domain.
  The fork schedule does not indicate which of the results, if any,
  corresponds to Capella.
- `CAPELLA_FORK_EPOCH`: To detect whether Capella was scheduled.
  If a BN does not have it in its config while other BNs have it,
  this leads to a log if Capella has not activated yet, or marks the BN
  as incompatible if Capella already activated.
- `DENEB_FORK_EPOCH`: To check whether EIP-7044 logic should be used.

Related PRs:

- #5120 added support for processing EIP-7044 `VoluntaryExit` messages
  as part of the state transition functions (tested by EF spec tests).
- #5953 synced the support from #5120 to gossip validation.
- #5954 added support to the `nimbus_beacon_node deposits exit` command.
- #5956 contains an alternative generic version of `VCForkConfig`.
arnetheduck pushed a commit that referenced this pull request Feb 26, 2024
* add EIP-7044 support to keymanager API

When trying to sign `VoluntaryExit` via keymanager API, the logic is not
yet aware of EIP-7044 (part of Deneb). This patch adds missing EIP-7044
support to the keymanager API as well.

As part of this, the VC needs to become aware about:

- `CAPELLA_FORK_VERSION`: To correctly form the EIP-7044 signing domain.
  The fork schedule does not indicate which of the results, if any,
  corresponds to Capella.
- `CAPELLA_FORK_EPOCH`: To detect whether Capella was scheduled.
  If a BN does not have it in its config while other BNs have it,
  this leads to a log if Capella has not activated yet, or marks the BN
  as incompatible if Capella already activated.
- `DENEB_FORK_EPOCH`: To check whether EIP-7044 logic should be used.

Related PRs:

- #5120 added support for processing EIP-7044 `VoluntaryExit` messages
  as part of the state transition functions (tested by EF spec tests).
- #5953 synced the support from #5120 to gossip validation.
- #5954 added support to the `nimbus_beacon_node deposits exit` command.
- #5956 contains an alternative generic version of `VCForkConfig`.

* address reviewer feedback: letter case, module location, double lookup

---------

Co-authored-by: cheatfate <eugene.kabanov@status.im>

* Update beacon_chain/rpc/rest_constants.nim

* move `VCRuntimeConfig` back to `rest_types`

---------

Co-authored-by: cheatfate <eugene.kabanov@status.im>

* fix `getForkVersion` helper

---------

Co-authored-by: cheatfate <eugene.kabanov@status.im>
zah pushed a commit that referenced this pull request Feb 27, 2024
* add EIP-7044 support to keymanager API

When trying to sign `VoluntaryExit` via keymanager API, the logic is not
yet aware of EIP-7044 (part of Deneb). This patch adds missing EIP-7044
support to the keymanager API as well.

As part of this, the VC needs to become aware about:

- `CAPELLA_FORK_VERSION`: To correctly form the EIP-7044 signing domain.
  The fork schedule does not indicate which of the results, if any,
  corresponds to Capella.
- `CAPELLA_FORK_EPOCH`: To detect whether Capella was scheduled.
  If a BN does not have it in its config while other BNs have it,
  this leads to a log if Capella has not activated yet, or marks the BN
  as incompatible if Capella already activated.
- `DENEB_FORK_EPOCH`: To check whether EIP-7044 logic should be used.

Related PRs:

- #5120 added support for processing EIP-7044 `VoluntaryExit` messages
  as part of the state transition functions (tested by EF spec tests).
- #5953 synced the support from #5120 to gossip validation.
- #5954 added support to the `nimbus_beacon_node deposits exit` command.
- #5956 contains an alternative generic version of `VCForkConfig`.

* address reviewer feedback: letter case, module location, double lookup

---------

Co-authored-by: cheatfate <eugene.kabanov@status.im>

* Update beacon_chain/rpc/rest_constants.nim

* move `VCRuntimeConfig` back to `rest_types`

---------

Co-authored-by: cheatfate <eugene.kabanov@status.im>

* fix `getForkVersion` helper

---------

Co-authored-by: cheatfate <eugene.kabanov@status.im>
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.

None yet

1 participant