Skip to content

Set disabled fork epoch values as null in yaml config #2569

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

Closed
pawanjay176 opened this issue Aug 26, 2021 · 1 comment
Closed

Set disabled fork epoch values as null in yaml config #2569

pawanjay176 opened this issue Aug 26, 2021 · 1 comment

Comments

@pawanjay176
Copy link
Contributor

pawanjay176 commented Aug 26, 2021

Currently in the yaml config, we set the disabled fork epoch values (ALTAIR_FORK_EPOCH, MERGE_FORK_EPOCH) as uint64::max().

To be more explicit, we could instead set the fork_epoch value for disabled forks as null in the yaml config.

The primary reasoning is that uint64::max() is a placeholder value to denote that the fork is disabled on the given network config. Setting it explicitly to null would simplify knowing if the fork is enabled or not without any additional context (that u64::max() denotes disabled).

@pawanjay176 pawanjay176 changed the title Set disabled values as null in yaml config Set disabled fork epoch values as null in yaml config Aug 26, 2021
@michaelsproul
Copy link
Contributor

Thanks Pawan. I was going to advocate for this too, because it differentiates between:

  1. The fork epoch has been set for this network, and it is N, and
  2. The fork epoch has not been decided for this network, but may be set to some value N in future

Lighthouse has been representing fork epochs as Option<Epoch> since we started working on Altair, so our None/null value was used to represent case (2). We were incorrectly treating 2**64 - 1 as case (1), i.e. a concrete epoch at which the fork would eventually activate. We're going to move to mapping 2**64 - 1 to None on (de)serialisation, which is probably what we should have done from the start. I think this should be backwards-compatible for us, and avoids changing the spec. The only thing I can imagine might be affected is the /config/fork_schedule endpoint, which will filter out the forks that aren't scheduled rather than returning them with u64::max.

TL;DR: I think this issue can be closed.

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

No branches or pull requests

2 participants