From 50b98e396f17068e25b820c58f94d26941b29e95 Mon Sep 17 00:00:00 2001 From: will pankiewicz Date: Fri, 12 Apr 2024 15:52:53 +0200 Subject: [PATCH 1/2] lint --- docs/docs/backend/config.md | 12 ------------ packages/common/src/config.ts | 6 ------ packages/common/src/db/models.ts | 1 - .../common/src/db/queries/ValidatorScoreMetadata.ts | 12 ------------ packages/core/config/kusama.current.dev.sample.json | 3 --- packages/core/config/kusama.current.sample.json | 3 --- .../core/config/kusama.microservice.dev.sample.json | 3 --- .../core/config/polkadot.current.dev.sample.json | 3 --- packages/core/config/polkadot.current.sample.json | 3 --- .../config/polkadot.microservice.dev.sample.json | 3 --- .../core/config/polkadot.microservice.sample.json | 3 --- packages/worker/config/kusama.sample.json | 6 ------ packages/worker/config/polkadot.sample.json | 6 ------ 13 files changed, 64 deletions(-) diff --git a/docs/docs/backend/config.md b/docs/docs/backend/config.md index bb85480b5..1f80f70f0 100644 --- a/docs/docs/backend/config.md +++ b/docs/docs/backend/config.md @@ -197,9 +197,6 @@ An example config may look something like: "country": "10", "provider": "100", "nominations": "100", - "delegations": "60", - "openGov": "100", - "openGovDelegation": "100", "rpc": "100", "client": "100", "useInclusion": true, @@ -215,9 +212,6 @@ An example config may look something like: "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, @@ -614,9 +608,6 @@ An example Worker config run as microservices may look something like: "country": "10", "provider": "100", "nominations": "100", - "delegations": "60", - "openGov": "100", - "openGovDelegation": "100", "rpc": "100", "client": "100", "useInclusion": true, @@ -632,9 +623,6 @@ An example Worker config run as microservices may look something like: "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/common/src/config.ts b/packages/common/src/config.ts index eb8aea873..5d41dff36 100644 --- a/packages/common/src/config.ts +++ b/packages/common/src/config.ts @@ -115,9 +115,6 @@ export type ConfigSchema = { country: number | 0; provider: number | 0; nominations: number | 0; - delegations: number | 0; - openGov: number | 0; - openGovDelegation: number | 0; rpc: number | 0; client: number | 0; useInclusion: boolean; @@ -134,9 +131,6 @@ export type ConfigSchema = { useCountry: boolean; useProvider: boolean; useNominations: boolean; - useDelegations: boolean; - useOpenGov: boolean; - useOpenGovDelegation: boolean; useRpc: boolean; useClient: boolean; }; diff --git a/packages/common/src/db/models.ts b/packages/common/src/db/models.ts index 799e6483e..01f2b07e6 100644 --- a/packages/common/src/db/models.ts +++ b/packages/common/src/db/models.ts @@ -593,7 +593,6 @@ export interface ValidatorScoreMetadata { openGovDelegationWeight?: number; openGovDelegationStats?: Stats; faultsWeight?: number; - openGovWeight?: number; rpcWeight?: number; clientWeight?: number; updated?: number; diff --git a/packages/common/src/db/queries/ValidatorScoreMetadata.ts b/packages/common/src/db/queries/ValidatorScoreMetadata.ts index 5c00df5b8..de3a98693 100644 --- a/packages/common/src/db/queries/ValidatorScoreMetadata.ts +++ b/packages/common/src/db/queries/ValidatorScoreMetadata.ts @@ -34,10 +34,6 @@ export const setValidatorScoreMetadata = async ( providerWeight, nominatorStakeStats, nominatorStakeWeight, - openGovStats, - openGovWeight, - openGovDelegationStats, - openGovDelegationWeight, } = scoreMetadata; const data = await ValidatorScoreMetadataModel.findOne({ @@ -77,10 +73,6 @@ export const setValidatorScoreMetadata = async ( providerWeight, nominatorStakeStats, nominatorStakeWeight, - openGovStats, - openGovWeight, - openGovDelegationStats, - openGovDelegationWeight, updated, }); await validatorScoreMetadata.save(); @@ -122,10 +114,6 @@ export const setValidatorScoreMetadata = async ( providerWeight, nominatorStakeStats, nominatorStakeWeight, - openGovStats, - openGovWeight, - openGovDelegationStats, - openGovDelegationWeight, updated, }, ).exec(); diff --git a/packages/core/config/kusama.current.dev.sample.json b/packages/core/config/kusama.current.dev.sample.json index 50606cb0a..96214a416 100644 --- a/packages/core/config/kusama.current.dev.sample.json +++ b/packages/core/config/kusama.current.dev.sample.json @@ -106,9 +106,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/core/config/kusama.current.sample.json b/packages/core/config/kusama.current.sample.json index a1efba2a8..a276a53b1 100644 --- a/packages/core/config/kusama.current.sample.json +++ b/packages/core/config/kusama.current.sample.json @@ -88,9 +88,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/core/config/kusama.microservice.dev.sample.json b/packages/core/config/kusama.microservice.dev.sample.json index 70615363e..8aecec8bb 100644 --- a/packages/core/config/kusama.microservice.dev.sample.json +++ b/packages/core/config/kusama.microservice.dev.sample.json @@ -89,9 +89,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/core/config/polkadot.current.dev.sample.json b/packages/core/config/polkadot.current.dev.sample.json index 3b1954b80..d613947a9 100644 --- a/packages/core/config/polkadot.current.dev.sample.json +++ b/packages/core/config/polkadot.current.dev.sample.json @@ -87,9 +87,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/core/config/polkadot.current.sample.json b/packages/core/config/polkadot.current.sample.json index 4819472f0..2d12638fd 100644 --- a/packages/core/config/polkadot.current.sample.json +++ b/packages/core/config/polkadot.current.sample.json @@ -85,9 +85,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/core/config/polkadot.microservice.dev.sample.json b/packages/core/config/polkadot.microservice.dev.sample.json index e40880060..453a2249f 100644 --- a/packages/core/config/polkadot.microservice.dev.sample.json +++ b/packages/core/config/polkadot.microservice.dev.sample.json @@ -66,9 +66,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/core/config/polkadot.microservice.sample.json b/packages/core/config/polkadot.microservice.sample.json index 465ac5d3f..3554bf247 100644 --- a/packages/core/config/polkadot.microservice.sample.json +++ b/packages/core/config/polkadot.microservice.sample.json @@ -66,9 +66,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/worker/config/kusama.sample.json b/packages/worker/config/kusama.sample.json index f48623a57..ae942c61b 100644 --- a/packages/worker/config/kusama.sample.json +++ b/packages/worker/config/kusama.sample.json @@ -29,9 +29,6 @@ "country": "10", "provider": "100", "nominations": "100", - "delegations": "60", - "openGov": "100", - "openGovDelegation": "100", "rpc": "100", "client": "100", "useInclusion": true, @@ -47,9 +44,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, diff --git a/packages/worker/config/polkadot.sample.json b/packages/worker/config/polkadot.sample.json index 862534925..8ab392bc5 100644 --- a/packages/worker/config/polkadot.sample.json +++ b/packages/worker/config/polkadot.sample.json @@ -27,9 +27,6 @@ "country": "10", "provider": "100", "nominations": "100", - "delegations": "60", - "openGov": "100", - "openGovDelegation": "100", "rpc": "100", "client": "100", "useInclusion": true, @@ -45,9 +42,6 @@ "useCountry": true, "useProvider": true, "useNominations": true, - "useDelegations": true, - "useOpenGov": true, - "useOpenGovDelegation": true, "useRpc": true, "useClient": true }, From e8e6a058427514cd9921d8162bd17938610b84d9 Mon Sep 17 00:00:00 2001 From: will pankiewicz Date: Fri, 12 Apr 2024 15:27:16 +0200 Subject: [PATCH 2/2] remove old unused config options --- docs/docs/backend/config.md | 7 +- .../config/kusama/otv-backend-ci.yaml.gotmpl | 5 +- .../kusama/otv-backend-local.yaml.gotmpl | 5 +- .../polkadot/otv-backend-ci.yaml.gotmpl | 5 +- .../polkadot/otv-backend-local.yaml.gotmpl | 5 +- packages/common/src/db/models.ts | 74 ------------------- .../config/kusama.current.dev.sample.json | 2 - packages/core/config/main.sample.json | 5 +- 8 files changed, 6 insertions(+), 102 deletions(-) diff --git a/docs/docs/backend/config.md b/docs/docs/backend/config.md index 1f80f70f0..4bb83b116 100644 --- a/docs/docs/backend/config.md +++ b/docs/docs/backend/config.md @@ -488,12 +488,7 @@ An example `core` config run as microservices may look something like: "region": "10", "country": "10", "provider": "100", - "council": "50", - "democracy": "100", - "nominations": "100", - "delegations": "60", - "openGov": "100", - "openGovDelegation": "100" + "nominations": "100" }, "scorekeeper": { "forceRound": false, diff --git a/helmfile.d/config/kusama/otv-backend-ci.yaml.gotmpl b/helmfile.d/config/kusama/otv-backend-ci.yaml.gotmpl index 854cb5326..ac36db046 100644 --- a/helmfile.d/config/kusama/otv-backend-ci.yaml.gotmpl +++ b/helmfile.d/config/kusama/otv-backend-ci.yaml.gotmpl @@ -71,10 +71,7 @@ config: | "region": "10", "country": "10", "provider": "50", - "council": "50", - "democracy": "100", - "nominations": "100", - "delegations": "60" + "nominations": "100" }, "scorekeeper": { "forceRound": false, diff --git a/helmfile.d/config/kusama/otv-backend-local.yaml.gotmpl b/helmfile.d/config/kusama/otv-backend-local.yaml.gotmpl index cc9e6fa1e..7b0bb7287 100644 --- a/helmfile.d/config/kusama/otv-backend-local.yaml.gotmpl +++ b/helmfile.d/config/kusama/otv-backend-local.yaml.gotmpl @@ -62,10 +62,7 @@ config: | "region": "10", "country": "10", "provider": "50", - "council": "50", - "democracy": "100", - "nominations": "100", - "delegations": "60" + "nominations": "100" }, "scorekeeper": { "candidates": [ diff --git a/helmfile.d/config/polkadot/otv-backend-ci.yaml.gotmpl b/helmfile.d/config/polkadot/otv-backend-ci.yaml.gotmpl index 27bb1ff75..0f272ee37 100644 --- a/helmfile.d/config/polkadot/otv-backend-ci.yaml.gotmpl +++ b/helmfile.d/config/polkadot/otv-backend-ci.yaml.gotmpl @@ -69,10 +69,7 @@ config: | "region": "10", "country": "10", "provider": "50", - "council": "50", - "democracy": "100", - "nominations": "100", - "delegations": "60" + "nominations": "100" }, "scorekeeper": { "forceRound": true, diff --git a/helmfile.d/config/polkadot/otv-backend-local.yaml.gotmpl b/helmfile.d/config/polkadot/otv-backend-local.yaml.gotmpl index f16e1f0c2..d8a98deaa 100644 --- a/helmfile.d/config/polkadot/otv-backend-local.yaml.gotmpl +++ b/helmfile.d/config/polkadot/otv-backend-local.yaml.gotmpl @@ -61,10 +61,7 @@ config: | "region": "10", "country": "10", "provider": "50", - "council": "50", - "democracy": "100", - "nominations": "100", - "delegations": "60" + "nominations": "100" }, "scorekeeper": { "candidates": [ diff --git a/packages/common/src/db/models.ts b/packages/common/src/db/models.ts index 01f2b07e6..1c9a91293 100644 --- a/packages/common/src/db/models.ts +++ b/packages/common/src/db/models.ts @@ -581,17 +581,8 @@ export interface ValidatorScoreMetadata { countryWeight: number; providerStats: LStats; providerWeight: number; - councilStakeWeight?: number; - councilStakeStats?: Stats; - democracyStats?: Stats; - democracyWeight?: number; nominatorStakeStats?: Stats; nominatorStakeWeight: number; - delegationStats?: Stats; - delegationWeight?: number; - openGovStats?: Stats; - openGovDelegationWeight?: number; - openGovDelegationStats?: Stats; faultsWeight?: number; rpcWeight?: number; clientWeight?: number; @@ -853,32 +844,6 @@ export const ValidatorScoreMetadataSchema = new Schema({ standardDeviation: Number, }, providerWeight: Number, - councilStakeWeight: Number, - councilStakeStats: { - values: [Number], - absoluteMin: Number, - absoluteMax: Number, - q10: Number, - q25: Number, - q50: Number, - q75: Number, - q90: Number, - mean: Number, - standardDeviation: Number, - }, - democracyStats: { - values: [Number], - absoluteMin: Number, - absoluteMax: Number, - q10: Number, - q25: Number, - q50: Number, - q75: Number, - q90: Number, - mean: Number, - standardDeviation: Number, - }, - democracyWeight: Number, nominatorStakeStats: { values: [Number], absoluteMin: Number, @@ -892,45 +857,6 @@ export const ValidatorScoreMetadataSchema = new Schema({ standardDeviation: Number, }, nominatorStakeWeight: Number, - delegationStats: { - values: [Number], - absoluteMin: Number, - absoluteMax: Number, - q10: Number, - q25: Number, - q50: Number, - q75: Number, - q90: Number, - mean: Number, - standardDeviation: Number, - }, - delegationWeight: Number, - openGovStats: { - values: [Number], - absoluteMin: Number, - absoluteMax: Number, - q10: Number, - q25: Number, - q50: Number, - q75: Number, - q90: Number, - mean: Number, - standardDeviation: Number, - }, - openGovDelegationWeight: Number, - openGovDelegationStats: { - values: [Number], - absoluteMin: Number, - absoluteMax: Number, - q10: Number, - q25: Number, - q50: Number, - q75: Number, - q90: Number, - mean: Number, - standardDeviation: Number, - }, - openGovWeight: Number, // The last time one was updated updated: Number, }); diff --git a/packages/core/config/kusama.current.dev.sample.json b/packages/core/config/kusama.current.dev.sample.json index 96214a416..5acfd0a8c 100644 --- a/packages/core/config/kusama.current.dev.sample.json +++ b/packages/core/config/kusama.current.dev.sample.json @@ -40,8 +40,6 @@ "unclaimedEras": "0 0-59/1 * * * *", "validatorPref": "0 0-59/1 * * * *", "nominator": "0 0-59/1 * * * *", - "delegation": "0 0-59/1 * * * *", - "democracy": "0 0-59/1 * * * *", "monitorEnabled": true, "clearOfflineEnabled": true, "validityEnabled": true, diff --git a/packages/core/config/main.sample.json b/packages/core/config/main.sample.json index 7658082e5..d274bbc6d 100644 --- a/packages/core/config/main.sample.json +++ b/packages/core/config/main.sample.json @@ -77,10 +77,7 @@ "region": "10", "country": "10", "provider": "50", - "council": "50", - "democracy": "100", - "nominations": "100", - "delegations": "60" + "nominations": "100" }, "scorekeeper": { "candidates": [