Add no_floating_points
feature flag.
#747
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're exploring the usage of halo2 in the context of ACTUS standard implementation and on-chain proof verification. Since our chain, Casper, doesn't support floats we needed these changes to do it. These changes may be useful more broadly since many other blockchains do not support floating points. This contribution should make the halo2_proofs code more universal across different operating systems and architectures.
With this flag turned on, the halo2_proofs crate can be compiled into Wasm, and the resulting binary will not use any floating point operations.
The code to generate the table is here https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cb4b6564b60d0ad65243679f3203fa77 - it's using a binary search to find the lowest argument to the ceil(ln(x)) function in 1..2^64-1 space, that produces the exponent it's looking for. The linked code and this commit contain relevant tests to ensure the lookup table is correct.