Skip to content

pubsub: Properly parse big numbers #769

Closed

Description

@jmalicevic

Bug Report

Setup

CometBFT version (use cometbft version or git rev-parse --verify HEAD if installed from source):
0.38.x, main,
Have you tried the latest version: yes/no
yes

What happened?

The performance optimizations introduced with tendermint/tendermint#7319 parse all numbers occurring in a query using ParseFloat, including integers. While this solves the problem of parsing big integers, it might lead to a loss of precision.

One way to achieve this is introduce a TFNumber and TIntNumber in query/syntax/scanner which would replace the current TNumber type. The function scanNumber already detects potential . in the number.

What did you expect to happen?

Integers are parsed using either ParseInt or parsed as big integers (for example by using math/big).

Activity

  1. added
    bug
    on Apr 27, 2023
  2. added this to the 2023-Q2 milestone on Apr 27, 2023
  3. changed the title [-]pubsub: Stop parsing integers from a query as floats[/-] [+]pubsub: Properly parse big numbers[/+] on May 5, 2023
  4. sergio-mena commented on May 16, 2023

    @sergio-mena
    Collaborator

    Closed by #797

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglibs

    Type

    No type

    Projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions