@@ -59,19 +59,19 @@ require_acct_recent_blockhashes( fd_exec_instr_ctx_t * ctx,
5959
6060static int
6161most_recent_block_hash ( fd_exec_instr_ctx_t * ctx ,
62- fd_hash_t * out ) {
62+ fd_blockhash_info_t * out ) {
6363 /* The environment config blockhash comes from `bank.last_blockhash_and_lamports_per_signature()`,
6464 which takes the top element from the blockhash queue.
6565 https://github.com/anza-xyz/agave/blob/v2.1.6/programs/system/src/system_instruction.rs#L47 */
66- fd_blockhashes_t const * blockhashes = fd_bank_block_hash_queue_query ( ctx -> txn_ctx -> bank );
67- fd_hash_t const * last_hash = fd_blockhashes_peek_last ( blockhashes );
68- if ( FD_UNLIKELY ( last_hash == NULL ) ) {
66+ fd_blockhashes_t const * blockhashes = fd_bank_block_hash_queue_query ( ctx -> txn_ctx -> bank );
67+ fd_blockhash_info_t const * last_bhash_info = fd_blockhashes_peek_last ( blockhashes );
68+ if ( FD_UNLIKELY ( last_bhash_info == NULL ) ) {
6969 // Agave panics if this blockhash was never set at the start of the txn batch
7070 ctx -> txn_ctx -> err .custom_err = FD_SYSTEM_PROGRAM_ERR_NONCE_NO_RECENT_BLOCKHASHES ;
7171 return FD_EXECUTOR_INSTR_ERR_CUSTOM_ERR ;
7272 }
7373
74- * out = * last_hash ;
74+ * out = * last_bhash_info ;
7575 return FD_EXECUTOR_INSTR_SUCCESS ;
7676}
7777
@@ -181,14 +181,14 @@ fd_system_program_advance_nonce_account( fd_exec_instr_ctx_t * ctx,
181181
182182 /* https://github.com/solana-labs/solana/blob/v1.17.23/programs/system/src/system_instruction.rs#L45 */
183183
184- fd_hash_t blockhash ;
184+ fd_blockhash_info_t blockhash [ 1 ] ;
185185 do {
186- int err = most_recent_block_hash ( ctx , & blockhash );
186+ int err = most_recent_block_hash ( ctx , blockhash );
187187 if ( FD_UNLIKELY ( err ) ) return err ;
188188 } while (0 );
189189
190190 fd_hash_t next_durable_nonce ;
191- fd_durable_nonce_from_blockhash ( & next_durable_nonce , & blockhash );
191+ fd_durable_nonce_from_blockhash ( & next_durable_nonce , & blockhash -> hash );
192192
193193 /* https://github.com/solana-labs/solana/blob/v1.17.23/programs/system/src/system_instruction.rs#L46-L52 */
194194
@@ -208,7 +208,7 @@ fd_system_program_advance_nonce_account( fd_exec_instr_ctx_t * ctx,
208208 .authority = data -> authority ,
209209 .durable_nonce = next_durable_nonce ,
210210 .fee_calculator = {
211- .lamports_per_signature = fd_bank_rbh_lamports_per_sig_get ( ctx -> txn_ctx -> bank )
211+ .lamports_per_signature = blockhash -> fee_calculator . lamports_per_signature
212212 }
213213 } }
214214 } }
@@ -364,14 +364,14 @@ fd_system_program_withdraw_nonce_account( fd_exec_instr_ctx_t * ctx,
364364
365365 /* https://github.com/solana-labs/solana/blob/v1.17.23/programs/system/src/system_instruction.rs#L109 */
366366
367- fd_hash_t blockhash ;
367+ fd_blockhash_info_t blockhash [ 1 ] ;
368368 do {
369- int err = most_recent_block_hash ( ctx , & blockhash );
369+ int err = most_recent_block_hash ( ctx , blockhash );
370370 if ( FD_UNLIKELY ( err ) ) return err ;
371371 } while (0 );
372372
373373 fd_hash_t next_durable_nonce ;
374- fd_durable_nonce_from_blockhash ( & next_durable_nonce , & blockhash );
374+ fd_durable_nonce_from_blockhash ( & next_durable_nonce , & blockhash -> hash );
375375
376376 /* https://github.com/solana-labs/solana/blob/v1.17.23/programs/system/src/system_instruction.rs#L110-L116 */
377377
@@ -554,14 +554,14 @@ fd_system_program_initialize_nonce_account( fd_exec_instr_ctx_t * ctx,
554554
555555 /* https://github.com/solana-labs/solana/blob/v1.17.23/programs/system/src/system_instruction.rs#L180 */
556556
557- fd_hash_t blockhash ;
557+ fd_blockhash_info_t blockhash [ 1 ] ;
558558 do {
559- int err = most_recent_block_hash ( ctx , & blockhash );
559+ int err = most_recent_block_hash ( ctx , blockhash );
560560 if ( FD_UNLIKELY ( err ) ) return err ;
561561 } while (0 );
562562
563563 fd_hash_t durable_nonce ;
564- fd_durable_nonce_from_blockhash ( & durable_nonce , & blockhash );
564+ fd_durable_nonce_from_blockhash ( & durable_nonce , & blockhash -> hash );
565565
566566 /* https://github.com/anza-xyz/agave/blob/v3.0.3/programs/system/src/system_instruction.rs#L185-L191 */
567567
@@ -573,7 +573,7 @@ fd_system_program_initialize_nonce_account( fd_exec_instr_ctx_t * ctx,
573573 .authority = * authorized ,
574574 .durable_nonce = durable_nonce ,
575575 .fee_calculator = {
576- .lamports_per_signature = fd_bank_rbh_lamports_per_sig_get ( ctx -> txn_ctx -> bank )
576+ .lamports_per_signature = blockhash -> fee_calculator . lamports_per_signature
577577 }
578578 } }
579579 } }
@@ -877,7 +877,7 @@ fd_system_program_exec_upgrade_nonce_account( fd_exec_instr_ctx_t * ctx ) {
877877int
878878fd_check_transaction_age ( fd_exec_txn_ctx_t * txn_ctx ) {
879879 fd_blockhashes_t const * block_hash_queue = fd_bank_block_hash_queue_query ( txn_ctx -> bank );
880- fd_hash_t const * last_blockhash = fd_blockhashes_peek_last ( block_hash_queue );
880+ fd_hash_t const * last_blockhash = fd_blockhashes_peek_last_hash ( block_hash_queue );
881881 if ( FD_UNLIKELY ( !last_blockhash ) ) {
882882 FD_LOG_CRIT (( "blockhash queue is empty" ));
883883 }
0 commit comments