-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Reverify programs that are extended using ExtendProgram #31886
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31886 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 752 753 +1
Lines 206799 206885 +86
=========================================
+ Hits 169480 169501 +21
- Misses 37319 37384 +65 |
Maybe we should actually perform the verification / compilation inside the instruction (like we do for upgrades) so that it can fail the TX if the verification fails. |
(cherry picked from commit 449f92e)
Note that since this change now updates the program data clock slot, it's no longer possible to extend and update a program in the same slot (or transaction for that matter). I don't think it's a great dev experience that two separate transactions will need to be created for program upgrades but the extend program instruction is still an improvement over the current dev experience so I think it's ok for now. |
invoke_context, | ||
program_key, | ||
&program_id, | ||
UpgradeableLoaderState::size_of_program().saturating_add(new_len), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think new_len
should already be the full account size, why is size_of_program
added here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right, this is a bug, probably copy pasta.
A fix should be backported before the feature is activated.
@pgarg66 Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking it back, this is correct behavior (consistent with v1.14). This is the sum of the proxy account plus the data account. The value is used in transaction loading for the TX wide loading limit and both accounts contribute to that.
Problem
The programs extended via
ExtendProgram
instruction need re-verification, as the updated program may return different verification result than the original program.Summary of Changes
Fixes #