diff --git a/CHANGES.md b/CHANGES.md index e0698c628f..5862e52cb2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,9 @@ To be released. became to `Int64` type. [[#396], [#399]] - Added `IStore.GetCanonicalNamespace()` method. [[#426]] - Added `IStore.SetCanonicalNamespace()` method. [[#426]] + - Removed `IRandom.NextDouble()` method, because [floating-point arithmetics, + which is underspecified, likely introduce + indeterminism][floating-point determinism]. [[#410], [#419]] ### Added interfaces @@ -123,15 +126,18 @@ To be released. [#398]: https://github.com/planetarium/libplanet/pull/398 [#399]: https://github.com/planetarium/libplanet/pull/399 [#400]: https://github.com/planetarium/libplanet/pull/400 +[#410]: https://github.com/planetarium/libplanet/issues/410 [#413]: https://github.com/planetarium/libplanet/pull/413 [#414]: https://github.com/planetarium/libplanet/pull/414 [#416]: https://github.com/planetarium/libplanet/pull/416 [#417]: https://github.com/planetarium/libplanet/pull/417 [#418]: https://github.com/planetarium/libplanet/pull/418 +[#419]: https://github.com/planetarium/libplanet/pull/419 [#423]: https://github.com/planetarium/libplanet/pull/423 [#424]: https://github.com/planetarium/libplanet/pull/424 [#426]: https://github.com/planetarium/libplanet/pull/426 [LiteDB #1268]: https://github.com/mbdavid/LiteDB/issues/1268 +[floating-point determinism]: https://wp.me/p1fTCO-kT Version 0.4.1 diff --git a/Libplanet/Action/IAction.cs b/Libplanet/Action/IAction.cs index 39ed6d15e3..c982cd0f9f 100644 --- a/Libplanet/Action/IAction.cs +++ b/Libplanet/Action/IAction.cs @@ -277,6 +277,13 @@ public interface IAction /// or networking. These bring an action indeterministic. You maybe /// fine to log messages for debugging purpose, but equivalent messages /// could be logged multiple times. + /// Lastly, although it might be surprising, floating-point arithmetics are + /// underspecified so that it can make different results on different + /// machines, platforms, runtimes, compilers, and builds. + /// For more on determinism in general, please read also Tendermint ABCI's docs on determinism. /// /// IAccountStateDelta Execute(IActionContext context); diff --git a/Libplanet/Action/IRandom.cs b/Libplanet/Action/IRandom.cs index 019b685d68..0f5e86956b 100644 --- a/Libplanet/Action/IRandom.cs +++ b/Libplanet/Action/IRandom.cs @@ -67,14 +67,5 @@ public interface IRandom /// name="buffer"/> is null. /// void NextBytes(byte[] buffer); - - /// - /// Gets a random floating-point number that is greater than or - /// equal to 0.0, and less than 1.0. - /// - /// A double-precision floating point number that is greater - /// than or equal to 0.0, and less than 1.0. - /// - double NextDouble(); } }