Skip to content

Allow /validator apis to work pre-genesis #7729

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

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

pawanjay176
Copy link
Member

Issue Addressed

N/A

Proposed Changes

Lighthouse BN http endpoint would return a server error pre-genesis on the validator/duties/attester and validator/prepare_beacon_proposer because slot_clock.now() would return a None pre-genesis.

The prysm VC depends on the endpoints pre-genesis and was having issues interoping with the lighthouse bn because of this reason.

The proposer duties endpoint explicitly handles the pre-genesis case here

let current_epoch = chain
.slot_clock
.now_or_genesis()
.map(|slot| slot.epoch(T::EthSpec::slots_per_epoch()))
.ok_or(BeaconChainError::UnableToReadSlot)
.map_err(warp_utils::reject::unhandled_error)?;

I see no reason why we can't make the other endpoints more flexible to work pre-genesis. This PR handles the pre-genesis case on the attester and prepare_beacon_proposer endpoints as well.

Thanks for raising @james-prysm.

@barnabasbusa
Copy link

Can confirm, prysm vc now works with ethpandaops/lighthouse:pawanjay176-duties-pre-genesis-552421c

participants:
  - el_type: nethermind
    cl_type: lighthouse
    cl_image: ethpandaops/lighthouse:pawanjay176-duties-pre-genesis-552421c
    vc_type: prysm
    count: 2
additional_services:
  - dora

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP-API ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants