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/drand-mainnet #27

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions pallets/drand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ try-runtime = [
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
# use the drand mainnet configuration
mainnet = []
Comment on lines +89 to +90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per a comment below, I don't think we should specify the net as a feature, but as a pallet config

Suggested change
# use the drand mainnet configuration
mainnet = []

2 changes: 1 addition & 1 deletion pallets/drand/docs/how_it_works.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document describes how the drand bridge pallet works.

## Overview

Drand's quicknet periodically outputs pulses of verifiable randomness every 3 seconds. There are various API's which provide access to the beacon, with this pallet simply using the main `api.drand.sh` URI. This pallet runs an offchain worker, which executes each time a node imports a new (*not* finalized) block.
Drand's quicknet periodically outputs pulses of verifiable randomness every 3 seconds. There are various API's which provide access to the beacon, with this pallet simply using the main `https://drand.cloudflare.com` URI. This pallet runs an offchain worker, which executes each time a node imports a new (*not* finalized) block.

### Assumption and Limitations

Expand Down
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
17 changes: 17 additions & 0 deletions pallets/drand/src/bls12_381.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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