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

bpf-loader-upgradeable: export get_program_data_address helper #35131

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

buffalojoec
Copy link
Contributor

Problem

The BPF Loader Upgradeable uses a deterministic derivation for the
address of an upgradeable program's data account. However, this
derivation is done manually through Pubkey::find_program_address(..)
each time within the loader's code.

It's also not available to anyone downstream using the SDK. Having this
helper available through the SDK - or at least through the BPF Loader
Upgradeable module - will come in handy for building out the module to
migrate built-in programs to Core BPF (BPF Upgradeable).

Summary of Changes

Export the helper!

@buffalojoec buffalojoec requested a review from joncinque February 7, 2024 16:47
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (9b63ac8) 81.6% compared to head (b2d92b0) 81.6%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #35131   +/-   ##
=======================================
  Coverage    81.6%    81.6%           
=======================================
  Files         832      832           
  Lines      224856   224858    +2     
=======================================
+ Hits       183538   183541    +3     
+ Misses      41318    41317    -1     

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Just one little comment, then this should be good to go!

sdk/program/src/bpf_loader_upgradeable.rs Outdated Show resolved Hide resolved
sdk/program/src/bpf_loader_upgradeable.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

address

@joncinque joncinque merged commit 78e187f into solana-labs:master Feb 16, 2024
45 checks passed
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.

2 participants