Custom ChainStart Genesis Time Delay in Deposit Contract #1666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is part of #1565
Description
Write why you are making the changes in this pull request
The specification for the deposit contract mentions how the genesis time is defined as 24 hours after the deposit threshold is reached. This is done to ensure nodes are all initialized and validators are ready to go for the beacon chain to begin. Currently, we use a flag called
skip-chainstart-delay
which instead sets the genesis time to time.Now(). The problem with this is that the beacon node needs time to initialize and validators need time to connect and prepare for the chain to begin. Given there is a discrepancy between when the log is initially fired and when validators are ready, validators may not begin their assignment until a few epochs have passed in the beacon node since genesis.For example, below:
The validator begins at 6 slots since genesis because it received the chainstart genesis time too late from the beacon node.
Write a summary of the changes you are making
Instead of having a bool flag for
skip-chainstart-delay
in our contract, we could instead use a custom initializer parameter in seconds which we can use to customize the delay between when the chainstart log occurs and when the chain needs to begin based on the genesis time. This would allow us to set smaller values than 24 hours but greater than time.Now() for local testing of the the full ETH2.0 workflow.