Skip to content

Commit 295c3e2

Browse files
authored
rm state_sim; capella genesis for block_sim (#5331)
* rm state_sim; capella genesis for block_sim * copyright year
1 parent 52640e9 commit 295c3e2

File tree

7 files changed

+73
-472
lines changed

7 files changed

+73
-472
lines changed

Makefile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ XML_TEST_BINARIES := \
289289

290290
# test suite
291291
TEST_BINARIES := \
292-
state_sim \
293292
block_sim \
294293
test_libnimbus_lc
295294
.PHONY: $(TEST_BINARIES) $(XML_TEST_BINARIES) force_build_alone_all_tests
@@ -346,8 +345,8 @@ fork_choice: | build deps
346345
# CI false negatives in a process lasting hours and requiring a restart, and
347346
# therefore even more wasted time, when it does.
348347
#
349-
# If one asks for, e.g., `make all_tests state_sim`, it intentionally allows
350-
# those in paralle, because the CI system does do that.
348+
# If one asks for, e.g., `make all_tests block_sim`, it intentionally allows
349+
# those in parallel, because the CI system doesn't do that.
351350
#
352351
# https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html
353352
# describes a special target .WAIT which would enable this more easily but
@@ -367,15 +366,7 @@ all_tests: | build deps nimbus_signing_node force_build_alone_all_tests
367366
$(NIM_PARAMS) $(TEST_MODULES_FLAGS) && \
368367
echo -e $(BUILD_END_MSG) "build/$@"
369368

370-
# State and block sims; getting to 4th epoch triggers consensus checks
371-
state_sim: | build deps
372-
+ echo -e $(BUILD_MSG) "build/$@" && \
373-
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
374-
$@ \
375-
"research/$@.nim" \
376-
$(NIM_PARAMS) && \
377-
echo -e $(BUILD_END_MSG) "build/$@"
378-
369+
# Block sim; getting to 4th epoch triggers consensus checks
379370
block_sim: | build deps
380371
+ echo -e $(BUILD_MSG) "build/$@" && \
381372
MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
@@ -404,8 +395,7 @@ endif
404395
for TEST_BINARY in $(TEST_BINARIES); do \
405396
PARAMS=""; \
406397
REDIRECT=""; \
407-
if [[ "$${TEST_BINARY}" == "state_sim" ]]; then PARAMS="--validators=8000 --slots=160"; \
408-
elif [[ "$${TEST_BINARY}" == "block_sim" ]]; then PARAMS="--validators=8000 --slots=160"; \
398+
if [[ "$${TEST_BINARY}" == "block_sim" ]]; then PARAMS="--validators=10000 --slots=192"; \
409399
elif [[ "$${TEST_BINARY}" == "test_libnimbus_lc" ]]; then REDIRECT="$${TEST_BINARY}.log"; \
410400
fi; \
411401
echo -e "\nRunning $${TEST_BINARY} $${PARAMS}\n"; \
@@ -804,7 +794,7 @@ ntu: | build deps
804794
+ $(ENV_SCRIPT) $(NIMC) -d:danger -o:vendor/.nimble/bin/ntu c vendor/nim-testutils/ntu.nim
805795

806796
clean: | clean-common
807-
rm -rf build/{$(TOOLS_CSV),all_tests,test_*,proto_array,fork_choice,*.a,*.so,*_node,*ssz*,nimbus_*,beacon_node*,block_sim,state_sim,transition*,generate_makefile,nimbus-wix/obj}
797+
rm -rf build/{$(TOOLS_CSV),all_tests,test_*,proto_array,fork_choice,*.a,*.so,*_node,*ssz*,nimbus_*,beacon_node*,block_sim,transition*,generate_makefile,nimbus-wix/obj}
808798
ifneq ($(USE_LIBBACKTRACE), 0)
809799
+ "$(MAKE)" -C vendor/nim-libbacktrace clean $(HANDLE_OUTPUT)
810800
endif

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ We provide several tools to interact with ETH2 and the data in the beacon chain:
7979

8080
## For researchers
8181

82-
### State transition simulation
82+
### Block simulation
8383

84-
The state transition simulator can quickly run the Beacon chain state transition function in isolation and output JSON snapshots of the state. The simulation runs without networking and blocks are processed without slot time delays.
84+
The block simulator can quickly run the Beacon chain state transition function in isolation. The simulation runs without networking and without slot time delays.
8585

8686
```bash
87-
# build and run the state simulator, then display its help ("-d:release" speeds it
87+
# build and run the block simulator, then display its help ("-d:release" speeds it
8888
# up substantially, allowing the simulation of longer runs in reasonable time)
89-
make NIMFLAGS="-d:release" state_sim
90-
build/state_sim --help
89+
make NIMFLAGS="-d:release" block_sim
90+
build/block_sim --help
9191
```
9292

9393
### Local network simulation

docs/the_nimbus_book/src/developers.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ nim --version # Nimbus is tested and supported on 1.2.12 at the moment
104104

105105
- build a specific tool:
106106
```bash
107-
make state_sim
107+
make block_sim
108108
```
109109

110110
- you can control the Makefile's verbosity with the V variable (defaults to 0):
@@ -232,8 +232,8 @@ It runs without networking and blocks are processed without slot time delays.
232232
```bash
233233
# build the state simulator, then display its help ("-d:release" speeds it
234234
# up substantially, allowing the simulation of longer runs in reasonable time)
235-
make NIMFLAGS="-d:release" state_sim
236-
build/state_sim --help
235+
make NIMFLAGS="-d:release" block_sim
236+
build/block_sim --help
237237
```
238238

239239
Use the output of the `help` command to pass desired values to the simulator.
@@ -244,11 +244,10 @@ The most important options are:
244244
- `slots`: the number of slots to run the simulation for (default 192)
245245
- `validators`: the number of validators (default 6400)
246246
- `attesterRatio`: the expected fraction of attesters that actually do their work for every slot (default 0.73)
247-
- `json_interval`: how often JSON snapshots of the state are outputted (default every 32 slots -- or once per epoch)
248247

249-
For example, to run the state simulator for 384 slots, with 20,000 validators, and an average of 66% of attesters doing their work every slot, while outputting snapshots of the state twice per epoch, run:
248+
For example, to run the block simulator for 384 slots, with 20,000 validators, and an average of 66% of attesters doing their work every slot, run:
250249

251250
```
252-
build/state_sim --slots=384 --validators=20000 --attesterRatio=0.66 --json_interval=16
251+
build/block_sim --slots=384 --validators=20000 --attesterRatio=0.66
253252
```
254253

0 commit comments

Comments
 (0)