feat(sdk#375): add the sdk_parity_fixtures binary the Parity Gate needs - #188
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Parity Gate's
percolator-nfttarget has failed withcargo run failedon 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:
reservedlast_holder#138renamed_reserved→last_holderin 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 itreserved.Why
offset_of!and not a literal tableA 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 staleCYCLE_CAPcopy found inpercolator-keepertoday. IfPositionNftV16changes, 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_jsonto the program's dependency graph for a dev-only binary.Verification
cargo run --quiet --bin sdk_parity_fixturesproduces the full spec shapecargo fmt --checkcleanThe spec file itself lives in
percolator-sdkand is updated there.🤖 Generated with Claude Code
https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D