Skip to content
Open
185 changes: 167 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ magicblock-config = { path = "./magicblock-config" }
magicblock-config-helpers = { path = "./magicblock-config-helpers" }
magicblock-config-macro = { path = "./magicblock-config-macro" }
magicblock-core = { path = "./magicblock-core" }
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "aa1de56d90c", features = [
magicblock-aperture = { path = "./magicblock-aperture" }
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "e8d03936", features = [
"no-entrypoint",
] }
magicblock-aperture = { path = "./magicblock-aperture" }
magicblock-geyser-plugin = { path = "./magicblock-geyser-plugin" }
magicblock-ledger = { path = "./magicblock-ledger" }
magicblock-metrics = { path = "./magicblock-metrics" }
Expand Down
29 changes: 14 additions & 15 deletions magicblock-committor-service/src/tasks/args_task.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dlp::args::{CallHandlerArgs, CommitStateArgs};
use dlp::args::CallHandlerArgs;
use solana_pubkey::Pubkey;
use solana_sdk::instruction::{AccountMeta, Instruction};

Expand Down Expand Up @@ -44,20 +44,7 @@ impl ArgsTask {
impl BaseTask for ArgsTask {
fn instruction(&self, validator: &Pubkey) -> Instruction {
match &self.task_type {
ArgsTaskType::Commit(value) => {
let args = CommitStateArgs {
nonce: value.commit_id,
lamports: value.committed_account.account.lamports,
data: value.committed_account.account.data.clone(),
allow_undelegation: value.allow_undelegation,
};
dlp::instruction_builder::commit_state(
*validator,
value.committed_account.pubkey,
value.committed_account.account.owner,
args,
)
}
ArgsTaskType::Commit(value) => value.create_commit_ix(validator),
ArgsTaskType::Finalize(value) => {
dlp::instruction_builder::finalize(
*validator,
Expand Down Expand Up @@ -101,6 +88,18 @@ impl BaseTask for ArgsTask {
self: Box<Self>,
) -> Result<Box<dyn BaseTask>, Box<dyn BaseTask>> {
match self.task_type {
ArgsTaskType::Commit(mut value) if value.is_commit_diff() => {
// TODO (snawaz): Currently, we do not support executing CommitDiff
// as BufferTask, which is why we're forcing CommitTask to use CommitState
// before converting this task into BufferTask Once CommitDiff is supported
// by BufferTask, we do not have to force_commit_state and we can remove
// force_commit_state stuff, as it's essentially a downgrade.

value.force_commit_state();
Ok(Box::new(BufferTask::new_preparation_required(
BufferTaskType::Commit(value),
)))
}
ArgsTaskType::Commit(value) => {
Ok(Box::new(BufferTask::new_preparation_required(
BufferTaskType::Commit(value),
Expand Down
Loading