From 9d1467f8d3e716c8dce0d108ef3e886c9bb982c0 Mon Sep 17 00:00:00 2001 From: Alessio Onori Date: Thu, 19 Sep 2024 16:08:21 +0200 Subject: [PATCH] fix maxNominations --- apps/1kv-backend/templates/kusama-otv-backend.yaml | 2 +- apps/1kv-backend/templates/polkadot-otv-backend.yaml | 2 +- charts/otv-backend/Chart.yaml | 4 ++-- packages/common/package.json | 2 +- packages/common/src/scorekeeper/NumNominations.ts | 8 ++++++-- packages/core/package.json | 2 +- packages/gateway/package.json | 2 +- packages/scorekeeper-status-ui/package.json | 2 +- packages/telemetry/package.json | 2 +- 9 files changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/1kv-backend/templates/kusama-otv-backend.yaml b/apps/1kv-backend/templates/kusama-otv-backend.yaml index 0224cbf8e..492b7dc2a 100644 --- a/apps/1kv-backend/templates/kusama-otv-backend.yaml +++ b/apps/1kv-backend/templates/kusama-otv-backend.yaml @@ -17,7 +17,7 @@ spec: source: repoURL: https://w3f.github.io/helm-charts/ chart: otv-backend - targetRevision: v3.3.4 + targetRevision: v3.3.5 plugin: env: - name: HELM_VALUES diff --git a/apps/1kv-backend/templates/polkadot-otv-backend.yaml b/apps/1kv-backend/templates/polkadot-otv-backend.yaml index 6c0101af4..2c5e7cb76 100644 --- a/apps/1kv-backend/templates/polkadot-otv-backend.yaml +++ b/apps/1kv-backend/templates/polkadot-otv-backend.yaml @@ -17,7 +17,7 @@ spec: source: repoURL: https://w3f.github.io/helm-charts/ chart: otv-backend - targetRevision: v3.3.4 + targetRevision: v3.3.5 plugin: env: - name: HELM_VALUES diff --git a/charts/otv-backend/Chart.yaml b/charts/otv-backend/Chart.yaml index 741933317..ea297c1f5 100644 --- a/charts/otv-backend/Chart.yaml +++ b/charts/otv-backend/Chart.yaml @@ -1,5 +1,5 @@ description: 1K Validators Backend name: otv-backend -version: v3.3.4 -appVersion: v3.3.4 +version: v3.3.5 +appVersion: v3.3.5 apiVersion: v2 diff --git a/packages/common/package.json b/packages/common/package.json index 74d26d5de..07f2df2c4 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@1kv/common", - "version": "3.3.4", + "version": "3.3.5", "description": "Services for running the Thousand Validator Program.", "main": "build/index.js", "types": "build/index.d.ts", diff --git a/packages/common/src/scorekeeper/NumNominations.ts b/packages/common/src/scorekeeper/NumNominations.ts index 54145f4eb..92cb529a7 100644 --- a/packages/common/src/scorekeeper/NumNominations.ts +++ b/packages/common/src/scorekeeper/NumNominations.ts @@ -6,7 +6,7 @@ import { ApiPromise } from "@polkadot/api"; import { scorekeeperLabel } from "./scorekeeper"; import Nominator from "../nominator/nominator"; -import { Constants } from "../index"; +import { Constants, queries } from "../index"; import logger from "../logger"; import { NominatorState, NominatorStatus } from "../types"; @@ -112,7 +112,11 @@ export const autoNumNominations = async ( // How many additional validator to nominate above the amount to get in the set const additional = 1.05; - const maxNominations = 24; + //Kusama max 24; Polkadot max 16 + const maxNominations = + (await queries.getChainMetadata())?.name.toLowerCase() == "kusama" + ? 24 + : 16; // The total amount of validators to nominate const adjustedNominationAmount = Math.min( Math.ceil(amount * additional), diff --git a/packages/core/package.json b/packages/core/package.json index 663942314..07b8868a7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@1kv/core", - "version": "3.3.4", + "version": "3.3.5", "description": "Services for running the Thousand Validator Program.", "main": "index.js", "scripts": { diff --git a/packages/gateway/package.json b/packages/gateway/package.json index 63639cebf..de28001bd 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -1,6 +1,6 @@ { "name": "@1kv/gateway", - "version": "3.3.4", + "version": "3.3.5", "description": "Services for running the Thousand Validator Program.", "main": "build/index.js", "types": "build/index.d.ts", diff --git a/packages/scorekeeper-status-ui/package.json b/packages/scorekeeper-status-ui/package.json index 166acc04f..d281d734a 100644 --- a/packages/scorekeeper-status-ui/package.json +++ b/packages/scorekeeper-status-ui/package.json @@ -1,7 +1,7 @@ { "name": "@1kv/scorekeeper-status-ui", "private": true, - "version": "3.3.4", + "version": "3.3.5", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index c74012cbe..e805e5f4d 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@1kv/telemetry", - "version": "3.3.4", + "version": "3.3.5", "description": "Services for running the Thousand Validator Program.", "main": "build/index.js", "types": "build/index.d.ts",