Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
252d027
wip: task rewrite
taco-paco Feb 17, 2026
7e0dab1
wip
taco-paco Feb 18, 2026
8d47fd2
feat: replaced dyn BaseTask with BaseTaskImpl
taco-paco Feb 18, 2026
3463c1a
refacotor: remove old types
taco-paco Feb 18, 2026
d99b9fb
fix: unit tests
taco-paco Feb 18, 2026
4e0ac1a
fix: test-integration
taco-paco Feb 18, 2026
154779d
refactor: remove old CommitTask
taco-paco Feb 18, 2026
3c0f304
refactor: removing todos
taco-paco Feb 18, 2026
08cf305
fix: clippy
taco-paco Feb 18, 2026
1e3d3f7
chore: added docs
taco-paco Feb 18, 2026
059be35
fix: todo
taco-paco Feb 18, 2026
cd02059
fix: tests
taco-paco Feb 18, 2026
6911c85
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Feb 18, 2026
a5265e8
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Feb 19, 2026
e77097f
refactor: remove unused
taco-paco Feb 19, 2026
54a9a20
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Feb 20, 2026
1c3bc4d
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Feb 24, 2026
05bf5b7
feat: add callback support into IntentExecutor
taco-paco Feb 26, 2026
25681fe
fix: typos
taco-paco Feb 26, 2026
9120ec1
fix: execute callbacvks on success as well
taco-paco Feb 26, 2026
086ac39
wip
taco-paco Feb 27, 2026
51edd63
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Feb 27, 2026
465be77
Merge branch 'fix/base-layer-ix/base-task-rewrite' into feat/action-then
taco-paco Feb 27, 2026
67ca644
feat: support correct tx creation
taco-paco Feb 27, 2026
bb09cf6
feat: send reult into ActionCallbackExecutor
taco-paco Feb 27, 2026
ebed2d6
fix: integration tests
taco-paco Mar 2, 2026
b064285
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Mar 3, 2026
1c0e74f
Merge branch 'master' into fix/base-layer-ix/base-task-rewrite
taco-paco Mar 5, 2026
d653b40
fix: lock
taco-paco Mar 5, 2026
b1a7e07
Merge branch 'fix/base-layer-ix/base-task-rewrite' into feat/action-then
taco-paco Mar 5, 2026
d598391
fix: visibility
taco-paco Mar 5, 2026
4080b9e
fix: visibility
taco-paco Mar 5, 2026
673b254
wip
taco-paco Mar 5, 2026
eff4ed1
fix: lint
taco-paco Mar 5, 2026
57b288c
feat: added support in magic-program
taco-paco Mar 6, 2026
42b7acb
Merge branch 'master' into feat/action-then
taco-paco Mar 9, 2026
7fd1043
fix: lint
taco-paco Mar 9, 2026
355d8f2
fix: test-integration compilation and lint
taco-paco Mar 9, 2026
865a9a8
wip
taco-paco Mar 9, 2026
a3f8974
feat: charge fee payer if it is delegated
taco-paco Mar 10, 2026
206e82c
feat: added tests
taco-paco Mar 10, 2026
67c0bda
feat: add magic-fee-vault
taco-paco Mar 10, 2026
93953c6
feat: raise versions
taco-paco Mar 11, 2026
40aa09e
fix: lock
taco-paco Mar 11, 2026
c5b2389
fix: compilation after SDK update
taco-paco Mar 11, 2026
2cb078e
feat: support init of magic fee vault
taco-paco Mar 11, 2026
40fff43
fix: most of the tests
taco-paco Mar 11, 2026
c420e79
fix: tests
taco-paco Mar 11, 2026
10e5f71
Merge branch 'master' into feat/magic-fee-vault
taco-paco Mar 12, 2026
0afa2cc
fix: unit test
taco-paco Mar 12, 2026
1f1e8bb
fix: address coderabbit
taco-paco Mar 12, 2026
d7e8b21
fix: comment
taco-paco Mar 12, 2026
259d73f
Merge branch 'master' into feat/magic-fee-vault
taco-paco Mar 12, 2026
beadd42
fix: assert actions are charged
taco-paco Mar 12, 2026
f89f711
Merge branch 'master' into feat/action-then
taco-paco Mar 13, 2026
4bbd53c
refactor: remove unused
taco-paco Mar 13, 2026
5503aae
feat: action callbacks, new service & crate
taco-paco Mar 16, 2026
dcc4dbc
feat: renamings
taco-paco Mar 16, 2026
0af52db
feat: add MagicResponse
taco-paco Mar 16, 2026
88041ed
Merge branch 'master' into feat/action-then
taco-paco Mar 16, 2026
ce61085
feat: add e2e tests
taco-paco Mar 17, 2026
97e504e
Merge branch 'master' into feat/magic-fee-vault
taco-paco Mar 17, 2026
d99c719
fix: proper versions
taco-paco Mar 17, 2026
29196cf
fix: tests. Setup fees vault where needed, add magic-fee-vault.json
taco-paco Mar 17, 2026
afffbc9
Merge branch 'feat/magic-fee-vault' into feat/action-then
taco-paco Mar 17, 2026
b5b4de5
fix: sdk
taco-paco Mar 17, 2026
8754965
fix: use keypair via env var
taco-paco Mar 17, 2026
22c4467
Merge branch 'feat/magic-fee-vault' into feat/action-then
taco-paco Mar 17, 2026
ef82963
fix: unit tests
taco-paco Mar 17, 2026
d677570
Merge branch 'master' into feat/action-then
taco-paco Mar 17, 2026
a09e6d6
fix: merge
taco-paco Mar 17, 2026
3379588
fix: test_schedule_intent
taco-paco Mar 18, 2026
952c2db
fix: coderabbit comments
taco-paco Mar 18, 2026
49dad28
fix: coderabbit
taco-paco Mar 18, 2026
eff23e6
fix: bug + added test for TwoStageExecutor
taco-paco Mar 19, 2026
53bc51d
Merge branch 'master' into feat/action-then
taco-paco Mar 19, 2026
86ad3f0
feat: update SDK version
taco-paco Mar 19, 2026
6d9f2f8
fix: fmt
taco-paco Mar 19, 2026
2fede9f
fix: raise version
taco-paco Mar 19, 2026
ed86111
fix: .lock
taco-paco Mar 23, 2026
f54c05f
Merge branch 'master' into feat/action-then
taco-paco Mar 23, 2026
c6d4372
fix: lock
taco-paco Mar 27, 2026
962707b
Merge branch 'master' into feat/action-then
taco-paco Mar 27, 2026
3fa6c8c
fix: fmt
taco-paco Mar 27, 2026
040e0c6
feat: added some doc + renaming
taco-paco Mar 27, 2026
b1804c7
feat: add signature into action report
taco-paco Mar 27, 2026
0db5e2b
refactor: add versioning for response, remove unused fields in this v…
taco-paco Mar 27, 2026
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
26 changes: 25 additions & 1 deletion Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"magicblock-metrics",
"magicblock-processor",
"magicblock-rpc-client",
"magicblock-services",
"magicblock-table-mania",
"magicblock-task-scheduler",
"magicblock-validator",
Expand Down Expand Up @@ -109,6 +110,7 @@ magicblock-metrics = { path = "./magicblock-metrics" }
magicblock-processor = { path = "./magicblock-processor" }
magicblock-program = { path = "./programs/magicblock" }
magicblock-rpc-client = { path = "./magicblock-rpc-client" }
magicblock-services = { path = "./magicblock-services" }
magicblock-table-mania = { path = "./magicblock-table-mania" }
magicblock-task-scheduler = { path = "./magicblock-task-scheduler" }
magicblock-tui-client = { path = "./tools/magicblock-tui-client" }
Expand Down
18 changes: 18 additions & 0 deletions magicblock-accounts/src/scheduled_commits_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,23 @@ impl ScheduledCommitsProcessorImpl {
})
.collect();

let callbacks_report = result
.callbacks_report
.iter()
.map(|r| match r {
Ok(sig) => {
format!("OK: {sig}")
}
Err(err) => {
error!(
"Callback failed to schedule: {}. error: {}",
intent_id, err
);
format!("ERR: {err}")
}
})
.collect();

SentCommit {
message_id: intent_id,
slot: intent_meta.slot,
Expand All @@ -266,6 +283,7 @@ impl ScheduledCommitsProcessorImpl {
requested_undelegation: intent_meta.requested_undelegation,
error_message,
patched_errors,
callbacks_scheduling_results: callbacks_report,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions magicblock-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ magicblock-magic-program-api = { workspace = true }
magicblock-metrics = { workspace = true }
magicblock-processor = { workspace = true }
magicblock-program = { workspace = true }
magicblock-services = { workspace = true }
magicblock-task-scheduler = { workspace = true }
magicblock-validator-admin = { workspace = true }

Expand Down
13 changes: 2 additions & 11 deletions magicblock-api/src/magic_sys_adapter.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::{collections::HashMap, error::Error, sync::Arc, time::Duration};
use std::{collections::HashMap, sync::Arc, time::Duration};

use magicblock_committor_service::CommittorService;
use magicblock_core::{intent::CommittedAccount, traits::MagicSys};
use magicblock_metrics::metrics;
use solana_instruction::error::InstructionError;
use solana_pubkey::Pubkey;
use tracing::{error, trace};
use tracing::error;

#[derive(Clone)]
pub struct MagicSysAdapter {
Expand All @@ -30,15 +30,6 @@ impl MagicSysAdapter {
}

impl MagicSys for MagicSysAdapter {
fn persist(&self, id: u64, data: Vec<u8>) -> Result<(), Box<dyn Error>> {
trace!(id, data_len = data.len(), "Persisting data");
Ok(())
}

fn load(&self, _id: u64) -> Result<Option<Vec<u8>>, Box<dyn Error>> {
Ok(None)
}

fn fetch_current_commit_nonces(
&self,
commits: &[CommittedAccount],
Expand Down
17 changes: 14 additions & 3 deletions magicblock-api/src/magic_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use magicblock_chainlink::{
};
use magicblock_committor_service::{
config::ChainConfig, BaseIntentCommittor, CommittorService,
ComputeBudgetConfig,
ComputeBudgetConfig, DEFAULT_ACTIONS_TIMEOUT,
};
use magicblock_config::{
config::{
Expand Down Expand Up @@ -65,6 +65,7 @@ use magicblock_program::{
validator::{self, validator_authority},
TransactionScheduler as ActionTransactionScheduler,
};
use magicblock_services::actions_callback_service::ActionsCallbackService;
use magicblock_task_scheduler::{SchedulerDatabase, TaskSchedulerService};
use magicblock_validator_admin::claim_fees::ClaimFeesTask;
use mdp::state::{
Expand Down Expand Up @@ -220,7 +221,9 @@ impl MagicValidator {
let (mut dispatch, validator_channels) = link();

let step_start = Instant::now();
let committor_service = Self::init_committor_service(&config).await?;
let committor_service =
Self::init_committor_service(&config, ledger.latest_block())
.await?;
log_timing("startup", "committor_service_init", step_start);
init_magic_sys(Arc::new(MagicSysAdapter::new(
committor_service.clone(),
Expand Down Expand Up @@ -391,14 +394,20 @@ impl MagicValidator {
})
}

#[instrument(skip(config))]
#[instrument(skip(config, latest_block))]
async fn init_committor_service(
config: &ValidatorParams,
latest_block: &LatestBlock,
) -> ApiResult<Option<Arc<CommittorService>>> {
let committor_persist_path =
config.storage.join("committor_service.sqlite");
debug!(path = %committor_persist_path.display(), "Initializing committor service");
// TODO(thlorenz): when we support lifecycle modes again, only start it when needed
let actions_callback_executor = ActionsCallbackService::new(
Arc::new(RpcClient::new(config.aperture.listen.http())),
config.validator.keypair.insecure_clone(),
latest_block.clone(),
);
let committor_service = Some(Arc::new(CommittorService::try_start(
config.validator.keypair.insecure_clone(),
committor_persist_path,
Expand All @@ -408,7 +417,9 @@ impl MagicValidator {
compute_budget_config: ComputeBudgetConfig::new(
config.commit.compute_unit_price,
),
actions_timeout: DEFAULT_ACTIONS_TIMEOUT,
},
actions_callback_executor,
)?));

if let Some(committor_service) = &committor_service {
Expand Down
22 changes: 17 additions & 5 deletions magicblock-committor-service/src/committor_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::{
sync::Arc,
};

use magicblock_core::traits::ActionsCallbackScheduler;
use magicblock_program::magic_scheduled_base_intent::ScheduledIntentBundle;
use magicblock_rpc_client::MagicblockRpcClient;
use magicblock_table_mania::{GarbageCollectorConfig, TableMania};
Expand All @@ -20,9 +21,12 @@ use crate::{
intent_execution_manager::{
db::DummyDB, BroadcastedIntentExecutionResult, IntentExecutionManager,
},
intent_executor::task_info_fetcher::{
CacheTaskInfoFetcher, RpcTaskInfoFetcher, TaskInfoFetcher,
TaskInfoFetcherResult,
intent_executor::{
intent_executor_factory::ExecutorConfig,
task_info_fetcher::{
CacheTaskInfoFetcher, RpcTaskInfoFetcher, TaskInfoFetcher,
TaskInfoFetcherResult,
},
},
persist::{
CommitStatusRow, IntentPersister, IntentPersisterImpl,
Expand All @@ -40,13 +44,15 @@ pub(crate) struct CommittorProcessor {
}

impl CommittorProcessor {
pub fn try_new<P>(
pub fn try_new<P, A>(
authority: Keypair,
persist_file: P,
chain_config: ChainConfig,
actions_callback_executor: A,
) -> CommittorServiceResult<Self>
where
P: AsRef<Path>,
A: ActionsCallbackScheduler,
{
let rpc_client = RpcClient::new_with_commitment(
chain_config.rpc_uri.to_string(),
Expand Down Expand Up @@ -76,7 +82,13 @@ impl CommittorProcessor {
task_info_fetcher.clone(),
Some(persister.clone()),
table_mania.clone(),
chain_config.compute_budget_config.clone(),
ExecutorConfig {
compute_budget_config: chain_config
.compute_budget_config
.clone(),
actions_timeout: chain_config.actions_timeout,
},
actions_callback_executor,
);

Ok(Self {
Expand Down
8 changes: 8 additions & 0 deletions magicblock-committor-service/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
use std::time::Duration;

use solana_commitment_config::CommitmentConfig;

use crate::compute_budget::ComputeBudgetConfig;

pub const DEFAULT_ACTIONS_TIMEOUT: Duration = Duration::from_secs(60);

#[derive(Debug, Clone)]
pub struct ChainConfig {
pub rpc_uri: String,
pub commitment: CommitmentConfig,
pub compute_budget_config: ComputeBudgetConfig,
pub actions_timeout: Duration,
}

impl ChainConfig {
Expand All @@ -15,6 +20,7 @@ impl ChainConfig {
rpc_uri: "https://api.devnet.solana.com".to_string(),
commitment: CommitmentConfig::confirmed(),
compute_budget_config,
actions_timeout: DEFAULT_ACTIONS_TIMEOUT,
}
}

Expand All @@ -23,6 +29,7 @@ impl ChainConfig {
rpc_uri: "https://api.mainnet-beta.solana.com".to_string(),
commitment: CommitmentConfig::confirmed(),
compute_budget_config,
actions_timeout: DEFAULT_ACTIONS_TIMEOUT,
}
}

Expand All @@ -31,6 +38,7 @@ impl ChainConfig {
rpc_uri: "http://localhost:7799".to_string(),
commitment: CommitmentConfig::processed(),
compute_budget_config,
actions_timeout: DEFAULT_ACTIONS_TIMEOUT,
}
}
}
Expand Down
18 changes: 12 additions & 6 deletions magicblock-committor-service/src/intent_execution_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod intent_scheduler;
use std::sync::Arc;

pub use intent_execution_engine::BroadcastedIntentExecutionResult;
use magicblock_core::traits::ActionsCallbackScheduler;
use magicblock_program::magic_scheduled_base_intent::ScheduledIntentBundle;
use magicblock_rpc_client::MagicblockRpcClient;
use magicblock_table_mania::TableMania;
Expand All @@ -16,11 +17,10 @@ use crate::{
intent_execution_engine::{IntentExecutionEngine, ResultSubscriber},
},
intent_executor::{
intent_executor_factory::IntentExecutorFactoryImpl,
intent_executor_factory::{ExecutorConfig, IntentExecutorFactoryImpl},
task_info_fetcher::{CacheTaskInfoFetcher, RpcTaskInfoFetcher},
},
persist::IntentPersister,
ComputeBudgetConfig,
};

pub struct IntentExecutionManager<D: DB> {
Expand All @@ -30,21 +30,27 @@ pub struct IntentExecutionManager<D: DB> {
}

impl<D: DB> IntentExecutionManager<D> {
pub fn new<P: IntentPersister>(
pub fn new<P, A>(
rpc_client: MagicblockRpcClient,
db: D,
task_info_fetcher: Arc<CacheTaskInfoFetcher<RpcTaskInfoFetcher>>,
intent_persister: Option<P>,
table_mania: TableMania,
compute_budget_config: ComputeBudgetConfig,
) -> Self {
executor_config: ExecutorConfig,
actions_callback_executor: A,
) -> Self
where
A: ActionsCallbackScheduler,
P: IntentPersister,
{
let db = Arc::new(db);

let executor_factory = IntentExecutorFactoryImpl {
rpc_client,
table_mania,
compute_budget_config,
executor_config,
task_info_fetcher,
actions_callback_executor,
};

let (sender, receiver) = mpsc::channel(1000);
Expand Down
Loading
Loading