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

Consider adding a bpf-entrypoint feature to enable the entrypoint #3

Open
joncinque opened this issue Aug 1, 2024 · 3 comments
Open

Comments

@joncinque
Copy link

Problem

As noted at https://github.com/paladin-bladesmith/sol-stake-view-program/pull/5/files#r1699203567, there are some competing ways of defining certain program features and then using them.

In this case, some programs specify a bpf-entrypoint feature, which enables the entrypoint for program builds. Historically, programs have used the no-entrypoint feature to disable the entrypoint, which is an antipattern for crate features, which should typically add functionality rather than remove.

Proposed Solution

Come up with a standard and use it here!

cc @febo @buffalojoec

@buffalojoec
Copy link

I think the additive bpf-entrypoint feature is probably a good standard. Optionally we could try to pack a few things into platform tools, like automatically detecting this feature when building with cargo build-sbf and/or allowing some custom crate type (ie. crate-type = ["sbf"]) that could abstract some of the entrypoint boilerplate.

I also think we should consider renaming the feature to sbf-entrypoint. 😅

@lorisleiva
Copy link
Member

Hey guys, am I right to say this would be for Solana 2.0+? If so, we already have that information when we generate the template so we can add that flag for Solana 2.0+ only. Wdyt?

@joncinque
Copy link
Author

There's nothing specific to Solana v2, it's whether we want to create a new convention that will make it easier to share program crates. With that said, this might not be such a big issue when we start generating and publishing client crates.

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

No branches or pull requests

3 participants