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

Optimize bls precompile by arkworks lib #993

Merged
merged 21 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ repository = "https://github.com/darwinia-network/darwinia"
version = "6.0.0"

[workspace.dependencies]
# arkworks
hujw77 marked this conversation as resolved.
Show resolved Hide resolved
ark-bls12-381 = { default-features = false, version = "0.4.0", features = ["curve"] }
ark-serialize = { default-features = false, version = "0.4.1", features = ["derive"]}
ark-std = { default-features = false, version = "0.4.0" }
ark-ec = { default-features = false, version = "0.4.1" }
ark-ff = { default-features = false, version = "0.4.1" }

# crates.io
array-bytes = { version = "6.0" }
codec = { package = "parity-scale-codec", version = "3.3", default-features = false, features = ["derive"] }
libsecp256k1 = { version = "0.7" }
scale-info = { version = "2.3", default-features = false, features = ["derive"] }
sha3 = { version = "0.9" }
sha2 = { version = "0.10.6", default-features = false }
static_assertions = { version = "1.1" }

# cumulus
Expand Down Expand Up @@ -60,6 +68,7 @@ darwinia-ecdsa-authority = { default-features = false, path = "pallet/e
darwinia-message-gadget = { default-features = false, path = "pallet/message-gadget" }
darwinia-message-transact = { default-features = false, path = "pallet/message-transact" }
darwinia-precompile-assets = { default-features = false, path = "precompile/assets" }
darwinia-precompile-ark-bls12-381 = { default-features = false, path = "precompile/ark-bls12-381" }
hujw77 marked this conversation as resolved.
Show resolved Hide resolved
darwinia-precompile-bls12-381 = { default-features = false, path = "precompile/bls12-381" }
darwinia-precompile-deposit = { default-features = false, path = "precompile/deposit" }
darwinia-precompile-staking = { default-features = false, path = "precompile/staking" }
Expand Down
56 changes: 56 additions & 0 deletions precompile/ark-bls12-381/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[package]
authors.workspace = true
description = "Arkworks BLS12-381 based precompile for EVM pallet."
edition.workspace = true
name = "darwinia-precompile-ark-bls12-381"
readme = "README.md"
version.workspace = true

[dependencies]
# crates.io
sha2 = { workspace = true }

# arkworks
ark-bls12-381 = { workspace = true }
ark-serialize = { workspace = true }
ark-std = { workspace = true }
ark-ec = { workspace = true }
ark-ff = { workspace = true }

# frontier
pallet-evm = { workspace = true }
fp-evm = { workspace = true }

# moonbeam
precompile-utils = { workspace = true }

# substrate
sp-std = { workspace = true }

[dev-dependencies]
rand = "0.8.5"

[features]
default = ["std"]
std = [
# crates.io
"sha2/std",

# arkworks
"ark-bls12-381/std",
"ark-serialize/std",
"ark-std/std",
"ark-ec/std",
"ark-ff/std",

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

# moonbeam
"precompile-utils/std",

# substrate
"sp-std/std",
]

Loading