Allow faster slots (#112)

* Allow compile time configurable slot time
This commit is contained in:
Mamy Ratsimbazafy 2019-02-14 13:15:10 +01:00 committed by Jacek Sieka
parent 0ceafc92c5
commit c2a52d7fc5
2 changed files with 5 additions and 4 deletions

View File

@ -107,7 +107,7 @@ const
# Time parameters # Time parameters
# https://github.com/ethereum/eth2.0-specs/blob/v0.2.0/specs/core/0_beacon-chain.md#time-parameters # https://github.com/ethereum/eth2.0-specs/blob/v0.2.0/specs/core/0_beacon-chain.md#time-parameters
SLOT_DURATION* = 6'u64 ## \ SLOT_DURATION*{.intdefine.} = 6'u64 # Compile with -d:SLOT_DURATION=1 for 6x faster slots
## TODO consistent time unit across projects, similar to C++ chrono? ## TODO consistent time unit across projects, similar to C++ chrono?
MIN_ATTESTATION_INCLUSION_DELAY* = 2'u64^2 ##\ MIN_ATTESTATION_INCLUSION_DELAY* = 2'u64^2 ##\

View File

@ -25,14 +25,15 @@ mkdir -p $BUILD_OUTPUTS_DIR
BEACON_NODE_BIN=$BUILD_OUTPUTS_DIR/beacon_node BEACON_NODE_BIN=$BUILD_OUTPUTS_DIR/beacon_node
VALIDATOR_KEYGEN_BIN=$BUILD_OUTPUTS_DIR/validator_keygen VALIDATOR_KEYGEN_BIN=$BUILD_OUTPUTS_DIR/validator_keygen
SLOT_DURATION="-d:SLOT_DURATION=3" # Default is 6
if [[ -z "$SKIP_BUILDS" ]]; then if [[ -z "$SKIP_BUILDS" ]]; then
nim c -o:"$VALIDATOR_KEYGEN_BIN" -d:release beacon_chain/validator_keygen nim c -o:"$VALIDATOR_KEYGEN_BIN" "$SLOT_DURATION" -d:release beacon_chain/validator_keygen
nim c -o:"$BEACON_NODE_BIN" beacon_chain/beacon_node nim c -o:"$BEACON_NODE_BIN" "$SLOT_DURATION" beacon_chain/beacon_node
fi fi
if [ ! -f $STARTUP_FILE ]; then if [ ! -f $STARTUP_FILE ]; then
$VALIDATOR_KEYGEN_BIN --validators=$NUMBER_OF_VALIDATORS --outputDir="$SIMULATION_DIR" --startupDelay=2 $VALIDATOR_KEYGEN_BIN --validators=$NUMBER_OF_VALIDATORS --outputDir="$SIMULATION_DIR" # --startupDelay=2
fi fi
if [ ! -f $SNAPSHOT_FILE ]; then if [ ! -f $SNAPSHOT_FILE ]; then