Skip to content

Commit

Permalink
fix maxNominations
Browse files Browse the repository at this point in the history
  • Loading branch information
ironoa committed Sep 19, 2024
1 parent 43ed00e commit 9d1467f
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 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.3.4
targetRevision: v3.3.5
plugin:
env:
- name: HELM_VALUES
Expand Down
2 changes: 1 addition & 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.3.4
targetRevision: v3.3.5
plugin:
env:
- name: HELM_VALUES
Expand Down
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.3.4
appVersion: v3.3.4
version: v3.3.5
appVersion: v3.3.5
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.3.4",
"version": "3.3.5",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
8 changes: 6 additions & 2 deletions packages/common/src/scorekeeper/NumNominations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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),
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.3.4",
"version": "3.3.5",
"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.3.4",
"version": "3.3.5",
"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.3.4",
"version": "3.3.5",
"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.3.4",
"version": "3.3.5",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down

0 comments on commit 9d1467f

Please sign in to comment.