midnightntwrk / midnightntwrk/midnight-node

Feature Request: Consider activating Rust integer overflow protection in release builds

Open Beginner friendly
#1,306 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

public
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.