Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(crypto, state): resolve panic on 32-bit OSes #1604

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

b00f
Copy link
Collaborator

@b00f b00f commented Nov 19, 2024

Description

This PR addresses a panic occurring on 32-bit operating systems, including Raspberry Pi devices running 32-bit ARM OS.

The root cause of the issue lies in the varying word sizes used in the big.Int implementation across different operating systems. A word is defined as an int in the big.Int implementation. Therefore, on 32-bit operating systems, each word is 32 bits, while on 64-bit systems, it is 64 bits.

Since we use kilic/bls12-381 in the wallet, this issue affects us directly. The problem has been addressed in their repository here. However, the repository is currently unmaintained. The ultimate solution would be to replace it with the gnark-crypto implementation of BLS.

In the meantime, this patch resolves the panic.

Additionally, this PR fixes some tests in the persistent Merkle tree that were failing due to the same int size discrepancy across different operating systems.

Related Issue(s)

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.27%. Comparing base (86a8ba9) to head (b90a692).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1604      +/-   ##
==========================================
+ Coverage   75.07%   76.27%   +1.19%     
==========================================
  Files         234      236       +2     
  Lines       12156    18240    +6084     
==========================================
+ Hits         9126    13912    +4786     
- Misses       2582     3871    +1289     
- Partials      448      457       +9     
---- 🚨 Try these New Features:

@b00f b00f mentioned this pull request Nov 19, 2024
@Ja7ad Ja7ad merged commit 01dbe17 into pactus-project:main Nov 20, 2024
12 checks passed
@b00f b00f deleted the fix/panic-32-bits-os branch November 20, 2024 11:41
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.

raspberry pi runtime error
2 participants