Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 16 additions & 49 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ magicblock-committor-program = { path = "./magicblock-committor-program", featur
magicblock-committor-service = { path = "./magicblock-committor-service" }
magicblock-config = { path = "./magicblock-config" }
magicblock-core = { path = "./magicblock-core" }
dlp-api = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "293e9222", package = "magicblock-delegation-program-api" }
magicblock-delegation-program-api = { version = "0.2.0" }
magicblock-ledger = { path = "./magicblock-ledger" }
magicblock-magic-program-api = { path = "./magicblock-magic-program-api" }
magicblock-metrics = { path = "./magicblock-metrics" }
Expand Down
2 changes: 1 addition & 1 deletion magicblock-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fd-lock = { workspace = true }
tracing = { workspace = true }

magic-domain-program = { workspace = true }
dlp-api = { workspace = true }
magicblock-delegation-program-api = { workspace = true }
magicblock-account-cloner = { workspace = true }
magicblock-accounts = { workspace = true }
magicblock-accounts-db = { workspace = true }
Expand Down
5 changes: 2 additions & 3 deletions magicblock-api/src/magic_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
time::{Duration, Instant},
};

use dlp_api::dlp;
use magicblock_account_cloner::{
map_committor_request_result, ChainlinkCloner,
};
Expand Down Expand Up @@ -671,9 +670,9 @@ impl MagicValidator {
let validator_keypair = validator_authority();
let validator_pubkey = validator_keypair.pubkey();
let vault_pubkey =
dlp::pda::magic_fee_vault_pda_from_validator(&validator_pubkey);
dlp_api::pda::magic_fee_vault_pda_from_validator(&validator_pubkey);
let delegation_record_pubkey =
dlp::pda::delegation_record_pda_from_delegated_account(
dlp_api::pda::delegation_record_pda_from_delegated_account(
&vault_pubkey,
);

Expand Down
2 changes: 1 addition & 1 deletion magicblock-chainlink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ magicblock-core = { workspace = true }
parking_lot = { workspace = true }
magicblock-magic-program-api = { workspace = true }
magicblock-metrics = { workspace = true }
dlp-api = { workspace = true }
magicblock-delegation-program-api = { workspace = true }
solana-account = { workspace = true }
solana-account-decoder = { workspace = true }
solana-account-decoder-client-types = { workspace = true }
Expand Down
3 changes: 1 addition & 2 deletions magicblock-chainlink/src/accounts_bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ pub mod mock {
// NOTE: that the validator will also have to set flip the delegated flag like
// we do here.
// See programs/magicblock/src/schedule_transactions/process_schedule_commit.rs :172
self.set_owner(pubkey, dlp_api::dlp::id())
.undelegate(pubkey);
self.set_owner(pubkey, dlp_api::id()).undelegate(pubkey);
}

pub fn set_undelegating(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dlp_api::dlp::state::DelegationRecord;
use dlp_api::state::DelegationRecord;
use solana_pubkey::Pubkey;
use tracing::*;

Expand Down Expand Up @@ -83,7 +83,7 @@ pub(crate) fn account_still_undelegating_on_chain(

#[cfg(test)]
mod tests {
use dlp_api::dlp::state::DelegationRecord;
use dlp_api::state::DelegationRecord;
use solana_pubkey::Pubkey;

use super::*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashSet;

use dlp_api::dlp::state::DelegationRecord;
use dlp_api::state::DelegationRecord;
use futures_util::future::join_all;
use magicblock_accounts_db::traits::AccountsBank;
use magicblock_core::token_programs::try_derive_eata_address_and_bump;
Expand Down
18 changes: 7 additions & 11 deletions magicblock-chainlink/src/chainlink/fetch_cloner/delegation.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use dlp_api::{
decrypt::Decrypt,
dlp::{
args::PostDelegationActions,
pda::delegation_record_pda_from_delegated_account,
state::DelegationRecord,
},
args::PostDelegationActions, decrypt::Decrypt,
pda::delegation_record_pda_from_delegated_account, state::DelegationRecord,
};
use magicblock_accounts_db::traits::AccountsBank;
use magicblock_core::token_programs::{derive_eata, EATA_PROGRAM_ID};
Expand Down Expand Up @@ -237,7 +233,7 @@ where

#[cfg(test)]
mod tests {
use dlp_api::dlp::args::{
use dlp_api::args::{
EncryptedBuffer, MaybeEncryptedAccountMeta, MaybeEncryptedInstruction,
MaybeEncryptedIxData, MaybeEncryptedPubkey, PostDelegationActions,
};
Expand Down Expand Up @@ -287,12 +283,12 @@ mod tests {
program_id: 1,
accounts: vec![
MaybeEncryptedAccountMeta::ClearText(
dlp_api::dlp::compact::AccountMeta::new_readonly(
dlp_api::compact::AccountMeta::new_readonly(
0, true,
),
),
MaybeEncryptedAccountMeta::ClearText(
dlp_api::dlp::compact::AccountMeta::new(2, false),
dlp_api::compact::AccountMeta::new(2, false),
),
],
data: MaybeEncryptedIxData {
Expand Down Expand Up @@ -354,12 +350,12 @@ mod tests {
program_id: 2,
accounts: vec![
MaybeEncryptedAccountMeta::ClearText(
dlp_api::dlp::compact::AccountMeta::new_readonly(
dlp_api::compact::AccountMeta::new_readonly(
0, true,
),
),
MaybeEncryptedAccountMeta::ClearText(
dlp_api::dlp::compact::AccountMeta::new(1, false),
dlp_api::compact::AccountMeta::new(1, false),
),
],
data: MaybeEncryptedIxData {
Expand Down
10 changes: 5 additions & 5 deletions magicblock-chainlink/src/chainlink/fetch_cloner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
time::Duration,
};

use dlp_api::dlp::{
use dlp_api::{
pda::delegation_record_pda_from_delegated_account, state::DelegationRecord,
};
use magicblock_accounts_db::traits::AccountsBank;
Expand Down Expand Up @@ -360,7 +360,7 @@ where
) {
return;
}
} else if in_bank.owner().eq(&dlp_api::dlp::id()) {
} else if in_bank.owner().eq(&dlp_api::id()) {
debug!(
pubkey = %pubkey,
"Received update for account owned by delegation program but not marked as undelegating"
Expand Down Expand Up @@ -500,7 +500,7 @@ where
return false;
};

if !account.owner().eq(&dlp_api::dlp::id()) {
if !account.owner().eq(&dlp_api::id()) {
return false;
}

Expand Down Expand Up @@ -1447,7 +1447,7 @@ where
);
return RefreshDecision::Yes;
}
} else if in_bank.owner().eq(&dlp_api::dlp::id()) {
} else if in_bank.owner().eq(&dlp_api::id()) {
debug!(
"Account {pubkey} owned by deleg program not marked as undelegating"
);
Expand Down Expand Up @@ -1502,7 +1502,7 @@ where
if account_in_bank.undelegating() {
undelegating_checks.push((**pubkey, account_in_bank));
} else {
if account_in_bank.owner().eq(&dlp_api::dlp::id()) {
if account_in_bank.owner().eq(&dlp_api::id()) {
debug!(
pubkey = %pubkey,
"Account owned by deleg program not marked as undelegating"
Expand Down
4 changes: 2 additions & 2 deletions magicblock-chainlink/src/chainlink/fetch_cloner/pipeline.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashSet, sync::atomic::Ordering};

use dlp_api::dlp::pda::delegation_record_pda_from_delegated_account;
use dlp_api::pda::delegation_record_pda_from_delegated_account;
use magicblock_accounts_db::traits::AccountsBank;
use magicblock_core::token_programs::is_ata;
use magicblock_metrics::metrics::AccountFetchOrigin;
Expand Down Expand Up @@ -134,7 +134,7 @@ fn classify_single_account(
ResolvedAccount::Fresh(account_shared_data) => {
let slot = account_shared_data.remote_slot();

if account_shared_data.owner().eq(&dlp_api::dlp::id()) {
if account_shared_data.owner().eq(&dlp_api::id()) {
// Account owned by delegation program
owned_by_deleg.push((
pubkey,
Expand Down
Loading
Loading