[PM-21804] task(runtime): benchmark WeightInfo for nine unmetered pallets#1338
Draft
m2ux wants to merge 10 commits into
Draft
[PM-21804] task(runtime): benchmark WeightInfo for nine unmetered pallets#1338m2ux wants to merge 10 commits into
m2ux wants to merge 10 commits into
Conversation
…tered pallets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Mike Clay <mike.clay@shielded.io>
…cument 4 as intentionally unweighted PM-21804: Replace placeholder WeightInfo = () with proper benchmarked weights. Wired pallets (SubstrateWeight<Runtime>): - pallet_federated_authority - pallet_federated_authority_observation - pallet_system_parameters - pallet_session_validator_management - pallet_timestamp Documented as intentionally unweighted (WeightInfo = ()): - pallet_grandpa (weights module not publicly exported) - pallet_mmr (weights module not publicly exported) - pallet_beefy_mmr (weights module not publicly exported) - pallet_beefy (no runtime-benchmarks feature, equivocation disabled) Additional changes: - Re-benchmarked 4 pallet weight files (STEPS=100, REPEAT=2) - Added pallet-mmr/runtime-benchmarks feature to Cargo.toml - Added pallet_grandpa and pallet_mmr to define_benchmarks! macro - Observation pallet: preserved 4 inherent extrinsic weights (cannot be re-benchmarked via dispatch path) Signed-off-by: Mike Clay <mike.clay@shielded.io>
Fixes CI changes_check: includes PR link and GitHub issue reference. Signed-off-by: Mike Clay <mike.clay@shielded.io>
Klapeyron
reviewed
Apr 17, 2026
Regenerated weight files for the following pallets with increased benchmark parameters for more accurate weight values: - pallet-federated-authority-observation: removed stale reset_members* inherent extrinsic weights, updated set_* dispatchable weights - pallet-federated-authority: updated weight values - pallet-system-parameters: updated weight values - pallet-session-validator-management (committee-selection): updated weight values with significantly lower standard error Signed-off-by: Mike Clay <mike.clay@shielded.io>
…into task/PM-21804-benchmark-weightinfo-pallets Signed-off-by: Mike Clay <mike.clay@shielded.io>
The benchmarks were run using frame-omni-bencher v1, not ./target/release/midnight-node. Updated the Executed Command comments in all four weight files to reflect the actual tool used. Signed-off-by: Mike Clay <mike.clay@shielded.io>
…servation The frame-omni-bencher tool cannot benchmark Mandatory inherent extrinsics like reset_members. The previous benchmark command excluded these variants via --extrinsic, which removed the weight functions that lib.rs depends on. Restore the carried-forward weight values for: - reset_members_only_council - reset_members_only_technical_committee - reset_members - reset_members_none Signed-off-by: Mike Clay <mike.clay@shielded.io>
0ed1367 to
3401fd8
Compare
…rk-weightinfo-pallets Signed-off-by: Mike Clay <mike.clay@shielded.io> # Conflicts: # partner-chains/toolkit/committee-selection/pallet/src/weights.rs
justinfrevert
approved these changes
Apr 30, 2026
Contributor
justinfrevert
left a comment
There was a problem hiding this comment.
Weights seem sensible. Thanks!
Contributor
|
We should benchmark against the benchmarking machine. |
Contributor
|
do we follow this issue as part of #1482 now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace placeholder
WeightInfo = ()with proper benchmarked weight implementations for nine pallets in the runtime, ensuring all user-facing extrinsics have accurate compute metering.🎫 Ticket 📐 Engineering
Motivation
An AI security audit (Finding R-033) identified that nine pallets in
runtime/src/lib.rsusetype WeightInfo = (), meaning all their extrinsic weights are placeholder values. This includes user-facing pallets such aspallet_session_validator_management,pallet_federated_authority, andpallet_system_parameters.Placeholder weights do not reflect actual execution costs, so blocks may include more computation than the weight budget intends to allow. This undermines the chain's resource accounting and could be exploited for denial-of-service against validators.
Changes
Implementation (coming next):
WeightInfo = ()()with generatedWeightInfoimplementations in runtime config📌 Submission Checklist
🔱 Fork Strategy
🗹 TODO before merging