-
Notifications
You must be signed in to change notification settings - Fork 48
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
base: main
Are you sure you want to change the base?
feat(ismp-grandpa): add benchmarking support #353
Conversation
- 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.
8507b80
to
15664bb
Compare
use super::*; | ||
|
||
#[benchmark] | ||
fn add_state_machines() -> Result<(), BenchmarkError> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this too
fn add_state_machines() -> Weight; | ||
fn remove_state_machines() -> Weight; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
Description
This PR implements benchmarking support for
ismp-grandpa
, addressing issue #350. The implementation includes:WeightInfo
trait and default weight implementationChanges include
Related issues
Closes #350
Testing Instructions
cargo test -p ismp-grandpa --features runtime-benchmarks