Skip to content

Commit

Permalink
drand mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnReedV committed Nov 12, 2024
1 parent 656f0a6 commit 5c664c0
Show file tree
Hide file tree
Showing 14 changed files with 646 additions and 411 deletions.
220 changes: 86 additions & 134 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pallet-evm-precompile-simple = { git = "https://github.com/gztensor/frontier", r
pallet-hotfix-sufficients = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }

#DRAND
pallet-drand = { path = "pallets/drand", default-features = false }
pallet-drand = { path = "pallets/drand", features = ["mainnet"], default-features = false }
sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", features = ["bls12-381"] }
getrandom = { version = "0.2.15", features = ["custom"], default-features = false }
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions pallets/drand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,6 @@ try-runtime = [
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]

# use the drand mainnet configuration
mainnet = []
16 changes: 16 additions & 0 deletions pallets/drand/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2024 by Ideal Labs, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

//! Benchmarking setup for pallet-drand
#![cfg(feature = "runtime-benchmarks")]
use super::*;
Expand Down
16 changes: 16 additions & 0 deletions pallets/drand/src/bls12_381.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2024 by Ideal Labs, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

use crate::utils::ScalarFieldFor;
use ark_bls12_381::{G1Affine, G1Projective, G2Affine, G2Projective};
use ark_ec::{pairing::Pairing, short_weierstrass::SWCurveConfig, AffineRepr};
Expand Down
Loading

0 comments on commit 5c664c0

Please sign in to comment.