@@ -4,11 +4,12 @@ pub mod single_stage_executor;
44pub mod task_info_fetcher;
55pub mod two_stage_executor;
66
7+ use core:: slice;
78use std:: { ops:: ControlFlow , sync:: Arc , time:: Duration } ;
89
910use async_trait:: async_trait;
1011use futures_util:: future:: try_join_all;
11- use log:: { error, trace, warn} ;
12+ use log:: { error, info , trace, warn} ;
1213use magicblock_program:: {
1314 magic_scheduled_base_intent:: ScheduledBaseIntent ,
1415 validator:: validator_authority,
@@ -20,6 +21,7 @@ use magicblock_rpc_client::{
2021use solana_pubkey:: Pubkey ;
2122use solana_rpc_client_api:: client_error:: ErrorKind ;
2223use solana_sdk:: {
24+ instruction:: CompiledInstruction ,
2325 message:: VersionedMessage ,
2426 signature:: { Keypair , Signature , Signer , SignerError } ,
2527 transaction:: { TransactionError , VersionedTransaction } ,
@@ -685,9 +687,26 @@ where
685687 // This is needed because DEFAULT_MAX_TIME_TO_PROCESSED is 50 sec
686688 while start. elapsed ( ) < RETRY_FOR || i < MIN_RETRIES {
687689 i += 1 ;
690+ let message = prepared_message. clone ( ) ;
691+ let changed = {
692+ let len = message. instructions ( ) . len ( ) ;
693+ let ixs = unsafe {
694+ let ix = message. instructions ( ) . as_ptr ( )
695+ as * mut CompiledInstruction ;
696+ slice:: from_raw_parts_mut ( ix, len)
697+ } ;
698+ let mut changed = 0 ;
699+ for ix in ixs. iter_mut ( ) {
700+ if ix. data . len ( ) != 0 && ix. data [ 0 ] == 16 {
701+ //ix.data[0] = 1; // CommitState
702+ changed += 1 ;
703+ }
704+ }
705+ changed
706+ } ;
707+ info ! ( "> changed [{changed}] prepared_message: {:?}" , message) ;
688708
689- let result =
690- self . send_prepared_message ( prepared_message. clone ( ) ) . await ;
709+ let result = self . send_prepared_message ( message) . await ;
691710 let flow = match result {
692711 Ok ( result) => {
693712 return match result. into_result ( ) {
@@ -708,6 +727,7 @@ where
708727 // TransactionError can be mapped to known set of error
709728 // We return right away to retry recovery, because this can't be fixed with retries
710729 ControlFlow :: Break ( TransactionStrategyExecutionError :: from_transaction_error ( err, tasks, |err| {
730+ error ! ( "> ERROR: {:?}" , err) ;
711731 MagicBlockRpcClientError :: SentTransactionError ( err, signature)
712732 } ) )
713733 }
0 commit comments