Coin Brief ENDE

Agave implements SIMD-0582: over-limit transactions fail at the first extra CPI

Anza merged pull request #15664, "Implement SIMD-582", into the Agave validator on 6 October. It adds a feature gate, a new check in TransactionContext::push and a test.

The rule today. A Solana transaction may execute at most 64 instructions, counting top-level instructions and cross-program invocations (CPIs) together. The runtime currently checks the count as instructions execute. The SIMD gives an example: in a transaction with 64 top-level instructions whose first instruction makes a CPI, 62 of the remaining 63 instructions still run before the limit is hit.

The new rule. SIMD-0582, "Early detection of instruction trace overflow", counts all top-level instructions, executed or not, plus the CPIs executed so far whenever a frame is pushed:

if number_of_top_level_instructions_in_tx + number_of_cpis > 64 {
  return Err(InstructionError::MaxInstructionTraceLengthExceeded);
}
Agave implements SIMD-0582: over-limit transactions fail at the first extra CPI
Agave implements SIMD-0582: over-limit transactions fail at the first extra CPI — Coin Brief

So MaxInstructionTraceLengthExceeded is raised as soon as the first offending CPI happens.

Why. The SIMD gives two reasons. The primary one is to fail transactions that will fail anyway sooner, freeing block space for well-formed ones. The second is ABIv2 (SIMD-0177): its memory layout exposes all top-level instructions in pre-defined address spaces for exactly 64 instructions, so a CPI in a transaction with 64 top-level instructions would overwrite a region already reserved for something else.

What does not change. Compute units charged on CPI entry and for instruction accounts and data are still charged when the error occurs. The SIMD also fixes the order of error precedence during the push, with the trace-length check fourth, after unsupported program ID, reentrancy and unbalanced instruction checks.

The merge adds the code and the feature gate; it does not by itself activate the rule on any cluster.