Skip to content

refactor: standalone basic_solana for ICP Ninja#249

Merged
lpahlavi merged 19 commits intomainfrom
lpahlavi/standalone-basic-solana
Nov 28, 2025
Merged

refactor: standalone basic_solana for ICP Ninja#249
lpahlavi merged 19 commits intomainfrom
lpahlavi/standalone-basic-solana

Conversation

@lpahlavi
Copy link
Contributor

@lpahlavi lpahlavi commented Nov 11, 2025

(DEFI-2462) Refactor the basic_solana example to be fully standalone, using only published crate versions. This allows the example to be imported directly into ICP Ninja without requiring forks due to breaking changes in sol_rpc_types or sol_rpc_client (as was done in #197).

The CI pipeline is updated with more robust testing for both local and ICP Ninja deployments of basic_solana via dfx, covering macOS and Linux.

@lpahlavi lpahlavi changed the title refactor: standalone basic_solana refactor: standalone basic_solana for ICP Ninja Nov 20, 2025
@lpahlavi lpahlavi force-pushed the lpahlavi/standalone-basic-solana branch from 4c4a4a9 to 42aea94 Compare November 20, 2025 13:24
@lpahlavi lpahlavi force-pushed the lpahlavi/standalone-basic-solana branch from 42aea94 to e59b66b Compare November 20, 2025 13:51
@lpahlavi lpahlavi marked this pull request as ready for review November 20, 2025 14:56

- name: 'Check ninja Cargo.toml'
run: python3 .github/scripts/check_ninja_cargo_toml.py
# TODO DEFI-2462: Re-enable once `sol_rpc_client` and `sol_rpc_types` crates using `ic-cdk` v0.18.6 are published
Copy link
Contributor

Choose a reason for hiding this comment

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

understanding question: to make it easier to review in the future. Wouldn't it be possible to let the source code of the example as is and comment out the CI part that builds the example? So that basically just a couple of lines are to be reviewed instead of currently 700 (I know it's probably just a copy from the symlink, but the problem is that the reviewer is supposed to verify the diff, which is annoying).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that then in the meantime the ICP Ninja deployment wouldn't work anymore... Not just in the CI but generally the links to deploy to ICP Ninja would link to something that doesn't compile. I completely agree that this is very annoying and honestly I'm not sure doing this circus everytime we have a breaking change is very sustainable (especially given the tendency of ic-cdk to have breaking changes).

Maybe we should consider making the examples use the latest published release altogether? We could also have a CI pipeline job that checks that we are using the latest published version of our crates to ensure the examples don't fall behind.

WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is that then in the meantime the ICP Ninja deployment wouldn't work anymore... Not just in the CI but generally the links to deploy to ICP Ninja would link to something that doesn't compile.

Good point, that wouldn't be nice.

Maybe we should consider making the examples use the latest published release altogether?

yes, I think that's a good suggestion, particularly since now that we launch the API should be much more stable.

We could also have a CI pipeline job that checks that we are using the latest published version of our crates to ensure the examples don't fall behind.

I think here we should be able to just re-use dependabot, no? I think we could just tell dependabot to update sol_rpc_client and sol_rpc_types only (to limit also the amount of noise that the other updates generates). WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! I've refactored things so that the basic_solana example is now completely standalone (i.e. has no path dependencies in Cargo.toml and depends only on published crates).

I've also made the CI job a bit more robust to test the local and ninja deployments each with both macOS and Ubuntu. I even uncovered a small mistake in examples/basic_solana/local/dfx.json in the process.

Note that the diff is huge, but it's almost entirely the new Cargo.lock for basic_solana.

I think here we should be able to just re-use dependabot, no? I think we could just tell dependabot to update sol_rpc_client and sol_rpc_types only (to limit also the amount of noise that the other updates generates). WDYT?

That's a very good idea! I'll take care of that in a separate PR but I agree that at this point dependabot has become more or less noise...

gregorydemay
gregorydemay previously approved these changes Nov 25, 2025

- name: 'Check ninja Cargo.toml'
run: python3 .github/scripts/check_ninja_cargo_toml.py
# TODO DEFI-2462: Re-enable once `sol_rpc_client` and `sol_rpc_types` crates using `ic-cdk` v0.18.6 are published
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is that then in the meantime the ICP Ninja deployment wouldn't work anymore... Not just in the CI but generally the links to deploy to ICP Ninja would link to something that doesn't compile.

Good point, that wouldn't be nice.

Maybe we should consider making the examples use the latest published release altogether?

yes, I think that's a good suggestion, particularly since now that we launch the API should be much more stable.

We could also have a CI pipeline job that checks that we are using the latest published version of our crates to ensure the examples don't fall behind.

I think here we should be able to just re-use dependabot, no? I think we could just tell dependabot to update sol_rpc_client and sol_rpc_types only (to limit also the amount of noise that the other updates generates). WDYT?

Copy link
Contributor

@gregorydemay gregorydemay left a comment

Choose a reason for hiding this comment

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

Thanks @lpahlavi !

"init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { MainnetTestKey1 }; sol_rpc_canister_id = opt principal \"tghme-zyaaa-aaaar-qarca-cai\" } )"
},
"sol_rpc": {
"candid": "https://github.com/dfinity/sol-rpc-canister/releases/download/v1.0.0/sol_rpc_canister.did",
Copy link
Contributor

Choose a reason for hiding this comment

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

For another PR, but the candid file should probably be updated with the latest release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I'll update it in another PR, thanks for pointing it out!

"ic": "tghme-zyaaa-aaaar-qarca-cai"
}
},
"wasm": "https://github.com/dfinity/sol-rpc-canister/releases/download/v1.0.0/sol_rpc_canister.wasm.gz",
Copy link
Contributor

Choose a reason for hiding this comment

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

similar here

@lpahlavi lpahlavi merged commit 532bdcc into main Nov 28, 2025
17 checks passed
@lpahlavi lpahlavi deleted the lpahlavi/standalone-basic-solana branch November 28, 2025 07:47
lpahlavi added a commit that referenced this pull request Jan 12, 2026
In #249, the `basic_solana` example was refactored to be standalone and
was thus removed from the repository's top-level Cargo workspace. This
PR updates `release-plz.toml` accordingly by removing the outdated
override to ignore the `basic_solana` crate to fix the `Release` job
(see an example run with an error
[here](https://github.com/dfinity/sol-rpc-canister/actions/runs/20909693682)).
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