Implement Chain Head Stream & Naming Consistency (#4160)

* include stream chain head mock
* uncomment test
* stream chain head implemented
* remove imports
* chain head stream test
* include stream test with mockgen
* test now passes
* checkin items
* stream tests all passing
* rem learn
* fix up fork checker
* add stream ctx
* gaz, fix test
* fix broken test
* Merge branch 'master' into chain-head-stream
* include context in chain head stream happy path test
* Merge branch 'master' into chain-head-stream
* Merge branch 'master' into chain-head-stream
* Merge refs/heads/master into chain-head-stream
* Merge refs/heads/master into chain-head-stream
This commit is contained in:
Raul Jordan
2019-12-03 11:48:11 -08:00
committed by prylabs-bulldozer[bot]
parent 8bbc589edd
commit 81a83cf100
10 changed files with 325 additions and 42 deletions

View File

@@ -255,7 +255,7 @@ index 69a148a..1b6ac18 100644
+ bytes signature = 4 [(gogoproto.moretags) = "ssz-size:\"96\""];
}
diff --git a/eth/v1alpha1/beacon_chain.proto b/eth/v1alpha1/beacon_chain.proto
index 0f490c1..592b169 100644
index c31fe0f..ee2e2ec 100644
--- a/eth/v1alpha1/beacon_chain.proto
+++ b/eth/v1alpha1/beacon_chain.proto
@@ -15,6 +15,7 @@ syntax = "proto3";
@@ -266,16 +266,29 @@ index 0f490c1..592b169 100644
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
@@ -261,7 +262,7 @@ message BeaconBlockContainer {
// Information about the head of the beacon chain.
message ChainHead {
// 32 byte merkle tree root of the canonical head block in the beacon node.
- bytes head_block_root = 1;
+ bytes head_block_root = 1 [(gogoproto.moretags) = "ssz-size:\"32\""];
@@ -76,9 +77,9 @@ service BeaconChain {
};
}
// Slot of the head block.
uint64 head_block_slot = 2;
@@ -276,7 +277,7 @@ message ChainHead {
- // Server-side stream of information about the head of the beacon chain
- // from the view of the beacon chain node.
- //
+ // Server-side stream of information about the head of the beacon chain
+ // from the view of the beacon chain node.
+ //
// This includes the head block slot and root as well as information about
// the most recent finalized and justified slots.
rpc StreamChainHead(google.protobuf.Empty) returns (stream ChainHead) {
@@ -278,7 +279,7 @@ message ChainHead {
uint64 head_epoch = 2;
// 32 byte merkle tree root of the canonical head block in the beacon node.
- bytes head_block_root = 3;
+ bytes head_block_root = 3 [(gogoproto.moretags) = "ssz-size:\"32\""];
// Most recent slot that contains the finalized block.
uint64 finalized_slot = 4;
@@ -287,7 +288,7 @@ message ChainHead {
uint64 finalized_epoch = 5;
// Most recent 32 byte finalized block root.
@@ -283,8 +296,8 @@ index 0f490c1..592b169 100644
+ bytes finalized_block_root = 6 [(gogoproto.moretags) = "ssz-size:\"32\""];
// Most recent slot that contains the justified block.
uint64 justified_block_slot = 7;
@@ -285,7 +286,7 @@ message ChainHead {
uint64 justified_slot = 7;
@@ -296,7 +297,7 @@ message ChainHead {
uint64 justified_epoch = 8;
// Most recent 32 byte justified block root.
@@ -293,7 +306,7 @@ index 0f490c1..592b169 100644
// Most recent slot that contains the previous justified block.
uint64 previous_justified_slot = 10;
@@ -294,7 +295,7 @@ message ChainHead {
@@ -305,7 +306,7 @@ message ChainHead {
uint64 previous_justified_epoch = 11;
// Previous 32 byte justified block root.
@@ -302,7 +315,7 @@ index 0f490c1..592b169 100644
}
message ListCommitteesRequest {
@@ -352,7 +353,7 @@ message ListValidatorBalancesRequest {
@@ -363,7 +364,7 @@ message ListValidatorBalancesRequest {
// Validator 48 byte BLS public keys to filter validators for the given
// epoch.
@@ -311,7 +324,7 @@ index 0f490c1..592b169 100644
// Validator indices to filter validators for the given epoch.
repeated uint64 indices = 4;
@@ -373,7 +374,7 @@ message ValidatorBalances {
@@ -384,7 +385,7 @@ message ValidatorBalances {
message Balance {
// Validator's 48 byte BLS public key.
@@ -320,7 +333,7 @@ index 0f490c1..592b169 100644
// Validator's index in the validator set.
uint64 index = 2;
@@ -449,17 +450,17 @@ message ActiveSetChanges {
@@ -460,17 +461,17 @@ message ActiveSetChanges {
uint64 epoch = 1;
// 48 byte validator public keys that have been activated in this epoch.
@@ -342,7 +355,7 @@ index 0f490c1..592b169 100644
}
message ValidatorQueue {
@@ -469,11 +470,11 @@ message ValidatorQueue {
@@ -480,11 +481,11 @@ message ValidatorQueue {
// Ordered list of 48 byte public keys awaiting activation. 0th index is the
// next key to be processed.
@@ -356,7 +369,7 @@ index 0f490c1..592b169 100644
}
message ListValidatorAssignmentsRequest {
@@ -485,7 +486,7 @@ message ListValidatorAssignmentsRequest {
@@ -496,7 +497,7 @@ message ListValidatorAssignmentsRequest {
bool genesis = 2;
}
// 48 byte validator public keys to filter assignments for the given epoch.
@@ -365,7 +378,7 @@ index 0f490c1..592b169 100644
// Validator indicies to filter assignments for the given epoch.
repeated uint64 indices = 4;
@@ -520,7 +521,7 @@ message ValidatorAssignments {
@@ -531,7 +532,7 @@ message ValidatorAssignments {
uint64 proposer_slot = 4;
// 48 byte BLS public key.