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

Define BeaconState Core Type and Protobuf Definition #863

Merged
merged 3 commits into from
Nov 20, 2018

Conversation

rauljordan
Copy link
Contributor

This is part of #781


Description

Given the latest specification, there is now only a single state for the beacon chain called BeaconState. We will be abandoning the split between the active and crystallized states and beginning a beacon node refactor by starting from defining the new state core type. This PR encompasses a basic Golang struct to represent the BeaconState as well as protobuf definitions for the underlying types. This PR also refactors the proto directory a bit, splitting type definitions into a types.proto file and p2p message request/response types into a messages.proto file.

@rauljordan rauljordan self-assigned this Nov 20, 2018
@rauljordan rauljordan added Enhancement New feature or request Refactor Priority: High High priority item and removed Enhancement New feature or request labels Nov 20, 2018
@rauljordan rauljordan added this to the Ruby - v0.1 milestone Nov 20, 2018
repeated SpecialRecord specials = 9;
}

message CrystallizedState {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We keep these in here for now until we are done with the refactor

Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validator index should be uint32 and gensis time should be uint64?

uint64 last_justified_slot = 6;
uint64 justified_streak = 7;
repeated ShardAndCommitteeArray shard_and_committees_for_slots = 8;
repeated uint64 persistent_committees = 9;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint32

}

message ShardReassignmentRecord {
uint64 validator_index = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint32

repeated uint64 deposits_penalized_in_period = 12;
bytes validator_delta_hash_chain = 13;
uint64 current_exit_seq = 14;
google.protobuf.Timestamp genesis_time = 15;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genesis time should probably be uint64 or we have to do the translation again before ssz

@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #863 into master will increase coverage by 0.04%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master     #863      +/-   ##
==========================================
+ Coverage   73.43%   73.47%   +0.04%     
==========================================
  Files          67       67              
  Lines        4370     4362       -8     
==========================================
- Hits         3209     3205       -4     
+ Misses        843      839       -4     
  Partials      318      318

@rauljordan rauljordan merged commit 891dc2e into prysmaticlabs:master Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High High priority item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants