Skip to content

Commit

Permalink
feat(sentry): Fetch proposer duties
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Apr 2, 2024
1 parent 17603d3 commit 7555492
Show file tree
Hide file tree
Showing 26 changed files with 677 additions and 507 deletions.
68 changes: 66 additions & 2 deletions deploy/local/docker-compose/vector-kafka-clickhouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,9 @@ transforms:
canonical_beacon_block_voluntary_exit: .event.name == "BEACON_API_ETH_V2_BEACON_BLOCK_VOLUNTARY_EXIT"
canonical_beacon_block_withdrawal: .event.name == "BEACON_API_ETH_V2_BEACON_BLOCK_WITHDRAWAL"
canonical_beacon_block: .event.name == "BEACON_API_ETH_V2_BEACON_BLOCK_V2" && .meta.client.additional_data.finalized_when_requested == true
canonical_beacon_proposer_duty: .event.name == "BEACON_API_ETH_V1_PROPOSER_DUTY"
canonical_beacon_proposer_duty: .event.name == "BEACON_API_ETH_V1_PROPOSER_DUTY" && .meta.client.additional_data.state_id == "finalized"
eth_v1_beacon_committee: .event.name == "BEACON_API_ETH_V1_BEACON_COMMITTEE"
eth_v1_proposer_duty: .event.name == "BEACON_API_ETH_V1_PROPOSER_DUTY" && .meta.client.additional_data.state_id == "head"
eth_v1_events_attestation_v2: .event.name == "BEACON_API_ETH_V1_EVENTS_ATTESTATION_V2"
eth_v1_events_attestation: .event.name == "BEACON_API_ETH_V1_EVENTS_ATTESTATION"
eth_v1_events_blob_sidecar: .event.name == "BEACON_API_ETH_V1_EVENTS_BLOB_SIDECAR"
Expand Down Expand Up @@ -353,6 +354,7 @@ transforms:
- xatu_server_events_router.canonical_beacon_block_withdrawal
- xatu_server_events_router.canonical_beacon_proposer_duty
- xatu_server_events_router.eth_v1_beacon_committee
- xatu_server_events_router.eth_v1_proposer_duty
- xatu_server_events_router.eth_v1_events_attestation
- xatu_server_events_router.eth_v1_events_attestation_v2
- xatu_server_events_router.eth_v1_events_blob_sidecar
Expand Down Expand Up @@ -1687,7 +1689,49 @@ transforms:
del(.event)
del(.meta)
del(.data)
eth_v1_proposer_duty_formatted:
type: remap
inputs:
- xatu_server_events_router.eth_v1_proposer_duty
source: |-
event_date_time, err = parse_timestamp(.event.date_time, format: "%+");
if err == null {
.event_date_time = to_unix_timestamp(event_date_time, unit: "milliseconds")
} else {
.error = err
.error_description = "failed to parse event date time"
log(., level: "error", rate_limit_secs: 60)
}
.slot = .meta.client.additional_data.slot.number
slot_start_date_time, err = parse_timestamp(.meta.client.additional_data.slot.start_date_time, format: "%+");
if err == null {
.slot_start_date_time = to_unix_timestamp(slot_start_date_time)
} else {
.error = err
.error_description = "failed to parse slot start date time"
log(., level: "error", rate_limit_secs: 60)
}
.epoch = .meta.client.additional_data.epoch.number
epoch_start_date_time, err = parse_timestamp(.meta.client.additional_data.epoch.start_date_time, format: "%+");
if err == null {
.epoch_start_date_time = to_unix_timestamp(epoch_start_date_time)
} else {
.error = err
.error_description = "failed to parse epoch start date time"
log(., level: "error", rate_limit_secs: 60)
}
.proposer_validator_index = .data.validator_index
.proposer_pubkey = .data.pubkey
key, err = .slot + .proposer_validator_index + .proposer_pubkey + .meta.client.name
if err != null {
.error = err
.error_description = "failed to generate unique key"
}
.unique_key = seahash(key)
.updated_date_time = to_unix_timestamp(now())
del(.event)
del(.meta)
del(.data)
sinks:
metrics:
Expand Down Expand Up @@ -2177,6 +2221,26 @@ sinks:
healthcheck:
enabled: true
skip_unknown_fields: false
eth_v1_proposer_duty_clickhouse:
type: clickhouse
inputs:
- eth_v1_proposer_duty_formatted
database: default
endpoint: "${CLICKHOUSE_ENDPOINT}"
table: beacon_api_eth_v1_proposer_duty
auth:
strategy: basic
user: "${CLICKHOUSE_USER}"
password: "${CLICKHOUSE_PASSWORD}"
batch:
max_bytes: 52428800
max_events: 200000
timeout_secs: 1
buffer:
max_events: 200000
healthcheck:
enabled: true
skip_unknown_fields: false
canonical_beacon_block_elaborated_attestation_clickhouse:
type: clickhouse
inputs:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ services:
xatu-server:
profiles:
- ""
image: ethpandaops/xatu:latest
command: server --config /etc/xatu-server/config.yaml
build:
context: .
Expand Down
5 changes: 4 additions & 1 deletion pkg/cannon/deriver/beacon/eth/v1/proposer_duty.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/ethpandaops/xatu/pkg/cannon/ethereum"
"github.com/ethpandaops/xatu/pkg/cannon/iterator"
"github.com/ethpandaops/xatu/pkg/observability"
v1 "github.com/ethpandaops/xatu/pkg/proto/eth/v1"
xatuethv1 "github.com/ethpandaops/xatu/pkg/proto/eth/v1"
"github.com/ethpandaops/xatu/pkg/proto/xatu"
"github.com/google/uuid"
Expand Down Expand Up @@ -295,7 +296,9 @@ func (b *ProposerDutyDeriver) createEventFromProposerDuty(ctx context.Context, d
}

func (b *ProposerDutyDeriver) getAdditionalData(_ context.Context, duty *apiv1.ProposerDuty) (*xatu.ClientMeta_AdditionalEthV1ProposerDutyData, error) {
extra := &xatu.ClientMeta_AdditionalEthV1ProposerDutyData{}
extra := &xatu.ClientMeta_AdditionalEthV1ProposerDutyData{
StateId: v1.StateIDFinalized,

Check failure on line 300 in pkg/cannon/deriver/beacon/eth/v1/proposer_duty.go

View workflow job for this annotation

GitHub Actions / full_ci (1.22.x)

undefined: v1.StateIDFinalized
}

slot := b.beacon.Metadata().Wallclock().Slots().FromNumber(uint64(duty.Slot))
epoch := b.beacon.Metadata().Wallclock().Epochs().FromSlot(uint64(duty.Slot))
Expand Down
4 changes: 2 additions & 2 deletions pkg/proto/blockprint/block_classification.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/attestation.pb.go

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

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/blob.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/checkpoint.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/committee.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/duties.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/events.pb.go

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

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v2/events.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/eth/v2/withdrawals.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/libp2p/peer.pb.go

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

4 changes: 2 additions & 2 deletions pkg/proto/xatu/coordinator.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_grpc.pb.go

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

Loading

0 comments on commit 7555492

Please sign in to comment.