Wave 6c: NFT mirror bytes update for engine phantom-dust 4-field schema - #83
Conversation
…-field schema Engine PR #95 (Wave 6a, merged @ 8a8776e) adopted toly's 4-field phantom-dust schema (2 × u128 → 4 × u128 per side; +32 bytes net on RiskEngine). The NFT vendored mirror must track byte-for-byte. ## What's changed | Field | Before | After | |---|---|---| | `phantom_dust_bound_long_q: U128` (1 field × 16) | 16 bytes | renamed | | `phantom_dust_bound_short_q: U128` (1 field × 16) | 16 bytes | renamed | | `phantom_dust_certified_long_q: U128` (new) | — | 16 bytes | | `phantom_dust_certified_short_q: U128` (new) | — | 16 bytes | | `phantom_dust_potential_long_q: U128` (renamed) | — | 16 bytes | | `phantom_dust_potential_short_q: U128` (renamed) | — | 16 bytes | Net change: 2 × U128 → 4 × U128 = +32 bytes. Field order matches toly (certified first, potential second). ## Downstream offset shifts (+32 each) | Const | Before | After | |---|---|---| | `ENGINE_REL_NEG_PNL_ACCOUNT_COUNT` | 616 | 648 | | `ENGINE_REL_LAST_ORACLE_PRICE` | 792 | 824 | | `ENGINE_REL_FUND_PX_LAST` | 800 | 832 | | `ENGINE_REL_F_LONG_NUM` | 816 | 848 | | `ENGINE_REL_F_SHORT_NUM` | 832 | 864 | | `ENGINE_REL_USED` | 880 | 912 | | `SLAB_OFF_NEG_PNL_ACCOUNT_COUNT` | 1200 | 1232 | | `SLAB_OFF_LAST_ORACLE_PRICE` | 1376 | 1408 | | `SLAB_OFF_FUND_PX_LAST` | 1384 | 1416 | | `SLAB_OFF_F_LONG_NUM` | 1400 | 1432 | | `SLAB_OFF_F_SHORT_NUM` | 1416 | 1448 | | `SLAB_OFF_USED` | 1464 | 1496 | The `EXPECTED_RISK_ENGINE_SIZE` closed-form `fixed_prefix` bumps 880 → 912 to track. Cumulative engine fixed_prefix growth since pre-Wave-1: +248 bytes (was +216 post-Wave-5). ## Verification | Gate | Result | |---|---| | `cargo build --release` | clean (7 pre-existing warnings) | | `cargo test --release` | all green (54+ compile-time assertions hold) | | `const _: () = assert!(size_of::<RiskEngine>() == EXPECTED_RISK_ENGINE_SIZE)` | holds | ## Cross-repo - Engine Wave 6a: PR #95 @ 8a8776e ✓ MERGED - Wrapper Wave 6a companion: PR #276 @ 4e71c0c ✓ MERGED - NFT Wave 6c (this PR): closes the phantom-dust schema cycle After this merges, the engine + wrapper + NFT are in full byte sync with the Wave 6a 4-field phantom-dust schema. Wave 6b (dynamic-fee API rename) and Wave 6d (any further wrapper integration) follow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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
Tracks engine PR dcccrypto/percolator#95 (Wave 6a phantom-dust 4-field schema, merged @ 8a8776e). NFT vendored mirror grows +32 bytes to match.
Schema:
phantom_dust_bound_<side>_q→phantom_dust_potential_<side>_q(renamed)phantom_dust_certified_<side>_qper side (always 0 on engine main)Cumulative engine fixed_prefix growth since pre-Wave-1: +248 bytes (was +216 post-Wave-5).
Verification
size_of!/offset_of!assertions holdassert!(size_of::<RiskEngine>() == EXPECTED_RISK_ENGINE_SIZE)passesTest plan
Cross-repo
After this merges, engine + wrapper + NFT are in full byte sync with the Wave 6a 4-field phantom-dust schema. Next: Wave 6b (dynamic-fee API).
🤖 Generated with Claude Code