Skip to content

pinocchio-stake#284

Draft
L0STE wants to merge 5 commits intoanza-xyz:mainfrom
L0STE:stake
Draft

pinocchio-stake#284
L0STE wants to merge 5 commits intoanza-xyz:mainfrom
L0STE:stake

Conversation

@L0STE
Copy link
Contributor

@L0STE L0STE commented Nov 21, 2025

A no-std efficient client to interact with the stake-program

@L0STE L0STE marked this pull request as draft November 21, 2025 10:18
use core::mem::MaybeUninit;
use pinocchio::{account_info::AccountInfo, instruction::AccountMeta};

const UNINIT_BYTE: MaybeUninit<u8> = MaybeUninit::<u8>::uninit();
Copy link
Contributor

Choose a reason for hiding this comment

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

this constant is already duplicated in pinocchio-token, pinocchio--token-2022, pinocchio-logger, and pinocchio crates.

i guess we are ready to extract it into either utils/helpers or import from pinocchio directly.

no need to do it in the scope of this MR, I believe, and better to make it as a separate one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really good point, but I have a counter argument to this:

Afaik Febo said that pinocchio should be as barebone as possible (meaning that probably this wouldn't fit there) and pinocchio should be the only import for any clients (meaning we can't put it anywhere else)

I don't mind it having it plastered across all clients, but at the same time having it in pinocchio would be great since it's always used across all clients

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense.

anyways, i have already made a small refactoring MR to show how it can be used, and taking into account this crate already dependent on pinocchio we can achieve the next usage:

-use core::mem::MaybeUninit;
-use pinocchio::{account_info::AccountInfo, instruction::AccountMeta};
+use pinocchio::{account_info::AccountInfo, bytes::UNINIT_BYTE, instruction::AccountMeta};

-const UNINIT_BYTE: MaybeUninit<u8> = MaybeUninit::<u8>::uninit();

@LStan
Copy link
Contributor

LStan commented Dec 1, 2025

GetMinimumDelegation, Initialize, DeactivateDelinquent don't have signers, so invoke_signed is not needed.

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