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

@@ -89,8 +89,8 @@ func compareHeads(clients map[string]pb.BeaconChainClient) {
log.Fatal(err)
}
log.Infof("Comparing all heads for head slot :%d", head1.HeadBlockSlot)
if (head1.HeadBlockSlot+1)%params.BeaconConfig().SlotsPerEpoch == 0 {
log.Infof("Comparing all heads for head slot :%d", head1.HeadSlot)
if (head1.HeadSlot+1)%params.BeaconConfig().SlotsPerEpoch == 0 {
p, err := clients[endpt1].GetValidatorParticipation(context.Background(), &pb.GetValidatorParticipationRequest{})
if err != nil {
log.Fatal(err)
@@ -108,10 +108,10 @@ func compareHeads(clients map[string]pb.BeaconChainClient) {
logHead(endpt1, head1)
logHead(endpt2, head2)
if (head1.HeadBlockSlot+1)%params.BeaconConfig().SlotsPerEpoch == 0 {
if (head1.HeadSlot+1)%params.BeaconConfig().SlotsPerEpoch == 0 {
p, err := clients[endpt2].GetValidatorParticipation(context.Background(), &pb.GetValidatorParticipationRequest{
QueryFilter: &pb.GetValidatorParticipationRequest_Epoch{
Epoch: head2.HeadBlockSlot / params.BeaconConfig().SlotsPerEpoch,
Epoch: head2.HeadSlot / params.BeaconConfig().SlotsPerEpoch,
},
})
if err != nil {
@@ -126,7 +126,7 @@ func compareHeads(clients map[string]pb.BeaconChainClient) {
func logHead(endpt string, head *pb.ChainHead) {
log.WithFields(
logrus.Fields{
"HeadSlot": head.HeadBlockSlot,
"HeadSlot": head.HeadSlot,
"HeadRoot": hex.EncodeToString(head.HeadBlockRoot),
"JustifiedEpoch": head.JustifiedEpoch,
"JustifiedRoot": hex.EncodeToString(head.JustifiedBlockRoot),