- 
                Notifications
    
You must be signed in to change notification settings  - Fork 530
 
Open
Description
Summary
The RollupCore.sol contract declares a private storage variable gap that is never used, leading to confusing code and wasted deployment gas.
Severity
LOW - Code quality issue, no direct security impact
Location
- File: 
l1-contracts/src/core/RollupCore.sol - Line: Approximately line 283
 
Description
The contract declares an unused storage variable:
/**
 * @dev Storage gap to ensure checkBlob is in its own storage slot
 */
uint256 private gap = 0; // This variable is declared but never read or written to.Issues
- Unused Variable: The 
gapvariable is never accessed anywhere in the contract - Unclear Intent: The comment suggests it's for storage layout management, but a single 
uint256doesn't create a meaningful gap - Gas Waste: Initializing this variable costs gas on deployment with no benefit
 - Code Smell: May indicate incomplete implementation of an upgradeability pattern
 
Impact
- Minor gas waste on deployment
 - Code confusion for developers and auditors
 - Potential misunderstanding of storage layout intentions
 
Recommendation
Option 1: If storage gap is needed for upgradeability, implement it properly:
// Reserve 50 storage slots for future upgrades
uint256[50] private __gap;Option 2: If not needed, remove the variable entirely:
// Remove the unused gap variable and its commentOption 3: If it's specifically for checkBlob alignment, add a comment explaining why and ensure it's actually achieving the intended layout.
Additional Context
Proper storage gaps are typically implemented as arrays (e.g., uint256[50]) in upgradeable contracts following the OpenZeppelin pattern. A single unused variable doesn't serve this purpose effectively.
Metadata
Metadata
Assignees
Labels
No labels