一键导入
tx-gas-benchmarking
Measure verifier transaction gas from Anvil broadcast artifacts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Measure verifier transaction gas from Anvil broadcast artifacts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tx-gas-benchmarking |
| description | Measure verifier transaction gas from Anvil broadcast artifacts. |
Use this skill to measure total user-paid transaction gas for the Solidity verifier paths in sol-spartan-whir. This includes intrinsic gas, calldata gas, byte counts, and execution remainder. It is not an execution-only or gasleft() profiling workflow — use the flamegraph profiling skill for that.
sol-spartan-whir/.anvil --silent --code-size-limit 50000
The --code-size-limit flag is required because the native verifier exceeds the default EIP-170 contract size limit (24576 bytes). Without it, the deployment transaction will fail.
Use the bundled helper:
.agents/skills/tx-gas-benchmarking/scripts/run_tx_gas_benchmark.sh \
script/WhirBlobNativeTxBenchmark_k22_jb100_ext5_lir4_ff4_rsv3_pow28.s.sol
You can also pass an explicit benchmark script path:
.agents/skills/tx-gas-benchmarking/scripts/run_tx_gas_benchmark.sh \
script/WhirBlobNativeTxBenchmark_k22_jb100_lir6_ff4_rsv1.s.sol
Supported mode aliases:
native: legacy mode alias for the native blob benchmark script family; prefer an explicit script path when multiple schedules are checked indirect: typed verifier, EOA -> WhirVerifier4.verify(...)blob: blob decode-and-delegate verifierwrapper: typed wrapper pathpkill -f "anvil"
If other Anvil instances might be running, do not use pkill. Stop the specific PID you started instead.
The helper accepts either:
native, direct, blob, wrapperscript/*.s.sol pathWhen given a mode alias, it searches script/ for the matching benchmark family. If more than one script matches on the current branch, it fails and asks for an explicit path instead of guessing.
Wrapper benchmarks still add --tc MeasureTxGas automatically.
It then calls the bundled parser:
python3 .agents/skills/tx-gas-benchmarking/scripts/parse_tx_gas.py <mode-or-script-path>
scripts/parse_tx_gas.py reads the Anvil broadcast run-latest.json artifacts and prints:
Use it when you need user-paid transaction cost, not just execution inside the Foundry harness.
The parser accepts either a mode alias or a benchmark script path. It discovers the matching broadcast/*/31337/run-latest.json artifact by benchmark family and keeps the receipt-position assumptions in one internal mode table.
--private-key is required. Without it, Foundry can produce empty receipts and the parser will report a failed broadcast.--code-size-limit 50000 (or similar). The native verifier exceeds the default 24576-byte EIP-170 limit, and Anvil will reject the deployment without this flag.--code-size-limit 50000 to forge script as well, so it does not prompt interactively about the oversized contract.blob and wrapper may not have checked-in run-latest.json artifacts on disk. If the parser prints Not found: ..., rerun the corresponding benchmark script first.forge clean before benchmarking. Stale artifacts can make mode-alias runs hit an old script family instead of the current one.sol-spartan-whir root by walking upward until it finds foundry.toml and broadcast/.forge script fails during tx simulation or broadcast in a way that looks environment-related, request running that command outside the sandbox and rerun it there.bash. Do not source it from zsh; it uses Bash features such as mapfile.