@@ -403,12 +403,20 @@ impl Consumer {
403
403
let pre_results = vec ! [ Ok ( ( ) ) ; txs. len( ) ] ;
404
404
let check_results =
405
405
bank. check_transactions ( txs, & pre_results, MAX_PROCESSING_AGE , & mut error_counters) ;
406
- let check_results = check_results. into_iter ( ) . map ( |( result, _nonce) | result) ;
406
+ // If checks passed, verify pre-compiles and continue processing on success.
407
+ let check_results: Vec < _ > = txs
408
+ . iter ( )
409
+ . zip ( check_results)
410
+ . map ( |( tx, ( result, _nonce) ) | match result {
411
+ Ok ( _) => tx. verify_precompiles ( & bank. feature_set ) ,
412
+ Err ( err) => Err ( err) ,
413
+ } )
414
+ . collect ( ) ;
407
415
let mut output = self . process_and_record_transactions_with_pre_results (
408
416
bank,
409
417
txs,
410
418
chunk_offset,
411
- check_results,
419
+ check_results. into_iter ( ) ,
412
420
) ;
413
421
414
422
// Accumulate error counters from the initial checks into final results
@@ -425,11 +433,13 @@ impl Consumer {
425
433
txs : & [ SanitizedTransaction ] ,
426
434
max_slot_ages : & [ Slot ] ,
427
435
) -> ProcessTransactionBatchOutput {
436
+ // Verify pre-compiles.
428
437
// Need to filter out transactions since they were sanitized earlier.
429
438
// This means that the transaction may cross and epoch boundary (not allowed),
430
439
// or account lookup tables may have been closed.
431
440
let pre_results = txs. iter ( ) . zip ( max_slot_ages) . map ( |( tx, max_slot_age) | {
432
441
if * max_slot_age < bank. slot ( ) {
442
+ // Pre-compiles are verified here.
433
443
// Attempt re-sanitization after epoch-cross.
434
444
// Re-sanitized transaction should be equal to the original transaction,
435
445
// but whether it will pass sanitization needs to be checked.
@@ -440,6 +450,8 @@ impl Consumer {
440
450
return Err ( TransactionError :: ResanitizationNeeded ) ;
441
451
}
442
452
} else {
453
+ // Verify pre-compiles.
454
+ tx. verify_precompiles ( & bank. feature_set ) ?;
443
455
// Any transaction executed between sanitization time and now may have closed the lookup table(s).
444
456
// Above re-sanitization already loads addresses, so don't need to re-check in that case.
445
457
let lookup_tables = tx. message ( ) . message_address_table_lookups ( ) ;
0 commit comments