-
Notifications
You must be signed in to change notification settings - Fork 4.9k
program execution: Rust 1.45 introduces incompatible math runtime behavior changes #10626
Comments
testnet has been running Rust 1.45.x since July, so I think we're ok here. |
@ryoqun The BPF instruction set does not support floating-point math but LLVM provides compiler intrinsics that do so currently you can perform floating-point math in our programs (though we should probably explicitly disallow that. So as it stands if anyone is using floating-point math the incompatibility mentioned in this issue could affect program execution as we update our Rust-BPF versions |
Oh, let's update the milestone as well, then. :) |
@ryoqun Looks like this is probably not an issue for BPF programs from a backward compatibility perspective. Programs built against the old toolchain are already immutable in their executable accounts. Any programs built against the new toolchain will be in new accounts. |
Anything we need to do here? |
Uh oh!
There was an error while loading. Please reload this page.
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 from0
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
The text was updated successfully, but these errors were encountered: