You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The no_panic crate detects if a function panics in the linking process.
Things to consider:
async functions aren't compatible with the#[no_panic] macro.
Use case Example:
In crates/l2/l1_committer.rs
use no_panic::no_panic;//[...]#[no_panic]pubfn get_deposit_hash(&self,deposit_hashes:Vec<H256>) -> Result<H256,CommitterError>{let s = "\u{1f980}input string";let c = &s[1..];println!("{c}");//[...]
**Motivation**
As explained by issue #1369, implementing the `no_panic` crate would
help prevent some hidden panics.
**Description**
I've tried to implement it for the non-async functions, facing the
following problems:
- For functions interacting with `TcpStream` and the `Database` it
throws a "panic compilation error".
- The `keccak` function used and `c-kzg` throws the "panic compilation
error".
- `no_panic` seems to be a crate that aims to avoid panics in low level
lib crates.
- Found a potential panic in `fake_exponential`, it's solved by the
`fake_exponential_checked` implementation.
- Some extra changes regarding usability were added.
- Remove `pub` keyword if not needed.
See if we can close the issue #1369
The no_panic crate detects if a function panics in the linking process.
Things to consider:
async
functions aren't compatible with the#[no_panic]
macro.Use case Example:
In
crates/l2/l1_committer.rs
Then if we build the program:
it should output:
Task to perform: Ideally, we should use the
#[no_panic]
macro in every non-async function. Then fix all the compilation errors.Note
For the
async
functions, we are handling the errors with aloop
for each component (therun
function). We may want acatch_unwind
as follows:The text was updated successfully, but these errors were encountered: