Skip to content

Commit

Permalink
Merge branch 'tomas/pos-vp-no-catch' (#2145)
Browse files Browse the repository at this point in the history
* tomas/pos-vp-no-catch:
  changelog: add #2145
  protocol: remove `panic::catch_unwind` for PoS VP
  • Loading branch information
brentstone committed Nov 14, 2023
2 parents 9008b68 + c5d7d69 commit ddf320f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/miscellaneous/2145-pos-vp-no-catch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Removed catching of panics from PoS VP.
([\#2145](https://github.com/anoma/namada/pull/2145))
25 changes: 0 additions & 25 deletions shared/src/ledger/pos/vp.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<DB, H, CA> 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<DB, H, CA> 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>,
Expand Down
1 change: 0 additions & 1 deletion shared/src/ledger/protocol/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! The ledger's protocol
use std::collections::BTreeSet;
use std::panic;

use borsh_ext::BorshSerializeExt;
use eyre::{eyre, WrapErr};
Expand Down

0 comments on commit ddf320f

Please sign in to comment.