Description
Problem
Pinocchio re-implements many types from Solana SDK to avoid non-essential dependencies. Since now the SDK has been divided into separate crates and they are much leaner in terms of external (non-SDK) dependencies, it is possible to use them in pinocchio. The main benefit is to make it easier to write code that works with both SDK and pinocchio once they share the same basic types.
Pinocchio will continue to be a zero-dependency library, with the caveat that "zero-dependency" means zero external (non-SDK) dependencies. Therefore, it will continue to mitigate dependency issues. It will also continue to be a zero-copy first library, redefining or creating new types when needed.
The principle of "zero-dependencies" is not to avoid having external dependencies at all, but to have them opt-in – it should always be possible to write a full-featured program without external dependencies.
This issue is used to track the different PRs that bring SDK types into pinocchio in preparation for the next release.
ProgramError
: UseProgramError
from Solana SDK #112Pubkey
->Address
: UseAddress
from Solana SDK #118AccountInfo
->AccountView
: UseAccountView
from Solana SDK #119- Move "out" instruction types: Use
InstructionView
from Solana SDK #122 - Remove
memory
module: Remove memory module #123
Current dependency tree
pinocchio
├── solana-account-view
│ ├── solana-address
│ └── solana-program-error
├── solana-address
│ ├── solana-define-syscall
│ └── solana-program-error
└── solana-program-error