diff --git a/.changelog/4386.bugfix.md b/.changelog/4386.bugfix.md new file mode 100644 index 00000000000..5581939c607 --- /dev/null +++ b/.changelog/4386.bugfix.md @@ -0,0 +1,5 @@ +runtime: Propagate panics during transaction/local RPC/policy dispatch + +A panic during transaction/local RPC/policy dispatch signals a serious +problem so it should be propagated and the runtime should crash to force +state reset. diff --git a/runtime/src/dispatcher.rs b/runtime/src/dispatcher.rs index 7c4dd3e305a..b052e011376 100644 --- a/runtime/src/dispatcher.rs +++ b/runtime/src/dispatcher.rs @@ -684,6 +684,10 @@ impl Dispatcher { inputs: TxnBatch, state: TxDispatchState, ) -> Result
{ + // Make sure to abort the process on panic during transaction processing as that indicates + // a serious problem and should make sure to clean up the process. + let _guard = AbortOnPanic; + debug!(self.logger, "Received transaction batch request"; "state_root" => ?state.header.state_root, "round" => state.header.round + 1, @@ -721,7 +725,8 @@ impl Dispatcher { ) } }) - .await? + .await + .unwrap() // Propagate panics during transaction dispatch. } async fn dispatch_rpc( @@ -841,6 +846,10 @@ impl Dispatcher { ctx: Context, request: Vec