03a147ab8d
In BlockPool, we keep the head state around, so it's trivial to restore the temporary state there and keep going as if nothing happened. This solves 3 problems: * stack space - the state copy on mainnet is huge * GC scanning - using stack space for state slows down the GC significantly * reckless copying - the copy itself takes a long time In state_sim, we'll do the same and allocate on heap - this helps a little with GC - without it, the collection of the temporary strings created with `toHex` while printing the json dominates the trace. |
||
---|---|---|
.. | ||
.gitignore | ||
README.md | ||
ncli_hash_tree_root.nim | ||
ncli_pretty.nim | ||
ncli_transition.nim | ||
nim.cfg |
README.md
Introduction
ncli
is a set of low level / debugging tools to interact with the nimbus beacon chain specification implementation, simliar to zcli. With it, you explore SSZ, make state transitions and compute hash tree roots.
Tools
- transition: Perform state transition given a pre-state and a block to apply (both in SSZ format)
- hash_tree_root: Print tree root of an SSZ object
- pretty: Pretty-print SSZ object as JSON
Building
Follow the instructions from nim-beacon-chain
git clone https://github.com/status-im/nim-beacon-chain.git
cd nim-beacon-chain
make
Usage
# Build with minimal config
../env.sh nim c -d:const_preset=minimal ncli_transition
# Build with mainnet config
../env.sh nim c -d:const_preset=mainnet ncli_transition
# Run..
./ncli_transition --help