Skip to content

Commit 36a495e

Browse files
authored
Merge pull request #2871 from w3f/tmp-sanctions
Tmp sanctions
2 parents d071ec5 + b0e3689 commit 36a495e

36 files changed

+553
-839
lines changed

apps/1kv-backend-staging/templates/kusama-otv-backend.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ spec:
6060
"skipUnclaimed": true,
6161
"minSelfStake": 10000000000000,
6262
"commission": 150000000,
63-
"unclaimedEraThreshold": 4
63+
"unclaimedEraThreshold": 4,
64+
"sanctionedGeoArea": {
65+
"skip": true,
66+
"sanctionedCountries": ["XXX"],
67+
"sanctionedRegions": ["XXX" ]
68+
}
6469
},
6570
"cron": {
6671
"monitor": "0 */15 * * * *",
@@ -123,5 +128,14 @@ spec:
123128
"Contabo GmbH"
124129
],
125130
"host": "wss://telemetry-backend.w3f.community/feed"
131+
},
132+
"logger": {
133+
"level": "info",
134+
"excludedLabels": [
135+
"Telemetry",
136+
"Location",
137+
"Block",
138+
"Gateway"
139+
]
126140
}
127141
}

apps/1kv-backend-staging/templates/polkadot-otv-backend.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ spec:
5959
"skipUnclaimed": true,
6060
"minSelfStake": 50000000000000,
6161
"commission": 50000000,
62-
"unclaimedEraThreshold": 1
62+
"unclaimedEraThreshold": 1,
63+
"sanctionedGeoArea": {
64+
"skip": true,
65+
"sanctionedCountries": ["XXX"],
66+
"sanctionedRegions": ["XXX" ]
67+
}
6368
},
6469
"cron": {
6570
"monitor": "0 */15 * * * *",
@@ -122,5 +127,14 @@ spec:
122127
"Contabo GmbH"
123128
],
124129
"host": "wss://telemetry-backend.w3f.community/feed"
130+
},
131+
"logger": {
132+
"level": "info",
133+
"excludedLabels": [
134+
"Telemetry",
135+
"Location",
136+
"Block",
137+
"Gateway"
138+
]
125139
}
126140
}

apps/1kv-backend/templates/kusama-otv-backend.yaml

+16-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
source:
1818
repoURL: https://w3f.github.io/helm-charts/
1919
chart: otv-backend
20-
targetRevision: v3.1.12
20+
targetRevision: v3.1.14
2121
plugin:
2222
env:
2323
- name: HELM_VALUES
@@ -58,7 +58,12 @@ spec:
5858
"skipUnclaimed": true,
5959
"minSelfStake": 10000000000000,
6060
"commission": 150000000,
61-
"unclaimedEraThreshold": 4
61+
"unclaimedEraThreshold": 4,
62+
"sanctionedGeoArea": {
63+
"skip": true,
64+
"sanctionedCountries": ["XXX"],
65+
"sanctionedRegions": ["XXX" ]
66+
}
6267
},
6368
"cron": {
6469
"monitor": "0 */15 * * * *",
@@ -121,5 +126,14 @@ spec:
121126
],
122127
"host": "wss://telemetry-backend.w3f.community/feed",
123128
"ipinfoToken": "token=<path:vaults/k8s-community-secrets/items/otv-kusama#ipinfo-token>"
129+
},
130+
"logger": {
131+
"level": "info",
132+
"excludedLabels": [
133+
"Telemetry",
134+
"Location",
135+
"Block",
136+
"Gateway"
137+
]
124138
}
125139
}

apps/1kv-backend/templates/polkadot-otv-backend.yaml

