diff --git a/charts/otv-backend/Chart.yaml b/charts/otv-backend/Chart.yaml index 859d06e2b..149c1e48b 100644 --- a/charts/otv-backend/Chart.yaml +++ b/charts/otv-backend/Chart.yaml @@ -1,4 +1,4 @@ description: 1K Validators Backend name: otv-backend -version: v2.5.98 +version: v2.5.99 apiVersion: v2 diff --git a/helmfile.d/10-otv-backend.yaml b/helmfile.d/10-otv-backend.yaml index bdbac30cb..6ddf1d74c 100644 --- a/helmfile.d/10-otv-backend.yaml +++ b/helmfile.d/10-otv-backend.yaml @@ -11,7 +11,7 @@ releases: namespace: kusama {{ if eq .Environment.Name "production" }} chart: w3f/otv-backend - version: v2.5.98 + version: v2.5.99 {{ else }} chart: ../charts/otv-backend {{ end }} @@ -23,7 +23,7 @@ releases: namespace: polkadot {{ if eq .Environment.Name "production" }} chart: w3f/otv-backend - version: v2.5.98 + version: v2.5.99 {{ else }} chart: ../charts/otv-backend {{ end }} diff --git a/package.json b/package.json index 350348822..2352b43d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "1k-validators-be", - "version": "2.5.98", + "version": "2.5.99", "description": "Services for running the Thousand Validator Program.", "main": "index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index b50dffb63..c5d77e46d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,7 +25,7 @@ import { startClearAccumulatedOfflineTimeJob, startMonitorJob } from "./cron"; const isCI = process.env.CI; -const version = "v2.5.98"; +const version = "v2.5.99"; const catchAndQuit = async (fn: any) => { try { diff --git a/src/score.ts b/src/score.ts index 919ca7071..1f4a04c6b 100644 --- a/src/score.ts +++ b/src/score.ts @@ -205,14 +205,14 @@ export const scoreDemocracyVotes = ( ); // The consistency of all historical votes, capped at 1.5x - const totalConsistencyMultiplier = totalConsistency - ? Math.min(1 + 1 / totalConsistency.length, 1.5) - : 1; + const totalConsistencyMultiplier = + totalConsistency?.length > 0 + ? Math.min(1 + 1 / totalConsistency.length, 1.5) + : 1; // The consistency of only the last _threshold_ votes - const lastConsistencyMultiplier = lastConsistency - ? 1 + 1 / lastConsistency.length - : 1; + const lastConsistencyMultiplier = + lastConsistency?.length > 0 ? 1 + 1 / lastConsistency.length : 1; // Calculate the total score, capping it at 250 points const totalDemScore = Math.min(