A home for Tweag's investigation into the cost structure of Cardano block validation
The script ./bootstrap.sh is a simple wrapper over Mithril that downloads the latest snapshot of the Cardano DB. See the instructions here. You can change where the files are downloaded with --download-dir.
# Make snapshots (very important! don't skip)
$ bash ./snapshots.sh
# Run the analysis proper
$ nix run github:tweag/ouroboros-consensus/aspiwack/explore-cardano#db-analyser -- --db path/to/db/ --config path/to/config.json --lmdb --dump-features --block-file path/to/blocks.csv --transaction-file path/to/transactions.csv --analyse-from 146620810Where
--dbpoints to a directory with a node's block database--configpoints to the config file that the node used--block-fileand--transaction-filepoint to possibly non-existent files, where the data will be dumped.
Notes:
-146620810 is the first block (or second block maybe?) of the latest epoch (see
feature
table).
There are meaningful block features way earlier than that (we've used 4492900
as a starting point in the past), but due to a quirk in the implementation of
the db-analyser tool, an analysis which crosses depends on the ledger state
cannot cross era boundaries.
Some early-project observations
The smallest a block has ever been on mainnet is 633 bytes. The largest is 648KB (633KiB). For a mean average of 17KiB per block.
There seems to be trends in block size, see how it evolves over time:
Most blocks are pretty small though
Here's the distribution of the number of script witnesses in transactions


