Fix get_current_instruction_index#10387
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10387 +/- ##
=======================================
Coverage 83.2% 83.2%
=======================================
Files 845 845
Lines 319794 319855 +61
=======================================
+ Hits 266266 266350 +84
+ Misses 53528 53505 -23 🚀 New features to boost your workflow:
|
buffalojoec
left a comment
There was a problem hiding this comment.
Can you please add an explicit unit test that asserts get_current_instruction_index returns the correct trace index, especially for CPI scenarios where nesting_level != index_in_trace?
It's kinda covered by some existing tests, but something more direct and exhaustive would add some confidence here.
|
Given that there is exactly one non-dead-code use of this function, why keep it at all? |
|
Added a unit test in e2831b9. |
Thanks!! |
Problem
The function
get_current_instruction_indexwas incorrectly implemented, returning the depth of the current executing instruction, not its index in trace. The issue was introduced in #9714.Although
get_current_instruction_contextdepended on it, the former was correctly using its results.The other usage is in
agave/program-runtime/src/invoke_context.rs
Line 433 in 01159e4
Summary of Changes
Implement the function correctly.