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

Remove post-altair initialize_beacon_state_from_eth1 from specs #3663

Open
hwwhww opened this issue Apr 9, 2024 · 2 comments
Open

Remove post-altair initialize_beacon_state_from_eth1 from specs #3663

hwwhww opened this issue Apr 9, 2024 · 2 comments

Comments

@hwwhww
Copy link
Contributor

hwwhww commented Apr 9, 2024

(copied from our previous discussion)

There are the post-altair testing initialize_beacon_state_from_eth1 helpers that set previous_version == current_version. It was designed for the testnets.

That said, it seems the previous testnets prefer using phase0 genesis and calling a series of upgrade_to_<fork> at slot 0…

If no one uses it, we may consider removing the post-altair initialize_beacon_state_from_eth1 from the specs.

@hwwhww hwwhww changed the title Remove post-phase0 initialize_beacon_state_from_eth1 from specs Remove post-altair initialize_beacon_state_from_eth1 from specs Apr 9, 2024
@ralexstokes
Copy link
Member

we do indirectly use these functions in testing, its not a big deal to move them to just testing code, and would simplify the specs so I support doing it

@dapplion
Copy link
Collaborator

dapplion commented Apr 10, 2024

The genesis generators used in our testing just re-use the upgrade_to_* functions from a phase0 genesis state. The result should be identical. Having to maintain the extra initialize_beacon_state_from_eth1 is just boilerplate.

    if spec.altair_fork_epoch == Some(GENESIS_EPOCH) {
        upgrade_to_altair(&mut state, spec).unwrap();
    }
    if spec.bellatrix_fork_epoch == Some(GENESIS_EPOCH) {
        upgrade_to_bellatrix(&mut state, spec).unwrap();
    }
    if spec.capella_fork_epoch == Some(GENESIS_EPOCH) {
        upgrade_to_capella(&mut state, spec).unwrap();
    }

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

No branches or pull requests

3 participants