-
Notifications
You must be signed in to change notification settings - Fork 23
chore: preserve undelegating and delegated accounts on startup #670
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
Manual Deploy AvailableYou can trigger a manual deploy of this PR branch to testnet: Alternative: Comment
Comment updated automatically when the PR is synchronized. |
📝 WalkthroughWalkthroughThis change refactors classification and logging inside Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-21T14:00:54.642ZApplied to files:
🔇 Additional comments (4)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
magicblock-chainlink/src/chainlink/mod.rs(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-14T09:56:14.047Z
Learnt from: taco-paco
Repo: magicblock-labs/magicblock-validator PR: 564
File: test-integration/programs/flexi-counter/src/processor/call_handler.rs:122-125
Timestamp: 2025-10-14T09:56:14.047Z
Learning: The file test-integration/programs/flexi-counter/src/processor/call_handler.rs contains a test smart contract used for integration testing, not production code.
Applied to files:
magicblock-chainlink/src/chainlink/mod.rs
📚 Learning: 2025-11-18T08:47:39.702Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: magicblock-chainlink/tests/04_redeleg_other_separate_slots.rs:158-165
Timestamp: 2025-11-18T08:47:39.702Z
Learning: In magicblock-chainlink tests involving compressed accounts, `set_remote_slot()` sets the slot of the `AccountSharedData`, while `compressed_account_shared_with_owner_and_slot()` sets the slot of the delegation record. These are two different fields and both calls are necessary.
Applied to files:
magicblock-chainlink/src/chainlink/mod.rs
🔇 Additional comments (1)
magicblock-chainlink/src/chainlink/mod.rs (1)
152-168: LGTM! Clear differentiation between delegation states.The refactored logic correctly distinguishes between accounts that are delegated-only versus those in an undelegating state, and appropriately preserves both on startup as intended by the PR objectives.
* master: chore: preserve undelegating and delegated accounts on startup (#670)
Summary
Refine account filtering on startup to preserve undelegating and delegated accounts by distinguishing between delegated-only and undelegating states.
Details
magicblock-chainlink Account Filtering
The startup account filtering logic was updated to provide better tracking and preservation of account states:
Removed DLP-owned account filtering: Previously, DLP-owned non-delegated accounts were explicitly filtered out during startup. This behavior has been removed, allowing these accounts to be preserved.
Refined delegated account tracking: The delegated account tracking now distinguishes between two states:
delegated_only: Accounts that are delegated but not undelegatingundelegating: Accounts that are both delegated and in an undelegating stateUpdated filtering logic: Accounts are now kept on startup if they are delegated (whether delegated-only or undelegating), ensuring that accounts in transition states are preserved for proper state management.
Improved logging: The startup logs now provide a clearer breakdown of account states, making it easier to track what's being filtered and what's being kept.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.