Skip to content

Commit ab51f90

Browse files
committed
add new tests
1 parent e496457 commit ab51f90

File tree

14 files changed

+258
-28
lines changed

14 files changed

+258
-28
lines changed

Cargo.lock

Lines changed: 2 additions & 3 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ magicblock-committor-program = { path = "./magicblock-committor-program", featur
9595
magicblock-committor-service = { path = "./magicblock-committor-service" }
9696
magicblock-config = { path = "./magicblock-config" }
9797
magicblock-core = { path = "./magicblock-core" }
98-
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "e8d03936", features = [
98+
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "3edb41022" , features = [
9999
"no-entrypoint",
100100
] }
101-
magicblock-geyser-plugin = { path = "./magicblock-geyser-plugin" }
102101
magicblock-ledger = { path = "./magicblock-ledger" }
103102
magicblock-magic-program-api = { path = "./magicblock-magic-program-api" }
104103
magicblock-metrics = { path = "./magicblock-metrics" }

magicblock-committor-service/src/tasks/args_task.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ impl BaseTask for ArgsTask {
7676
allow_undelegation: value.allow_undelegation,
7777
};
7878

79+
log::info!(
80+
"DIFF SIZE: {} / {}",
81+
args.diff.len(),
82+
value.base_account.data.len()
83+
);
84+
7985
dlp::instruction_builder::commit_diff(
8086
*validator,
8187
value.committed_account.pubkey,

magicblock-committor-service/src/tasks/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub struct CommitTask {
108108
pub committed_account: CommittedAccount,
109109
}
110110

111-
#[derive(Clone)]
111+
#[derive(Clone, Debug)]
112112
pub struct CommitDiffTask {
113113
pub commit_id: u64,
114114
pub allow_undelegation: bool,

magicblock-committor-service/src/tasks/task_builder.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ impl TaskBuilderImpl {
5757
account: CommittedAccount,
5858
task_info_fetcher: &Arc<C>,
5959
) -> ArgsTask {
60+
log::warn!("create_commit_task entered");
61+
6062
let base_account = if account.account.data.len()
6163
> COMMIT_STATE_SIZE_THRESHOLD
6264
{
@@ -78,13 +80,19 @@ impl TaskBuilderImpl {
7880
};
7981

8082
if let Some(base_account) = base_account {
83+
log::warn!(
84+
"create_commit_task: base_account: {:#?}, {:#?}",
85+
base_account,
86+
account.account
87+
);
8188
ArgsTaskType::CommitDiff(CommitDiffTask {
8289
commit_id,
8390
allow_undelegation,
8491
committed_account: account,
8592
base_account,
8693
})
8794
} else {
95+
log::warn!("create_commit_task: {:#?}", account.account);
8896
ArgsTaskType::Commit(CommitTask {
8997
commit_id,
9098
allow_undelegation,

magicblock-committor-service/src/tasks/task_strategist.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ impl TaskStrategist {
289289

290290
// Get initial transaction size
291291
let mut current_tx_length = calculate_tx_length(tasks)?;
292+
log::info!(
293+
"optimze initial size: {} / limit {}",
294+
current_tx_length,
295+
MAX_ENCODED_TRANSACTION_SIZE
296+
);
297+
292298
if current_tx_length <= MAX_ENCODED_TRANSACTION_SIZE {
293299
return Ok(current_tx_length);
294300
}
@@ -340,6 +346,11 @@ impl TaskStrategist {
340346
let new_ix_size =
341347
usize::try_from(new_ix_size).unwrap_or(usize::MAX);
342348
current_tx_length = calculate_tx_length(tasks)?;
349+
log::info!(
350+
"optimze updated size: {} / limit {}",
351+
current_tx_length,
352+
MAX_ENCODED_TRANSACTION_SIZE
353+
);
343354
map.push((new_ix_size, index));
344355
}
345356
// That means el-t can't be optimized further

test-integration/Cargo.lock

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

test-integration/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ magicblock-config = { path = "../magicblock-config" }
5757
magicblock-core = { path = "../magicblock-core" }
5858
magic-domain-program = { git = "https://github.com/magicblock-labs/magic-domain-program.git", rev = "ea04d46", default-features = false }
5959
magicblock_magic_program_api = { package = "magicblock-magic-program-api", path = "../magicblock-magic-program-api" }
60-
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "e8d03936", features = [
60+
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "3edb41022" , features = [
6161
"no-entrypoint",
6262
] }
6363
magicblock-program = { path = "../programs/magicblock" }

test-integration/programs/schedulecommit/src/api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ pub fn delegate_account_cpi_instruction(
110110
);
111111

112112
let delegate_accounts = DelegateAccounts::new(pda, program_id);
113+
println!("delegate_accounts: {:#?}", delegate_accounts);
114+
println!(
115+
"config: {:#?}",
116+
dlp::pda::program_config_from_program_id(&crate::ID)
117+
);
118+
113119
let delegate_metas = DelegateAccountMetas::from(delegate_accounts);
114120
let account_metas = vec![
115121
AccountMeta::new(payer, true),
864 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)