-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extrinsic Benchmarks doesn't work and report an InvalidTransaction::BadProof
error
#1365
Comments
InvalidTransaction::BadProof
errorInvalidTransaction::BadProof
error
Sounds weird. I added this line as shown in the screenshot and ran the following command in the root of the frontier repo. It works. ~/c/r/frontier (master±) ▶︎︎ ./target/release/frontier-template-node benchmark pallet --chain=dev --steps=50 --repeat=20 --extrinsic=transfer_all --pallet=pallet_balances --output=weights.rs --header=HEADER-APACHE2 --template=./.maintain/frame-weight-template.hbs
Pallet: "pallet_balances", Extrinsic: "transfer_all", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: `System::Number` (r:1 w:0)
Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Storage: `System::ExecutionPhase` (r:1 w:0)
Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
Storage: `System::EventCount` (r:1 w:1)
Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Storage: `System::Events` (r:1 w:1)
Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
Storage: `System::Account` (r:1 w:0)
Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
Median Slopes Analysis
========
-- Extrinsic Time --
Model:
Time ~= 35.27
µs
Reads = 5
Writes = 2
Recorded proof Size = 65
Min Squares Analysis
========
-- Extrinsic Time --
Model:
Time ~= 35.27
µs
Reads = 5
Writes = 2
Recorded proof Size = 65
Created file: "weights.rs"
2024-04-07 16:44:12 Starting benchmark: pallet_balances::transfer_all |
isn't the command you executed different from the one I posted tho ? I still can't get it to work and it also appear with the RemarkBuilder: |
Please have a try based on #1380. I have tried two ways:
According to https://docs.substrate.io/test/benchmark/, it's also recommended to compile first and then run the benchmark command. I have no idea of the extra reason for the differences here yet. |
Based on the PR #1380 The problem still persist for both builders: RemarkBuilder: $ ../target/release/frontier-template-node benchmark extrinsic --chain=dev --pallet=system --extrinsic=remark
2024-04-08 15:04:45 🔨 Initializing Genesis block/state (state: 0x17f3…ad4b, header-hash: 0x15a2…8651)
2024-04-08 15:04:45 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2024-04-08 15:04:45 Essential task `txpool-background` failed. Shutting down service.
2024-04-08 15:04:45 Essential task `transaction-pool-task-0` failed. Shutting down service.
2024-04-08 15:04:45 Essential task `basic-block-import-worker` failed. Shutting down service.
Error: Client(ApplyExtrinsicFailed(Validity(TransactionValidityError::Invalid(InvalidTransaction::BadProof))))
2024-04-08 15:04:45 Running 10 warmups...
2024-04-08 15:04:45 Executing block 100 times
2024-04-08 15:04:45 Building block, this takes some time... TransferKeepAliveBuilder: $ ../target/release/frontier-template-node benchmark extrinsic --chain=dev --pallet=balances --extrinsic=transfer_keep_alive
2024-04-08 15:04:21 🔨 Initializing Genesis block/state (state: 0x17f3…ad4b, header-hash: 0x15a2…8651)
2024-04-08 15:04:21 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2024-04-08 15:04:21 Essential task `txpool-background` failed. Shutting down service.
2024-04-08 15:04:21 Essential task `transaction-pool-task-1` failed. Shutting down service.
2024-04-08 15:04:21 Essential task `transaction-pool-task-0` failed. Shutting down service.
2024-04-08 15:04:21 Running 10 warmups...
2024-04-08 15:04:21 Executing block 100 times
Error: Client(ApplyExtrinsicFailed(Validity(TransactionValidityError::Invalid(InvalidTransaction::BadProof))))
2024-04-08 15:04:21 Building block, this takes some time... |
Have you ever tried using |
Yes, doesn't work as the name of the pallet seems hard coded inside the builder anyway: See /// Generates extrinsics for the `benchmark overhead` command.
///
/// Note: Should only be used for benchmarking.
pub struct RemarkBuilder {
client: Arc<Client>,
}
impl RemarkBuilder {
/// Creates a new [`Self`] from the given client.
pub fn new(client: Arc<Client>) -> Self {
Self { client }
}
}
impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
fn pallet(&self) -> &str {
"system"
}
fn extrinsic(&self) -> &str {
"remark"
}
fn build(&self, nonce: u32) -> std::result::Result<OpaqueExtrinsic, &'static str> {
let acc = ecdsa::Pair::from_string("//Bob", None).expect("static values are valid; qed");
let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic(
self.client.as_ref(),
acc,
SystemCall::remark { remark: vec![] }.into(),
nonce,
)
.into();
Ok(extrinsic)
}
} Also I was checking the Darwinia node source code and I saw that the benchmark BenchmarkCmd::Overhead(_) => Err("Unsupported benchmarking command".into()),
BenchmarkCmd::Extrinsic(_) => Err("Unsupported benchmarking command".into()), |
Description
Running an extrinsic benchmarks doesn't work and crash with the following error:
Error: Client(ApplyExtrinsicFailed(Validity(TransactionValidityError::Invalid(InvalidTransaction::BadProof))))
After a debug session, it happen at the signature verification of the transaction in the Runtime.
Steps to Reproduce
template
folder on this repository.cargo run --features runtime-benchmarks benchmark extrinsic --pallet=balances --extrinsic=transfer_keep_alive
The text was updated successfully, but these errors were encountered: