test(simulation): fix insolvency simulation steal sizing for ETH and ARB

Summary

  • replace the fixed 10% insolvency steal with a chain-aware amount selector in the simulation actor
  • keep 10% of wallet balance as the default minimum steal amount, with an 80% cap to avoid over-draining the wallet
  • require larger steal amounts when needed so the solvency gap is large enough to be detected reliably for ETH, ARB, BTC, DASH, and ZEC
  • skip the insolvency scenario cleanly when the wallet balance is too low for the required amount
  • add logging for wallet balance and selected steal amount to make simulation runs easier to diagnose
  • increase the target height for ZEC Sapling and Orchard unshield transactions from anchorHeight + 50 to anchorHeight + 1800

Why

The previous logic always stole 10% of the wallet balance. In some simulation runs, depending on the work combination and timing of other actors, that fixed 10% could end up smaller than the amount actually needed to trigger insolvency on a given chain.

When that happened, the solvency gap was not large enough to be detected reliably, which caused the insolvency actor to fail even though the scenario itself was otherwise valid.

This change makes the steal amount chain-specific where necessary, while still bounding it to a safe portion of the wallet balance and avoiding false failures when the wallet cannot support the required amount.

Summary by CodeRabbit

  • Tests
    • Enhanced insolvency simulation logic to dynamically compute steal amounts based on wallet balance and chain-specific requirements instead of using fixed percentages
    • Improved error handling in insolvency checks with structured logging
    • Adjusted transaction validity windows for Zcash shielded transaction testing
Edited by Ghost User

Merge request reports

Loading
Loading