This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Restore ability for programs to upgrade themselves #20265
Merged
CriesofCarrots
merged 4 commits into
solana-labs:master
from
CriesofCarrots:upgrade-self
Sep 28, 2021
Merged
Restore ability for programs to upgrade themselves #20265
CriesofCarrots
merged 4 commits into
solana-labs:master
from
CriesofCarrots:upgrade-self
Sep 28, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CriesofCarrots
commented
Sep 27, 2021
720da24
to
6ba19bd
Compare
6ba19bd
to
7448cee
Compare
jackcmay
reviewed
Sep 27, 2021
/// Inspect all message keys for the bpf upgradeable loader | ||
pub fn is_upgradeable_loader_present(&self) -> bool { | ||
match self { | ||
Self::Legacy(message) => message.is_upgradeable_loader_present(), |
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.
Side note, but @jstarry this might be clearer if the messages implemented a trait containing is_upgradeable_loader_present
?
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.
Sure, sounds good to me
jackcmay
previously approved these changes
Sep 27, 2021
jstarry
reviewed
Sep 28, 2021
…r is present; restore bpf upgrade-self test
7448cee
to
935f3f5
Compare
Pull request has been modified.
935f3f5
to
46957bc
Compare
Codecov Report
@@ Coverage Diff @@
## master #20265 +/- ##
=========================================
+ Coverage 82.6% 82.8% +0.1%
=========================================
Files 522 487 -35
Lines 137655 135606 -2049
Branches 293 0 -293
=========================================
- Hits 113755 112304 -1451
+ Misses 23800 23302 -498
+ Partials 100 0 -100 |
mergify bot
pushed a commit
that referenced
this pull request
Sep 28, 2021
* Make helper associated fn * Add feature definition * Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test * Use single feature (cherry picked from commit 2cd9dc9) # Conflicts: # runtime/src/accounts.rs # sdk/program/src/message.rs # sdk/program/src/message/mapped.rs # sdk/program/src/message/sanitized.rs # sdk/src/feature_set.rs
mergify bot
added a commit
that referenced
this pull request
Sep 29, 2021
…20295) * Restore ability for programs to upgrade themselves (#20265) * Make helper associated fn * Add feature definition * Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test * Use single feature (cherry picked from commit 2cd9dc9) # Conflicts: # runtime/src/accounts.rs # sdk/program/src/message.rs # sdk/program/src/message/mapped.rs # sdk/program/src/message/sanitized.rs # sdk/src/feature_set.rs * Fix conflicts Co-authored-by: Tyera Eulberg <[email protected]> Co-authored-by: Tyera Eulberg <[email protected]>
dankelleher
pushed a commit
to identity-com/solana
that referenced
this pull request
Nov 24, 2021
* Make helper associated fn * Add feature definition * Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test * Use single feature
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
#20263 for master
In preventing inappropriate program write locks (#19637 + #19877 ), we assumed that programs would not need to upgrade themselves (ie. the program-id of a transaction is never writable). However, various governance programs depend on this ability, using their own governance mechanism for program upgrades.
Summary of Changes
Restore program-id write lock when the upgradeable loader id is present in the transaction; feature gate and require both
restore_write_lock_when_upgradeable
anddemote_program_write_locks
features for new functionality.v1.6 vs v1.7/master compatibility will be restored when #20263 is released and these two features are activated on MNB