-
Notifications
You must be signed in to change notification settings - Fork 87
FIP-0105: Add Full Support for EIP-2537 (BLS12-381 Precompiles) in the Filecoin EVM #1669
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
Merged
Merged
Changes from 103 commits
Commits
Show all changes
112 commits
Select commit
Hold shift + click to select a range
1e05c3a
adding bls12_g1_add
aaravm 9f43287
Updated the util functions
aaravm b363408
add precompile addresses
aaravm dbfd513
Adding tests and correcting utility functions
aaravm 84ed0a7
remove padding from input in extract_g1_poin
aaravm 5b119e3
add bls12_g1msm fn
aaravm 656d5ba
added testcase for bls_add
aaravm 3431a5f
added gls12_g1msm scalars
aaravm a29fdb0
added tests test_g1_msm_success and test_g1_msm_failures
aaravm e2846b3
adding details about the bug
aaravm 1ffbe1a
Adding the g2_add_function
aaravm ff0b1f6
Adding the g2_msm_function
aaravm cdf1f2a
corrected subgroup check testcase in g1msm
aaravm cec90bf
adding testcases for g2_add
aaravm 0614ee5
adding testcases for g2_add_fail
aaravm 8104180
adding testcases for g2_msm
aaravm 9f78dff
separated util file
aaravm 9c687f3
separates bls12_381 into 7 files
aaravm ff40af6
update g1_add unit tests
aaravm 91dad92
add fp2_to_g2, pairing fn
aaravm 0d7e13d
Add utility functions to pairing.rs
aaravm c78655e
Add util functions for map_fp_to_g1 and map_fp2_to_g2
aaravm 53fa0fd
Fix the Curve-error bug
aaravm 4e82a45
corrected the bug in g1_msm and g2_add
aaravm 13fd9e0
added testcases for map_fp_to_g1
aaravm 93deac4
add successful tests to pairing.rs
aaravm dc7ef60
Add more testcases for pairing
aaravm 7bf5811
added more tests for g1_msm, and g2_add
aaravm 96ca478
change g1_msm variable names
aaravm cff0fb0
add g2msm failure tests
aaravm b051dca
correct bug in g2_msm
aaravm 2f8e8ae
fixed corresponding bug in g1_msm
aaravm 3d00793
update pairing tests
aaravm 28066f0
added remaining tests
aaravm e4613d0
Merge branch 'master' of github.com:aaravm/builtin-actors
snissn a1a124b
run cargo fmt --all
snissn 4ca96d7
refactor(bls12_381): unify G1ADD and G2ADD precompile implementations…
snissn 046c5d0
refactor(bls12_381): unify is_infinity logic for G1 and G2 MSM and ad…
snissn f5c6960
refactor(bls12_mapping): standardize map_fp2_to_g2 and map_fp_to_g1 p…
snissn 564f71f
Merge pull request #1 from snissn/mikers/bls-review
aaravm 7a4c94d
remove repeatedly defined fns
aaravm 0cca6de
correct clippy errors
aaravm 62d5dd3
recompile cargo.lock
aaravm 304409a
temporarily removed cargo.lock
aaravm 6840879
merging from upstream
aaravm b3cf19b
cargo fmt --all
aaravm 1444225
Merge branch 'master' of github.com:filecoin-project/builtin-actors
snissn b409cd3
using input.chunks_exact instead of manual indexing
snissn a25f6c4
using input.chunks_exact instead of manual indexing
snissn fc764ef
simplify input parsing using chunks_exact and split_at
snissn bb5a4fc
refactor(pairing): use split_first for safer empty input handling
snissn 9dcd627
fmt
snissn 1990118
install clang in ci
snissn cb2a1d3
Revert "install clang in ci"
snissn bceaeef
install clang in docker
snissn 951f003
initial BLS precompile solidity test working
snissn a59a701
rename clean up solidity test
snissn bf7c374
use split_at in g1_add
snissn 63533f3
cargo fmt fix
snissn d890694
Merge pull request #2 from snissn/master
snissn b56a83c
Update BLSPrecompile.sol
snissn 0feecb5
Merge branch 'filecoin-project:master' into master
snissn 127cd02
Merge pull request #3 from snissn/master
snissn de97365
Merge branch 'master' of github.com:aaravm/builtin-actors
snissn e482a8b
Merge pull request #4 from snissn/master
snissn 4ed841f
merge pre-megre and master
aaravm 5d30561
cargo fmt
aaravm e12cc90
add remaining fns except pairing
aaravm 5818890
add pairing tests
aaravm 7bce060
cargo fmt
aaravm 6d9965f
Merge branch 'filecoin-project:master' into master
snissn 096dc13
add clang for tests
snissn b3055b8
Update actors/evm/tests/contracts/BLSPrecompile.sol
snissn 7e37a9e
Update actors/evm/tests/contracts/BLSPrecompile.sol
snissn 497c7d8
Update actors/evm/tests/contracts/BLSPrecompile.sol
snissn 22fbb08
Update actors/evm/tests/contracts/BLSPrecompile.sol
snissn 643bd65
Update actors/evm/tests/contracts/BLSPrecompile.sol
snissn fddd3ba
Merge branch 'filecoin-project:master' into master
snissn 729d15b
Update actors/evm/src/interpreter/precompiles/bls_util.rs
snissn 6a66353
Update actors/evm/src/interpreter/precompiles/bls_util.rs
snissn 81dd006
Update actors/evm/src/interpreter/precompiles/bls_util.rs
snissn 8c71907
Merge branch 'filecoin-project:master' into master
snissn 7c251f2
**feat(evm/bls): localize FFI `unsafe`, prefer refs over raw ptrs; mi…
snissn 4727f52
Updated safety comments to clarify the unsafe blocks
aaravm 08dd45a
Update actors/evm/src/interpreter/precompiles/bls12_381/g1_msm.rs
aaravm f0bb2e3
Update actors/evm/src/interpreter/precompiles/bls12_381/g1_msm.rs
aaravm 5d666da
Update actors/evm/src/interpreter/precompiles/bls12_381/g1_msm.rs
aaravm cdf1986
added better comments for g1_add
aaravm e69720d
Update actors/evm/src/interpreter/precompiles/bls12_381/g2_add.rs
aaravm 6434e65
added better comments in g2_add
aaravm bfc77fa
removed unnecessary variables
aaravm 265f531
bls12-381: fix pairing filter; accept ∞; clarify G2 ABI; tests; CI
snissn f98bfe3
Merge branch 'master' of github.com:aaravm/builtin-actors
snissn fb9b974
cargo fmt
snissn 50479b7
Update actors/evm/src/interpreter/precompiles/bls12_381/map_fp2_to_g2.rs
aaravm 34ffcb5
Update actors/evm/src/interpreter/precompiles/bls12_381/g1_msm.rs
aaravm bc9fdcf
Update actors/evm/src/interpreter/precompiles/bls12_381/g2_msm.rs
aaravm eca5ee6
Update actors/evm/src/interpreter/precompiles/bls12_381/pairing.rs
aaravm 3027923
using is_infinity trait
aaravm 635e1ee
add remaining g1_msm tests
aaravm 88fc159
correct g1_msm fail tests
aaravm b48581c
added missing g2_msm test
aaravm 4f50148
added test names in map_gp_to_g1
aaravm 27ded2d
Update actors/evm/src/interpreter/precompiles/bls_util.rs
aaravm 309488e
removed repeated check in bls_util
aaravm 931ba51
reduced ffi calls in bls_util, removed unnecessary debug_assert_eq
aaravm b11a19b
changed safety comment
aaravm 51c871b
added test names to solidity fns
aaravm 3ee50b2
cargo fmt
aaravm 54aa9d6
check c compiler does wasm via @ZenGround0
snissn 92dced7
format
snissn 725341c
Merge branch 'filecoin-project:master' into master
snissn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my understanding of why clang is now a dependency:
We are compiling BLST C code directly into WASM so we can't rely purely on rust compiler which compiles directly from rust to WASM -- we now need a C compiler. Furthermore gcc doesn't yet have support for wasm compilation so it can't be gcc.
This is not the only possible option -- the other option is laid out in the BLST rust bindings crate:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to understand if there is anything we can do in builtin-actors build.rs to make this update to clang / CC dependency as smooth as possible. Should we be checking this dependency before we even start building or is the BLST build error going to be ergonomic enough for those building actors bundles?
My other open question is whether we have clang installed on the github actions infra that runs actor bundle generation -- we'll want to make sure that's the case to prevent jobs from failing mysteriously. All of the CI testing flows build properly but I want to make sure this also holds for tagged bundle generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd recommend throwing this check into the top of the build.rs main function (courtesy of AI but looks correct)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok the above doesn't work for a few reasons but this diff does: