Skip to content

Commit

Permalink
Merge pull request #2702 from w3f/will-v3.1.3
Browse files Browse the repository at this point in the history
update client check / monitor constants
  • Loading branch information
wpank committed Mar 5, 2024
2 parents 352f574 + aa7a7b3 commit c11f491
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export const TIME_DELAY_BLOCKS = 10850;
// The number of blocks after a time delay proxy call was announced that we want to cancel the tx. Should be 36 hours
export const CANCEL_THRESHOLD = 21700;

// Monitor Cron job for checking if clients have upgraded. This runs ever 15 minutes by default
export const MONITOR_CRON = "0 */15 * * * *";
// Monitor Cron job for checking if clients have upgraded. This runs ever 3 minutes by default
export const MONITOR_CRON = "0 */3 * * * *";

// Clear Offline Time Cron Job. This runs once every sunday by default
// export const CLEAR_OFFLINE_CRON = "0 0 0 * * 0";
Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/constraints/ScoreCandidates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ export const scoreCandidate = async (
const nominatorStakeScore =
scaledNominatorStake * constraints.WEIGHT_CONFIG.NOMINATIONS_WEIGHT;

const isAlternativeClient = candidate?.implementation != "Parity Polkadot";
const isAlternativeClient = candidate?.implementation
? candidate?.implementation != "Parity Polkadot"
: false;
const clientScore = isAlternativeClient
? constraints.WEIGHT_CONFIG.CLIENT_WEIGHT
: 0;
Expand Down
3 changes: 1 addition & 2 deletions packages/common/src/constraints/ValidityChecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const checkLatestClientVersion = async (
): Promise<boolean> => {
try {
const skipClientUpgrade = config.constraints?.skipClientUpgrade || false;
if (skipClientUpgrade!) {
if (!skipClientUpgrade) {
if (candidate?.implementation == "Kagome Node") {
await setLatestClientReleaseValidity(candidate.stash, true);
return true;
Expand Down Expand Up @@ -126,7 +126,6 @@ export const checkLatestClientVersion = async (
await setLatestClientReleaseValidity(candidate.stash, true);
return true;
}
return true;
} catch (e) {
logger.error(
`Error checking latest client version: ${e}`,
Expand Down

0 comments on commit c11f491

Please sign in to comment.