Skip to content

Conversation

@ice-charon
Copy link
Contributor

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

@ice-charon ice-charon changed the title Fix floating point quality comparison Fix floating point equality comparison Apr 14, 2025
@ice-charon
Copy link
Contributor Author

Would you want me to do it in other way?

@Rafazzzz
Copy link

@ElderOrb t

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.

2 participants