Skip to content

Commit

Permalink
feat(node): Implement builtin actor providing bls12-381 (#3771)
Browse files Browse the repository at this point in the history
Co-authored-by: LouiseMedova <[email protected]>
  • Loading branch information
gshep and LouiseMedova authored Mar 28, 2024
1 parent 6061bdf commit 26a077e
Show file tree
Hide file tree
Showing 25 changed files with 2,290 additions and 5 deletions.
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

0 comments on commit 26a077e

Please sign in to comment.