feat: add binary to benchmark TPS#2073
Conversation
8c02a61 to
dca1f4f
Compare
5807a7f to
d75ee70
Compare
|
@bobbinth @Mirko-von-Leipzig this isn't fully working with the deployed networks and remote prover yet because of the version mismatch of the protocol. Do you prefer that I rebase the changes to |
|
I think should be fine to keep as is as we'll try to make a release (at least to devnet) towards the end of this week. |
f2fc4f9 to
72a40a9
Compare
JereSalo
left a comment
There was a problem hiding this comment.
I ran the benchmarks with the bench-local.sh script and it worked fine 😄
|
|
||
| ### The batch-builder worker pool (`--batch.workers`) | ||
|
|
||
| `--batch.workers` (env `MIDEN_NODE_BLOCK_PRODUCER_BATCH_WORKERS`) sets how many batches the block-producer keeps proving |
There was a problem hiding this comment.
| `--batch.workers` (env `MIDEN_NODE_BLOCK_PRODUCER_BATCH_WORKERS`) sets how many batches the block-producer keeps proving | |
| `--batch.workers` (env `MIDEN_NODE_BATCH_WORKERS`) sets how many batches the block-producer keeps proving |
node/bin/node/src/commands/block_producer.rs
Line 151 in 330e709
| keywords = ["benchmark", "miden", "node"] | ||
| license.workspace = true | ||
| name = "miden-benchmark" | ||
| publish = true |
There was a problem hiding this comment.
Do we want to publish this to crates.io or is it meant to be internal tooling? I don't know if it was intentional but in case it wasn't we can set publish to false.
| publish = true | |
| publish = false |
| --bin miden-benchmark | ||
| - name: Run benchmark with N=1 | ||
| env: | ||
| N_TXS: "1" |
There was a problem hiding this comment.
Would bumping this number here widen coverage?
| N_TXS: "1" | |
| N_TXS: "5" |
| /logs | ||
| /snapshots | ||
| /benchmark-proofs | ||
|
|
There was a problem hiding this comment.
It'd be good to add to the .gitignore this directory because when I ran the script (scripts/bench-local.sh) it was created and left untracked.
| /bench-local-run | |
|
|
||
| The benchmark needs a running Miden node with a reachable RPC endpoint. | ||
|
|
||
| ### Option A: docker-compose (recommended for benchmarking) |
There was a problem hiding this comment.
I think part of this "Starting the node" section is stale. For example, the make compose-* targets don't exist anymore, and the miden-node store start / block-producer start / rpc start commands are gone as well.
Partially address #1989
THis PR introduces a new binary to run benchmarks against the Miden node:
miden-benchmark. It is split in two subcommands:create-proofs: which generates proofs and stores them in a file.run-benchmark: that reads the proofs file, submits them to the node and generates a report of the result.Along with the new binary, this PR also introduces a small change in the block producer configurations by
batch_workersconfigurable.Note
Currently it won't work against the deployed against the deployed networks due to a change in the protobuf definition of
SyncMmr.Note
Generating 2k transaction (1k mint 1k consume) takes a bit over an hour in a Macbook M4 Max.
In the README of the new binary I added a section about how to start up the block producer with some parameters changes to increase the limit of TPS imposed by the node:
TX PER BATCH * BATCHES PER BLOCK / INTERVAL PER BLOCK. At the moment of posting this and with the node's configuration from the README, I didn't reached the limit of TPS yet, though I never sent more than 1k transactions at a time (because the mint transaction are submitted sequentially).The next steps are to:
Changelog