Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_program_fd_stake_program_h 2 : #define HEADER_fd_src_flamenco_runtime_program_fd_stake_program_h 3 : 4 : /* The stake program (native program) allows users to stake their coins 5 : on a validator (registered with the vote program). The user 6 : receives inflation rewards for doing so. The slot boundary will read 7 : and write accounts owned by the stake program (e.g. to determine 8 : validator stake weights and pay out staking rewards). 9 : 10 : Address: Stake11111111111111111111111111111111111111 */ 11 : 12 : #include "../context/fd_exec_instr_ctx.h" 13 : 14 24 : #define FD_STAKE_STATE_V2_SZ (200UL) 15 : 16 : FD_PROTOTYPES_BEGIN 17 : 18 : int 19 : fd_new_warmup_cooldown_rate_epoch( fd_exec_slot_ctx_t const * slot_ctx, 20 : /* out */ ulong * epoch, 21 : int * err ); 22 : 23 : /* fd_stake_program_execute is the instruction processing entrypoint 24 : for the stake program. On return, ctx.txn_ctx->dirty_stake_acc==1 if 25 : a stake account may have been modified. */ 26 : 27 : int 28 : fd_stake_program_execute( fd_exec_instr_ctx_t * ctx ); 29 : 30 : /* Initializes an account which holds configuration used by the stake program. 31 : https://github.com/solana-labs/solana/blob/8f2c8b8388a495d2728909e30460aa40dcc5d733/sdk/program/src/stake/config.rs 32 : */ 33 : void 34 : fd_stake_program_config_init( fd_exec_slot_ctx_t * global ); 35 : 36 : int 37 : fd_stake_get_state( fd_borrowed_account_t const * self, 38 : fd_valloc_t const * valloc, 39 : fd_stake_state_v2_t * out ); 40 : 41 : fd_stake_history_entry_t 42 : fd_stake_activating_and_deactivating( fd_delegation_t const * self, 43 : ulong target_epoch, 44 : fd_stake_history_t const * stake_history, 45 : ulong * new_rate_activation_epoch ); 46 : 47 : void 48 : fd_store_stake_delegation( fd_exec_slot_ctx_t * slot_ctx, 49 : fd_borrowed_account_t * stake_account ); 50 : 51 : FD_PROTOTYPES_END 52 : 53 : #endif /* HEADER_fd_src_flamenco_runtime_program_fd_stake_program_h */