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

v1.18: Fix: deploy program on last slot of epoch during environment change (backport of #101) #387

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Mar 22, 2024

Problem

On runtime environment change, the program deployed in the last slot of the prior epoch will use incorrect environment. This will also prevent the loading of the program in future epochs with the correct runtime environment.

Summary of Changes

The problem happens because the effective slot for the deployed program is in the next epoch, where the new environment becomes effective.
This change updates the program deployment procedure, to use the environment of the epoch where the program actually becomes effective.

Fixes #


This is an automatic backport of pull request #101 done by [Mergify](https://mergify.com).

@mergify mergify bot added the conflicts label Mar 22, 2024
Copy link
Author

mergify bot commented Mar 22, 2024

Cherry-pick of 91b1ee3 has failed:

On branch mergify/bp/v1.18/pr-101
Your branch is up to date with 'origin/v1.18'.

You are currently cherry-picking commit 91b1ee3df6.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   program-runtime/src/invoke_context.rs
	modified:   program-runtime/src/loaded_programs.rs
	modified:   programs/bpf_loader/src/lib.rs
	modified:   programs/bpf_loader/src/syscalls/mod.rs
	modified:   programs/loader-v4/src/lib.rs
	modified:   runtime/src/bank.rs

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   ledger-tool/src/program.rs
	both modified:   runtime/src/bank/tests.rs
	deleted by us:   svm/src/transaction_processor.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

…101)

* Fix: deploy program on last slot of epoch during environment change

* solana-runtime: deploy at last epoch slot test

* disable deployment of sol_alloc_free

* Move tx-batch-constructor to its own function

* use new_from_cache

---------

Co-authored-by: Alessandro Decina <[email protected]>
(cherry picked from commit 91b1ee3)
@pgarg66 pgarg66 requested a review from willhickey March 22, 2024 15:56
@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 89.83957% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 81.6%. Comparing base (f0cd4e5) to head (9012ccd).

Additional details and impacted files
@@           Coverage Diff            @@
##            v1.18     #387    +/-   ##
========================================
  Coverage    81.5%    81.6%            
========================================
  Files         827      827            
  Lines      224453   224590   +137     
========================================
+ Hits       183132   183292   +160     
+ Misses      41321    41298    -23     

Copy link

@willhickey willhickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for backport to beta

@pgarg66 pgarg66 merged commit 85f6c36 into v1.18 Mar 22, 2024
36 checks passed
@pgarg66 pgarg66 deleted the mergify/bp/v1.18/pr-101 branch March 22, 2024 20:38
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
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.

4 participants