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

Create configurable constants for DEX sidechain configuration #177

Closed
Tracked by #58
Naureen1lightcurve opened this issue Jan 17, 2023 · 0 comments · Fixed by #211
Closed
Tracked by #58

Create configurable constants for DEX sidechain configuration #177

Naureen1lightcurve opened this issue Jan 17, 2023 · 0 comments · Fixed by #211

Comments

@Naureen1lightcurve
Copy link
Contributor

Naureen1lightcurve commented Jan 17, 2023

Description

Define following constants at the constants.ts

  • GENESIS_BLOCK_VERSION with a value of 0 and type uint32
  • GENESIS_BLOCK_TIMESTAMP with a value of “TBD” and type uint32
  • NUM_INIT_ROUNDS with a value of 2574 and type uint32.
  • NUM_BOOTSTRAP_VALIDATORS with a value of 101 and type uint32.
  • MODULE_NAME_DEX with a value of “dex” and type string.
  • MODULE_NAME_POS with a value of “pos” and type string.
  • MODULE_NAME_TOKEN with a value of “token" and type string.
  • ADDRESS_LENGTH with a value of 20 and type uint32.
  • TOKEN_ID_DEX with a value of TBD and type bytes.
  • ALL_SUPPORTED_TOKENS_KEY with a value of EMPTY_BYTES and bytes.
  • ADDRESS_VALIDATOR_INCENTIVES with a value of SHA256(b"validatorIncentivesAccount")[:20] and type bytes.
  • LENGTH_EPOCH_REWARDS_INCENTIVES with a value of 3153600 and type uint32.
  • ED25519_PUBLIC_KEY_LENGTH with a value of 32 and type uint32.
  • BLS_PUBLIC_KEY_LENGTH with a value of 48 and type uint32.
  • BLS_POP_LENGTH with a value of 96 and type uint32.

Engine Specific Configurable Constants for DEX sidechain

  • Chain_ID (as defined here)
  • MAX_TRANSACTIONS_SIZE_BYTES with a value of “configurable per chain” and type integer
  • MAX_ASSET_DATA_SIZE_BYTES with a value of “18” and type integer
  • BLOCK_TIME with a value of “10” and type uint32.
  • LSK_BFT_BATCH_SIZE with a value of 103 and type uint32.
  • MAX_PARAMS_SIZE with a value of 14336 and type uint32.

Module Specific Configurable Constants for DEX sidechain

  • LOCKING_PERIOD_STAKES with a value of 260,000.
  • PUNISHMENT_WINDOW_STAKES with a value of 780,000
  • TOKEN_ID_POS with a value of TOKEN_ID_DEX
  • TOKEN_ID_DYNAMIC_BLOCK_REWARD with a value of TOKEN_ID_DEX.
  • ADDRESS_LIQUIDITY_PROVIDER_INCENTIVES with a value of SHA256(b"liquidityProviderIncentivesAccount")[:NUM_BYTES_ADDRESS] and type bytes
  • ADDRESS_VALIDATOR_INCENTIVES with a value of SHA256(b"validatorIncentivesAccount")[:NUM_BYTES_ADDRESS] and a value of bytes
  • BOOTSTRAP_PERIOD_OFFSET with a value of 259975 and type uint32.

Acceptance Criteria

  • Constants are defined in constant.ts file and are easily accessible for the rest of the codebase.
  • Constants are clearly named and well-documented to indicate their purpose and usage.
  • The code compiles without errors and the sidechain functions as expected when the constants are used.
  • All the constants are unit tested.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants