ton
ton copied to clipboard
Fix floating point equality comparison
Equal comparison on floating point numbers is problematic, they cannot be easy comparable via operator== instead it should be used an epsilon. I don't find critical path (in consensus nor in full node/validator) using floating point equality comparison, here in lite-client is not a big dial but still bothers mytonctrl time-to-time.
[error] 14.04.2025, 08:09:48.592 (UTC) <MainThread> args: ['/usr/bin/ton/lite-client/lite-client', '--addr', '127.0.0.1:36892', '--pub', '/var/ton-work/keys/liteserver.pub', '--verbosity', '0', '--cmd', 'checkloadall 1744616128 1744618128 ']
Error: LiteClient error: [ 0][t 1][2025-04-14 08:09:48.588702271][block.cpp:1691][!testnode] Check `total_wt >= W[a]` failed
[pid 3221836] [time 1744618188] Signal: 6
Would you want me to do it in other way?
@ElderOrb t