refactor(extern): add INTEGRITY_FUNCTION_POINTERS_LENGTH and pin pointer slot non-zero tests - #226
refactor(extern): add INTEGRITY_FUNCTION_POINTERS_LENGTH and pin pointer slot non-zero tests#226thedavidmeister wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
|
Design-gate reject (human, 2026-07-04): the opcode and integrity tables are parallel-indexed over the SAME opcode set and can never legitimately differ in length — BaseRainlangExtern (rainlang-0.1.2 src/abstract/BaseRainlangExtern.sol:32-40) structurally enforces equality. A single shared constant is the correct encoding of that invariant (divergence unrepresentable); splitting it into INTEGRITY_FUNCTION_POINTERS_LENGTH CREATES a representable divergence plus the need for agreement checks — the two-sources-of-truth hazard introduced, not fixed. #28's premise is inverted; it is queued for human close. Only defensible kernel: an optional cosmetic rename of the shared constant to something like OPCODE_COUNT to express that one count drives both tables. Do not re-attempt the split. |
|
🤖 ai:vetter |
Closes #28
Closes #32
What changed
Issue #28 — mis-named constant for integrity table size
buildIntegrityFunctionPointers()was allocating its array usingOPCODE_FUNCTION_POINTERS_LENGTH. This hides any future divergence between opcode-table size and integrity-table size (BaseRainlangExtern explicitly checks they match). Added a distinctINTEGRITY_FUNCTION_POINTERS_LENGTH = 2constant and used it inbuildIntegrityFunctionPointers().OPCODE_FUNCTION_POINTERS_LENGTHis unchanged for backward compatibility.Issue #32 — opcode/integrity index constants not pinned for non-zero values
Added two tests to
ERC4626Words.indexAlignment.t.sol:testOpcodeTableSlotsNonZero: each byte-pair atOPCODE_ERC4626_CONVERT_TO_ASSETSandOPCODE_ERC4626_CONVERT_TO_SHARESoffsets inOPCODE_FUNCTION_POINTERSmust be non-zero.testIntegrityTableSlotsNonZero: same forINTEGRITY_FUNCTION_POINTERS.These guard against silently zero-defaulted function pointer slots that would compile fine but dispatch to address zero at runtime.