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

Fix lamport calculation and transfer for loader-v4 program upgrade #33279

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Sep 16, 2023

Problem

The upgrade/redeployment using temporary buffer fails for loader-v4 programs when the new program is larger than the current program.

Summary of Changes

As part of program upgrade, the loader transfers necessary lamports from the temporary buffer account to the program account. The calculation of the required lamports, and transferred lamports is incorrect. That resulted into transfer of 0 lamports the the program account resulting in underflow of account balance.

Fixes #

@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Merging #33279 (d3a1d86) into master (6283c1d) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           master   #33279     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         790      790             
  Lines      214273   214273             
=========================================
- Hits       175661   175625     -36     
- Misses      38612    38648     +36     

@pgarg66 pgarg66 marked this pull request as ready for review September 16, 2023 17:12
@pgarg66 pgarg66 merged commit 6db57f8 into solana-labs:master Sep 16, 2023
32 checks passed
@pgarg66 pgarg66 deleted the loader-v4-source-lamports branch September 16, 2023 20:12
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.

None yet

2 participants