Do not propose a block when compute state root fails (#1972)

This commit is contained in:
Preston Van Loon 2019-03-12 12:49:09 -04:00 committed by GitHub
parent c320877dea
commit a7a22856f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -110,7 +110,8 @@ func (v *validator) ProposeBlock(ctx context.Context, slot uint64) {
if err != nil {
log.WithField(
"block", proto.MarshalTextString(block),
).Errorf("Unable to compute state root: %v", err)
).Errorf("Not proposing! Unable to compute state root: %v", err)
return
}
block.StateRootHash32 = resp.GetStateRoot()

View File

@ -354,11 +354,6 @@ func TestProposeBlock_ComputeStateFailure(t *testing.T) {
gomock.AssignableToTypeOf(&pb.PendingAttestationsRequest{}),
).Return(&pb.PendingAttestationsResponse{PendingAttestations: []*pbp2p.Attestation{}}, nil)
m.proposerClient.EXPECT().ProposeBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&pbp2p.BeaconBlock{}),
).Return(&pb.ProposeResponse{}, nil /*error*/)
m.proposerClient.EXPECT().ComputeStateRoot(
gomock.Any(), // context
gomock.AssignableToTypeOf(&pbp2p.BeaconBlock{}),