Skip to content

Commit 656e7e7

Browse files
authored
Merge pull request #90 from ethpandaops/fix/new-cols
fix: new geo fields
2 parents 06dacff + 68b85dd commit 656e7e7

148 files changed

Lines changed: 10925 additions & 3256 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/aws/aws-sdk-go-v2/config v1.31.8
1414
github.com/aws/aws-sdk-go-v2/credentials v1.18.12
1515
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1
16-
github.com/ethpandaops/xatu-cbt v0.0.0-20250918110622-149d20b49ff8
16+
github.com/ethpandaops/xatu-cbt v0.0.0-20250925031027-7c0e1f54ae78
1717
github.com/mitchellh/mapstructure v1.5.0
1818
github.com/prometheus/client_golang v1.23.2
1919
github.com/rs/cors v1.11.1

backend/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ github.com/ethpandaops/ethwallclock v0.4.0 h1:+sgnhf4pk6hLPukP076VxkiLloE4L0Yk1y
9292
github.com/ethpandaops/ethwallclock v0.4.0/go.mod h1:y0Cu+mhGLlem19vnAV2x0hpFS5KZ7oOi2SWYayv9l24=
9393
github.com/ethpandaops/xatu-cbt v0.0.0-20250918110622-149d20b49ff8 h1:q6Rt5cSHjru2HEa3H2QtDpdwl3W9jZX6lSqeBz9b+Iw=
9494
github.com/ethpandaops/xatu-cbt v0.0.0-20250918110622-149d20b49ff8/go.mod h1:iJpkfBEpE98rnSIb+6dBlrBXfy35VqhCxhwRFzefUsU=
95+
github.com/ethpandaops/xatu-cbt v0.0.0-20250925031027-7c0e1f54ae78 h1:DDuIYXEiyEBra/h+qNdpmAUWz45mH1mw6RVSzwfC2wQ=
96+
github.com/ethpandaops/xatu-cbt v0.0.0-20250925031027-7c0e1f54ae78/go.mod h1:iJpkfBEpE98rnSIb+6dBlrBXfy35VqhCxhwRFzefUsU=
9597
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
9698
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
9799
github.com/ferranbt/fastssz v1.0.0 h1:9EXXYsracSqQRBQiHeaVsG/KQeYblPf40hsQPb9Dzk8=

backend/pkg/server/internal/service/xatu_cbt/fct_block_first_seen_by_node.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/ethpandaops/lab/backend/pkg/internal/lab/clickhouse"
99
cbtproto "github.com/ethpandaops/xatu-cbt/pkg/proto/clickhouse"
1010
"github.com/prometheus/client_golang/prometheus"
11+
"google.golang.org/protobuf/types/known/wrapperspb"
1112
)
1213

1314
const (
@@ -119,6 +120,10 @@ func scanFctBlockFirstSeenByNode(
119120
node cbtproto.FctBlockFirstSeenByNode
120121
updatedDateTime, slotStartDateTime time.Time
121122
epochStartDateTime time.Time
123+
geoLongitude *float64
124+
geoLatitude *float64
125+
geoAsNumber *uint32
126+
geoAsOrg *string
122127
)
123128

124129
if err := scanner.Scan(
@@ -140,6 +145,10 @@ func scanFctBlockFirstSeenByNode(
140145
&node.MetaClientGeoCountry,
141146
&node.MetaClientGeoCountryCode,
142147
&node.MetaClientGeoContinentCode,
148+
&geoLongitude,
149+
&geoLatitude,
150+
&geoAsNumber,
151+
&geoAsOrg,
143152
&node.MetaConsensusVersion,
144153
&node.MetaConsensusImplementation,
145154
); err != nil {
@@ -150,5 +159,22 @@ func scanFctBlockFirstSeenByNode(
150159
node.SlotStartDateTime = uint32(slotStartDateTime.Unix()) //nolint:gosec // safe.
151160
node.EpochStartDateTime = uint32(epochStartDateTime.Unix()) //nolint:gosec // safe.
152161

162+
// Convert nullable fields to protobuf wrappers
163+
if geoLongitude != nil {
164+
node.MetaClientGeoLongitude = wrapperspb.Double(*geoLongitude)
165+
}
166+
167+
if geoLatitude != nil {
168+
node.MetaClientGeoLatitude = wrapperspb.Double(*geoLatitude)
169+
}
170+
171+
if geoAsNumber != nil {
172+
node.MetaClientGeoAutonomousSystemNumber = wrapperspb.UInt32(*geoAsNumber)
173+
}
174+
175+
if geoAsOrg != nil {
176+
node.MetaClientGeoAutonomousSystemOrganization = wrapperspb.String(*geoAsOrg)
177+
}
178+
153179
return &node, nil
154180
}

backend/pkg/server/internal/service/xatu_cbt/fct_node_active_last_24h.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/ethpandaops/lab/backend/pkg/internal/lab/clickhouse"
99
cbtproto "github.com/ethpandaops/xatu-cbt/pkg/proto/clickhouse"
1010
"github.com/prometheus/client_golang/prometheus"
11+
"google.golang.org/protobuf/types/known/wrapperspb"
1112
)
1213

1314
const (
@@ -118,6 +119,10 @@ func scanFctNodeActiveLast24h(
118119
var (
119120
node cbtproto.FctNodeActiveLast24H
120121
updatedDateTime, lastSeenDateTime time.Time
122+
geoLongitude *float64
123+
geoLatitude *float64
124+
geoAsNumber *uint32
125+
geoAsOrg *string
121126
)
122127

123128
if err := scanner.Scan(
@@ -133,6 +138,10 @@ func scanFctNodeActiveLast24h(
133138
&node.MetaClientGeoCountry,
134139
&node.MetaClientGeoCountryCode,
135140
&node.MetaClientGeoContinentCode,
141+
&geoLongitude,
142+
&geoLatitude,
143+
&geoAsNumber,
144+
&geoAsOrg,
136145
&node.MetaConsensusVersion,
137146
&node.MetaConsensusImplementation,
138147
); err != nil {
@@ -142,5 +151,22 @@ func scanFctNodeActiveLast24h(
142151
node.UpdatedDateTime = uint32(updatedDateTime.Unix()) //nolint:gosec // safe.
143152
node.LastSeenDateTime = uint32(lastSeenDateTime.Unix()) //nolint:gosec // safe.
144153

154+
// Convert nullable fields to protobuf wrappers
155+
if geoLongitude != nil {
156+
node.MetaClientGeoLongitude = wrapperspb.Double(*geoLongitude)
157+
}
158+
159+
if geoLatitude != nil {
160+
node.MetaClientGeoLatitude = wrapperspb.Double(*geoLatitude)
161+
}
162+
163+
if geoAsNumber != nil {
164+
node.MetaClientGeoAutonomousSystemNumber = wrapperspb.UInt32(*geoAsNumber)
165+
}
166+
167+
if geoAsOrg != nil {
168+
node.MetaClientGeoAutonomousSystemOrganization = wrapperspb.String(*geoAsOrg)
169+
}
170+
145171
return &node, nil
146172
}

frontend/src/api/gen/vendor/xatu-cbt/clickhouse/admin_cbt_pb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class ListAdminCbtRequest extends Message<ListAdminCbtRequest> {
120120
/**
121121
* The maximum number of admin_cbt to return.
122122
* If unspecified, at most 100 items will be returned.
123-
* The maximum value is 1000; values above 1000 will be coerced to 1000.
123+
* The maximum value is 10000; values above 10000 will be coerced to 10000.
124124
*
125125
* @generated from field: int32 page_size = 6;
126126
*/

frontend/src/api/gen/vendor/xatu-cbt/clickhouse/dim_node_pb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class ListDimNodeRequest extends Message<ListDimNodeRequest> {
152152
/**
153153
* The maximum number of dim_node to return.
154154
* If unspecified, at most 100 items will be returned.
155-
* The maximum value is 1000; values above 1000 will be coerced to 1000.
155+
* The maximum value is 10000; values above 10000 will be coerced to 10000.
156156
*
157157
* @generated from field: int32 page_size = 8;
158158
*/

frontend/src/api/gen/vendor/xatu-cbt/clickhouse/fct_attestation_correctness_by_validator_canonical_pb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class ListFctAttestationCorrectnessByValidatorCanonicalRequest extends Me
197197
/**
198198
* The maximum number of fct_attestation_correctness_by_validator_canonical to return.
199199
* If unspecified, at most 100 items will be returned.
200-
* The maximum value is 1000; values above 1000 will be coerced to 1000.
200+
* The maximum value is 10000; values above 10000 will be coerced to 10000.
201201
*
202202
* @generated from field: int32 page_size = 11;
203203
*/

frontend/src/api/gen/vendor/xatu-cbt/clickhouse/fct_attestation_correctness_by_validator_head_pb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class ListFctAttestationCorrectnessByValidatorHeadRequest extends Message
182182
/**
183183
* The maximum number of fct_attestation_correctness_by_validator_head to return.
184184
* If unspecified, at most 100 items will be returned.
185-
* The maximum value is 1000; values above 1000 will be coerced to 1000.
185+
* The maximum value is 10000; values above 10000 will be coerced to 10000.
186186
*
187187
* @generated from field: int32 page_size = 10;
188188
*/

frontend/src/api/gen/vendor/xatu-cbt/clickhouse/fct_attestation_correctness_canonical_pb.ts

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,18 @@ export class FctAttestationCorrectnessCanonical extends Message<FctAttestationCo
6161
votesMax = 0;
6262

6363
/**
64-
* The number of actual votes for the block
64+
* The number of votes for the block proposed in the current slot
6565
*
66-
* @generated from field: google.protobuf.UInt32Value votes_actual = 18;
66+
* @generated from field: google.protobuf.UInt32Value votes_head = 18;
6767
*/
68-
votesActual?: number;
68+
votesHead?: number;
69+
70+
/**
71+
* The number of votes for any blocks proposed in previous slots
72+
*
73+
* @generated from field: google.protobuf.UInt32Value votes_other = 19;
74+
*/
75+
votesOther?: number;
6976

7077
constructor(data?: PartialMessage<FctAttestationCorrectnessCanonical>) {
7178
super();
@@ -82,7 +89,8 @@ export class FctAttestationCorrectnessCanonical extends Message<FctAttestationCo
8289
{ no: 15, name: "epoch_start_date_time", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
8390
{ no: 16, name: "block_root", kind: "message", T: StringValue },
8491
{ no: 17, name: "votes_max", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
85-
{ no: 18, name: "votes_actual", kind: "message", T: UInt32Value },
92+
{ no: 18, name: "votes_head", kind: "message", T: UInt32Value },
93+
{ no: 19, name: "votes_other", kind: "message", T: UInt32Value },
8694
]);
8795

8896
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FctAttestationCorrectnessCanonical {
@@ -158,26 +166,33 @@ export class ListFctAttestationCorrectnessCanonicalRequest extends Message<ListF
158166
votesMax?: UInt32Filter;
159167

160168
/**
161-
* Filter by votes_actual (optional)
169+
* Filter by votes_head (optional)
170+
*
171+
* @generated from field: cbt.NullableUInt32Filter votes_head = 8;
172+
*/
173+
votesHead?: NullableUInt32Filter;
174+
175+
/**
176+
* Filter by votes_other (optional)
162177
*
163-
* @generated from field: cbt.NullableUInt32Filter votes_actual = 8;
178+
* @generated from field: cbt.NullableUInt32Filter votes_other = 9;
164179
*/
165-
votesActual?: NullableUInt32Filter;
180+
votesOther?: NullableUInt32Filter;
166181

167182
/**
168183
* The maximum number of fct_attestation_correctness_canonical to return.
169184
* If unspecified, at most 100 items will be returned.
170-
* The maximum value is 1000; values above 1000 will be coerced to 1000.
185+
* The maximum value is 10000; values above 10000 will be coerced to 10000.
171186
*
172-
* @generated from field: int32 page_size = 9;
187+
* @generated from field: int32 page_size = 10;
173188
*/
174189
pageSize = 0;
175190

176191
/**
177192
* A page token, received from a previous `ListFctAttestationCorrectnessCanonical` call.
178193
* Provide this to retrieve the subsequent page.
179194
*
180-
* @generated from field: string page_token = 10;
195+
* @generated from field: string page_token = 11;
181196
*/
182197
pageToken = "";
183198

@@ -186,7 +201,7 @@ export class ListFctAttestationCorrectnessCanonicalRequest extends Message<ListF
186201
* Example: "foo,bar" or "foo desc,bar" for descending order on foo.
187202
* If unspecified, results will be returned in the default order.
188203
*
189-
* @generated from field: string order_by = 11;
204+
* @generated from field: string order_by = 12;
190205
*/
191206
orderBy = "";
192207

@@ -205,10 +220,11 @@ export class ListFctAttestationCorrectnessCanonicalRequest extends Message<ListF
205220
{ no: 5, name: "epoch_start_date_time", kind: "message", T: UInt32Filter },
206221
{ no: 6, name: "block_root", kind: "message", T: NullableStringFilter },
207222
{ no: 7, name: "votes_max", kind: "message", T: UInt32Filter },
208-
{ no: 8, name: "votes_actual", kind: "message", T: NullableUInt32Filter },
209-
{ no: 9, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
210-
{ no: 10, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
211-
{ no: 11, name: "order_by", kind: "scalar", T: 9 /* ScalarType.STRING */ },
223+
{ no: 8, name: "votes_head", kind: "message", T: NullableUInt32Filter },
224+
{ no: 9, name: "votes_other", kind: "message", T: NullableUInt32Filter },
225+
{ no: 10, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
226+
{ no: 11, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
227+
{ no: 12, name: "order_by", kind: "scalar", T: 9 /* ScalarType.STRING */ },
212228
]);
213229

214230
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListFctAttestationCorrectnessCanonicalRequest {

frontend/src/api/gen/vendor/xatu-cbt/clickhouse/fct_attestation_correctness_head_pb.ts

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,18 @@ export class FctAttestationCorrectnessHead extends Message<FctAttestationCorrect
6161
votesMax = 0;
6262

6363
/**
64-
* The number of actual votes for the block
64+
* The number of votes for the block proposed in the current slot
6565
*
66-
* @generated from field: google.protobuf.UInt32Value votes_actual = 18;
66+
* @generated from field: google.protobuf.UInt32Value votes_head = 18;
6767
*/
68-
votesActual?: number;
68+
votesHead?: number;
69+
70+
/**
71+
* The number of votes for any blocks proposed in previous slots
72+
*
73+
* @generated from field: google.protobuf.UInt32Value votes_other = 19;
74+
*/
75+
votesOther?: number;
6976

7077
constructor(data?: PartialMessage<FctAttestationCorrectnessHead>) {
7178
super();
@@ -82,7 +89,8 @@ export class FctAttestationCorrectnessHead extends Message<FctAttestationCorrect
8289
{ no: 15, name: "epoch_start_date_time", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
8390
{ no: 16, name: "block_root", kind: "message", T: StringValue },
8491
{ no: 17, name: "votes_max", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
85-
{ no: 18, name: "votes_actual", kind: "message", T: UInt32Value },
92+
{ no: 18, name: "votes_head", kind: "message", T: UInt32Value },
93+
{ no: 19, name: "votes_other", kind: "message", T: UInt32Value },
8694
]);
8795

8896
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FctAttestationCorrectnessHead {
@@ -158,26 +166,33 @@ export class ListFctAttestationCorrectnessHeadRequest extends Message<ListFctAtt
158166
votesMax?: UInt32Filter;
159167

160168
/**
161-
* Filter by votes_actual (optional)
169+
* Filter by votes_head (optional)
170+
*
171+
* @generated from field: cbt.NullableUInt32Filter votes_head = 8;
172+
*/
173+
votesHead?: NullableUInt32Filter;
174+
175+
/**
176+
* Filter by votes_other (optional)
162177
*
163-
* @generated from field: cbt.NullableUInt32Filter votes_actual = 8;
178+
* @generated from field: cbt.NullableUInt32Filter votes_other = 9;
164179
*/
165-
votesActual?: NullableUInt32Filter;
180+
votesOther?: NullableUInt32Filter;
166181

167182
/**
168183
* The maximum number of fct_attestation_correctness_head to return.
169184
* If unspecified, at most 100 items will be returned.
170-
* The maximum value is 1000; values above 1000 will be coerced to 1000.
185+
* The maximum value is 10000; values above 10000 will be coerced to 10000.
171186
*
172-
* @generated from field: int32 page_size = 9;
187+
* @generated from field: int32 page_size = 10;
173188
*/
174189
pageSize = 0;
175190

176191
/**
177192
* A page token, received from a previous `ListFctAttestationCorrectnessHead` call.
178193
* Provide this to retrieve the subsequent page.
179194
*
180-
* @generated from field: string page_token = 10;
195+
* @generated from field: string page_token = 11;
181196
*/
182197
pageToken = "";
183198

@@ -186,7 +201,7 @@ export class ListFctAttestationCorrectnessHeadRequest extends Message<ListFctAtt
186201
* Example: "foo,bar" or "foo desc,bar" for descending order on foo.
187202
* If unspecified, results will be returned in the default order.
188203
*
189-
* @generated from field: string order_by = 11;
204+
* @generated from field: string order_by = 12;
190205
*/
191206
orderBy = "";
192207

@@ -205,10 +220,11 @@ export class ListFctAttestationCorrectnessHeadRequest extends Message<ListFctAtt
205220
{ no: 5, name: "epoch_start_date_time", kind: "message", T: UInt32Filter },
206221
{ no: 6, name: "block_root", kind: "message", T: NullableStringFilter },
207222
{ no: 7, name: "votes_max", kind: "message", T: UInt32Filter },
208-
{ no: 8, name: "votes_actual", kind: "message", T: NullableUInt32Filter },
209-
{ no: 9, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
210-
{ no: 10, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
211-
{ no: 11, name: "order_by", kind: "scalar", T: 9 /* ScalarType.STRING */ },
223+
{ no: 8, name: "votes_head", kind: "message", T: NullableUInt32Filter },
224+
{ no: 9, name: "votes_other", kind: "message", T: NullableUInt32Filter },
225+
{ no: 10, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
226+
{ no: 11, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
227+
{ no: 12, name: "order_by", kind: "scalar", T: 9 /* ScalarType.STRING */ },
212228
]);
213229

214230
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListFctAttestationCorrectnessHeadRequest {

0 commit comments

Comments
 (0)