Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Update PoS constants (#9021)
Browse files Browse the repository at this point in the history
* ♻️ Update PoS constants

* ✅ Fix test for _updateProductivity

---------

Co-authored-by: shuse2 <shuse2@users.noreply.github.com>
  • Loading branch information
ishantiw and shuse2 authored Sep 21, 2023
1 parent 1c1c9ab commit cfd46fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions framework/src/modules/pos/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const MODULE_NAME_POS = 'pos';

export const COMMAND_NAME_VALIDATOR_REGISTRATION = 'registerValidator';

export const LOCKING_PERIOD_STAKING = 26_000;
export const LOCKING_PERIOD_SELF_STAKING = 260_000;
export const PUNISHMENT_WINDOW_STAKING = 241_920;
export const PUNISHMENT_WINDOW_SELF_STAKING = 725_760;
export const LOCKING_PERIOD_STAKING = 25_920; // (3 * 24 * 3600 // BLOCK_TIME)
export const LOCKING_PERIOD_SELF_STAKING = 241_920; // (28 * 24 * 3600 // BLOCK_TIME)
export const PUNISHMENT_WINDOW_STAKING = 241_920; // (28 * 24 * 3600 // BLOCK_TIME)
export const PUNISHMENT_WINDOW_SELF_STAKING = 725_760; // (725,760 = 3 * PUNISHMENT_WINDOW_STAKING)
export const MAX_LENGTH_NAME = 20;
export const BASE_STAKE_AMOUNT = BigInt(10) * BigInt(10) ** BigInt(8);
export const MAX_NUMBER_SENT_STAKES = 10;
Expand All @@ -35,11 +35,11 @@ export const LOCAL_ID_LENGTH = 4;
export const TOKEN_ID_LENGTH = CHAIN_ID_LENGTH + LOCAL_ID_LENGTH;
export const MAX_NUMBER_BYTES_Q96 = 24;
export const COMMISSION = 10000;
export const COMMISSION_INCREASE_PERIOD = 260_000;
export const COMMISSION_INCREASE_PERIOD = 241_920; // (28 * 24 * 3600 // BLOCK_TIME)
export const MAX_COMMISSION_INCREASE_RATE = 500; // MAX_COMMISSION_INCREASE in LIP-0063
export const FACTOR_SELF_STAKES = 10; // FACTOR_SELF_STAKING in LIP-0063
const FAIL_SAFE_MISSED_BLOCKS = 50;
const FAIL_SAFE_INACTIVE_WINDOW = 260_000; // 120960 in LIP-0063
const FAIL_SAFE_INACTIVE_WINDOW = 120_960; // (14 * 24 * 3600 // BLOCK_TIME)
const MAX_BFT_WEIGHT_CAP = 500; // 1000 in LIP-0063
const USE_INVALID_BLS_KEY = false; // true in LIP-0063
const NUMBER_ACTIVE_VALIDATORS = 101;
Expand Down
3 changes: 2 additions & 1 deletion framework/test/unit/modules/pos/module.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,8 @@ describe('PoS module', () => {
.mockReturnValue(missedBlocks);

validatorData[missedValidatorIndex].consecutiveMissedBlocks = 50;
validatorData[missedValidatorIndex].lastGeneratedHeight = nextForgedHeight - 260000 + 5000;
validatorData[missedValidatorIndex].lastGeneratedHeight =
nextForgedHeight - defaultConfig.failSafeInactiveWindow + 5000;

await validatorStore.set(
createStoreGetter(stateStore),
Expand Down

0 comments on commit cfd46fd

Please sign in to comment.