Skip to content

Commit

Permalink
Merge pull request #1720 from w3f/will-dem-clean
Browse files Browse the repository at this point in the history
Democracy scoring fix
  • Loading branch information
wpank authored Mar 25, 2022
2 parents a49ace3 + 0b4da82 commit 1efbe37
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/otv-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: 1K Validators Backend
name: otv-backend
version: v2.5.97
version: v2.5.98
apiVersion: v2
4 changes: 2 additions & 2 deletions helmfile.d/10-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ releases:
namespace: kusama
{{ if eq .Environment.Name "production" }}
chart: w3f/otv-backend
version: v2.5.97
version: v2.5.98
{{ else }}
chart: ../charts/otv-backend
{{ end }}
Expand All @@ -23,7 +23,7 @@ releases:
namespace: polkadot
{{ if eq .Environment.Name "production" }}
chart: w3f/otv-backend
version: v2.5.97
version: v2.5.98
{{ else }}
chart: ../charts/otv-backend
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "1k-validators-be",
"version": "2.5.97",
"version": "2.5.98",
"description": "Services for running the Thousand Validator Program.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { startClearAccumulatedOfflineTimeJob, startMonitorJob } from "./cron";

const isCI = process.env.CI;

const version = "v2.5.97";
const version = "v2.5.98";

const catchAndQuit = async (fn: any) => {
try {
Expand Down
11 changes: 6 additions & 5 deletions src/score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,14 @@ export const scoreDemocracyVotes = (
);

// The consistency of all historical votes, capped at 1.5x
const totalConsistencyMultiplier = Math.min(
1 + 1 / totalConsistency.length,
1.5
);
const totalConsistencyMultiplier = totalConsistency
? Math.min(1 + 1 / totalConsistency.length, 1.5)
: 1;

// The consistency of only the last _threshold_ votes
const lastConsistencyMultiplier = 1 + 1 / lastConsistency.length;
const lastConsistencyMultiplier = lastConsistency
? 1 + 1 / lastConsistency.length
: 1;

// Calculate the total score, capping it at 250 points
const totalDemScore = Math.min(
Expand Down

0 comments on commit 1efbe37

Please sign in to comment.