nimbus-eth1/scripts
web3-developer db8c5b90bd
Cleanup stateless and block witness code. (#2295)
* Cleanup unneeded stateless and block witness code. Keeping MultiKeys which is used in the eth_getProofsByBlockNumber RPC endpoint which is needed for the Fluffy state network bridge.

* Rename generateWitness flag to collectWitnessData to better describe what the flag does. We only collect the keys of the touched accounts and storage slots but no block witness generation is supported for now.

* Move remaining stateless code into nimbus directory.

* Add vmstate parameter to ChainRef to fix test.

* Exclude *.in from check copyright year

---------

Co-authored-by: jangko <jangko128@gmail.com>
2024-06-08 15:05:00 +07:00
..
.gitignore eth: bump (#2308) 2024-06-06 23:39:09 +00:00
README.md Script for comparing csv outputs from block import 2024-06-06 14:33:49 +02:00
block-import-stats.py keccak: improve perf a little (#2321) 2024-06-07 16:48:27 +00:00
check_copyright_year.sh Cleanup stateless and block witness code. (#2295) 2024-06-08 15:05:00 +07:00
make_dist.sh ci: fix nightly build 2023-02-23 18:34:04 +07:00
make_states.sh Script for comparing csv outputs from block import 2024-06-06 14:33:49 +02:00
print_version.nims Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
requirements.in Script for comparing csv outputs from block import 2024-06-06 14:33:49 +02:00
requirements.txt Script for comparing csv outputs from block import 2024-06-06 14:33:49 +02:00

README.md

Utility scripts

block-import-stats.py

This script compares outputs from two nimbus import --debug-csv-stats, a baseline and a contender.

To use it, set up a virtual environment:

# Create a venv for the tool
python -m venv stats
. stats/bin/activate
pip install -r requirements.txt

python block-import-stats.py
  • Generate a baseline version by processing a long range of blocks using nimbus import
  • Modify your code and commit to git (to generate a unique identifier for the code)
  • Re-run the same import over the range of blocks of interest, saving the import statistics to a new CSV
  • Pass the two CSV files to the script

By default, the script will skip block numbers below 500k since these are mostly unintersting.

See -h for help text on running the script.

Testing a particular range of blocks

As long as block import is run on similar hardware, each run can be saved for future reference using the git hash.

The block import can be run repeatedly with --max-blocks to stop after processing a number of blocks - by copying the state at that point, one can resume or replay the import of a particular block range

See make_states.sh for such an example.