Skip to content

Do not make pallet-nfts benchmarks signature-dependent#4756

Merged
bkchr merged 8 commits intoparitytech:masterfrom
moliholy:fix/nft-benchmarks
Jun 21, 2024
Merged

Do not make pallet-nfts benchmarks signature-dependent#4756
bkchr merged 8 commits intoparitytech:masterfrom
moliholy:fix/nft-benchmarks

Conversation

@moliholy
Copy link
Copy Markdown
Contributor

@moliholy moliholy commented Jun 11, 2024

This PR:

  • Adds extra functionality to pallet-nfts's BenchmarkHelper to provide signers and sign message.
  • Abstracts away the explicit link with Sr25519 schema in the benchmarks, allowing parachains with a different one to be able to run them and calculate the weights.
  • Adds a default implementation for the empty tuple that leaves the code equivalent.

@ggwpez ggwpez added the T2-pallets This PR/Issue is related to a particular pallet. label Jun 11, 2024
Copy link
Copy Markdown
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where_clause {
where
T::OffchainSignature: From<MultiSignature>,
T::AccountId: From<AccountId32>,
}
this should also be removed.

Comment on lines +98 to +100
sp_runtime::MultiSigner,
sp_runtime::AccountId32,
sp_runtime::MultiSignature,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This is not a good solution. This way () will not work for any runtime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current behaviour is that it builds but fails to execute the benchmarks. In my opinion it's already an improvement that it does not build, so that you can take care of the error instead of thinking "benchmarks will be fine because it compiles".

@moliholy
Copy link
Copy Markdown
Contributor Author

this should also be removed.

Nice catch. Done in 54b2397.

@paritytech-cicd-pr
Copy link
Copy Markdown

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6491090

@bkchr bkchr added this pull request to the merge queue Jun 21, 2024
Merged via the queue into paritytech:master with commit 2657cfb Jun 21, 2024
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
This PR:

- Adds extra functionality to pallet-nfts's `BenchmarkHelper` to provide
signers and sign message.
- Abstracts away the explicit link with Sr25519 schema in the
benchmarks, allowing parachains with a different one to be able to run
them and calculate the weights.
- Adds a default implementation for the empty tuple that leaves the code
equivalent.
sfffaaa pushed a commit to peaqnetwork/polkadot-sdk that referenced this pull request Dec 27, 2024
This PR:

- Adds extra functionality to pallet-nfts's `BenchmarkHelper` to provide
signers and sign message.
- Abstracts away the explicit link with Sr25519 schema in the
benchmarks, allowing parachains with a different one to be able to run
them and calculate the weights.
- Adds a default implementation for the empty tuple that leaves the code
equivalent.
github-merge-queue bot pushed a commit that referenced this pull request Jun 5, 2025
Similar to #4756 for `pallet-nfts`, the changes proposed in this PR
intend to make benchmarks for `pallet-identity` signature-agnostic by
the inclusion of a benchmark helper with sane defaults to handle the
signing operations.
pgherveou pushed a commit that referenced this pull request Jun 11, 2025
Similar to #4756 for `pallet-nfts`, the changes proposed in this PR
intend to make benchmarks for `pallet-identity` signature-agnostic by
the inclusion of a benchmark helper with sane defaults to handle the
signing operations.
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
Similar to #4756 for `pallet-nfts`, the changes proposed in this PR
intend to make benchmarks for `pallet-identity` signature-agnostic by
the inclusion of a benchmark helper with sane defaults to handle the
signing operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants