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

extract solana-cpi crate #2981

Merged
merged 11 commits into from
Oct 25, 2024
Merged

extract solana-cpi crate #2981

merged 11 commits into from
Oct 25, 2024

Conversation

kevinheavey
Copy link

Problem

solana_program::program is a vital component of onchain programs and it needs to be made available outside of solana_program.

This branches off #2924 so that needs to be merged first

Summary of Changes

  • Extract a solana-cpi crate with inline syscall stubs that cannot be overwritten
  • Wrap the functions from solana-cpi in solana_program::program so the syscall stubs can be overwritten as before

@kevinheavey kevinheavey force-pushed the cpi-crate branch 2 times, most recently from b7c9ac1 to d74ee32 Compare September 27, 2024 08:02
@kevinheavey kevinheavey force-pushed the cpi-crate branch 2 times, most recently from 85b266d to 6d8fcd1 Compare October 14, 2024 13:46
@kevinheavey kevinheavey marked this pull request as ready for review October 22, 2024 12:14
@kevinheavey kevinheavey requested a review from joncinque October 22, 2024 14:55
Copy link

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

Looks great overall! Mostly small stuff

sdk/cpi/src/lib.rs Outdated Show resolved Hide resolved
sdk/cpi/src/lib.rs Outdated Show resolved Hide resolved
sdk/cpi/src/lib.rs Outdated Show resolved Hide resolved
sdk/program/src/program.rs Show resolved Hide resolved
sdk/program/src/program.rs Outdated Show resolved Hide resolved
sdk/program/src/program.rs Outdated Show resolved Hide resolved
Copy link

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

Looks great! Just needs a rebase, @yihau can you accept ownership of solana-cpi?

@kevinheavey kevinheavey added the automerge automerge Merge this Pull Request automatically once CI passes label Oct 23, 2024
@joncinque joncinque merged commit 7d455b0 into anza-xyz:master Oct 25, 2024
53 checks passed
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
* extract cpi crate

* unused import

* fmt

* move sol_invoke_signed_c to cpi crate

* minimize solana_program use in doc comment

Co-authored-by: Jon C <[email protected]>

* minimize solana_program use in doc comment

Co-authored-by: Jon C <[email protected]>

* fix doc link

Co-authored-by: Jon C <[email protected]>

* fix entrypoint usage in doc examples

* add static assertion for inlined SUCCESS const (needed to remove #[cfg(target_os = "solana")] for this to work)

* fix doc link

Co-authored-by: Jon C <[email protected]>

* sort deps

---------

Co-authored-by: Jon C <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes need:merge-assist
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants