Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_rent_h 2 : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_rent_h 3 : 4 : #include "../fd_bank.h" 5 : 6 : /* SIMD-0194: deprecate_rent_exemption_threshold 7 : https://github.com/anza-xyz/agave/blob/v3.1.4/runtime/src/bank.rs#L5322-L5329 */ 8 0 : #define FD_SIMD_0194_NEW_RENT_EXEMPTION_THRESHOLD (1.0) 9 : 10 : /* SIMD-0194: deprecate_rent_exemption_threshold 11 : https://github.com/anza-xyz/agave/blob/v4.1.0-beta.1/runtime/src/rent_collector.rs#L50-L57 */ 12 0 : #define FD_SIMD_0194_NEW_BURN_PERCENT (50) 13 : 14 : /* alpenclock and genesis certificate account rent is pinned to the 15 : default rent values here: 16 : https://github.com/anza-xyz/solana-sdk/blob/rent%40v4.3.0/rent/src/lib.rs#L87-L95 */ 17 60 : #define FD_RENT_DEFAULT_PARAMS ((fd_rent_t){ .lamports_per_uint8_year=6960UL, .exemption_threshold=1.0, .burn_percent=(uchar)50 }) 18 : 19 : FD_PROTOTYPES_BEGIN 20 : 21 : /* fd_sysvar_rent_init writes bank->f.rent to the rent sysvar account. */ 22 : 23 : void 24 : fd_sysvar_rent_init( fd_bank_t * bank, 25 : fd_accdb_t * accdb, 26 : fd_capture_ctx_t * capture_ctx ); 27 : 28 : /* fd_sysvar_rent_write writes the current value of the rent sysvar to 29 : the accounts database. */ 30 : 31 : void 32 : fd_sysvar_rent_write( fd_bank_t * bank, 33 : fd_accdb_t * accdb, 34 : fd_capture_ctx_t * capture_ctx, 35 : fd_rent_t const * rent ); 36 : 37 : /* fd_rent_exempt_minimum_balance returns the minimum balance needed for 38 : an account with the given data_len to be rent exempt. rent points to 39 : the current rent parameters. */ 40 : 41 : ulong 42 : fd_rent_exempt_minimum_balance( fd_rent_t const * rent, 43 : ulong data_len ); 44 : 45 : /* fd_sysvar_rent_read reads the current value of the rent sysvar from 46 : the accounts database into rent. Returns rent on success, or NULL on 47 : failure (the account does not exist or has an unexpected size). */ 48 : 49 : fd_rent_t const * 50 : fd_sysvar_rent_read( fd_accdb_t * accdb, 51 : fd_accdb_fork_id_t fork_id, 52 : fd_rent_t * rent ); 53 : 54 : FD_PROTOTYPES_END 55 : 56 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_rent_h */ 57 :