Bug: BigInt.toString produces incorrect decimal string for large uint256 numbers

Đang mở
#4,029 9 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
blockchain

Hướng nghiên cứu

Bắt đầu với đường dẫn thực thi của graph-ts cho BigInt.toString và tái hiện vấn đề bằng BigInt.fromByteArray(ByteArray.fromHexString(hex)) với giá trị thập lục phân trong báo cáo. So sánh chuỗi thập phân được trả về với giá trị mong đợi và xác minh rằng các giá trị uint256 lớn được chuyển đổi chính xác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

developer experience

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Calling BigInt.toString in graph-ts execution context produces an incorrect results for large numbers

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Given this hex: 0x344435891c9a299443ad1ff6f97829fcf3aff343795f7eb86730d1d0f968cb54, various popular js libraries successfully convert the hex to the following decimal string: 23640783215816018536649662874651199072550547213372823297679392888119521495892

In the graph-ts execution context, BigInt.toString should return the same decimal string.
However BigInt.fromByteArray(ByteArray.fromHexString(hex)).toString() returns the following:
38353673751782187045679142956196807757628143702081891553022150933500130575412, which is incorrect.

Ngôn ngữ chính
Rust
Star
3.2k
Fork
1.1k
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphprotocol/graph-node

Tất cả issue của graphprotocol/graph-node

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.