Skip to content

Commit

Permalink
Merge pull request #2673 from w3f/will-nominated
Browse files Browse the repository at this point in the history
adjust last nominated
  • Loading branch information
wpank authored Mar 2, 2024
2 parents fa4185a + 18df513 commit 5762a38
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 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.0.23
targetRevision: v3.0.24
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.0.23
targetRevision: v3.0.24
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.0.23
appVersion: v3.0.23
version: v3.0.24
appVersion: v3.0.24
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.0.23",
"version": "3.0.24",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
18 changes: 18 additions & 0 deletions packages/common/src/scorekeeper/Nominating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,26 @@ export const doNominations = async (
});
let counter = 0;

const currentEra = await chaindata.getCurrentEra();
if (!currentEra) {
logger.error(
`Error getting current era. Skipping nominations`,
scorekeeperLabel,
);
return null;
}

// ensure the group is sorted by least avg stake
for (const nominator of nominatorGroups) {
const nomStash = await nominator.stash();
const nominatorLastNominated =
await chaindata.getNominatorLastNominationEra(nomStash);
if (nominatorLastNominated + 4 > currentEra) {
logger.info(
`Nominator ${nomStash} has already nominated this era: ${nominatorLastNominated}`,
);
continue;
}
const nominatorStatus: NominatorStatus = {
status: `Nominating...`,
updated: Date.now(),
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.0.23",
"version": "3.0.24`",
"description": "Services for running the Thousand Validator Program.",
"main": "index.js",
"scripts": {
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.0.23",
"version": "3.0.24",
"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.0.23",
"version": "3.0.24",
"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/worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/worker",
"version": "3.0.23",
"version": "3.0.24g",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down

0 comments on commit 5762a38

Please sign in to comment.