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

Make use of object initial values #843

Closed
wants to merge 3 commits into from
Closed

Conversation

JustinDrake
Copy link
Collaborator

@JustinDrake JustinDrake commented Mar 26, 2019

  • 71 lines removed in phase 0 if GENESIS_SLOT != 0
  • 92 lines removed in phase 0 if GENESIS_SLOT == 0 (upcoming PR from @djrtwo)

Also bunch of lines also removed in phase 1. Golang has such initial values baked into the language.

Screenshot 2019-03-26 at 20 26 41

@djrtwo
Copy link
Contributor

djrtwo commented Mar 27, 2019

Internally debating this.
Do you plan to define initial values for each type somewhere?

@JustinDrake
Copy link
Collaborator Author

Do you plan to define initial values for each type somewhere?

Yes, we can define initial values immediately after defining types. It's a one-liner: "Recursively initialize objects using 0 for "uintN", False for "bool", and [] for lists."

JustinDrake added a commit that referenced this pull request Apr 14, 2019
* Remove unnecessary per-field comments, focus on field grouping
* Group `Validator` fields relevant to light-clients together (small optimisation for light clients)
* Rework grouping of `BeaconState` fields
* `deposit_index` => `eth1_deposit_index`

Do not merge before:

* #695 which specifies custom types for individual container fields, offsetting the removal of comments in some instances
* #896 and #843 so that we don't have to continuously maintain the genesis `BeaconState`
* #874 which introduces `current_crosslinks` and `previous_crosslinks`
@JustinDrake JustinDrake mentioned this pull request Apr 14, 2019
@JustinDrake JustinDrake added general:simplification general:presentation Presentation (as opposed to content) labels Apr 17, 2019
@JustinDrake
Copy link
Collaborator Author

Close in favour of #963

@djrtwo djrtwo deleted the JustinDrake-patch-4 branch September 7, 2019 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general:presentation Presentation (as opposed to content) general:simplification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants