Skip to content

fix: accept the u64::MAX weight boundary - #314

Merged
HaoZeke merged 2 commits into
developfrom
fix/existing-weight-bound
Nov 27, 2026
Merged

HaoZeke merged 2 commits into
developfrom
fix/existing-weight-bound

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

fix: accept the u64::MAX weight boundary

Casting u64::MAX to f64 rounds the bound up to 2^64, so the
check refused the largest valid weights, such as
18446744073709551615 and 18446744073709551614.5.

The check now compares each --existing weight with the bound in
exact decimal space and refuses a weight only once it reaches 2^64.
A real overflow still reports the same error text.

`--existing` accepted a seconds value at or above 2^64. `ceil_seconds`
then saturated that weight at the largest `u64`, and the command
exited 0. Refuse the value with the same exclusive bound already used
for result and summary durations.
Casting `u64::MAX` to `f64` rounds the bound up to 2^64, so the
check refused the largest valid weights, such as
18446744073709551615 and 18446744073709551614.5.

The check now compares each `--existing` weight with the bound in
exact decimal space and refuses a weight only once it reaches 2^64.
A real overflow still reports the same error text.
@HaoZeke
HaoZeke merged commit 5135cae into develop Nov 27, 2026
8 checks passed
@HaoZeke
HaoZeke deleted the fix/existing-weight-bound branch November 27, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant