From 18aba4b8174be67ca9b36d9c263d90857fbb11f5 Mon Sep 17 00:00:00 2001 From: Boris Astardzhiev Date: Fri, 13 Mar 2026 12:53:43 +0200 Subject: [PATCH] fix: skip cleanup transaction check for cheatcode deployments The `only_cleanup_transactions_remaining` subtraction overflows when `instant_surfnet_deployment = true` because the cheatcode path produces only 1 transaction, and the code unconditionally subtracts 4. Cheatcode deployments return no cleanup transactions, so the check should not apply to them. --- addons/svm/core/src/commands/deploy_program.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/svm/core/src/commands/deploy_program.rs b/addons/svm/core/src/commands/deploy_program.rs index 5bf345346..c2d7c5048 100644 --- a/addons/svm/core/src/commands/deploy_program.rs +++ b/addons/svm/core/src/commands/deploy_program.rs @@ -304,9 +304,10 @@ impl CommandImplementation for DeployProgram { let already_generated_deployment_transactions = deployment_transactions.is_some(); - let only_cleanup_transactions_remaining = signed_nested_execution_index - == (initial_expected_deployment_transactions_count - - (UpgradeableProgramDeployer::get_cleanup_transactions_count() + 1)); + let only_cleanup_transactions_remaining = !do_cheatcode_deployment + && signed_nested_execution_index + == (initial_expected_deployment_transactions_count + - (UpgradeableProgramDeployer::get_cleanup_transactions_count() + 1)); let use_existing = already_generated_deployment_transactions && !only_cleanup_transactions_remaining;