-
Notifications
You must be signed in to change notification settings - Fork 636
Feature - Write lock demotion exemption for loader-v4 #4575
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
Feature - Write lock demotion exemption for loader-v4 #4575
Conversation
@@ -37,15 +37,19 @@ pub struct LegacyMessage<'a> { | |||
} | |||
|
|||
impl LegacyMessage<'_> { | |||
pub fn new(message: legacy::Message, reserved_account_keys: &HashSet<Pubkey>) -> Self { | |||
pub fn new( |
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.
this crate follows semver so this will probably have to wait until SDK crates are moved to a new repo and given a new release schedule
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.
Won't we have a new version bump before then? Also, we could deprecate the constructor and have a new one with the feature gating for consensus relevant call sites.
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.
haven't heard anything about 3.0 coming soon. I think the SDK repo is the most imminent thing that will enable this
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.
Do we have a rough time line? Otherwise I will look for alternative implementations
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.
@joncinque can comment on timeline
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 we discussed this offline last week, but for public visibility, the sdk will be moved into a new repo with the v2.2 branch cut, likely in the next 7-10 days.
After that point, we can consider making breaking changes to solana-message
or any other crate. We need to choose what to do with solana-program
and solana-sdk
-- my inclination is to bump major versions much less often for them, or stop publishing updates altogether and encourage people to use the split-up crates.
pub fn is_upgradeable_loader_present(&self, enable_loader_v4: bool) -> bool { | ||
self.account_keys.iter().any(|key| { | ||
bpf_loader_upgradeable::check_id(key) || (enable_loader_v4 && loader_v4::check_id(key)) | ||
}) |
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.
we'd need a similar piping of this variable to the transaction view; see ResolvedTransactionView::cache_is_writable
and test_demote_writable_program
in the same file.
ce3fc48
to
ea0913b
Compare
ea0913b
to
850cfb5
Compare
This PR contains changes to the solana sdk, which will be moved to a new repo within the next week, when v2.2 is branched from master. Please merge or close this PR as soon as possible, or re-create the sdk changes when the new repository is ready at https://github.com/anza-xyz/solana-sdk |
Problem
Split off from #2796.
Summary of Changes
Wires a
enable_loader_v4
parameter through allMessage
constructors which then ends up inis_upgradeable_loader_present()
. The parameter is abool
and not&FeatureSet
on purpose so that the feature check can be hoisted outside of loops at the call sites. All consensus irrelevant parts (such as tests, benchmarks and some tools) have it hard coded totrue
.