fix: system program addresses#2298
Conversation
Entire-Checkpoint: e8de3c68866c
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces a feature-gated enum variant Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
programs/system/src/lib.rs (1)
50-58: 🧹 Nitpick | 🔵 Trivial
InstructionDiscriminatorshould be#[non_exhaustive]when it has cfg-gated variants.Since
InstructionDiscriminatorispuband has a variant that only exists under#[cfg(feature = "reinit")], any downstream exhaustivematchon this type will fail to compile depending on which features are active. Marking the enum#[non_exhaustive]prevents this class of breakage.♻️ Proposed fix
+#[non_exhaustive] pub enum InstructionDiscriminator { InitializeCpiContextAccount, Invoke, InvokeCpi, InvokeCpiWithReadOnly, InvokeCpiWithAccountInfo, #[cfg(feature = "reinit")] ReInitCpiContextAccount, }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@programs/system/src/lib.rs` around lines 50 - 58, The public enum InstructionDiscriminator contains a cfg-gated variant (ReInitCpiContextAccount) which can cause downstream exhaustive matches to break; add the #[non_exhaustive] attribute above the pub enum InstructionDiscriminator declaration so external code cannot exhaustively pattern-match it and future/feature-gated variants won't break consumers (no other code changes required besides annotating the enum).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@programs/system/src/lib.rs`:
- Around line 50-58: The public enum InstructionDiscriminator contains a
cfg-gated variant (ReInitCpiContextAccount) which can cause downstream
exhaustive matches to break; add the #[non_exhaustive] attribute above the pub
enum InstructionDiscriminator declaration so external code cannot exhaustively
pattern-match it and future/feature-gated variants won't break consumers (no
other code changes required besides annotating the enum).
Summary by CodeRabbit
New Features
Refactor