feat: redirect to to ephemeral system program calls associated with ephemeral accounts - #254
feat: redirect to to ephemeral system program calls associated with ephemeral accounts#254taco-paco wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThe Rust dependency now references a fixed revision of the validator repository. A public ephemeral system program ID constant was added. Pinocchio ephemeral account builders now accept and target an ESP account, with updated operation discriminators. The SDK now uses Suggested reviewers: ✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust/pinocchio/src/ephemeral_accounts.rs`:
- Around line 52-54: Document the serialization contract beside
CREATE_EPHEMERAL_ACCOUNT_DISCRIMINATOR, RESIZE_EPHEMERAL_ACCOUNT_DISCRIMINATOR,
and CLOSE_EPHEMERAL_ACCOUNT_DISCRIMINATOR: these 4-byte little-endian values
must remain aligned with the u32 bincode variant indices of
EphemeralSystemInstruction. Note that reordering the enum or changing its
serialization requires updating these constants.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a7cf04cb-50c1-498a-8ab3-407c14b3da12
⛔ Files ignored due to path filters (1)
rust/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
rust/Cargo.tomlrust/pinocchio/src/consts.rsrust/pinocchio/src/ephemeral_accounts.rsrust/sdk/src/ephemeral_accounts.rs
| const CREATE_EPHEMERAL_ACCOUNT_DISCRIMINATOR: u32 = 0; | ||
| const RESIZE_EPHEMERAL_ACCOUNT_DISCRIMINATOR: u32 = 1; | ||
| const CLOSE_EPHEMERAL_ACCOUNT_DISCRIMINATOR: u32 = 2; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Document the implicit bincode discriminator coupling.
The Pinocchio layer manually constructs 4-byte LE discriminators (0/1/2) while the SDK layer relies on bincode's u32 enum variant serialization via EphemeralSystemInstruction. These happen to match because bincode serializes enum variant indices as u32, but this coupling is implicit. If the EphemeralSystemInstruction enum is reordered or the serialization changes, the Pinocchio layer will silently break.
Consider adding a comment documenting this contract, or deriving the discriminators from the enum to eliminate the manual duplication.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rust/pinocchio/src/ephemeral_accounts.rs` around lines 52 - 54, Document the
serialization contract beside CREATE_EPHEMERAL_ACCOUNT_DISCRIMINATOR,
RESIZE_EPHEMERAL_ACCOUNT_DISCRIMINATOR, and
CLOSE_EPHEMERAL_ACCOUNT_DISCRIMINATOR: these 4-byte little-endian values must
remain aligned with the u32 bincode variant indices of
EphemeralSystemInstruction. Note that reordering the enum or changing its
serialization requires updating these constants.
Validator moved out handling of ephemeral accounts into separate builtin. Here we update sdk accordingly
Summary by CodeRabbit
New Features
Documentation