I'm trying to benchmark the pallet_template from the substrate-node-template example but am getting the error: Found argument 'Cargo.toml' which wasn't expected, or isn't valid in this context.

I have already built the runtime with the runtime-benchmarks flag enabled, and have also included the list_benchmark!(list, extra, pallet_template, TemplateModule) and add_benchmark!(params, batches, pallet_template, TemplateModule) in the runtime/lib.rs. But when I run the command -

./target/release/node-template benchmark pallet \
    --chain dev \
    --execution=wasm \
    --wasm-execution=compiled \
    --pallet pallet_template \
    --extrinsic * \
    --steps 50 \
    --repeat 20 \
    --output pallets/template/src/weight.rs

I keep getting this weird error: Found argument 'Cargo.toml' which wasn't expected, or isn't valid in this context. I have used the exact same command mentioned on the official substrate benchmarking tutorial and don't understand why the compiler is telling me that I'm passing Cargo.toml as an argument. I'm still a beginner in Substrate so please forgive me if I'm asking a very dumb question 🙏.

Please help me understand where I'm missing it.

New contributor
AKASH S M is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1


Depending on your shell you have to escape the * symbol or put it into quotes.
Please try again with --extrinsic "", --extrinsic "\*" or --extrinsic "*" which should all be equialent.

  • 1
    Thanks a lot! It worked after putting * in quotes.
    – AKASH S M
    2 days ago
  • Please consider marking your question as "answered" so that other people can easily find it. 2 days ago

Your Answer

AKASH S M is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.