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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace solana_program::program::invoke with solana_invoke::invoke #2958

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

deanmlittle
Copy link

Creating this PR to get the conversation started. Thanks @cavemanloverboy. Running some A/B tests locally now against my own escrow program that does some basic CPI calls. Will report back shortly. Check out solana-invoke to see how it works. 馃檹

Copy link

vercel bot commented May 11, 2024

@deanmlittle is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

Thanks for creating the PR, it's an interesting one.

The README mentions:

The current CPI functions solana_program::program::invoke* perform unnecessary copies and allocations. This crate removes these inefficiencies in a manner that is 100% backwards compatible.

If this really is 100% backwards compatible, and is objectively better than solana_program's implementation, why not PR this to change it from solana-program side? Both Anchor and Native programs would get the benefits this way.

@deanmlittle deanmlittle changed the title Reaplce solana_program::program::invoke with solana_invoke::invoke Replace solana_program::program::invoke with solana_invoke::invoke May 11, 2024
@deanmlittle
Copy link
Author

Yes, this should definitely be merged into solana-program. At the same time, if we can significantly reduce CU usage today without waiting for an upstream merge that may or not may not even happen, would that not be better than leaving it as is?

@cavemanloverboy
Copy link
Contributor

Historically, I've had trouble getting PRs into agave. Either ignored or takes far too long. Since the instruction stabilizer has a few tricky unsafe bits, I suspect it will receive pushback.

@cavemanloverboy
Copy link
Contributor

cavemanloverboy commented May 20, 2024

Thanks for creating the PR, it's an interesting one.

The README mentions:

The current CPI functions solana_program::program::invoke* perform unnecessary copies and allocations. This crate removes these inefficiencies in a manner that is 100% backwards compatible.

If this really is 100% backwards compatible, and is objectively better than solana_program's implementation, why not PR this to change it from solana-program side? Both Anchor and Native programs would get the benefits this way.

this is why lol

anza-xyz/agave#1426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants