File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
magicblock-committor-service/src/intent_executor
test-integration/schedulecommit/elfs Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,9 @@ impl From<MagicBlockRpcClientError> for TransactionStrategyExecutionError {
156156}
157157
158158impl TransactionStrategyExecutionError {
159- // There's always 2 budget instructions in front
160- const OFFSET : u8 = 2 ;
159+ /// Number of compute budget instructions prepended to every transaction.
160+ /// Used to map instruction indices back to task indices.
161+ const TASK_OFFSET : u8 = 2 ;
161162
162163 pub fn is_cpi_limit_error ( & self ) -> bool {
163164 matches ! ( self , Self :: CpiLimitError ( _, _) )
@@ -184,7 +185,7 @@ impl TransactionStrategyExecutionError {
184185 | Self :: CpiLimitError (
185186 TransactionError :: InstructionError ( index, _) ,
186187 _,
187- ) => index. checked_sub ( Self :: OFFSET ) ,
188+ ) => index. checked_sub ( Self :: TASK_OFFSET ) ,
188189 _ => None ,
189190 }
190191 }
@@ -235,7 +236,7 @@ impl TransactionStrategyExecutionError {
235236 let tx_err_helper = |instruction_err| -> TransactionError {
236237 TransactionError :: InstructionError ( index, instruction_err)
237238 } ;
238- let Some ( action_index) = index. checked_sub ( Self :: OFFSET ) else {
239+ let Some ( action_index) = index. checked_sub ( Self :: TASK_OFFSET ) else {
239240 return Err ( tx_err_helper ( instruction_err) ) ;
240241 } ;
241242
You can’t perform that action at this time.
0 commit comments