From cba7317ace1f216f38a9665b52dc260fc254ce6b 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 1/2] protocol: remove `panic::catch_unwind` for PoS VP --- shared/src/ledger/pos/vp.rs | 25 ------------------------- shared/src/ledger/protocol/mod.rs | 1 - 2 files changed, 26 deletions(-) diff --git a/shared/src/ledger/pos/vp.rs b/shared/src/ledger/pos/vp.rs index 76607c3199c..506ef489ca0 100644 --- a/shared/src/ledger/pos/vp.rs +++ b/shared/src/ledger/pos/vp.rs @@ -1,7 +1,6 @@ //! Proof-of-Stake native validity predicate. use std::collections::BTreeSet; -use std::panic::{RefUnwindSafe, UnwindSafe}; use namada_core::ledger::storage_api::governance; // use borsh::BorshDeserialize; @@ -58,30 +57,6 @@ where } } -// TODO this is temporarily to run PoS native VP in a new thread to avoid -// crashing the ledger (in apps/src/lib/node/ledger/protocol/mod.rs). The -// RefCells contained within PosVP are not thread-safe, but each thread has its -// own instances. -impl UnwindSafe for PosVP<'_, DB, H, CA> -where - DB: 'static + ledger_storage::DB + for<'iter> ledger_storage::DBIter<'iter>, - H: 'static + StorageHasher, - CA: 'static + WasmCacheAccess, -{ -} - -// TODO this is temporarily to run PoS native VP in a new thread to avoid -// crashing the ledger (in apps/src/lib/node/ledger/protocol/mod.rs). The -// RefCells contained within PosVP are not thread-safe, but each thread has its -// own instances. -impl RefUnwindSafe for PosVP<'_, DB, H, CA> -where - DB: 'static + ledger_storage::DB + for<'iter> ledger_storage::DBIter<'iter>, - H: 'static + StorageHasher, - CA: 'static + WasmCacheAccess, -{ -} - impl<'a, DB, H, CA> NativeVp for PosVP<'a, DB, H, CA> where DB: 'static + ledger_storage::DB + for<'iter> ledger_storage::DBIter<'iter>, diff --git a/shared/src/ledger/protocol/mod.rs b/shared/src/ledger/protocol/mod.rs index d1427811273..a9c4e768930 100644 --- a/shared/src/ledger/protocol/mod.rs +++ b/shared/src/ledger/protocol/mod.rs @@ -1,6 +1,5 @@ //! The ledger's protocol use std::collections::BTreeSet; -use std::panic; use borsh_ext::BorshSerializeExt; use eyre::{eyre, WrapErr}; From c5d7d6903bd1e57274ba7738fa69f7878dfb1ccc 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:30:44 +0100 Subject: [PATCH 2/2] changelog: add #2145 --- .changelog/unreleased/miscellaneous/2145-pos-vp-no-catch.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/miscellaneous/2145-pos-vp-no-catch.md diff --git a/.changelog/unreleased/miscellaneous/2145-pos-vp-no-catch.md b/.changelog/unreleased/miscellaneous/2145-pos-vp-no-catch.md new file mode 100644 index 00000000000..812e6d7975d --- /dev/null +++ b/.changelog/unreleased/miscellaneous/2145-pos-vp-no-catch.md @@ -0,0 +1,2 @@ +- Removed catching of panics from PoS VP. + ([\#2145](https://github.com/anoma/namada/pull/2145)) \ No newline at end of file