Skip to content

Wave 6c: NFT mirror bytes update for engine phantom-dust 4-field schema - #83

Merged
dcccrypto merged 1 commit into
mainfrom
feat/sync/nft-engine-bytes-wave6c
May 10, 2026
Merged

Wave 6c: NFT mirror bytes update for engine phantom-dust 4-field schema#83
dcccrypto merged 1 commit into
mainfrom
feat/sync/nft-engine-bytes-wave6c

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

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>_qphantom_dust_potential_<side>_q (renamed)
  • New phantom_dust_certified_<side>_q per side (always 0 on engine main)
  • Field order matches toly (certified first, potential second)

Cumulative engine fixed_prefix growth since pre-Wave-1: +248 bytes (was +216 post-Wave-5).

Verification

  • cargo build --release clean
  • cargo test --release all green
  • 54+ compile-time size_of! / offset_of! assertions hold
  • assert!(size_of::<RiskEngine>() == EXPECTED_RISK_ENGINE_SIZE) passes

Test plan

  • cargo build --release
  • cargo test --release
  • CI green
  • Admin-merge after CI passes

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

…-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>
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@dcccrypto has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 20 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b2dc751-3d52-412d-9a9d-32ef8089a7e6

📥 Commits

Reviewing files that changed from the base of the PR and between 0708f8f and 279dddb.

📒 Files selected for processing (1)
  • src/slab_types.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sync/nft-engine-bytes-wave6c

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dcccrypto
dcccrypto merged commit c7845c9 into main May 10, 2026
2 checks passed
@dcccrypto
dcccrypto deleted the feat/sync/nft-engine-bytes-wave6c branch May 10, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant