Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Extract spl-math-utils from spl-math #7421

Merged
merged 8 commits into from
Oct 31, 2024

Conversation

kevinheavey
Copy link
Contributor

Crates that are using spl-math as a library don't need the parts that use solana_program .

This PR pulls the math parts into a separate spl-math-utils crate and updates spl-token-swap to use that instead of spl-math. That's the only SPL crate that uses spl-math.

This PR also removes spl-math from the spl-stake-pool deps but spl-stake-pool wasn't using spl-math in the first place

@mergify mergify bot added the community Community contribution label Oct 31, 2024
@kevinheavey
Copy link
Contributor Author

Clippy errors are unrelated to this PR:

error: doc list item without indentation
  --> token/program-2022/src/extension/confidential_mint_burn/instruction.rs:80:9
   |
80 |     ///   3.. `[signer]` Required M signer accounts for the SPL Token Multisig

Copy link
Contributor

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

Great change, thanks! Since it's more of a mistake that spl-math included a whole a program, can we rename the program bit instead?

@@ -0,0 +1,19 @@
[package]
name = "spl-math-utils"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have this crate be spl-math and change the one with the program to spl-math-example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Set the spl-math version back to 0.3 and set spl-math-example version to 0.1

Copy link
Contributor

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

Thanks!

@joncinque joncinque merged commit d0f238f into solana-labs:master Oct 31, 2024
14 checks passed
joncinque added a commit to joncinque/solana-program-library that referenced this pull request Nov 20, 2024
#### Problem

The current spl-stake-pool crate doesn't always work due to its
dependency on spl-math which still uses the v1 Solana crates.

#### Summary of changes

Since the spl-math dependency wasn't actually needed, it was removed in
solana-labs#7421. So just to get a new patch release out, downgrade the local
dependencies.

This will fail CI, but after it lands we can tag the release, and revert
this PR.
joncinque added a commit that referenced this pull request Nov 20, 2024
#### Problem

The current spl-stake-pool crate doesn't always work due to its
dependency on spl-math which still uses the v1 Solana crates.

#### Summary of changes

Since the spl-math dependency wasn't actually needed, it was removed in
#7421. So just to get a new patch release out, downgrade the local
dependencies.

This will fail CI, but after it lands we can tag the release, and revert
this PR.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants