Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

program execution: Rust 1.45 introduces incompatible math runtime behavior changes #10626

Closed
@ryoqun

Description

@ryoqun

Problem

Rust 1.45 will introduce incompatible math runtime behavior changes: https://github.com/rust-lang/rust/blob/master/RELEASES.md#compatibility-notes

In one sentence, (N/0.0) as {integer} is changed from 0 to {integer}::MAX.

In our codecase, this manifested 3 times already, caught via nightly test runs in #10585 and #10445. I think this is high occurance, worth to be aware of from this observation.

At worst, this might cause a cluster consensus loss due to different handling regarding rewards, fees, fork selection, and other token calculation with some edge cases, assuming a cluster comprised of differently-built binaries.

@jackcmay Also, smart contracts could be affected? (Well, dumb question, bpf supports floating number math??) (Quick googling tells me this is not the case...)

Proposed Solution

  • Don't go straightly to update 1.45. Let's see how the rust community handles the transition
  • Once more, go through any suspicious fdivs in our codebase? (But this couldn't cover our depending crates)
  • Build with 1.44 and 1.45 and mix them within a cluster? (= testnet)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions