Skip to content

Commit

Permalink
Filter attestation with ProcessAttestationNoSignatureVerify (#4513)
Browse files Browse the repository at this point in the history
* Use no sig verify and comment

* Fixed all tests

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and rauljordan committed Jan 12, 2020
1 parent a79dab7 commit 22e01aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion beacon-chain/rpc/validator/proposer.go
Expand Up @@ -358,7 +358,11 @@ func (vs *Server) filterAttestationsForBlockInclusion(ctx context.Context, slot
break
}

if _, err := blocks.ProcessAttestation(ctx, bState, att); err != nil {
// TODO(4512): Until we align bls lib to latest IETF spec with `FastAggregateVerify`,
// we assume complete honest model and skip attestation's signature verification before
// including in block. We do verify everything about the attestation and just not
// its signature.
if _, err := blocks.ProcessAttestationNoVerify(ctx, bState, att); err != nil {
inValidAtts = append(inValidAtts, att)
continue

Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/validator/proposer_test.go
Expand Up @@ -1050,7 +1050,7 @@ func TestFilterAttestation_OK(t *testing.T) {
aggBits.SetBitAt(0, true)
atts[i] = &ethpb.Attestation{Data: &ethpb.AttestationData{
CommitteeIndex: uint64(i),
Target: &ethpb.Checkpoint{},
Target: &ethpb.Checkpoint{Epoch: 1},
Source: &ethpb.Checkpoint{Root: params.BeaconConfig().ZeroHash[:]}},
AggregationBits: aggBits,
}
Expand All @@ -1075,7 +1075,7 @@ func TestFilterAttestation_OK(t *testing.T) {
}
atts[i].Signature = bls.AggregateSignatures(sigs).Marshal()[:]
}

atts[0].Data.Target.Epoch = 0
received, err = proposerServer.filterAttestationsForBlockInclusion(context.Background(), 1, atts)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 22e01aa

Please sign in to comment.