Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add database analyse-gas-usage command (#10240)
Add a command which allows to analyse gas usage on some part of the blockchain. The command goes over the specified blocks and gathers information about how much gas was used by each block, shard and account. Then it displays an analysis of all the data. The analysis contains: * Total gas used * Gas used on each shard * Top 10 accounts by gas usage * The optimal account by which a shard could be split into two halves with similar gas usage Help page: ```bash $ ./neard database analyse-gas-usage --help Analyse gas usage in a chosen sequnce of blocks Usage: neard database analyse-gas-usage [OPTIONS] Options: --last-blocks <LAST_BLOCKS> Analyse the last N blocks in the blockchain --from-block-height <FROM_BLOCK_HEIGHT> Analyse blocks from the given block height, inclusive --to-block-height <TO_BLOCK_HEIGHT> Analyse blocks up to the given block height, inclusive -h, --help Print help ``` Example usage: ```bash # Analyse gas usage in the last 1000 blocks cargo run --bin neard -- database analyse-gas-usage --last-blocks 1000 # Analyse gas usage in blocks with heights between 200 and 300 (inclusive) ./neard database analyse-gas-usage --from-block-height 200 --to-block-height 300 ```
- Loading branch information