Skip to content

fix(abi): EXPECTED_SLAB_VERSION 16 -> 17 to match the deployed wrapper (#379) - #380

Open
0x-SquidSol wants to merge 1 commit into
dcccrypto:mainfrom
0x-SquidSol:fix/expected-slab-version-17
Open

fix(abi): EXPECTED_SLAB_VERSION 16 -> 17 to match the deployed wrapper (#379)#380
0x-SquidSol wants to merge 1 commit into
dcccrypto:mainfrom
0x-SquidSol:fix/expected-slab-version-17

Conversation

@0x-SquidSol

Copy link
Copy Markdown
Contributor

Closes #379.

Problem

EXPECTED_SLAB_VERSION is 16. The deployed wrapper writes and hard-checks 17.

percolator-prog/src/v16_program.rs:51pub const VERSION: u16 = 17; — written into data[8..10] by write_header (:1445), and check_header (:1461) rejects any mismatch with PercolatorError::InvalidVersion.

Verified against the live chain

getProgramAccounts on the deployed devnet wrapper DhSkE7uTb8HBUYYWF1xkxMYBGtLYJEoDq1tfBD7SnHcj, reading bytes 8..10 of each:

live devnet wrapper-owned accounts: 206
version at bytes 8..10 -> {17: 204, 0: 2}

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_MAGIC is 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 --noEmit clean; 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 main and can merge in any order.

🤖 Generated with Claude Code

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

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 47 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 669468a4-ebdf-49cd-a424-0aea5fdcb53f

📥 Commits

Reviewing files that changed from the base of the PR and between 5b0aa77 and eb259d4.

⛔ Files ignored due to path filters (3)
  • dist/abi/instructions.d.ts is excluded by !**/dist/**
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/abi/instructions.ts
  • test/drift-check.test.ts

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.

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.

[HIGH] EXPECTED_SLAB_VERSION = 16 but the deployed wrapper writes 17 — any integrator gating on it rejects every live account

1 participant