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
188 changes: 5 additions & 183 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ magicblock-tui-client = { path = "./tools/magicblock-tui-client" }
magicblock-validator-admin = { path = "./magicblock-validator-admin" }
magicblock-version = { path = "./magicblock-version" }

machineid-rs = "1.2"

num-derive = "0.4"
num-format = "0.4.4"
num-traits = "0.2"
Expand Down
18 changes: 12 additions & 6 deletions magicblock-account-cloner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use magicblock_chainlink::{
};
use magicblock_core::link::transactions::{
with_encoded, SanitizeableTransaction, TransactionSchedulerHandle,
WithEncoded,
};
use magicblock_ledger::LatestBlock;
use magicblock_magic_program_api::{
Expand Down Expand Up @@ -124,7 +125,7 @@ impl ChainlinkCloner {

async fn send_sanitized_tx(
&self,
tx: SanitizedTransaction,
tx: WithEncoded<SanitizedTransaction>,
) -> ClonerResult<()> {
self.tx_scheduler.execute(tx).await?;
Ok(())
Expand Down Expand Up @@ -562,12 +563,12 @@ impl ChainlinkCloner {

async fn send_actions_tx(
&self,
actions_tx: Option<SanitizedTransaction>,
actions_tx: Option<WithEncoded<SanitizedTransaction>>,
) -> ClonerResult<Option<()>> {
let Some(sanitized_tx) = actions_tx else {
return Ok(None);
};
let action_tx_sig = *sanitized_tx.signature();
let action_tx_sig = *sanitized_tx.txn.signature();
{
let mut sent = self.lock_sent_action_txs();
if sent.contains(&action_tx_sig) {
Expand Down Expand Up @@ -597,7 +598,7 @@ impl ChainlinkCloner {
&self,
actions: &DelegationActions,
recent_blockhash: Hash,
) -> ClonerResult<Option<SanitizedTransaction>> {
) -> ClonerResult<Option<WithEncoded<SanitizedTransaction>>> {
if actions.is_empty() {
return Ok(None);
}
Expand All @@ -607,7 +608,12 @@ impl ChainlinkCloner {
Some(&validator_authority_id()),
);
tx.partial_sign(&[&validator_authority()], recent_blockhash);
Ok(Some(tx.sanitize(false)?))
let tx = with_encoded(tx)?;
let tx = WithEncoded {
encoded: tx.encoded,
txn: tx.txn.sanitize(false)?,
};
Ok(Some(tx))
}
}

Expand All @@ -632,7 +638,7 @@ impl Cloner for ChainlinkCloner {
let data_len = request.account.data().len();
let actions_tx =
self.create_actions_tx(&request.delegation_actions, blockhash)?;
let actions_tx_sig = actions_tx.as_ref().map(|tx| *tx.signature());
let actions_tx_sig = actions_tx.as_ref().map(|tx| *tx.txn.signature());

// Small account: single tx
if data_len <= MAX_INLINE_DATA_SIZE {
Expand Down
Loading
Loading