harden: add layout invariant validation to detectSlabLayout#200
harden: add layout invariant validation to detectSlabLayout#2000x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
Conversation
Added validateLayout helper that checks 3 structural invariants before any layout is returned from detectSlabLayout: 1. accountsOff > engineOff (accounts come after engine) 2. engineBitmapOff > engineParamsOff (bitmap follows params) 3. maxAccounts in [1, 65536] (sane tier bounds) Catches transcription errors in layout constants at detection time instead of producing garbled account data downstream. This codebase has had multiple such errors (V1M bitmap corrected from 726→720, V_ADL bitmap from 1006→1008, V12.1 HOST bitmapOff double-subtraction). The invariant check catches this class of bug immediately. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 18 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
detectSlabLayoutreturns layouts from 10+buildLayout*()functions with no post-construction validationvalidateLayouthelper checks 3 structural invariants before returning:accountsOff > engineOff— accounts array lives after engine headerengineBitmapOff > engineParamsOff— bitmap follows params in engine structmaxAccounts ∈ [1, 65536]— sane tier boundsdetectSlabLayoutTest plan
🤖 Generated with Claude Code