-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add delegation/undelegation & use upgraded SDK #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis PR introduces delegation functionality to the Ephemeral SPL Token program by adding new processors for delegating and undelegating ephemeral ATAs, integrating with Pinocchio-based ephemeral rollups infrastructure. Workspace metadata is updated to reflect MagicBlock Labs ownership, and new dependencies are added to support the delegation operations. Documentation is expanded with build, test, and architecture details. Integration tests validate the delegation and undelegation workflows. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/Payer
participant EToken as e-token Program
participant DLP as Delegation Program
participant Pinocchio as ephemeral-rollups-pinocchio
rect rgb(230, 240, 255)
Note over User,Pinocchio: Delegation Flow
User->>EToken: DelegateEphemeralAta Instruction<br/>(payer, ephemeral_ata, validator)
activate EToken
EToken->>EToken: Parse DelegateArgs<br/>(bump, validator)
EToken->>EToken: Validate accounts &<br/>derive PDA seeds
EToken->>Pinocchio: delegate_account()<br/>(ephemeral_ata, config)
activate Pinocchio
Pinocchio->>DLP: Change account owner<br/>to delegation program
deactivate Pinocchio
EToken-->>User: Success
deactivate EToken
end
rect rgb(240, 230, 255)
Note over User,Pinocchio: Undelegation Flow
DLP->>EToken: UndelegationCallback Instruction<br/>(delegated_ata, buffer, payer)
activate EToken
EToken->>EToken: Validate accounts<br/>&& verify PDA
EToken->>Pinocchio: undelegate()<br/>(delegated_acc, buffer_acc, payer)
activate Pinocchio
Pinocchio->>EToken: Restore account ownership<br/>to e-token program
deactivate Pinocchio
EToken-->>DLP: Success
deactivate EToken
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Free ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (13)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
Release Notes
New Features
Documentation
Chores