use slice discriminator for anchor >=0.31 compatibility - #1289
Open
jshiohaha wants to merge 2 commits into
Open
Conversation
jshiohaha
marked this pull request as ready for review
April 20, 2026 18:23
jshiohaha
requested review from
josh-orca,
wjthieme and
yugure-orca
as code owners
April 20, 2026 18:23
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.
Description
use slice discriminator for anchor >=0.31 (changelog) compatibility
How did we miss this error?
we don't run cargo check or build with
--all-features, so we missed this feature based error. there are other feature gated errors, but we can address those in a follow up PR to keep this one focused on addressing the specified issue. further, we can update the the CI build scripts to try and catch these.Testing
Reproducing error before change. This same error is resolved with the change in this PR.
whirlpools % cargo +stable check --manifest-path rust-sdk/client/Cargo.toml --features anchor-idl-build Checking orca_whirlpools_client v7.2.0 (/Users/jacobshiohira/projects/solana/orca/whirlpools/rust-sdk/client) error[E0326]: implemented const `DISCRIMINATOR` has an incompatible type for trait --> src/state/tick_array.rs:257:26 | 257 | const DISCRIMINATOR: [u8; 8] = [0; 8]; | ^^^^^^^ expected `&[u8]`, found `[u8; 8]` For more information about this error, try `rustc --explain E0326`.Closes #1285