I'm basically trying to work out if there's any limit to inner instructions that would limit how much I can rely on them for understanding a transaction. I understand from the docs that a list of them can be returned for each transaction instruction.
So if I have a transaction that calls into program A at instruction index 0, and that program makes 2 CPI calls, there'd be two inner instructions.
Does this work recursively too? If I have programs A, B and C, and they call each other:
A --CPI to-> B --CPI to-> C --CPI to-> token program transfer instruction
Then if I call A in a transaction at index 0, will I get something like this?:
{
index: 0,
instructions: [
{
programIdIndex: // the one for B,
accounts: //,
data: //
},
{
programIdIndex: // the one for C,
accounts: //,
data: //
},
{
programIdIndex: // the one for token program,
accounts: // token transfer accounts
data: // token transfer data
},
]
Assuming this does work, are there any limitations to this recursion, other than the existing limits of transaction size? Given there's no re-entrancy, are we able to always unroll inner instructions fully?
innerInstructions