solana-svm 4.3.0-alpha.2

Solana SVM
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Direct-mapping output adjustment shared by conformance harnesses.

/// Due to how Firedancer's VM CU accounting works, when
/// `virtual_address_space_adjustments` is enabled and execution fails with the
/// CU meter exhausted, we cannot compare the data region of the accounts with
/// Agave. Clears each supplied data buffer in that case.
pub fn direct_mapping_handle_cu_exhaustion<'a>(
    virtual_address_space_adjustments_active: bool,
    cu_avail: u64,
    has_err: bool,
    account_data: impl IntoIterator<Item = &'a mut Vec<u8>>,
) {
    if virtual_address_space_adjustments_active && cu_avail == 0 && has_err {
        for data in account_data {
            data.clear();
        }
    }
}