From 845576c52b8cabecf6b315dbc44988debd6b1924 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 7 Feb 2025 12:42:24 -0600 Subject: [PATCH] GH-1145 Attempt to make comment clearer --- .../chain/include/eosio/chain/wasm_interface_private.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/chain/include/eosio/chain/wasm_interface_private.hpp b/libraries/chain/include/eosio/chain/wasm_interface_private.hpp index 43a320e9c8..3f329936f6 100644 --- a/libraries/chain/include/eosio/chain/wasm_interface_private.hpp +++ b/libraries/chain/include/eosio/chain/wasm_interface_private.hpp @@ -164,9 +164,12 @@ struct eosvmoc_tier { } } #endif - // do not allow oc interrupt if no undo as the transaction needs to be undone to restart it. - // do not allow oc interrupt if implicit as deferred trx onerror execute as implicit outside the transaction - // retry in transaction_context. Also scheduled manage the undo stack explicitly. + // Do not allow oc interrupt if no undo as the transaction needs to be undone to restart it. + // Do not allow oc interrupt if implicit or scheduled. There are two implicit trxs: onblock and onerror. + // The onerror trx of deferred trxs is implicit. Interrupt needs to be disabled for deferred trxs because + // they capture all exceptions, explicitly handle undo stack, and directly call trx_context.execute_action. + // Not allowing interrupt for onblock seems rather harmless, so instead of distinguishing between onerror and + // onblock, just disallow for all implicit. const bool allow_oc_interrupt = attempt_tierup && context.is_applying_block() && context.trx_context.has_undo() && !context.trx_context.is_implicit() && !context.trx_context.is_scheduled(); auto ex = fc::make_scoped_exit([&]() {