instruction-view: Add new crate#401
Conversation
902e59c to
104f4cc
Compare
|
Waiting on #442 to rebase. |
* [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
* [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 <febo@anza.xyz> * Update sdk/pinocchio/src/entrypoint/mod.rs Co-authored-by: Fernando Otero <febo@anza.xyz> * Update sdk/pinocchio/src/instruction.rs Co-authored-by: Fernando Otero <febo@anza.xyz> * Update sdk/pinocchio/src/sysvars/clock.rs Co-authored-by: Fernando Otero <febo@anza.xyz> * 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 <febo@anza.xyz> * Update sdk/pinocchio/src/sysvars/instructions.rs Co-authored-by: Fernando Otero <febo@anza.xyz> * Update sdk/pinocchio/src/sysvars/instructions.rs Co-authored-by: Fernando Otero <febo@anza.xyz> * Update sdk/pinocchio/src/sysvars/clock.rs * Fix syntax error in Instructions struct derive macro --------- Co-authored-by: Fernando Otero <febo@anza.xyz>
3a5bc83 to
fec6cf7
Compare
@joncinque Rebase done. |
joncinque
left a comment
There was a problem hiding this comment.
Looks great overall! Mostly small comments and nits
joncinque
left a comment
There was a problem hiding this comment.
Looks good to me! It's up to you if you want to do the alloc work here though, whichever you prefer
111404c to
491515b
Compare
I had a go at refactoring the invoke to support the actual maximum of CPI accounts (commit 491515b). The downside is that it requires a small bump on the minimum Rust version. We could implement with a |
joncinque
left a comment
There was a problem hiding this comment.
Just a few last nits, looks really close!
| cargo-cache-key: cargo-minimum-check | ||
| cargo-cache-fallback-key: cargo-minimum | ||
|
|
||
| - name: Install additional toolchains |
There was a problem hiding this comment.
We could add a cache to this step, but it does not seem to take very long since one of the toolchains will usually be installed already.
There was a problem hiding this comment.
This looks fine to me! It only takes 8 seconds, and the whole check is less than a minute
| @@ -0,0 +1,25 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Not sure if we need a separate script for this – we could just add its contents to the github workflow directly.
There was a problem hiding this comment.
It can't hurt, looks good!
| cargo-cache-key: cargo-minimum-check | ||
| cargo-cache-fallback-key: cargo-minimum | ||
|
|
||
| - name: Install additional toolchains |
There was a problem hiding this comment.
This looks fine to me! It only takes 8 seconds, and the whole check is less than a minute
| @@ -0,0 +1,25 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
It can't hurt, looks good!
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_csyscall.Solution
Add a new
solana-instruction-viewcrate moving the types from pinocchio – the main type of this crate is theInstructionView.The crate also includes a feature for cross-program invocations ("cpi") syscalls.