fix(abi): EXPECTED_SLAB_VERSION 16 -> 17 to match the deployed wrapper (#379) - #380
Open
0x-SquidSol wants to merge 1 commit into
Open
fix(abi): EXPECTED_SLAB_VERSION 16 -> 17 to match the deployed wrapper (#379)#3800x-SquidSol wants to merge 1 commit into
0x-SquidSol wants to merge 1 commit into
Conversation
The deployed wrapper writes VERSION = 17 into bytes [8..10] of every account it owns (v16_program.rs:51, written by write_header) and check_header rejects any mismatch with InvalidVersion. The SDK exported 16. Verified against the live chain rather than source alone: getProgramAccounts on the devnet wrapper DhSkE7uTb8HBUYYWF1xkxMYBGtLYJEoDq1tfBD7SnHcj, reading bytes 8..10 of each account, returns 206 accounts of which 204 carry version 17 and two are uninitialised zeros. None carries 16. Nothing inside this package consumes the constant, so no test failed and no in-repo behaviour changes — but it is a public export, and an integrator using it as a header guard rejected every account the wrapper has ever written. percolator-nft needed the identical correction in 3e26fe7. The adjacent V17_SLAB_MAGIC is correct; the on-chain magic bytes match it. Add a test pinning the constant so this cannot drift silently again. Closes dcccrypto#379 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 47 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (3)
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 |
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.
Closes #379.
Problem
EXPECTED_SLAB_VERSIONis16. The deployed wrapper writes and hard-checks17.percolator-prog/src/v16_program.rs:51—pub const VERSION: u16 = 17;— written intodata[8..10]bywrite_header(:1445), andcheck_header(:1461) rejects any mismatch withPercolatorError::InvalidVersion.Verified against the live chain
getProgramAccountson the deployed devnet wrapperDhSkE7uTb8HBUYYWF1xkxMYBGtLYJEoDq1tfBD7SnHcj, reading bytes8..10of each:204 of 206 are version 17, two are uninitialised. None is 16.
Impact
Nothing in this package consumes the constant, so no test failed and no in-repo behaviour changes. But it is a public export whose own doc block tells integrators to "verify both MAGIC at [0..8] and VERSION at [8..10]" — and anyone who does rejects every account the wrapper has ever written.
percolator-nft needed the identical correction in
3e26fe7("accept wrapper VERSION 17"). Same drift, still present here.The adjacent
V17_SLAB_MAGICis correct — I checked the on-chain magic bytes (00 36 31 56 43 52 45 50) against it. Only the version was wrong.Change
One line, plus a test pinning it with the live evidence in a comment so it cannot drift silently again.
tsc --noEmitclean; full suite 1009 passing across 29 files;dist/rebuilt (it is committed deliberately for git-dep consumers —.gitignore:20).Independent of #377 and #378; branches from
mainand can merge in any order.🤖 Generated with Claude Code