+16-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
source:
1818
repoURL: https://w3f.github.io/helm-charts/
1919
chart: otv-backend
20-
targetRevision: v3.1.12
20+
targetRevision: v3.1.14
2121
plugin:
2222
env:
2323
- name: HELM_VALUES
@@ -57,7 +57,12 @@ spec:
5757
"skipUnclaimed": true,
5858
"minSelfStake": 50000000000000,
5959
"commission": 50000000,
60-
"unclaimedEraThreshold": 1
60+
"unclaimedEraThreshold": 1,
61+
"sanctionedGeoArea": {
62+
"skip": true,
63+
"sanctionedCountries": ["XXX"],
64+
"sanctionedRegions": ["XXX" ]
65+
}
6166
},
6267
"cron": {
6368
"monitor": "0 */15 * * * *",
@@ -120,5 +125,14 @@ spec:
120125
],
121126
"host": "wss://telemetry-backend.w3f.community/feed",
122127
"ipinfoToken": "token=<path:vaults/k8s-community-secrets/items/otv-polkadot#ipinfo-token>"
128+
},
129+
"logger": {
130+
"level": "info",
131+
"excludedLabels": [
132+
"Telemetry",
133+
"Location",
134+
"Block",
135+
"Gateway"
136+
]
123137
}
124138
}

charts/otv-backend/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
description: 1K Validators Backend
22
name: otv-backend
3-
version: v3.1.12
4-
appVersion: v3.1.12
3+
version: v3.1.14
4+
appVersion: v3.1.14
55
apiVersion: v2

charts/otv-backend/values.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ config: |
4949
"constraints": {
5050
"skipConnectionTime": false,
5151
"skipIdentity": false,
52-
"skipSanctionedGeoArea": false
52+
"sanctionedGeoArea": {
53+
"skip": false,
54+
"sanctionedCountries": ["XXX"],
55+
"sanctionedRegions": ["XXX" ]
56+
}
5357
},
5458
"db": {
5559
"mongo": {
@@ -94,7 +98,7 @@ config: |
9498
"Telemetry",
9599
"Location",
96100
"Block",
97-
"Gateway",
101+
"Gateway"
98102
]
99103
}
100104
}

packages/common/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@1kv/common",
3-
"version": "3.1.12",
3+
"version": "3.1.14",
44
"description": "Services for running the Thousand Validator Program.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

packages/common/src/config.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ export type ConfigSchema = {
2727
skipClientUpgrade: boolean;
2828
skipUnclaimed: boolean;
2929
skipClaiming: boolean;
30-
skipSanctionedGeoArea: boolean;
3130
forceClientVersion: string;
3231
minSelfStake: number;
3332
commission: number;
3433
unclaimedEraThreshold: number;
35-
sanctionedCountries: string[];
36-
sanctionedRegions: string[];
34+
sanctionedGeoArea?: {
35+
skip: boolean;
36+
sanctionedCountries: string[];
37+
sanctionedRegions: string[];
38+
};
3739
};
3840
cron: {
3941
monitor: string;

packages/common/src/constraints/CheckCandidates.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const checkCandidate = async (
131131
}
132132

133133
const sanctionedGeoAreaValid =
134-
constraints.config?.constraints?.skipSanctionedGeoArea == true
134+
constraints.config?.constraints?.sanctionedGeoArea?.skip == true
135135
? true
136136
: (await checkSanctionedGeoArea(constraints.config, candidate)) ||
137137
false;
@@ -152,10 +152,10 @@ export const checkCandidate = async (
152152
beefyValid &&
153153
sanctionedGeoAreaValid;
154154

155-
await setValid(candidate.stash, valid);
155+
await setValid(candidate, valid);
156156

157157
if (valid) {
158-
await setLastValid(candidate.stash);
158+
await setLastValid(candidate);
159159
}
160160
return valid;
161161
} catch (e) {

packages/common/src/constraints/ScoreCandidates.ts

-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ export const scoreCandidate = async (
9696

9797
const latestCandidateLocation = await queries.getCandidateLocation(
9898
candidate.slotId,
99-
candidate.name,
100-
candidate.stash,
10199
);
102100

103101
const provider = latestCandidateLocation?.provider || "No Provider";

0 commit comments

Comments
 (0)