Skip to content

Commit

Permalink
Optimize bls precompile by arkworks lib (#993)
Browse files Browse the repository at this point in the history
* Optimize bls precompile by arkworks lib

* Pin bls-test precompose at `address(2017)`

* Fmt

* Update deps

* Add openssl deps in nix

* Remove empty line

* Format and fix compile

* Fix

* Resolve conv

* Fix

* Use rustup on nixos

* Fix

* Disable in the crab and darwinia network

* Add `shell.nix` to .gitigore

* Format

* Format

---------

Co-authored-by: Xavier Lau <[email protected]>
Co-authored-by: bear <[email protected]>
  • Loading branch information
3 people authored Mar 10, 2023
1 parent 355805c commit 5923b2e
Show file tree
Hide file tree
Showing 7 changed files with 358 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# Package Manager
## cargo
target
# nix
shell.nix
## npm
node_modules

Expand Down
136 changes: 128 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions precompile/bls12-381/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
[package]
authors.workspace = true
description = "BLS12-381 implementation for EVM pallet."
description = "Arkworks BLS12-381 based precompile for EVM pallet."
edition.workspace = true
name = "darwinia-precompile-bls12-381"
readme = "README.md"
version.workspace = true

[dependencies]
# crates.io
ark-bls12-381 = { version = "0.4.0", default-features = false, features = ["curve"] }
ark-ec = { version = "0.4.1", default-features = false }
ark-ff = { version = "0.4.1", default-features = false }
ark-serialize = { version = "0.4.1", default-features = false, features = ["derive"] }
sha2 = { version = "0.10.6", default-features = false }

# frontier
fp-evm = { workspace = true }
pallet-evm = { workspace = true }
Expand All @@ -18,27 +25,22 @@ precompile-utils = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
# crates.io
codec = { package = "parity-scale-codec", workspace = true }
scale-info = { workspace = true }

# moonbeam
precompile-utils = { workspace = true, features = ["testing"] }

# substrate
frame-system = { workspace = true }
pallet-balances = { workspace = true, features = ["std"] }
pallet-timestamp = { workspace = true, features = ["std"] }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
rand = { version = "0.8.5" }
ark-std = { version = "0.4.0" }

[features]
default = ["std"]
std = [
# crates.io
"ark-bls12-381/std",
"ark-serialize/std",
"ark-ec/std",
"ark-ff/std",
"sha2/std",

# frontier
"fp-evm/std",
"pallet-evm/std",
"fp-evm/std",

# moonbeam
"precompile-utils/std",
Expand Down
Loading

0 comments on commit 5923b2e

Please sign in to comment.