midnightntwrk / midnightntwrk/midnight-node
Feature Request: Consider activating Rust integer overflow protection in release builds
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 68
- Forks
- 45
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 64
Description
Feature Request: Consider activating Rust integer overflow protection in release builds
The Cargo.toml does not enable overflow checks in release builds, meaning that integer underflow or overflow will wrap instead of causing panics.
It looks like the node code uses checked math in most cases but it's safer to do this as a policy in release builds rather than to rely only on catching individual cases, especially as the codebase changes over time.
https://doc.rust-lang.org/cargo/reference/profiles.html#overflow-checks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by opening Cargo.toml and inspecting the release profile settings, then read the Cargo overflow-checks documentation linked in the issue. Done means the release-build policy enables integer overflow and underflow protection without changing the existing checked-math code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100