Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Refactor: Make program_id always last in program chain#20598

Merged
Lichtso merged 3 commits intosolana-labs:masterfrom
Lichtso:refactor/make_program_id_always_end_of_program_chain
Oct 13, 2021
Merged

Refactor: Make program_id always last in program chain#20598
Lichtso merged 3 commits intosolana-labs:masterfrom
Lichtso:refactor/make_program_id_always_end_of_program_chain

Conversation

@Lichtso
Copy link
Copy Markdown
Contributor

@Lichtso Lichtso commented Oct 11, 2021

Problem

Currently we need to keep track of program_id in the InvokeContextStackFrame because it can either be the last or second last account in the program account chain (depending on the presence of a programdata account).

Summary of Changes

By swapping program account and programdata account in the program account chain we can omit storing the index of program_id as it is implicitly always the last one in the program account chain.

Fixes #

@Lichtso Lichtso force-pushed the refactor/make_program_id_always_end_of_program_chain branch from cfa4e70 to 2167377 Compare October 12, 2021 18:15
@Lichtso Lichtso force-pushed the refactor/make_program_id_always_end_of_program_chain branch from 2167377 to ffc6719 Compare October 12, 2021 18:39
@Lichtso Lichtso requested a review from jackcmay October 12, 2021 21:02
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 12, 2021

Codecov Report

Merging #20598 (ffc6719) into master (06cad19) will decrease coverage by 0.0%.
The diff coverage is 80.8%.

@@            Coverage Diff            @@
##           master   #20598     +/-   ##
=========================================
- Coverage    82.0%    82.0%   -0.1%     
=========================================
  Files         494      494             
  Lines      137601   137598      -3     
=========================================
- Hits       112867   112833     -34     
- Misses      24734    24765     +31     

@Lichtso Lichtso merged commit 1d813ea into solana-labs:master Oct 13, 2021
@Lichtso Lichtso deleted the refactor/make_program_id_always_end_of_program_chain branch October 13, 2021 06:58
jeffwashington added a commit to jeffwashington/solana that referenced this pull request Oct 13, 2021
Lichtso added a commit to Lichtso/solana that referenced this pull request Oct 13, 2021
Lichtso added a commit to Lichtso/solana that referenced this pull request Oct 13, 2021
@Lichtso Lichtso mentioned this pull request Oct 13, 2021
CriesofCarrots pushed a commit to CriesofCarrots/solana that referenced this pull request Oct 13, 2021
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Oct 13, 2021
Lichtso added a commit that referenced this pull request Oct 14, 2021
* Makes argument / parameter interfaces more clear.

* Fixes the bug in #20598
jeffwashington added a commit to jeffwashington/solana that referenced this pull request Oct 15, 2021
jeffwashington added a commit to jeffwashington/solana that referenced this pull request Oct 15, 2021
jeffwashington added a commit to jeffwashington/solana that referenced this pull request Oct 15, 2021
@Lichtso Lichtso mentioned this pull request Nov 9, 2021
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
…0598)

* Replaces program_id field in InvokeContextStackFrame by index.

* Swaps order of program account and programdata account.

* Removes program_id parameter from InvokeContext::push().
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
* Makes argument / parameter interfaces more clear.

* Fixes the bug in solana-labs#20598
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants