From 82d8c233d2f860b2ec148444f7891a7df7beb7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Fri, 10 Nov 2023 16:25:57 +0100 Subject: [PATCH] protocol: remove `panic::catch_unwind` for PoS VP --- shared/src/ledger/protocol/mod.rs | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/shared/src/ledger/protocol/mod.rs b/shared/src/ledger/protocol/mod.rs index b8a9902ac5c..52248b420aa 100644 --- a/shared/src/ledger/protocol/mod.rs +++ b/shared/src/ledger/protocol/mod.rs @@ -842,24 +842,13 @@ where // and `RefUnwindSafe` in // shared/src/ledger/pos/vp.rs) let keys_changed_ref = &keys_changed; - let result = match panic::catch_unwind(move || { - pos_ref - .validate_tx( - tx, - keys_changed_ref, - verifiers_addr_ref, - ) - .map_err(Error::PosNativeVpError) - }) { - Ok(result) => result, - Err(err) => { - tracing::error!( - "PoS native VP failed with {:#?}", - err - ); - Err(Error::PosNativeVpRuntime) - } - }; + let result = pos_ref + .validate_tx( + tx, + keys_changed_ref, + verifiers_addr_ref, + ) + .map_err(Error::PosNativeVpError); // Take the gas meter back out of the context gas_meter = pos.ctx.gas_meter.into_inner(); result