Skip to content

Commit

Permalink
Fix proposal bug (#4419)
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvanloon authored Jan 5, 2020
1 parent 08a203b commit 6f58efd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/rpc/validator/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (vs *Server) randomETH1DataVote(ctx context.Context) (*ethpb.Eth1Data, erro
// computeStateRoot computes the state root after a block has been processed through a state transition and
// returns it to the validator client.
func (vs *Server) computeStateRoot(ctx context.Context, block *ethpb.SignedBeaconBlock) ([]byte, error) {
beaconState, err := vs.BeaconDB.HeadState(ctx)
beaconState, err := vs.BeaconDB.State(ctx, bytesutil.ToBytes32(block.Block.ParentRoot))
if err != nil {
return nil, errors.Wrap(err, "could not retrieve beacon state")
}
Expand Down
3 changes: 0 additions & 3 deletions beacon-chain/rpc/validator/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ func TestProposeBlock_OK(t *testing.T) {
if err := db.SaveState(ctx, beaconState, genesisRoot); err != nil {
t.Fatalf("Could not save genesis state: %v", err)
}
if err := db.SaveHeadBlockRoot(ctx, genesisRoot); err != nil {
t.Fatalf("Could not save genesis state: %v", err)
}

proposerServer := &Server{
BeaconDB: db,
Expand Down

0 comments on commit 6f58efd

Please sign in to comment.