This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Refactor InvokeContext::process_instruction()#21671
Merged
Lichtso merged 1 commit intosolana-labs:masterfrom Dec 7, 2021
Merged
Refactor InvokeContext::process_instruction()#21671Lichtso merged 1 commit intosolana-labs:masterfrom
InvokeContext::process_instruction()#21671Lichtso merged 1 commit intosolana-labs:masterfrom
Conversation
998bf80 to
e8e9c7c
Compare
… instructions in process_message. - Lets InvokeContext::process_cross_program_instruction() handle the first invocation depth too. - Marks InvokeContext::verify(), InvokeContext::verify_and_update() and InvokeContext::process_executable_chain() private. - Renames InvokeContext::process_cross_program_instruction() to InvokeContext::process_instruction(). - Removes InvokeContext::new_mock_with_sysvars().
e8e9c7c to
2489b09
Compare
Codecov Report
@@ Coverage Diff @@
## master #21671 +/- ##
=========================================
- Coverage 81.6% 81.6% -0.1%
=========================================
Files 511 511
Lines 143128 143127 -1
=========================================
- Hits 116897 116866 -31
- Misses 26231 26261 +30 |
mergify Bot
pushed a commit
that referenced
this pull request
Dec 8, 2021
… instructions in process_message. (#21671) - Lets InvokeContext::process_cross_program_instruction() handle the first invocation depth too. - Marks InvokeContext::verify(), InvokeContext::verify_and_update() and InvokeContext::process_executable_chain() private. - Renames InvokeContext::process_cross_program_instruction() to InvokeContext::process_instruction(). - Removes InvokeContext::new_mock_with_sysvars(). (cherry picked from commit 1df8883)
mergify Bot
added a commit
that referenced
this pull request
Dec 8, 2021
… instructions in process_message. (#21671) (#21684) - Lets InvokeContext::process_cross_program_instruction() handle the first invocation depth too. - Marks InvokeContext::verify(), InvokeContext::verify_and_update() and InvokeContext::process_executable_chain() private. - Renames InvokeContext::process_cross_program_instruction() to InvokeContext::process_instruction(). - Removes InvokeContext::new_mock_with_sysvars(). (cherry picked from commit 1df8883) Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The first level of program invocation is handled at
process_message()while the higher levels (CPI andnative_invoke) are handled inInvokeContext. The code duplication is prone to errors (such as the handling ofreturn_databeing left out) and should be unified.Summary of Changes
invoke_context.return_datanot being reset between instructions inprocess_message().InvokeContext::process_cross_program_instruction()handle the first invocation depth too.InvokeContext::process_instruction()toInvokeContext::process_executable_chain().InvokeContext::process_cross_program_instruction()toInvokeContext::process_instruction().InvokeContext::verify(),InvokeContext::verify_and_update()andInvokeContext::process_executable_chain()private.InvokeContext::new_mock_with_sysvars().Fixes #