decipherhub / decipherhub/cipherbft

Panic on cache initialization if size is zero

Open
#140 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Several cache initializations panic if the cache size is somehow zero.

**Locations:**
- https://github.com/decipherhub/cipherbft/blob/main/crates/execution/src/database.rs#L20
- https://github.com/decipherhub/cipherbft/blob/main/crates/execution/src/database.rs#L26
- https://github.com/decipherhub/cipherbft/blob/main/crates/execution/src/state.rs#L20
- https://github.com/decipherhub/cipherbft/blob/main/crates/execution/src/engine.rs#L30

While the constants are non-zero, these panics could be replaced with compile-time assertions or graceful error handling.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.