Bug
The NFT program mirrors the converged v17 portfolio layout (PortfolioAccountV16Account, 9227 bytes) via bytemuck cast in decode_portfolio (slab_types_v16.rs:484). This is the only place portfolio bytes are interpreted, and every security decision downstream depends on correct field offsets.
False Claims
cpi_v16.rs:14: "end-to-end path is verified by the A.5 LiteSVM suite"
README.md:95: "Struct offsets are validated at compile-time with size and offset assertions"
slab_types_v16.rs:43: "The LiteSVM integration test (cross-cut phase) is the runtime ground truth"
Reality: There is no tests/ directory, and CI runs only cargo test --lib --tests (self-referential unit tests).
The const_assert! macros measure the mirror struct against itself, proving internal consistency but proving nothing about correspondence to the live engine layout.
Risk
If the engine layout ever inserts/reorders/resizes a field before the read fields (legs, owner, locks), the provenance header checks still pass while owner/market_id/gate-flags are silently read from wrong bytes:
- wrong
owner offset → mint against positions you don't own
- wrong
market_id/slot-reuse anchor → transfer gate decisions on garbage
- wrong lock/stale flags → bypass transfer restrictions
This is the failure mode warned about in SCHEMA_DRIFT_v12.19.md: "mirror schema drift can mask itself as compile-pass."
Fix
Either:
- Remove false claims from comments/docs to match reality, OR
- Add the promised LiteSVM integration test (spin up real wrapper portfolio, assert NFT reads match)
Labels: security, documentation
Bug
The NFT program mirrors the converged v17 portfolio layout (PortfolioAccountV16Account, 9227 bytes) via bytemuck cast in
decode_portfolio(slab_types_v16.rs:484). This is the only place portfolio bytes are interpreted, and every security decision downstream depends on correct field offsets.False Claims
cpi_v16.rs:14: "end-to-end path is verified by the A.5 LiteSVM suite"README.md:95: "Struct offsets are validated at compile-time with size and offset assertions"slab_types_v16.rs:43: "The LiteSVM integration test (cross-cut phase) is the runtime ground truth"Reality: There is no
tests/directory, and CI runs onlycargo test --lib --tests(self-referential unit tests).The
const_assert!macros measure the mirror struct against itself, proving internal consistency but proving nothing about correspondence to the live engine layout.Risk
If the engine layout ever inserts/reorders/resizes a field before the read fields (legs, owner, locks), the provenance header checks still pass while
owner/market_id/gate-flags are silently read from wrong bytes:owneroffset → mint against positions you don't ownmarket_id/slot-reuse anchor → transfer gate decisions on garbageThis is the failure mode warned about in SCHEMA_DRIFT_v12.19.md: "mirror schema drift can mask itself as compile-pass."
Fix
Either:
Labels: security, documentation