Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging #2853

Merged
merged 3 commits into from
Apr 12, 2024
Merged

Staging #2853

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/1kv-backend-staging/templates/kusama-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,14 @@ spec:
"Contabo GmbH"
],
"host": "wss://telemetry-backend.w3f.community/feed"
},
"logger": {
"level": "info",
"excludedLabels": [
"Telemetry",
"Location",
"Block",
"Gateway",
]
}
}
9 changes: 9 additions & 0 deletions apps/1kv-backend-staging/templates/polkadot-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,14 @@ spec:
"Contabo GmbH"
],
"host": "wss://telemetry-backend.w3f.community/feed"
},
"logger": {
"level": "info",
"excludedLabels": [
"Telemetry",
"Location",
"Block",
"Gateway",
]
}
}
11 changes: 10 additions & 1 deletion apps/1kv-backend/templates/kusama-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
source:
repoURL: https://w3f.github.io/helm-charts/
chart: otv-backend
targetRevision: v3.1.12
targetRevision: v3.1.13
plugin:
env:
- name: HELM_VALUES
Expand Down Expand Up @@ -121,5 +121,14 @@ spec:
],
"host": "wss://telemetry-backend.w3f.community/feed",
"ipinfoToken": "token=<path:vaults/k8s-community-secrets/items/otv-kusama#ipinfo-token>"
},
"logger": {
"level": "info",
"excludedLabels": [
"Telemetry",
"Location",
"Block",
"Gateway",
]
}
}
11 changes: 10 additions & 1 deletion apps/1kv-backend/templates/polkadot-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
source:
repoURL: https://w3f.github.io/helm-charts/
chart: otv-backend
targetRevision: v3.1.12
targetRevision: v3.1.13
plugin:
env:
- name: HELM_VALUES
Expand Down Expand Up @@ -120,5 +120,14 @@ spec:
],
"host": "wss://telemetry-backend.w3f.community/feed",
"ipinfoToken": "token=<path:vaults/k8s-community-secrets/items/otv-polkadot#ipinfo-token>"
},
"logger": {
"level": "info",
"excludedLabels": [
"Telemetry",
"Location",
"Block",
"Gateway",
]
}
}
4 changes: 2 additions & 2 deletions charts/otv-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: 1K Validators Backend
name: otv-backend
version: v3.1.12
appVersion: v3.1.12
version: v3.1.13
appVersion: v3.1.13
apiVersion: v2
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/common",
"version": "3.1.12",
"version": "3.1.13",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/db/queries/Candidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export const reportOnline = async (
await mergeTelemetryNodeToCandidate(candidate);

// Try and update or make a new Location record
await fetchAndSetCandidateLocation(telemetryNodeDetails);
await fetchAndSetCandidateLocation(candidate, telemetryNodeDetails);

// Update the candidate online validity
await setCandidateOnlineValid(candidate);
Expand Down
15 changes: 4 additions & 11 deletions packages/common/src/db/queries/CandidateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ export const filterCandidateInvalidityFields = (
candidate: Candidate,
filter: InvalidityReasonType,
): InvalidityReason[] => {
if (!candidate || !candidate?.invalidity)
throw new Error(
`NO CANDIDATE DATA FOUND FOR CANDIDATE with slotId ${candidate.slotId}`,
);

const invalidityReasons = candidate?.invalidity?.filter(
(invalidityReason) => {
return invalidityReason.type !== filter;
},
return (
candidate?.invalidity?.filter(
(invalidityReason) => invalidityReason.type !== filter,
) || []
);

return invalidityReasons;
};

export const setCandidateInvalidity = async (
Expand Down
9 changes: 4 additions & 5 deletions packages/common/src/utils/Location.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
Candidate,
getCandidateByName,
getCandidateLocation,
getIIT,
getLocation,
removeIIT,
setIIT,
setLocation,
Expand Down Expand Up @@ -101,13 +102,11 @@ export const nodeDetailsFromTelemetryMessage = (
};

export const fetchAndSetCandidateLocation = async (
candidate: Candidate,
telemetryNodeDetails: TelemetryNodeDetails,
) => {
// See if there's an existing location for the given telemetry data
const existingLocation = await getLocation(
telemetryNodeDetails.name,
telemetryNodeDetails.ipAddress,
);
const existingLocation = await getCandidateLocation(candidate.slotId);

// Fetch and set a new location if:
// - There's no existing location
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/core",
"version": "3.1.12",
"version": "3.1.13",
"description": "Services for running the Thousand Validator Program.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gateway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/gateway",
"version": "3.1.12",
"version": "3.1.13",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/scorekeeper-status-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@1kv/scorekeeper-status-ui",
"private": true,
"version": "3.1.12",
"version": "3.1.13",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/telemetry",
"version": "3.1.12",
"version": "3.1.13",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/worker",
"version": "3.1.12",
"version": "3.1.13",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down