Skip to content
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

Refactor: Merge MessageProcessor into InvokeContext #20165

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented Sep 24, 2021

Problem

MessageProcessor has no real purpose anymore as most of its functionality has been moved to InstructionProcessor and InvokeContext. Currently, it is redirecting dozens of parameters over multiple function calls without doing much. By removing it we can use InvokeContext transaction wide instead of creating one per instruction. This way the InvokeContext can become the runtime wrapper around the TransactionContext of ABIv2 (#19191).

Summary of Changes

Moves all instance properties and methods (except for process_message) out of MessageProcessor.

Fixes #

@Lichtso Lichtso added the CI Pull Request is ready to enter CI label Sep 24, 2021
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Sep 24, 2021
@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #20165 (da3c630) into master (3aba89d) will increase coverage by 0.0%.
The diff coverage is 91.3%.

@@           Coverage Diff           @@
##           master   #20165   +/-   ##
=======================================
  Coverage    82.7%    82.8%           
=======================================
  Files         487      487           
  Lines      135326   135315   -11     
=======================================
+ Hits       112036   112049   +13     
+ Misses      23290    23266   -24     

@Lichtso Lichtso merged commit df6905c into solana-labs:master Sep 27, 2021
@Lichtso Lichtso deleted the refactor/merge_message_processor_into_invoke_context branch September 27, 2021 06:28
jackcmay added a commit to jackcmay/solana that referenced this pull request Sep 28, 2021
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Sep 28, 2021
@Lichtso Lichtso restored the refactor/merge_message_processor_into_invoke_context branch September 29, 2021 07:29
@Lichtso Lichtso deleted the refactor/merge_message_processor_into_invoke_context branch September 29, 2021 11:43
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
* Inlines MessageProcessor::execute_instruction() in MessageProcessor::process_message().

* Moves MessageProcessor::create_pre_accounts() into ThisInvokeContext::push().

* Hoists ThisInvokeContext::new() out of loop inside MessageProcessor::process_message().

* Moves MessageProcessor::verify_account_references() and MessageProcessor::verify() into InvokeContext::verify().
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants