-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability for programs to check the processed instruction stack #22437
Comments
I think we may need this in v1.9 timeframe. Will that be possible? |
I think we can make that happen |
"processed instruction stack" is ambiguous, do you mean (in terms of flamegraph diagram axes):
The former is only used by the bank and the later will be exposed in ABIv2 per default (no syscall necessary). |
An ordered list of all the instructions that have been processed before the current one (including CPI) is my understanding. And the target is v1.9 |
So a mixture of the two. The thing is, the frames below the current one in the CPI stack are not finished / processed yet. They are just suspended and waiting for the upper ones to finish. Thus, these are two separate concepts that can not be mixed (at least not directly). Also the order of mixing a sequence and a stack will be messed up, because a lower frame would come before the current one in the CPI stack but after the current one in the recorded sequence. |
The immediate need is to discover the previous sibling CPI instruction. Use case:
|
I think for our current purposes, just the sequence of recorded instructions would be sufficient, assuming it works within an instruction on the CPIs called at that level. |
Yeah, that's my understanding, what about non-cpi sibling instructions. For example, given the call flow:
You want D to see C and A, but not B? |
I think D seeing C and A would be the most generically useful. But for our purposes, it would work if D only saw C. |
And at the end B would see D and C? |
Yes? Again, not strictly necessary for our purposes, but seems like it could be generically useful. |
This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs. |
Note that this feature will not work as expected on testnet and devnet if a transaction contains precompile instructions until the following issue is resolved: #24705 |
Problem
There are certain scenarios where instructions (top-level or via CPI) would like to know what the last instruction processed was. Some examples are verification of assert instructions or to check memo instructions
Proposed Solution
Make at least the last executed instruction available to programs. With the option of expanding to to a list of all past processed instructions in the tx. There has already been work done in this general direction so hopefully, this will not be very disruptive.
The text was updated successfully, but these errors were encountered: