Skip to content

Commit

Permalink
Merge pull request #2347 from AleoHQ/feat/network-v0
Browse files Browse the repository at this point in the history
Renames `Testnet3` to `MainnetV0`
  • Loading branch information
howardwu authored Feb 11, 2024
2 parents 0987894 + 97cb08d commit f45f22b
Show file tree
Hide file tree
Showing 393 changed files with 2,656 additions and 2,342 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run snarkVM Benchmarks
on:
push:
branches:
- 'testnet3'
- 'mainnet'

jobs:
# Run benchmarks and stores the output to a file
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<a href="https://circleci.com/gh/AleoHQ/snarkVM"><img src="https://dl.circleci.com/status-badge/img/gh/AleoHQ/snarkVM/tree/testnet3.svg?style=svg"></a>
<a href="https://circleci.com/gh/AleoHQ/snarkVM"><img src="https://dl.circleci.com/status-badge/img/gh/AleoHQ/snarkVM/tree/mainnet.svg?style=svg"></a>
<a href="https://codecov.io/gh/AleoHQ/snarkVM"><img src="https://codecov.io/gh/AleoHQ/snarkVM/branch/master/graph/badge.svg?token=cck8tS9HpO"/></a>
<a href="https://discord.gg/aleo"><img src="https://img.shields.io/discord/700454073459015690?logo=discord"/></a>
<a href="https://twitter.com/AleoHQ"><img src="https://img.shields.io/twitter/follow/AleoHQ?style=social"/></a>
Expand Down
10 changes: 2 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

The following describes our procedure for addressing major and minor security concerns in snarkVM.

## Testnet

As Aleo is currently in the prototype stage and does not operate a platform intended for production use,
our security procedures are designed to promote public disclosure and quick security resolution.

In preparation for the production stage, we will release new security guidelines and
issue new procedures for addressing the disclosure of sensitive security vulnerabilities.
Our security procedures are designed to promote public disclosure and quick security resolution.

### Reporting a Bug

During Testnet, all software bugs should be reported by filing a Github issue.
All software bugs should be reported by filing a Github issue.

If you are unsure and would like to reach out to us directly, please email security \_at\_ aleo.org to elaborate on the issue.
2 changes: 1 addition & 1 deletion algorithms/src/polycommit/kzg10/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
};
use snarkvm_curves::{AffineCurve, PairingCurve, PairingEngine, ProjectiveCurve};
use snarkvm_fields::{ConstraintFieldError, ToConstraintField, Zero};
use snarkvm_parameters::testnet3::PowersOfG;
use snarkvm_parameters::mainnet::PowersOfG;
use snarkvm_utilities::{
borrow::Cow,
error,
Expand Down
8 changes: 4 additions & 4 deletions circuit/environment/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use core::{
fmt,
};

type Field = <console::Testnet3 as console::Environment>::Field;
type Field = <console::MainnetV0 as console::Environment>::Field;

thread_local! {
pub(super) static CONSTRAINT_LIMIT: Cell<Option<u64>> = Cell::new(None);
Expand All @@ -33,10 +33,10 @@ thread_local! {
pub struct Circuit;

impl Environment for Circuit {
type Affine = <console::Testnet3 as console::Environment>::Affine;
type Affine = <console::MainnetV0 as console::Environment>::Affine;
type BaseField = Field;
type Network = console::Testnet3;
type ScalarField = <console::Testnet3 as console::Environment>::Scalar;
type Network = console::MainnetV0;
type ScalarField = <console::MainnetV0 as console::Environment>::Scalar;

/// Returns the `zero` constant.
fn zero() -> LinearCombination<Self::BaseField> {
Expand Down
8 changes: 4 additions & 4 deletions circuit/network/src/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ type E = Circuit;

thread_local! {
/// The group bases for the Aleo signature and encryption schemes.
static GENERATOR_G: Vec<Group<AleoV0>> = Vec::constant(<console::Testnet3 as console::Network>::g_powers().to_vec());
static GENERATOR_G: Vec<Group<AleoV0>> = Vec::constant(<console::MainnetV0 as console::Network>::g_powers().to_vec());

/// The encryption domain as a constant field element.
static ENCRYPTION_DOMAIN: Field<AleoV0> = Field::constant(<console::Testnet3 as console::Network>::encryption_domain());
static ENCRYPTION_DOMAIN: Field<AleoV0> = Field::constant(<console::MainnetV0 as console::Network>::encryption_domain());
/// The graph key domain as a constant field element.
static GRAPH_KEY_DOMAIN: Field<AleoV0> = Field::constant(<console::Testnet3 as console::Network>::graph_key_domain());
static GRAPH_KEY_DOMAIN: Field<AleoV0> = Field::constant(<console::MainnetV0 as console::Network>::graph_key_domain());
/// The serial number domain as a constant field element.
static SERIAL_NUMBER_DOMAIN: Field<AleoV0> = Field::constant(<console::Testnet3 as console::Network>::serial_number_domain());
static SERIAL_NUMBER_DOMAIN: Field<AleoV0> = Field::constant(<console::MainnetV0 as console::Network>::serial_number_domain());

/// The BHP hash function, which can take an input of up to 256 bits.
static BHP_256: BHP256<AleoV0> = BHP256::<AleoV0>::constant(console::BHP_256.clone());
Expand Down
96 changes: 48 additions & 48 deletions circuit/program/src/data/literal/cast/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<E: Environment> Cast<Scalar<E>> for Boolean<E> {
mod tests {
use super::*;
use console::Cast as _;
use console_root::{network::Testnet3, prelude::TestRng};
use console_root::{network::MainnetV0, prelude::TestRng};
use snarkvm_circuit_types::environment::{count_is, Circuit, Eject, Inject, Mode, UpdatableCount};

use std::fmt::Debug;
Expand All @@ -77,114 +77,114 @@ mod tests {
i: usize,
mode: Mode,
_: &mut TestRng,
) -> (console_root::types::Boolean<Testnet3>, Boolean<Circuit>) {
) -> (console_root::types::Boolean<MainnetV0>, Boolean<Circuit>) {
(console_root::types::Boolean::new(i % 2 == 0), Boolean::new(mode, i % 2 == 0))
}

impl_check_cast!(cast, Boolean<Circuit>, console_root::types::Boolean::<Testnet3>);
impl_check_cast!(cast, Boolean<Circuit>, console_root::types::Boolean::<MainnetV0>);

#[test]
fn test_boolean_to_address() {
check_cast::<Address<Circuit>, console_root::types::Address<Testnet3>>(Mode::Constant, count_is!(10, 0, 0, 0));
check_cast::<Address<Circuit>, console_root::types::Address<Testnet3>>(Mode::Public, count_is!(10, 0, 0, 0));
check_cast::<Address<Circuit>, console_root::types::Address<Testnet3>>(Mode::Private, count_is!(10, 0, 0, 0));
check_cast::<Address<Circuit>, console_root::types::Address<MainnetV0>>(Mode::Constant, count_is!(10, 0, 0, 0));
check_cast::<Address<Circuit>, console_root::types::Address<MainnetV0>>(Mode::Public, count_is!(10, 0, 0, 0));
check_cast::<Address<Circuit>, console_root::types::Address<MainnetV0>>(Mode::Private, count_is!(10, 0, 0, 0));
}

#[test]
fn test_boolean_to_boolean() {
check_cast::<Boolean<Circuit>, console_root::types::Boolean<Testnet3>>(Mode::Constant, count_is!(0, 0, 0, 0));
check_cast::<Boolean<Circuit>, console_root::types::Boolean<Testnet3>>(Mode::Public, count_is!(0, 0, 0, 0));
check_cast::<Boolean<Circuit>, console_root::types::Boolean<Testnet3>>(Mode::Private, count_is!(0, 0, 0, 0));
check_cast::<Boolean<Circuit>, console_root::types::Boolean<MainnetV0>>(Mode::Constant, count_is!(0, 0, 0, 0));
check_cast::<Boolean<Circuit>, console_root::types::Boolean<MainnetV0>>(Mode::Public, count_is!(0, 0, 0, 0));
check_cast::<Boolean<Circuit>, console_root::types::Boolean<MainnetV0>>(Mode::Private, count_is!(0, 0, 0, 0));
}

#[test]
fn test_boolean_to_field() {
check_cast::<Field<Circuit>, console_root::types::Field<Testnet3>>(Mode::Constant, count_is!(0, 0, 0, 0));
check_cast::<Field<Circuit>, console_root::types::Field<Testnet3>>(Mode::Public, count_is!(0, 0, 0, 0));
check_cast::<Field<Circuit>, console_root::types::Field<Testnet3>>(Mode::Private, count_is!(0, 0, 0, 0));
check_cast::<Field<Circuit>, console_root::types::Field<MainnetV0>>(Mode::Constant, count_is!(0, 0, 0, 0));
check_cast::<Field<Circuit>, console_root::types::Field<MainnetV0>>(Mode::Public, count_is!(0, 0, 0, 0));
check_cast::<Field<Circuit>, console_root::types::Field<MainnetV0>>(Mode::Private, count_is!(0, 0, 0, 0));
}

#[test]
fn test_boolean_to_group() {
check_cast::<Group<Circuit>, console_root::types::Group<Testnet3>>(Mode::Constant, count_is!(10, 0, 0, 0));
check_cast::<Group<Circuit>, console_root::types::Group<Testnet3>>(Mode::Public, count_is!(10, 0, 0, 0));
check_cast::<Group<Circuit>, console_root::types::Group<Testnet3>>(Mode::Private, count_is!(10, 0, 0, 0));
check_cast::<Group<Circuit>, console_root::types::Group<MainnetV0>>(Mode::Constant, count_is!(10, 0, 0, 0));
check_cast::<Group<Circuit>, console_root::types::Group<MainnetV0>>(Mode::Public, count_is!(10, 0, 0, 0));
check_cast::<Group<Circuit>, console_root::types::Group<MainnetV0>>(Mode::Private, count_is!(10, 0, 0, 0));
}

#[test]
fn test_boolean_to_i8() {
check_cast::<I8<Circuit>, console_root::types::I8<Testnet3>>(Mode::Constant, count_is!(16, 0, 0, 0));
check_cast::<I8<Circuit>, console_root::types::I8<Testnet3>>(Mode::Public, count_is!(16, 0, 0, 0));
check_cast::<I8<Circuit>, console_root::types::I8<Testnet3>>(Mode::Private, count_is!(16, 0, 0, 0));
check_cast::<I8<Circuit>, console_root::types::I8<MainnetV0>>(Mode::Constant, count_is!(16, 0, 0, 0));
check_cast::<I8<Circuit>, console_root::types::I8<MainnetV0>>(Mode::Public, count_is!(16, 0, 0, 0));
check_cast::<I8<Circuit>, console_root::types::I8<MainnetV0>>(Mode::Private, count_is!(16, 0, 0, 0));
}

#[test]
fn test_boolean_to_i16() {
check_cast::<I16<Circuit>, console_root::types::I16<Testnet3>>(Mode::Constant, count_is!(32, 0, 0, 0));
check_cast::<I16<Circuit>, console_root::types::I16<Testnet3>>(Mode::Public, count_is!(32, 0, 0, 0));
check_cast::<I16<Circuit>, console_root::types::I16<Testnet3>>(Mode::Private, count_is!(32, 0, 0, 0));
check_cast::<I16<Circuit>, console_root::types::I16<MainnetV0>>(Mode::Constant, count_is!(32, 0, 0, 0));
check_cast::<I16<Circuit>, console_root::types::I16<MainnetV0>>(Mode::Public, count_is!(32, 0, 0, 0));
check_cast::<I16<Circuit>, console_root::types::I16<MainnetV0>>(Mode::Private, count_is!(32, 0, 0, 0));
}

#[test]
fn test_boolean_to_i32() {
check_cast::<I32<Circuit>, console_root::types::I32<Testnet3>>(Mode::Constant, count_is!(64, 0, 0, 0));
check_cast::<I32<Circuit>, console_root::types::I32<Testnet3>>(Mode::Public, count_is!(64, 0, 0, 0));
check_cast::<I32<Circuit>, console_root::types::I32<Testnet3>>(Mode::Private, count_is!(64, 0, 0, 0));
check_cast::<I32<Circuit>, console_root::types::I32<MainnetV0>>(Mode::Constant, count_is!(64, 0, 0, 0));
check_cast::<I32<Circuit>, console_root::types::I32<MainnetV0>>(Mode::Public, count_is!(64, 0, 0, 0));
check_cast::<I32<Circuit>, console_root::types::I32<MainnetV0>>(Mode::Private, count_is!(64, 0, 0, 0));
}

#[test]
fn test_boolean_to_i64() {
check_cast::<I64<Circuit>, console_root::types::I64<Testnet3>>(Mode::Constant, count_is!(128, 0, 0, 0));
check_cast::<I64<Circuit>, console_root::types::I64<Testnet3>>(Mode::Public, count_is!(128, 0, 0, 0));
check_cast::<I64<Circuit>, console_root::types::I64<Testnet3>>(Mode::Private, count_is!(128, 0, 0, 0));
check_cast::<I64<Circuit>, console_root::types::I64<MainnetV0>>(Mode::Constant, count_is!(128, 0, 0, 0));
check_cast::<I64<Circuit>, console_root::types::I64<MainnetV0>>(Mode::Public, count_is!(128, 0, 0, 0));
check_cast::<I64<Circuit>, console_root::types::I64<MainnetV0>>(Mode::Private, count_is!(128, 0, 0, 0));
}

#[test]
fn test_boolean_to_i128() {
check_cast::<I128<Circuit>, console_root::types::I128<Testnet3>>(Mode::Constant, count_is!(256, 0, 0, 0));
check_cast::<I128<Circuit>, console_root::types::I128<Testnet3>>(Mode::Public, count_is!(256, 0, 0, 0));
check_cast::<I128<Circuit>, console_root::types::I128<Testnet3>>(Mode::Private, count_is!(256, 0, 0, 0));
check_cast::<I128<Circuit>, console_root::types::I128<MainnetV0>>(Mode::Constant, count_is!(256, 0, 0, 0));
check_cast::<I128<Circuit>, console_root::types::I128<MainnetV0>>(Mode::Public, count_is!(256, 0, 0, 0));
check_cast::<I128<Circuit>, console_root::types::I128<MainnetV0>>(Mode::Private, count_is!(256, 0, 0, 0));
}

#[test]
fn test_boolean_to_scalar() {
check_cast::<Scalar<Circuit>, console_root::types::Scalar<Testnet3>>(Mode::Constant, count_is!(2, 0, 0, 0));
check_cast::<Scalar<Circuit>, console_root::types::Scalar<Testnet3>>(Mode::Public, count_is!(2, 0, 0, 0));
check_cast::<Scalar<Circuit>, console_root::types::Scalar<Testnet3>>(Mode::Private, count_is!(2, 0, 0, 0));
check_cast::<Scalar<Circuit>, console_root::types::Scalar<MainnetV0>>(Mode::Constant, count_is!(2, 0, 0, 0));
check_cast::<Scalar<Circuit>, console_root::types::Scalar<MainnetV0>>(Mode::Public, count_is!(2, 0, 0, 0));
check_cast::<Scalar<Circuit>, console_root::types::Scalar<MainnetV0>>(Mode::Private, count_is!(2, 0, 0, 0));
}

#[test]
fn test_boolean_to_u8() {
check_cast::<U8<Circuit>, console_root::types::U8<Testnet3>>(Mode::Constant, count_is!(16, 0, 0, 0));
check_cast::<U8<Circuit>, console_root::types::U8<Testnet3>>(Mode::Public, count_is!(16, 0, 0, 0));
check_cast::<U8<Circuit>, console_root::types::U8<Testnet3>>(Mode::Private, count_is!(16, 0, 0, 0));
check_cast::<U8<Circuit>, console_root::types::U8<MainnetV0>>(Mode::Constant, count_is!(16, 0, 0, 0));
check_cast::<U8<Circuit>, console_root::types::U8<MainnetV0>>(Mode::Public, count_is!(16, 0, 0, 0));
check_cast::<U8<Circuit>, console_root::types::U8<MainnetV0>>(Mode::Private, count_is!(16, 0, 0, 0));
}

#[test]
fn test_boolean_to_u16() {
check_cast::<U16<Circuit>, console_root::types::U16<Testnet3>>(Mode::Constant, count_is!(32, 0, 0, 0));
check_cast::<U16<Circuit>, console_root::types::U16<Testnet3>>(Mode::Public, count_is!(32, 0, 0, 0));
check_cast::<U16<Circuit>, console_root::types::U16<Testnet3>>(Mode::Private, count_is!(32, 0, 0, 0));
check_cast::<U16<Circuit>, console_root::types::U16<MainnetV0>>(Mode::Constant, count_is!(32, 0, 0, 0));
check_cast::<U16<Circuit>, console_root::types::U16<MainnetV0>>(Mode::Public, count_is!(32, 0, 0, 0));
check_cast::<U16<Circuit>, console_root::types::U16<MainnetV0>>(Mode::Private, count_is!(32, 0, 0, 0));
}

#[test]
fn test_boolean_to_u32() {
check_cast::<U32<Circuit>, console_root::types::U32<Testnet3>>(Mode::Constant, count_is!(64, 0, 0, 0));
check_cast::<U32<Circuit>, console_root::types::U32<Testnet3>>(Mode::Public, count_is!(64, 0, 0, 0));
check_cast::<U32<Circuit>, console_root::types::U32<Testnet3>>(Mode::Private, count_is!(64, 0, 0, 0));
check_cast::<U32<Circuit>, console_root::types::U32<MainnetV0>>(Mode::Constant, count_is!(64, 0, 0, 0));
check_cast::<U32<Circuit>, console_root::types::U32<MainnetV0>>(Mode::Public, count_is!(64, 0, 0, 0));
check_cast::<U32<Circuit>, console_root::types::U32<MainnetV0>>(Mode::Private, count_is!(64, 0, 0, 0));
}

#[test]
fn test_boolean_to_u64() {
check_cast::<U64<Circuit>, console_root::types::U64<Testnet3>>(Mode::Constant, count_is!(128, 0, 0, 0));
check_cast::<U64<Circuit>, console_root::types::U64<Testnet3>>(Mode::Public, count_is!(128, 0, 0, 0));
check_cast::<U64<Circuit>, console_root::types::U64<Testnet3>>(Mode::Private, count_is!(128, 0, 0, 0));
check_cast::<U64<Circuit>, console_root::types::U64<MainnetV0>>(Mode::Constant, count_is!(128, 0, 0, 0));
check_cast::<U64<Circuit>, console_root::types::U64<MainnetV0>>(Mode::Public, count_is!(128, 0, 0, 0));
check_cast::<U64<Circuit>, console_root::types::U64<MainnetV0>>(Mode::Private, count_is!(128, 0, 0, 0));
}

#[test]
fn test_boolean_to_u128() {
check_cast::<U128<Circuit>, console_root::types::U128<Testnet3>>(Mode::Constant, count_is!(256, 0, 0, 0));
check_cast::<U128<Circuit>, console_root::types::U128<Testnet3>>(Mode::Public, count_is!(256, 0, 0, 0));
check_cast::<U128<Circuit>, console_root::types::U128<Testnet3>>(Mode::Private, count_is!(256, 0, 0, 0));
check_cast::<U128<Circuit>, console_root::types::U128<MainnetV0>>(Mode::Constant, count_is!(256, 0, 0, 0));
check_cast::<U128<Circuit>, console_root::types::U128<MainnetV0>>(Mode::Public, count_is!(256, 0, 0, 0));
check_cast::<U128<Circuit>, console_root::types::U128<MainnetV0>>(Mode::Private, count_is!(256, 0, 0, 0));
}
}
Loading

0 comments on commit f45f22b

Please sign in to comment.