Skip to content

Commit

Permalink
protocol: remove panic::catch_unwind for PoS VP
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Nov 10, 2023
1 parent 193ca95 commit 82d8c23
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions shared/src/ledger/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 82d8c23

Please sign in to comment.