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

feat(node): Implement builtin actor providing bls12-381 #3771

Merged
merged 40 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
efd2bc4
enable bls12-381 host functions
gshep Feb 29, 2024
59a8c04
decode_bytes benchmark and weigths update
gshep Feb 27, 2024
202670f
bls12_381_multi_miller_loop bench and weights update
gshep Feb 27, 2024
aece8a9
bls12_381_multi_miller_loop
gshep Feb 29, 2024
fdfa6bf
bls12_381_final_exponentiation bench and weights update
gshep Feb 29, 2024
d6e7c72
bls12_381_final_exponentiation
gshep Feb 29, 2024
1c7b458
bls12_381_msm_g1 bench and weights update
gshep Feb 29, 2024
3c882ee
bls12_381_msm_g1
gshep Feb 29, 2024
4cc54a0
bls12_381_msm_g2 bench and weights update
gshep Feb 29, 2024
e205d1d
bls12_381_msm_g2
gshep Feb 29, 2024
c555e01
bls12_381_mul_projective_g1 bench and weights update
gshep Feb 29, 2024
f8cff01
bls12_381_mul_projective_g1
gshep Feb 29, 2024
9561505
bls12_381_mul_projective_g2 bench and weights update
gshep Feb 29, 2024
aedf02d
bls12_381_mul_projective_g2
gshep Feb 29, 2024
9752517
make fmt & clippy
gshep Feb 29, 2024
0b99313
patch for gp-crypto-ec-utils
gshep Mar 14, 2024
7198fc6
fix several review remarks
gshep Mar 14, 2024
ecd4ff9
use the right version of ark-scale
gshep Mar 14, 2024
8605acd
Merge remote-tracking branch 'origin/master'
gshep Mar 22, 2024
a1d3d99
fix review remark: use MAX_PAYLOAD_SIZE
gshep Mar 22, 2024
9e3a7e5
fix remark: group deps in another way
gshep Mar 22, 2024
f6a25fe
fix review remark: rename to gbuiltin-bls381 and make no_std only
gshep Mar 22, 2024
9dd1576
fix review remark: edit test
gshep Mar 22, 2024
f32b8b8
make clippy
gshep Mar 25, 2024
03bb748
fix review remark: doc comments
gshep Mar 25, 2024
a73c5ed
fix review remark: use DecodingError & Custom(LimitedStr) for returning
gshep Mar 25, 2024
38d1ec7
Merge remote-tracking branch 'origin/master'
gshep Mar 25, 2024
0c22a25
Empty-Commit
gshep Mar 26, 2024
1ddb0c8
add new imports to check
gshep Mar 26, 2024
d5621c8
fix wrong array length
gshep Mar 26, 2024
af5aa07
fix extended host functions
gshep Mar 26, 2024
ed0cb5a
add pallet tests for builtin-bls381 actor
gshep Mar 26, 2024
ae5ec40
fix node testing deps
gshep Mar 26, 2024
e6d583b
Merge remote-tracking branch 'origin/master'
gshep Mar 26, 2024
2c3ad48
fix typos
gshep Mar 26, 2024
aaf7e0b
make clippy
gshep Mar 26, 2024
f3250cc
Merge remote-tracking branch 'origin/master'
gshep Mar 28, 2024
3cc537d
demo-bls381 demonstrating interaction with the builtin (#3836)
gshep Mar 28, 2024
873ca8a
fix review remark
gshep Mar 28, 2024
cf11d6f
fix review remarks
gshep Mar 28, 2024
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
177 changes: 177 additions & 0 deletions Cargo.lock

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

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ members = [
"examples/async-signal-entry",
"examples/async-tester",
"examples/autoreply",
"examples/bls381",
"examples/calc-hash",
"examples/custom",
"examples/delayed-reservation-sender",
Expand Down Expand Up @@ -72,6 +73,7 @@ members = [
"examples/waiting-proxy",
"examples/wat",
"galloc",
"gbuiltins/bls381",
"gcli",
"gclient",
"gcore",
Expand Down Expand Up @@ -166,6 +168,12 @@ which = "4.4.2"
winapi = "0.3.9"
paste = "1.0"
tempfile = "3.10.1"
ark-std = { version = "0.4.0", default-features = false }
ark-bls12-381 = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4", default-features = false }
ark-ec = { version = "0.4.2", default-features = false }
ark-ff = { version = "0.4.2", default-features = false }
ark-scale = { version = "0.0.12", default-features = false }

# Published deps
#
Expand All @@ -182,6 +190,7 @@ authorship = { package = "gear-authorship", path = "node/authorship" }
common = { package = "gear-common", path = "common", default-features = false }
core-processor = { package = "gear-core-processor", path = "core-processor", default-features = false }
galloc = { path = "galloc" }
gbuiltin-bls381 = { path = "gbuiltins/bls381", default-features = false }
gcore = { path = "gcore" }
gcli = { path = "gcli" }
gclient = { path = "gclient" }
Expand Down Expand Up @@ -304,6 +313,7 @@ sc-consensus-babe = { version = "0.10.0-dev", git = "https://github.com/gear-tec
sc-consensus-babe-rpc = { version = "0.10.0-dev", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0" }
sc-consensus-epochs = { version = "0.10.0-dev", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0" }
sc-consensus-slots = { version = "0.10.0-dev", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0" }
sp-crypto-ec-utils = { version = "0.4.1", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0", default-features = false }
sp-debug-derive = { version = "8.0.0", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0", default-features = false }
sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0" }
sc-cli = { version = "0.10.0-dev", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-v1.1.0" }
Expand Down Expand Up @@ -379,6 +389,7 @@ demo-async-init = { path = "examples/async-init" }
demo-async-recursion = { path = "examples/async-recursion" }
demo-async-signal-entry = { path = "examples/async-signal-entry" }
demo-async-tester = { path = "examples/async-tester" }
demo-bls381 = { path = "examples/bls381" }
demo-calc-hash = { path = "examples/calc-hash" }
demo-calc-hash-in-one-block = { path = "examples/calc-hash/in-one-block" }
demo-calc-hash-over-blocks = { path = "examples/calc-hash/over-blocks" }
Expand Down
21 changes: 21 additions & 0 deletions examples/bls381/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "demo-bls381"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
codec = { workspace = true, features = ["derive"] }
gstd = { workspace = true, features = ["debug"] }
gbuiltin-bls381.workspace = true
hex-literal.workspace = true

[build-dependencies]
gear-wasm-builder.workspace = true

[features]
default = ["std"]
std = ["codec/std"]
21 changes: 21 additions & 0 deletions examples/bls381/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This file is part of Gear.

// Copyright (C) 2024 Gear Technologies Inc.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

fn main() {
gear_wasm_builder::build();
}
Loading
Loading