Skip to content

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

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Jan 22, 2025

Problem

Split off from #2796.

Summary of Changes

Wires a enable_loader_v4 parameter through all Message constructors which then ends up in is_upgradeable_loader_present(). The parameter is a bool 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 to true.

@Lichtso Lichtso requested review from a team as code owners January 22, 2025 10:49
Copy link

mergify bot commented Jan 22, 2025

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/web3.js (example)

Thank you for keeping the RPC clients in sync with the server API @Lichtso.

@@ -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(

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

Copy link
Author

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.

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

Copy link
Author

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

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

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.

Comment on lines +730 to +733
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))
})

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.

@Lichtso Lichtso force-pushed the feature/loader_v4_write_lock_demotion_exemption branch from ce3fc48 to ea0913b Compare January 24, 2025 10:47
@Lichtso Lichtso force-pushed the feature/loader_v4_write_lock_demotion_exemption branch from ea0913b to 850cfb5 Compare January 24, 2025 11:01
@joncinque
Copy link

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

@Lichtso Lichtso closed this Mar 11, 2025
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