-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Description
Hi @JohnReedV,
While reviewing the pallet-commitments code I noticed a potentially critical issue with the on_initialize implementation:
🔗 pallets/commitments/src/lib.rs#L365
Problem
- The function performs non-trivial iteration over storage and executes complex logic.
- However, it returns
Weight::zero(). - This causes a mismatch between the actual CPU/memory work and the weight system.
Potential Risks
- Unaccounted workload: since
on_initializereturnsWeight::zero(), heavy storage iteration is not deducted from the block weight budget. Extrinsics can fill their 75% quota while this logic still executes “for free”. - Slot timing issues: block production (
Proposer::propose) has a strictmax_durationtied to the consensus slot. Ifon_initializetakes significant time but is reported as zero weight, authors might not complete block construction within the deadline, leading to missed slots. - Reduced throughput / liveness: in a solochain, consistent missed slots do not directly break finalization, but they reduce effective throughput and can impact network liveness if too many blocks are skipped.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels