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

Custom ChainStart Genesis Time Delay in Deposit Contract #1666

Merged
merged 5 commits into from
Feb 21, 2019

Conversation

rauljordan
Copy link
Contributor

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:

[2019-02-20 15:27:33]  INFO validator: Beacon chain initialized at unix time: 2019-02-20 15:27:03 -0600 CST
[2019-02-20 15:27:33]  INFO validator: Updated validator assignments attesterSlot=9223372036854775808 proposerSlot=0 shard=0
[2019-02-20 15:27:39]  WARN validator: Unknown role, doing nothing role=UNKNOWN slot=9223372036854775814 slotsSinceGenesis=6
[2019-02-20 15:27:45]  WARN validator: Unknown role, doing nothing role=UNKNOWN slot=9223372036854775815 slotsSinceGenesis=7
[2019-02-20 15:27:51]  WARN validator: Unknown role, doing nothing role=UNKNOWN slot=9223372036854775816 slotsSinceGenesis=8
[2019-02-20 15:27:57]  WARN validator: Unknown role, doing nothing role=UNKNOWN slot=9223372036854775817 slotsSinceGenesis=9

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.

@codecov
Copy link

codecov bot commented Feb 20, 2019

Codecov Report

Merging #1666 into master will increase coverage by 0.22%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1666      +/-   ##
==========================================
+ Coverage   70.82%   71.04%   +0.22%     
==========================================
  Files          97       97              
  Lines        6879     6846      -33     
==========================================
- Hits         4872     4864       -8     
+ Misses       1563     1543      -20     
+ Partials      444      439       -5

@rauljordan rauljordan self-assigned this Feb 20, 2019
@rauljordan rauljordan added Enhancement New feature or request Priority: High High priority item Ready For Review labels Feb 20, 2019
@rauljordan rauljordan merged commit 718f99e into master Feb 21, 2019
@rauljordan rauljordan deleted the customdelay branch February 21, 2019 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Priority: High High priority item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants