Extract data structures and pure functions into shareable crate#36
Open
jeff-sqds wants to merge 10 commits into
Open
Extract data structures and pure functions into shareable crate#36jeff-sqds wants to merge 10 commits into
jeff-sqds wants to merge 10 commits into
Conversation
strip solana-program from types crate
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is an attempt to reduce the overall vulnerability of consumers of the smart-account-program rust components by enabling data structures and their pure functions to be canonically defined alongside the solana programs they're chiefly intended for, while removing the need for consumers of those types and functions from importing the entire solana program and anchor dependency chain. This is an attempt to mitigate the brittle duplication of copy-pasting types and methods previously seen from consumers of the V4 program as well as maintain a single canonical source of the types by the originating project so consumers are not required to vet potentially malicious copies in the crates registry when constructing consuming applications.
Functionally this change migrates type definitions and function implementations into a
squads_smart_account_program_typescrate that includes optional implementations of borsh and anchor dependencies for "batteries included but not installed" deriving of common traits. These are then imported and enabled by default in the program crate. The types crate is structured to mirror the module layout of the program crate for familiarity and usage internal to the program crate is maintained via re-exports.