Skip to content

Commit

Permalink
feat: Add validator position to raw unaggregated attestations
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Jul 14, 2023
1 parent ab333a0 commit 168d3b6
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/attestation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/beacon_block.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/checkpoint.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/execution_engine.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/fork_choice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v1/sync_committee.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v2/beacon_block.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v2/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/eth/v2/withdrawals.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/xatu/coordinator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 20 additions & 12 deletions pkg/proto/xatu/coordinator_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions pkg/proto/xatu/event_ingester.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/proto/xatu/event_ingester.proto
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ message ClientMeta {
// Propagation contains information about the propagation of the
// attestation.
Propagation propagation = 5;

// ValidatorPosition is the position of the validator in the committee.
// Note: only available for unaggregated attestations.
uint64 validator_position = 6 [ json_name = "validator_position" ];
}

message AdditionalEthV1EventsHeadData {
Expand Down
12 changes: 8 additions & 4 deletions pkg/proto/xatu/event_ingester_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/sentry/event/beacon/eth/v1/events_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,11 @@ func (e *EventsAttestation) getAdditionalData(_ context.Context) (*xatu.ClientMe
},
}

// If the attestation is unaggreated, we can append the validator position within the committee
if e.event.AggregationBits.Count() == 1 {
e.log.WithField("position", e.event.AggregationBits.BitIndices()[0]).Info("Got unaagregated attestation")
extra.ValidatorPosition = uint64(e.event.AggregationBits.BitIndices()[0])
}

return extra, nil
}

0 comments on commit 168d3b6

Please sign in to comment.