Skip to content

feat(sdk#375): add the sdk_parity_fixtures binary the Parity Gate needs - #188

Merged
dcccrypto merged 1 commit into
mainfrom
fix/375-nft-parity-fixtures
Sep 2, 2026
Merged

feat(sdk#375): add the sdk_parity_fixtures binary the Parity Gate needs#188
dcccrypto merged 1 commit into
mainfrom
fix/375-nft-parity-fixtures

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

The Parity Gate's percolator-nft target has failed with cargo run failed on every run since at least 2026-08-23, because this binary did not exist. Three of the gate's four targets were in that state — so ABI drift in prog, stake and nft had no automated detection at all. Every drift defect found in that window (sdk#376, sdk#379, nft#182) was found by hand.

It immediately found a drift

That is the argument for having it, so leading with it:

committed spec actual struct
field at offset 167 reserved last_holder
offset 167 167
total length 199 199

#138 renamed _reservedlast_holder in place. Nothing broke, because the SDK reads by offset — and nothing flagged it, because the gate could not run. Every other offset matches the struct exactly, so the mirror is correct and only the name drifted.

Benign, and that is precisely what makes it a good first catch: a naming drift survives indefinitely without a gate, then misleads whoever next reads the spec to work out what a byte range means. The SDK already exposes this as lastHolder (percolator-sdk#384) — the spec was the last thing still calling it reserved.

Why offset_of! and not a literal table

A hand-written offset list would restate the numbers the spec already holds, so the check would compare a copy against a copy and pass regardless of what the program does.

That is the same failure mode as this crate's own const_assert!s (see #160), and as the stale CYCLE_CAP copy found in percolator-keeper today. If PositionNftV16 changes, these values move and the gate goes red.

No new dependency

This crate builds an on-chain program. The fixture shape is small and fixed, so the JSON is emitted directly rather than adding serde_json to the program's dependency graph for a dev-only binary.

Verification

  • cargo run --quiet --bin sdk_parity_fixtures produces the full spec shape
  • diffed against the committed spec: one key renamed, zero offsets changed, length unchanged
  • nft suite: 11 + 6 + 5 + 5 + 4 passing, 0 failed; cargo fmt --check clean

The spec file itself lives in percolator-sdk and is updated there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D

The gate's `percolator-nft` target has failed with `cargo run failed` on every
run since at least 2026-08-23, because this binary did not exist. Three of the
gate's four targets were in that state, so ABI drift in prog, stake and nft had
NO automated detection at all — every drift defect found in that window
(sdk#376, sdk#379, nft#182) was found by hand.

The binary emits live `offset_of!` values, not a copied table. That is the entire
point: a hand-written offset list would restate the numbers the spec already
holds, so the check would compare a copy against a copy and pass regardless of
what the program does. That is the failure mode #160 describes for this crate's
own `const_assert!`s, and the one that let a stale `CYCLE_CAP` copy sit in
percolator-keeper. If `PositionNftV16` changes, these move and the gate goes red.

No serde dependency: this crate builds an on-chain program and the fixture shape
is small and fixed, so the JSON is emitted directly rather than adding a
dependency to the program's graph for a dev-only binary.

IT IMMEDIATELY FOUND ONE DRIFT, which is the argument for having it.

The committed spec calls a field `reserved` at offset 167. #138 renamed
`_reserved` -> `last_holder` at the SAME offset, with the SAME total length
(199), so nothing broke at runtime and nothing flagged it — the SDK reads by
offset. Every other offset in the spec matches the struct exactly, so the mirror
is correct and only the NAME drifted.

Benign, and that is what makes it a good first catch: a naming drift survives
indefinitely without a gate and then misleads whoever next reads the spec to work
out what a byte range means. The SDK already exposes this field as `lastHolder`
(percolator-sdk#384) — the spec was the only thing still calling it reserved.

The spec file itself lives in percolator-sdk and is updated there.

nft suite: 11 + 6 + 5 + 5 + 4 passing, 0 failed. fmt clean.

Refs: dcccrypto/percolator-sdk#375

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D
@dcccrypto
dcccrypto merged commit 4915325 into main Sep 2, 2026
@dcccrypto
dcccrypto deleted the fix/375-nft-parity-fixtures branch September 2, 2026 16:55
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