Skip to content
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

feat(ismp-grandpa): add benchmarking support #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sylvaincormier
Copy link

Description

This PR implements benchmarking support for ismp-grandpa, addressing issue #350. The implementation includes:

  • Added WeightInfo trait and default weight implementation
  • Added benchmarking feature flag and dependencies
  • Configured benchmarking in Gargantua and Nexus runtimes
  • Implemented placeholder weight values for pallet extrinsics

Changes include

  • Benchmarking infrastructure setup
  • Runtime integration for Gargantua and Nexus
  • Weight implementations

Related issues

Closes #350

Testing Instructions

  1. Run the benchmarks using:
    cargo test -p ismp-grandpa --features runtime-benchmarks

@sylvaincormier sylvaincormier marked this pull request as draft December 15, 2024 19:31
- Add WeightInfo trait and default implementation
- Integrate benchmarking feature flag and dependencies
- Configure benchmarking in Gargantua and Nexus runtimes
- Add placeholder weight values for pallet extrinsics

This implements benchmarking support for ismp-grandpa, addressing polytope-labs#350.
@sylvaincormier sylvaincormier force-pushed the feat/benchmark-ismp-grandpa branch from 8507b80 to 15664bb Compare December 15, 2024 20:26
@sylvaincormier sylvaincormier marked this pull request as ready for review December 15, 2024 20:27
use super::*;

#[benchmark]
fn add_state_machines() -> Result<(), BenchmarkError> {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this benchmark be dynamic? so that the weight is calculated based on the number of items to be added?

}

#[benchmark]
fn remove_state_machines() -> Result<(), BenchmarkError> {
Copy link
Member

Choose a reason for hiding this comment

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

yeah this too

Comment on lines +30 to +31
fn add_state_machines() -> Weight;
fn remove_state_machines() -> Weight;
Copy link
Member

Choose a reason for hiding this comment

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

should take the length of state machines

@@ -41,6 +51,7 @@ pub mod pallet {

/// IsmpHost implementation
type IsmpHost: IsmpHost + Default;
type WeightInfo: WeightInfo;
Copy link
Member

Choose a reason for hiding this comment

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

Some doc comments will be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmark ismp-grandpa
2 participants