Skip to content

Commit 9cf7e54

Browse files
committed
feat: Add MagicBlockInstruction::ScheduleCommitDiffAndUndelegate to efficiently commit changes in delegated accounts
1 parent 3e940c9 commit 9cf7e54

File tree

30 files changed

+1470
-184
lines changed

30 files changed

+1470
-184
lines changed

Cargo.lock

Lines changed: 166 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ magicblock-config = { path = "./magicblock-config" }
108108
magicblock-config-helpers = { path = "./magicblock-config-helpers" }
109109
magicblock-config-macro = { path = "./magicblock-config-macro" }
110110
magicblock-core = { path = "./magicblock-core" }
111-
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "aa1de56d90c", features = [
112-
"no-entrypoint",
113-
] }
114111
magicblock-aperture = { path = "./magicblock-aperture" }
112+
magicblock-delegation-program = { path="../delegation-program", features = ["no-entrypoint"] }
115113
magicblock-geyser-plugin = { path = "./magicblock-geyser-plugin" }
116114
magicblock-ledger = { path = "./magicblock-ledger" }
117115
magicblock-metrics = { path = "./magicblock-metrics" }

magicblock-accounts/src/scheduled_commits_processor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ impl ScheduledCommitsProcessorImpl {
343343
included_pubkeys: intent_meta.included_pubkeys,
344344
excluded_pubkeys: intent_meta.excluded_pubkeys,
345345
requested_undelegation: intent_meta.requested_undelegation,
346+
commit_diff: intent_meta.commit_diff,
346347
}
347348
}
348349
}
@@ -412,6 +413,7 @@ struct ScheduledBaseIntentMeta {
412413
excluded_pubkeys: Vec<Pubkey>,
413414
intent_sent_transaction: Transaction,
414415
requested_undelegation: bool,
416+
commit_diff: bool,
415417
}
416418

417419
impl ScheduledBaseIntentMeta {
@@ -429,6 +431,7 @@ impl ScheduledBaseIntentMeta {
429431
excluded_pubkeys,
430432
intent_sent_transaction: intent.action_sent_transaction.clone(),
431433
requested_undelegation: intent.is_undelegate(),
434+
commit_diff: intent.is_commit_diff(),
432435
}
433436
}
434437
}

0 commit comments

Comments
 (0)