Skip to content

task(runtime): benchmark WeightInfo for nine unmetered pallets (PM-21804)#1338

Draft
m2ux wants to merge 1 commit intomainfrom
task/PM-21804-benchmark-weightinfo-pallets
Draft

task(runtime): benchmark WeightInfo for nine unmetered pallets (PM-21804)#1338
m2ux wants to merge 1 commit intomainfrom
task/PM-21804-benchmark-weightinfo-pallets

Conversation

@m2ux
Copy link
Copy Markdown
Contributor

@m2ux m2ux commented Apr 15, 2026

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.rs use type WeightInfo = (), meaning all their extrinsic weights are placeholder values. This includes user-facing pallets such as pallet_session_validator_management, pallet_federated_authority, and pallet_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):

  • Identify all nine pallets using WeightInfo = ()
  • Run FRAME benchmarking for each pallet to generate weight files
  • Replace () with generated WeightInfo implementations in runtime config
  • Document any intentionally unweighted pallets with justification

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: [reason]
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • No new todos introduced

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other
  • N/A

🗹 TODO before merging

  • Ready for review

…tered pallets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Mike Clay <mike.clay@shielded.io>
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.

1 participant