Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9f5c613
feat: parallelize task cleanup
taco-paco Nov 17, 2025
2019491
fix: comments for metrics
taco-paco Nov 18, 2025
0202989
feat: add undelegation patching
taco-paco Nov 18, 2025
1a094ec
feat: add tests
taco-paco Nov 18, 2025
541c1a5
fix: some comments
taco-paco Nov 18, 2025
2684f8d
fix: wait a little bit for async cleanup
taco-paco Nov 18, 2025
254652a
fix: wait a little bit for async cleanup
taco-paco Nov 18, 2025
d684952
Merge branch 'fix/committor/long-intents' into feat/base-layer-ix/imp…
taco-paco Nov 19, 2025
470fcea
refactor: Executors store reports and junk
taco-paco Nov 20, 2025
f4d9eae
fix: compilation
taco-paco Nov 20, 2025
95e0fb0
fix: tests
taco-paco Nov 21, 2025
1968617
fix: tests
taco-paco Nov 21, 2025
d02cc05
feat: added error message field into SentCommit
taco-paco Nov 19, 2025
f25213a
Merge branch 'feat/base-layer-ix/trigger-sent-commit-on-failure' into…
taco-paco Nov 21, 2025
98aa18b
fix: compilation
taco-paco Nov 21, 2025
21743ca
feat: introduced patched errors trace in SentCommit transaction
taco-paco Nov 21, 2025
6909e0e
fix: typo
taco-paco Nov 21, 2025
b319f3d
fix: tests
taco-paco Nov 21, 2025
438c527
fix: tests
taco-paco Nov 21, 2025
e4f241d
feat: added error message field into SentCommit
taco-paco Nov 19, 2025
3c3b398
refactor: add extra logging + fix coderabbit
taco-paco Nov 21, 2025
1bb9ef4
Merge branch 'feat/base-layer-ix/trigger-sent-commit-on-failure' into…
taco-paco Nov 21, 2025
e01bc79
refactor: executors
taco-paco Nov 21, 2025
cd79fa9
refactor
taco-paco Nov 21, 2025
d1f9a74
fix: tests
taco-paco Nov 21, 2025
9461a48
fix: fmt
taco-paco Nov 21, 2025
927a357
refactor: naming
taco-paco Nov 21, 2025
9213381
Merge branch 'master' into feat/base-layer-ix/improve-executors
taco-paco Nov 24, 2025
aaf48f2
Merge branch 'master' into feat/base-layer-ix/improve-executors
taco-paco Nov 25, 2025
60c6e45
refactor: remove unnecessary impls
taco-paco Nov 25, 2025
922ab1a
refactor: address PR comments
taco-paco Nov 25, 2025
b0409ef
refactor: log cleanup
taco-paco Nov 25, 2025
703c94e
refactor: fix log
taco-paco Nov 25, 2025
bfb2270
Merge branch 'master' into feat/base-layer-ix/improve-executors
taco-paco Nov 25, 2025
090c47c
refactor: comments fixes
taco-paco Nov 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 40 additions & 42 deletions magicblock-accounts/src/scheduled_commits_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ use magicblock_program::{
magic_scheduled_base_intent::ScheduledBaseIntent,
register_scheduled_commit_sent, SentCommit, TransactionScheduler,
};
use solana_sdk::{
hash::Hash, pubkey::Pubkey, signature::Signature, transaction::Transaction,
};
use solana_sdk::{hash::Hash, pubkey::Pubkey, transaction::Transaction};
use tokio::{
sync::{broadcast, oneshot},
task,
Expand Down Expand Up @@ -203,11 +201,8 @@ impl ScheduledCommitsProcessorImpl {
}
};

let (intent_id, trigger_type) = execution_result
.as_ref()
.map(|output| (output.id, output.trigger_type))
.unwrap_or_else(|(id, trigger_type, _)| (*id, *trigger_type));

let intent_id = execution_result.id;
let trigger_type = execution_result.trigger_type;
// Here we handle on OnChain triggered intent
// TODO: should be removed once crank supported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we open an issue to clean this up, since the cranking is supported now?

if matches!(trigger_type, TriggerType::OffChain) {
Expand Down Expand Up @@ -249,40 +244,10 @@ impl ScheduledCommitsProcessorImpl {
result: BroadcastedIntentExecutionResult,
mut intent_meta: ScheduledBaseIntentMeta,
) {
let error_message = result
.as_ref()
.err()
.map(|(_, _, err)| format!("{:?}", err));
let chain_signatures = match result {
Ok(execution_outcome) => match execution_outcome.output {
ExecutionOutput::SingleStage(signature) => vec![signature],
ExecutionOutput::TwoStage {
commit_signature,
finalize_signature,
} => vec![commit_signature, finalize_signature],
},
Err((_, _, err)) => {
error!(
"Failed to commit in slot: {}, blockhash: {}. {:?}",
intent_meta.slot, intent_meta.blockhash, err
);
err.signatures()
.map(|(commit, finalize)| {
finalize
.map(|finalize| vec![commit, finalize])
.unwrap_or(vec![commit])
})
.unwrap_or(vec![])
}
};
let intent_sent_transaction =
std::mem::take(&mut intent_meta.intent_sent_transaction);
let sent_commit = Self::build_sent_commit(
intent_id,
chain_signatures,
intent_meta,
error_message,
);
let sent_commit =
Self::build_sent_commit(intent_id, intent_meta, result);
register_scheduled_commit_sent(sent_commit);
match internal_transaction_scheduler
.execute(intent_sent_transaction)
Expand All @@ -300,10 +265,42 @@ impl ScheduledCommitsProcessorImpl {

fn build_sent_commit(
intent_id: u64,
chain_signatures: Vec<Signature>,
intent_meta: ScheduledBaseIntentMeta,
error_message: Option<String>,
result: BroadcastedIntentExecutionResult,
) -> SentCommit {
let error_message =
result.as_ref().err().map(|err| format!("{:?}", err));
let chain_signatures = match result.inner {
Ok(value) => match value {
ExecutionOutput::SingleStage(signature) => vec![signature],
ExecutionOutput::TwoStage {
commit_signature,
finalize_signature,
} => vec![commit_signature, finalize_signature],
},
Err(err) => {
error!(
"Failed to commit in slot: {}, blockhash: {}. {:?}",
intent_meta.slot, intent_meta.blockhash, err
);
err.signatures()
.map(|(commit, finalize)| {
finalize
.map(|finalize| vec![commit, finalize])
.unwrap_or(vec![commit])
})
.unwrap_or(vec![])
}
};
let patched_errors = result
.patched_errors
.iter()
.map(|err| {
info!("Patched intent: {}. error was: {}", intent_id, err);
err.to_string()
})
.collect();

SentCommit {
message_id: intent_id,
slot: intent_meta.slot,
Expand All @@ -314,6 +311,7 @@ impl ScheduledCommitsProcessorImpl {
excluded_pubkeys: vec![],
requested_undelegation: intent_meta.requested_undelegation,
error_message,
patched_errors,
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions magicblock-committor-service/src/intent_execution_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ pub mod intent_scheduler;

use std::sync::Arc;

pub use intent_execution_engine::{
BroadcastedIntentExecutionResult, ExecutionOutputWrapper,
};
pub use intent_execution_engine::BroadcastedIntentExecutionResult;
use magicblock_rpc_client::MagicblockRpcClient;
use magicblock_table_mania::TableMania;
use tokio::sync::{broadcast, mpsc, mpsc::error::TrySendError};
Expand Down
Loading
Loading