Skip to main content

shrink_sequence_value

Function shrink_sequence_value 

Source
pub(crate) fn shrink_sequence_value(
    config: &InvariantConfig,
    invariant_contract: &InvariantContract<'_>,
    calls: &[BasicTxDetails],
    executor: &Executor,
    target_value: I256,
    progress: Option<&ProgressBar>,
    early_exit: &EarlyExit,
) -> Result<Vec<BasicTxDetails>>
Expand description

Shrinks a call sequence to the shortest sequence that still produces the target optimization value. This is specifically for optimization mode where we want to find the minimal sequence that achieves the maximum value.

Unlike shrink_sequence (for check mode), this function:

  • Accumulates warp/roll values from removed calls into the next kept call
  • Checks for target value equality rather than invariant failure