Use Ethereum Foundation naming convention (snake_case + MACRO_CASE)

This commit is contained in:
mratsim 2018-08-17 18:21:10 +02:00
parent f8b2e790e3
commit f203859316
2 changed files with 21 additions and 7 deletions

View File

@ -10,6 +10,20 @@ Please see [Full Casper chain v2.1](https://notes.ethereum.org/SCIg8AH5SA-O4C1G1
You can check where the beacon chain fits in the Ethereum research ecosystem in the [Status Athenaeum](https://github.com/status-im/athenaeum/blob/b465626cc551e361492e56d32517b2cdadd7493f/ethereum_research_records.json#L38).
## Convention
Ethereum Foundation uses:
- snake_case for fields and procedure names
- MACRO_CASE for constants
- PascalCase for types
Nim NEP-1 recommends:
- camelCase for fields and procedure names
- PascalCase for constants
- PsacalCase for types
To facilitate collaboration and comparison, Nim-beacon-chain uses the Ethereum Foundation convention.
## Installation
You can install the developement version of the library through nimble with the following command

View File

@ -45,7 +45,7 @@ type
dynasty_seed*: Keccak256_Digest # Used to select the committees for each shard
dynasty_seed_last_reset*: int64 # Last epoch the crosslink seed was reset
ShardAndCommittee = object
ShardAndCommittee* = object
shard_id*: int16 # The shard ID
committee*: seq[Uint24] # Validator indices
@ -91,9 +91,9 @@ type
const
ShardCount* = 1024 # a constant referring to the number of shards
DepositSize* = 32 # You need to deposit 32 ETH to be a validator in Casper
MaxValidatorCount* = 2^22 # 4_194_304, this means that ~132M ETH can stake at the same time (= MaxValidator Count * DepositSize)
SlotDuration* = 8 # seconds
CycleLength* = 64 # slots
MinCommitteeSize* = 128 # (rationale: see recommended minimum 111 here https://vitalik.ca/files/Ithaca201807_Sharding.pdf)
SHARD_COUNT* = 1024 # a constant referring to the number of shards
DEPOSITE_SIZE* = 32 # You need to deposit 32 ETH to be a validator in Casper
MAX_VALIDATOR_COUNT* = 2^22 # 4_194_304, this means that ~132M ETH can stake at the same time (= MaxValidator Count * DepositSize)
SLOT_DURATION* = 8 # seconds
CYCLE_LENGTH* = 64 # slots
MIN_COMMITTEE_SIZE* = 128 # (rationale: see recommended minimum 111 here https://vitalik.ca/files/Ithaca201807_Sharding.pdf)