Skip to content

svm: Remove solana-sdk dependency from examples#6304

Merged
steviez merged 1 commit intoanza-xyz:masterfrom
steviez:rm_moar_sdk3
May 27, 2025
Merged

svm: Remove solana-sdk dependency from examples#6304
steviez merged 1 commit intoanza-xyz:masterfrom
steviez:rm_moar_sdk3

Conversation

@steviez
Copy link
Copy Markdown

@steviez steviez commented May 23, 2025

This rips out the dependency on solana-sdk; however, I'm not sure that the examples are currently building in CI. Running cargo build in <REPO_ROOT>/svm/examples yields this error on the tip of master (this goes away if you enable the blake3 feature):

cargo build output
error[E0599]: no function or associated item named `try_create` found for struct `SanitizedTransaction` in the current scope
   --> json-rpc/server/src/rpc_process.rs:911:27
    |
911 |     SanitizedTransaction::try_create(
    |                           ^^^^^^^^^^ function or associated item not found in `SanitizedTransaction`
    |
note: if you're trying to build a new `SanitizedTransaction` consider using one of the following associated functions:
      SanitizedTransaction::try_new
      SanitizedTransaction::try_new_from_fields
   --> /.../.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/solana-transaction-2.2.2/src/sanitized.rs:58:5
    |
58  | /     pub fn try_new(
59  | |         tx: SanitizedVersionedTransaction,
60  | |         message_hash: Hash,
61  | |         is_simple_vote_tx: bool,
62  | |         address_loader: impl AddressLoader,
63  | |         reserved_account_keys: &HashSet<Pubkey>,
64  | |     ) -> Result<Self> {
    | |_____________________^
...
148 | /     pub fn try_new_from_fields(
149 | |         message: SanitizedMessage,
150 | |         message_hash: Hash,
151 | |         is_simple_vote_tx: bool,
152 | |         signatures: Vec<Signature>,
153 | |     ) -> Result<Self> {
    | |_____________________^

error[E0599]: no function or associated item named `try_from_legacy_transaction` found for struct `SanitizedTransaction` in the current scope
   --> paytube/src/transaction.rs:65:37
    |
65  |         SolanaSanitizedTransaction::try_from_legacy_transaction(
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `SanitizedTransaction`
    |
note: if you're trying to build a new `SanitizedTransaction` consider using one of the following associated functions:
      SanitizedTransaction::try_new
      SanitizedTransaction::try_new_from_fields
   --> /.../.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/solana-transaction-2.2.2/src/sanitized.rs:58:5
    |
58  | /     pub fn try_new(
59  | |         tx: SanitizedVersionedTransaction,
60  | |         message_hash: Hash,
61  | |         is_simple_vote_tx: bool,
62  | |         address_loader: impl AddressLoader,
63  | |         reserved_account_keys: &HashSet<Pubkey>,
64  | |     ) -> Result<Self> {
    | |_____________________^
...
148 | /     pub fn try_new_from_fields(
149 | |         message: SanitizedMessage,
150 | |         message_hash: Hash,
151 | |         is_simple_vote_tx: bool,
152 | |         signatures: Vec<Signature>,
153 | |     ) -> Result<Self> {
    | |_____________________^

Moreso, this is an invalid dependency path given that sdk is no longer in the monorepo:

solana-program = { path = "../../../../sdk/program", version = "=2.2.0" }

This is because json-rpc-example-program is not listed in the members:

[workspace]
members = ["json-rpc/client", "json-rpc/server", "paytube"]

For the sake of progressing removal of solana-sdk, I propose we push these changes as is (assuming CI is happy) and then tackle further cleanup later

@steviez steviez requested a review from a team as a code owner May 23, 2025 19:46
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.7%. Comparing base (ae8fe77) to head (e18c15e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6304   +/-   ##
=======================================
  Coverage    82.7%    82.7%           
=======================================
  Files         845      845           
  Lines      377824   377824           
=======================================
+ Hits       312782   312817   +35     
+ Misses      65042    65007   -35     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@steviez steviez requested a review from t-nelson May 23, 2025 20:47
@LucasSte
Copy link
Copy Markdown

The examples folder is checked in CI with only cargo clippy and cargo check. Since these are here to show people how to use SVM in an external project, I thought compilation errors would surface in one of these commands. That is not the case though.

@LucasSte
Copy link
Copy Markdown

I'm OK merging the PR. We can fix the examples and the CI later.

@steviez steviez changed the title svm-examples: Remove solana-sdk dependency svm: Remove solana-sdk dependency from examples May 27, 2025
@steviez steviez merged commit 65432f9 into anza-xyz:master May 27, 2025
58 checks passed
@steviez steviez deleted the rm_moar_sdk3 branch May 27, 2025 15:08
@steviez steviez mentioned this pull request May 27, 2025
mircea-c pushed a commit to mircea-c/agave that referenced this pull request Jun 12, 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.

3 participants