Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Oct 23, 2025

Problem

Currently pinocchio provides a CU efficient way to perform cross-program invocation by using zero-copy structs to represent instruction-related data, which can be used with sol_invoke_signed_c syscall.

Solution

Add a new solana-instruction-view crate moving the types from pinocchio – the main type of this crate is the InstructionView.

The crate also includes a feature for cross-program invocations ("cpi") syscalls.

febo and others added 30 commits October 23, 2025 10:51
* [wip]: Address review comments

* [wip]: Fix pointer reference

* [wip]: Add logger buffer size tests

* Remove unused

* More logger tests

* Rename program to cpi

* Remove dynamic allocation

* Fixed signed tests

* Fix review comments

* Fix unsigned test case

* Add is_owner_by helper
* Add resize

* Deprecate realloc
Ignore zero_init parameter
* Use macro rules

* Update directory structure
* Add unchecked helper

* Fix lint

* Add inline

* Rename to checked

* Cosmetics

* Fix sol log params
* [wip]: Add new scripts

* [wip]: Use matric strategy

* [wip]: Fix members parsing

* [wip]: Add CI env variables

* [wip]: Remove nothrow

* [wip]: Filter changes

* [wip]: Add audit step

* [wip]: Add semver checks

* [wip]: Refactor publish workflow

* [wip]: Refactor

* [wip]: Fix commands

* Fix formatting

* Remove detect changes step

* Review comments

* Fix lint comments

* Expand crate comment

* Ignore crate comment tests

* Add missing docs

* More missing docs

* Add missing release component

* Pin cargo-release version

* Fix merge

* Review comments
* use `seeds` macro over `signer` macro

* fix doc to pass doc test

* deprecate  macro
* [wip]: Address review comments

* [wip]: Fix pointer reference

* [wip]: Add logger buffer size tests

* Remove unused

* More logger tests

* Rename program to cpi

* Remove dynamic allocation

* Fixed signed tests

* Fix review comments

* Fix unsigned test case

* Add is_owner_by helper
* add memo program

* use MAX_CPI_ACCOUNTS over MAX_TX_ACCOUNTS

* nit

* add account info borrowing check

* update docstring and comments

* use &str over &[u8]

* check num_accounts

* avoid unnecessary codegen

* update doc to use &str over &[u8]

* fix doc

* seperate lifetime
* Improve fallback and docs

* Add borrow state check

* Add inline

* Review comments

* Revert doc link merge change
* Fix review comments

* Revert offset increment change

* Improve invoke performance

* Add invoke instruction helper

* Typos

* Remove new helpers

* Remove unused

* Address review comments

* Tweak iteration

* More tweaks

* Limit the length of the slice

* Uncomment code

* Validate account length

* Tweak inline attributes

* Use invoke signed unchecked

* Refactor inline

* Renamed to with_bounds

* Update docs

* Fix accounts length test

* Revert change

* Add constant length check

* Review comments

* Fix error variant
* Add invoke instruction helper

* Typos

* Remove new helpers

* Remove unused

* Address review comments

* Tweak inline attributes

* Use invoke signed unchecked

* Refactor inline

* Renamed to with_bounds

* Update docs

* Revert change

* Add constant length check

* Add spellcheck step

* Tweak action

* Fix typos

* More fixes

* Yet more fixes

* Fixes

* Add j1 option

* More and more fixes

* Add missing acronym

* Fix merge

* Fix spelling

* Fix spelling
* Add comments on constants

* Improve offset comments

* Add bitmask to dictionary

* Renamed to field_at_offset
…-xyz#228)

* Add debug/copy derives and enable missing debug/copy lint

* Update sdk/pinocchio/src/sysvars/rent.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/entrypoint/mod.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/instruction.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/sysvars/clock.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/sysvars/fees.rs

* Update sdk/pinocchio/src/sysvars/fees.rs

* Update sdk/pinocchio/src/sysvars/instructions.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/sysvars/instructions.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/sysvars/instructions.rs

Co-authored-by: Fernando Otero <[email protected]>

* Update sdk/pinocchio/src/sysvars/clock.rs

* Fix syntax error in Instructions struct derive macro

---------

Co-authored-by: Fernando Otero <[email protected]>
* Add pubkey_eq helper

* Fix typo

* Update pubkey comparison

* Add proptest

* Add unlikely

* Replace proptest
/// accounts which actually may be mutated are specified as writable.
#[repr(C)]
#[derive(Debug, Clone)]
pub struct AccountRole<'a> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not 100% sure about this name.

@febo febo force-pushed the solana-instruction-view branch from 902e59c to 104f4cc Compare October 23, 2025 11:17
@febo febo marked this pull request as ready for review October 23, 2025 12:23
@febo febo requested a review from joncinque October 23, 2025 12:23
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