diff --git a/.cargo/release-version b/.cargo/release-version index f08075098e..60453e6906 100644 --- a/.cargo/release-version +++ b/.cargo/release-version @@ -1 +1 @@ -v0.16.19 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml index c05a0b2055..4aad608529 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,22 +60,22 @@ commands: parameters: cache_key: type: string - default: snarkvm-stable-cache + default: v1.0.0-rust-1.81.0-snarkvm-stable-cache steps: - run: set -e - run: name: Prepare environment and install dependencies command: | - export SCCACHE_CACHE_SIZE=200M + echo 'export "RUSTC_WRAPPER"="sccache"' >> $BASH_ENV + echo 'export "SCCACHE_CACHE_SIZE"="200M"' >> $BASH_ENV export WORK_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache" export SCCACHE_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache" mkdir -p "$CIRCLE_WORKING_DIRECTORY/.bin" wget https://github.com/mozilla/sccache/releases/download/v0.3.0/sccache-v0.3.0-x86_64-unknown-linux-musl.tar.gz tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf sccache-v0.3.0-x86_64-unknown-linux-musl.tar.gz - mv $CIRCLE_WORKING_DIRECTORY/.bin/sccache-v0.3.0-x86_64-unknown-linux-musl/sccache $CIRCLE_WORKING_DIRECTORY/.bin/sccache - export PATH="$PATH:$CIRCLE_WORKING_DIRECTORY/.bin" - export RUSTC_WRAPPER="sccache" - rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry" + chmod +x $CIRCLE_WORKING_DIRECTORY/.bin/sccache-v0.3.0-x86_64-unknown-linux-musl/sccache + mv $CIRCLE_WORKING_DIRECTORY/.bin/sccache-v0.3.0-x86_64-unknown-linux-musl/sccache /home/circleci/bin/sccache + rm -rf "/home/circleci/.cargo/registry" DEBIAN_FRONTEND=noninteractive sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get dist-upgrade -y -o DPkg::Options::=--force-confold DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends clang llvm-dev llvm pkg-config xz-utils make libssl-dev libssl-dev @@ -88,15 +88,17 @@ commands: parameters: cache_key: type: string - default: snarkvm-stable-cache + default: v1.0.0-rust-1.81.0-snarkvm-stable-cache steps: - - run: (sccache -s||true) + - run: (sccache -s || true) - run: set +e - save_cache: key: << parameters.cache_key >> paths: - - .cache/sccache - - .cargo + - /home/circleci/.cache/sccache + - /home/circleci/.cargo + - /home/circleci/.aleo/resources + run_serial: description: "Build and run tests" parameters: @@ -152,7 +154,7 @@ commands: jobs: snarkvm: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.large >> steps: - checkout @@ -162,695 +164,707 @@ jobs: algorithms: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.large >> steps: - run_serial: workspace_member: algorithms - cache_key: snarkvm-algorithms-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-algorithms-cache algorithms-profiler: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: # This runs a single test with profiler enabled workspace_member: algorithms - cache_key: snarkvm-algorithms-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-algorithms-cache flags: varuna::prove_and_verify_with_square_matrix --features profiler circuit: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit - cache_key: snarkvm-circuit-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-cache circuit-account: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/account - cache_key: snarkvm-circuit-account-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-account-cache # This checks that no `console` structs are used in core circuit logic. circuit-account-noconsole: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/account flags: --no-default-features - cache_key: snarkvm-circuit-account-noconsole-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-account-noconsole-cache circuit-algorithms: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: circuit/algorithms - cache_key: snarkvm-circuit-algorithms-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-algorithms-cache circuit-collections: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: workspace_member: circuit/collections - cache_key: snarkvm-circuit-collections-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-collections-cache # This checks that no `console` structs are used in core circuit logic. circuit-collections-noconsole: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: workspace_member: circuit/collections flags: --no-default-features - cache_key: snarkvm-circuit-collections-noconsole-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-collections-noconsole-cache circuit-environment: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/environment - cache_key: snarkvm-circuit-environment-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-environment-cache circuit-network: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/network - cache_key: snarkvm-circuit-network-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-network-cache circuit-program: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: circuit/program - cache_key: snarkvm-circuit-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-program-cache circuit-types: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types - cache_key: snarkvm-circuit-types-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-cache circuit-types-address: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types/address - cache_key: snarkvm-circuit-types-address-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-address-cache circuit-types-boolean: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types/boolean - cache_key: snarkvm-circuit-types-boolean-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-boolean-cache circuit-types-field: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types/field - cache_key: snarkvm-circuit-types-field-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-field-cache circuit-types-group: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types/group - cache_key: snarkvm-circuit-types-group-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-group-cache circuit-types-integers: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: workspace_member: circuit/types/integers - cache_key: snarkvm-circuit-types-integers-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-integers-cache flags: -- --ignored circuit-types-scalar: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types/scalar - cache_key: snarkvm-circuit-types-scalar-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-scalar-cache circuit-types-string: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: circuit/types/string - cache_key: snarkvm-circuit-types-string-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-circuit-types-string-cache console: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console - cache_key: snarkvm-console-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-cache console-account: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: console/account - cache_key: snarkvm-console-account-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-account-cache console-algorithms: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/algorithms - cache_key: snarkvm-console-algorithms-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-algorithms-cache console-collections: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: workspace_member: console/collections - cache_key: snarkvm-console-collections-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-collections-cache console-network: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/network - cache_key: snarkvm-console-network-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-network-cache console-network-environment: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/network/environment - cache_key: snarkvm-console-network-environment-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-network-environment-cache console-program: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/program - cache_key: snarkvm-console-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-program-cache console-types: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types - cache_key: snarkvm-console-types-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-cache console-types-address: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/address - cache_key: snarkvm-console-types-address-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-address-cache console-types-boolean: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/boolean - cache_key: snarkvm-console-types-boolean-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-boolean-cache console-types-field: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/field - cache_key: snarkvm-console-types-field-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-field-cache console-types-group: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/group - cache_key: snarkvm-console-types-group-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-group-cache console-types-integers: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/integers - cache_key: snarkvm-console-types-integers-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-integers-cache console-types-scalar: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/scalar - cache_key: snarkvm-console-types-scalar-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-scalar-cache console-types-string: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: console/types/string - cache_key: snarkvm-console-types-string-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-console-types-string-cache curves: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: curves - cache_key: snarkvm-curves-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-curves-cache fields: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: fields - cache_key: snarkvm-fields-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-fields-cache ledger: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: workspace_member: ledger - cache_key: snarkvm-ledger-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-cache ledger-with-rocksdb: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: flags: --features=rocks workspace_member: ledger - cache_key: snarkvm-ledger-with-rocksdb-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-with-rocksdb-cache ledger-with-valid-solutions: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: valid_solutions --features=test workspace_member: ledger - cache_key: snarkvm-ledger-with-valid-solutions-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-with-valid-solutions-cache ledger-authority: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/authority - cache_key: snarkvm-ledger-authority-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-authority-cache ledger-block: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: workspace_member: ledger/block - cache_key: snarkvm-ledger-block-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-block-cache ledger-committee: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: ledger/committee - cache_key: snarkvm-ledger-committee-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-committee-cache ledger-narwhal: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/narwhal - cache_key: snarkvm-ledger-narwhal-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-cache ledger-narwhal-batch-certificate: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: ledger/narwhal/batch-certificate - cache_key: snarkvm-ledger-narwhal-batch-certificate-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-batch-certificate-cache ledger-narwhal-batch-header: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/narwhal/batch-header - cache_key: snarkvm-ledger-narwhal-batch-header-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-batch-header-cache ledger-narwhal-data: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/narwhal/data - cache_key: snarkvm-ledger-narwhal-data-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-data-cache ledger-narwhal-subdag: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: ledger/narwhal/subdag - cache_key: snarkvm-ledger-narwhal-subdag-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-subdag-cache ledger-narwhal-transmission: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: ledger/narwhal/transmission - cache_key: snarkvm-ledger-narwhal-transmission-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-transmission-cache ledger-narwhal-transmission-id: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: ledger/narwhal/transmission-id - cache_key: snarkvm-ledger-narwhal-transmission-id-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-narwhal-transmission-id-cache ledger-puzzle: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/puzzle - cache_key: snarkvm-ledger-puzzle-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-puzzle-cache ledger-puzzle-epoch: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/puzzle/epoch - cache_key: snarkvm-ledger-puzzle-epoch-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-puzzle-epoch-cache ledger-query: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: ledger/query - cache_key: snarkvm-ledger-query-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-query-cache ledger-store: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: flags: --features=rocks workspace_member: ledger/store - cache_key: snarkvm-ledger-store-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-store-cache ledger-test-helpers: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: workspace_member: ledger/test-helpers - cache_key: snarkvm-ledger-test-helpers-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-ledger-test-helpers-cache parameters: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: + flags: -- --test-threads=2 + workspace_member: parameters + cache_key: v1.0.0-rust-1.81.0-snarkvm-parameters-cache + + parameters-uncached: + docker: + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + resource_class: << pipeline.parameters.large >> + steps: + - run_serial: + flags: -- --test-threads=2 --ignored test_load_bytes_mini workspace_member: parameters - cache_key: snarkvm-parameters-cache + cache_key: v-{{ epoch }}-snarkvm-parameters-cache synthesizer: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: - flags: --lib --bins + flags: --lib --bins -- --test-threads=2 workspace_member: synthesizer - cache_key: snarkvm-synthesizer-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-cache synthesizer-integration: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: - flags: --test '*' + flags: --test '*' -- --test-threads=8 workspace_member: synthesizer - cache_key: snarkvm-synthesizer-integration-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-integration-cache synthesizer-process: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well - resource_class: << pipeline.parameters.large >> + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: + flags: -- --test-threads=8 workspace_member: synthesizer/process - cache_key: snarkvm-synthesizer-process-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-process-cache synthesizer-process-with-rocksdb: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: --features=rocks workspace_member: synthesizer/process - cache_key: snarkvm-synthesizer-process-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-process-cache synthesizer-program: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: --lib --bins workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-cache synthesizer-program-integration: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: flags: --test '*' -- --skip keccak --skip psd --skip sha --skip instruction::is --skip instruction::equal --skip instruction::commit workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-integration-cache synthesizer-program-integration-keccak: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: keccak --test '*' workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-keccak-cache synthesizer-program-integration-psd: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: psd --test '*' workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-psd-cache synthesizer-program-integration-sha: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: sha --test '*' workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-sha-cache synthesizer-program-integration-instruction-is: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.twoxlarge >> steps: - run_serial: flags: instruction::is --test '*' workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-is-cache synthesizer-program-integration-instruction-equal: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - run_serial: flags: instruction::equal --test '*' workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-equal-cache synthesizer-program-integration-instruction-commit: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - run_serial: flags: instruction::commit --test '*' workspace_member: synthesizer/program - cache_key: snarkvm-synthesizer-program-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-program-commit-cache synthesizer-snark: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: synthesizer/snark - cache_key: snarkvm-synthesizer-snark-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-synthesizer-snark-cache utilities: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.large >> steps: - run_serial: workspace_member: utilities - cache_key: snarkvm-utilities-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-utilities-cache utilities-derives: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - run_serial: workspace_member: utilities/derives - cache_key: snarkvm-utilities-derives-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-utilities-derives-cache wasm: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - checkout - setup_environment: - cache_key: snarkvm-wasm-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-wasm-cache - run: no_output_timeout: 30m command: | sudo apt-get install nodejs - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + (cargo install wasm-pack || true) cd wasm && wasm-pack test --node # cargo test --target wasm32-unknown-unknown - clear_environment: - cache_key: snarkvm-wasm-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-wasm-cache check-fmt: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.medium >> steps: - checkout - install_rust_nightly - setup_environment: - cache_key: snarkvm-fmt-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-fmt-cache - run: name: Check style no_output_timeout: 35m command: cargo +nightly fmt --all -- --check - clear_environment: - cache_key: snarkvm-fmt-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-fmt-cache check-clippy: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.xlarge >> steps: - checkout - setup_environment: - cache_key: snarkvm-clippy-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-clippy-cache - run: name: Check Clippy no_output_timeout: 35m @@ -858,22 +872,22 @@ jobs: cargo clippy --workspace --all-targets -- -D warnings cargo clippy --workspace --all-targets --all-features -- -D warnings - clear_environment: - cache_key: snarkvm-clippy-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-clippy-cache check-all-targets: docker: - - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well + - image: cimg/rust:1.81.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: << pipeline.parameters.small >> steps: - checkout - setup_environment: - cache_key: snarkvm-all-targets-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-all-targets-cache - run: name: Check all targets no_output_timeout: 35m command: cargo check --release --workspace --all-targets - clear_environment: - cache_key: snarkvm-all-targets-cache + cache_key: v1.0.0-rust-1.81.0-snarkvm-all-targets-cache verify-windows: executor: @@ -950,6 +964,7 @@ workflows: - ledger-store - ledger-test-helpers - parameters + - parameters-uncached - synthesizer - synthesizer-integration - synthesizer-process diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 340bea64fd..03e5b9555b 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,3 +1,3 @@ -## 👉 [Please follow one of these issue templates](https://github.com/AleoHQ/snarkVM/issues/new/choose) 👈 +## 👉 [Please follow one of these issue templates](https://github.com/AleoNet/snarkVM/issues/new/choose) 👈 Note: to keep the backlog clean and actionable, issues may be immediately closed if they do not follow one of the above issue templates. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6a38950155..142af6df75 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,7 +17,7 @@ diff --git a/.license_header b/.license_header index 2f0c61d37c..137acd8f31 100644 --- a/.license_header +++ b/.license_header @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/.rustfmt.toml b/.rustfmt.toml index 30b32606ff..b5dd5e6730 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -13,4 +13,4 @@ imports_layout = "HorizontalVertical" imports_granularity = "Crate" overflow_delimited_expr = true reorder_impl_items = true -version = "Two" +style_edition = "2024" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0233c6c71..ee6d42c75c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,8 @@ Thank you for your interest in contributing to snarkVM! Below you can find some Please follow the instructions below when filing a pull request: -- ensure that your branch is forked from the current [master](https://github.com/AleoHQ/snarkVM/tree/master) branch -- run `cargo fmt` before you commit; we use the `nightly` version of `rustfmt` to format the code, so you'll need to have the `nightly` toolchain installed on your machine; there's a [git hook](https://git-scm.com/docs/githooks) that ensures proper formatting before any commits can be made, and [`.rustfmt.toml`](https://github.com/AleoHQ/snarkVM/blob/master/.rustfmt.toml) specifies some of the formatting conventions +- ensure that your branch is forked from the current [master](https://github.com/AleoNet/snarkVM/tree/master) branch +- run `cargo fmt` before you commit; we use the `nightly` version of `rustfmt` to format the code, so you'll need to have the `nightly` toolchain installed on your machine; there's a [git hook](https://git-scm.com/docs/githooks) that ensures proper formatting before any commits can be made, and [`.rustfmt.toml`](https://github.com/AleoNet/snarkVM/blob/master/.rustfmt.toml) specifies some of the formatting conventions - run `cargo clippy --all-targets --all-features` to ensure that popular correctness and performance pitfalls are avoided ## Coding conventions diff --git a/Cargo.lock b/Cargo.lock index c777d0dfe3..c70efe4e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2551,7 +2551,7 @@ dependencies = [ [[package]] name = "snarkvm" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anstyle", "anyhow", @@ -2587,7 +2587,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -2626,7 +2626,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms-cuda" -version = "0.16.19" +version = "1.0.0" dependencies = [ "blst", "cc", @@ -2636,7 +2636,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2649,7 +2649,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2661,7 +2661,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "snarkvm-circuit-types", @@ -2673,7 +2673,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2687,7 +2687,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.16.19" +version = "1.0.0" dependencies = [ "criterion", "indexmap 2.2.6", @@ -2708,11 +2708,11 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.16.19" +version = "1.0.0" [[package]] name = "snarkvm-circuit-network" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2723,7 +2723,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "paste", @@ -2741,7 +2741,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2756,7 +2756,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2768,7 +2768,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.16.19" +version = "1.0.0" dependencies = [ "criterion", "snarkvm-circuit-environment", @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2786,7 +2786,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2798,7 +2798,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.16.19" +version = "1.0.0" dependencies = [ "paste", "snarkvm-circuit-environment", @@ -2811,7 +2811,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2821,7 +2821,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.16.19" +version = "1.0.0" dependencies = [ "rand", "snarkvm-circuit-environment", @@ -2834,7 +2834,7 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2846,7 +2846,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "bs58", @@ -2859,7 +2859,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.16.19" +version = "1.0.0" dependencies = [ "blake2s_simd", "criterion", @@ -2877,7 +2877,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "criterion", @@ -2890,7 +2890,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "indexmap 2.2.6", @@ -2912,7 +2912,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "bech32", @@ -2929,7 +2929,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "enum-iterator", @@ -2951,7 +2951,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.16.19" +version = "1.0.0" dependencies = [ "criterion", "snarkvm-console-network", @@ -2967,7 +2967,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -2979,7 +2979,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -2988,7 +2988,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -2999,7 +2999,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -3011,7 +3011,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -3023,7 +3023,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -3035,7 +3035,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -3047,7 +3047,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "criterion", @@ -3062,7 +3062,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3080,7 +3080,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3091,6 +3091,7 @@ dependencies = [ "rand", "rayon", "serde_json", + "snarkvm-circuit", "snarkvm-console", "snarkvm-ledger-authority", "snarkvm-ledger-block", @@ -3101,13 +3102,14 @@ dependencies = [ "snarkvm-ledger-store", "snarkvm-ledger-test-helpers", "snarkvm-synthesizer", + "snarkvm-utilities", "time", "tracing", ] [[package]] name = "snarkvm-ledger-authority" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "bincode", @@ -3120,7 +3122,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "indexmap 2.2.6", @@ -3132,6 +3134,7 @@ dependencies = [ "snarkvm-ledger-authority", "snarkvm-ledger-committee", "snarkvm-ledger-narwhal-batch-header", + "snarkvm-ledger-narwhal-data", "snarkvm-ledger-narwhal-subdag", "snarkvm-ledger-narwhal-transmission-id", "snarkvm-ledger-puzzle", @@ -3144,7 +3147,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" -version = "0.16.19" +version = "1.0.0" dependencies = [ "anyhow", "bincode", @@ -3165,7 +3168,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" -version = "0.16.19" +version = "1.0.0" dependencies = [ "snarkvm-ledger-narwhal", "snarkvm-ledger-narwhal-batch-certificate", @@ -3178,7 +3181,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "indexmap 2.2.6", @@ -3192,7 +3195,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "indexmap 2.2.6", @@ -3206,17 +3209,19 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bytes", "serde_json", "snarkvm-console", + "snarkvm-ledger-block", + "snarkvm-ledger-test-helpers", "tokio", ] [[package]] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "indexmap 2.2.6", @@ -3232,7 +3237,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "bytes", @@ -3245,7 +3250,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "serde_json", @@ -3255,7 +3260,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-puzzle" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3276,7 +3281,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-puzzle-epoch" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3296,7 +3301,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" -version = "0.16.19" +version = "1.0.0" dependencies = [ "async-trait", "reqwest", @@ -3308,7 +3313,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std-storage", "anyhow", @@ -3338,7 +3343,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" -version = "0.16.19" +version = "1.0.0" dependencies = [ "once_cell", "snarkvm-circuit", @@ -3352,7 +3357,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" -version = "0.16.19" +version = "1.0.0" dependencies = [ "metrics", "metrics-exporter-prometheus", @@ -3360,7 +3365,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3394,7 +3399,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3416,6 +3421,7 @@ dependencies = [ "snarkvm-ledger-block", "snarkvm-ledger-committee", "snarkvm-ledger-narwhal-batch-header", + "snarkvm-ledger-narwhal-data", "snarkvm-ledger-puzzle", "snarkvm-ledger-puzzle-epoch", "snarkvm-ledger-query", @@ -3432,7 +3438,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "bincode", @@ -3442,6 +3448,7 @@ dependencies = [ "once_cell", "parking_lot", "rand", + "rand_chacha", "rayon", "serde_json", "snarkvm-circuit", @@ -3459,7 +3466,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "criterion", @@ -3475,7 +3482,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" -version = "0.16.19" +version = "1.0.0" dependencies = [ "bincode", "colored", @@ -3488,7 +3495,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.16.19" +version = "1.0.0" dependencies = [ "aleo-std", "anyhow", @@ -3508,7 +3515,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.16.19" +version = "1.0.0" dependencies = [ "proc-macro2", "quote 1.0.35", @@ -3517,7 +3524,7 @@ dependencies = [ [[package]] name = "snarkvm-wasm" -version = "0.16.19" +version = "1.0.0" dependencies = [ "getrandom", "snarkvm-circuit-network", diff --git a/Cargo.toml b/Cargo.toml index 2140fafde8..01dda7a469 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A decentralized virtual machine" homepage = "https://aleo.org" @@ -22,7 +22,7 @@ categories = [ include = [ "Cargo.toml", "vm", "README.md", "LICENSE.md" ] license = "Apache-2.0" edition = "2021" -rust-version = "1.76.0" # Attention - Change the MSRV in rust-toolchain and in .circleci/config.yml as well +rust-version = "1.81.0" # Attention - Change the MSRV in rust-toolchain and in .circleci/config.yml as well [workspace] members = [ @@ -152,58 +152,58 @@ wasm = [ "snarkvm-wasm" ] [dependencies.snarkvm-algorithms] path = "./algorithms" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit] path = "./circuit" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console] path = "./console" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-curves] path = "./curves" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-fields] path = "./fields" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-ledger] path = "./ledger" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-metrics] path = "./metrics" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-parameters] path = "./parameters" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-synthesizer] path = "./synthesizer" -version = "=0.16.19" +version = "=1.0.0" default-features = false optional = true [dependencies.snarkvm-utilities] path = "./utilities" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-wasm] path = "./wasm" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.anstyle] diff --git a/algorithms/Cargo.toml b/algorithms/Cargo.toml index fd8e78c5e1..2ea45acba3 100644 --- a/algorithms/Cargo.toml +++ b/algorithms/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-algorithms" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Algorithms for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -47,27 +47,27 @@ required-features = [ "test" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-parameters] path = "../parameters" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-algorithms-cuda] path = "./cuda" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.aleo-std] diff --git a/algorithms/benches/crypto_hash/poseidon.rs b/algorithms/benches/crypto_hash/poseidon.rs index 283de61e45..41c7f018ba 100644 --- a/algorithms/benches/crypto_hash/poseidon.rs +++ b/algorithms/benches/crypto_hash/poseidon.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,7 +16,7 @@ #[macro_use] extern crate criterion; -use snarkvm_algorithms::{crypto_hash::PoseidonSponge, AlgebraicSponge}; +use snarkvm_algorithms::{AlgebraicSponge, crypto_hash::PoseidonSponge}; use snarkvm_curves::bls12_377::{Fq, FqParameters}; use snarkvm_fields::Fp384; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/algorithms/benches/fft/fft.rs b/algorithms/benches/fft/fft.rs index 0f52c2ff37..652eef55dc 100644 --- a/algorithms/benches/fft/fft.rs +++ b/algorithms/benches/fft/fft.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ use snarkvm_curves::bls12_377::Fr as Bls12_377_Fr; use snarkvm_fields::PrimeField; use snarkvm_utilities::TestRng; -use criterion::{criterion_group, criterion_main, Bencher, BenchmarkId, Criterion}; +use criterion::{Bencher, BenchmarkId, Criterion, criterion_group, criterion_main}; use std::cmp::min; /// Degree bounds to benchmark on diff --git a/algorithms/benches/msm/variable_base.rs b/algorithms/benches/msm/variable_base.rs index 5382d2cd75..651a651028 100644 --- a/algorithms/benches/msm/variable_base.rs +++ b/algorithms/benches/msm/variable_base.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/benches/snark/varuna.rs b/algorithms/benches/snark/varuna.rs index ea23d8d4ed..a18522956d 100644 --- a/algorithms/benches/snark/varuna.rs +++ b/algorithms/benches/snark/varuna.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,10 +17,10 @@ extern crate criterion; use snarkvm_algorithms::{ - crypto_hash::PoseidonSponge, - snark::varuna::{ahp::AHPForR1CS, CircuitVerifyingKey, TestCircuit, VarunaHidingMode, VarunaSNARK}, AlgebraicSponge, SNARK, + crypto_hash::PoseidonSponge, + snark::varuna::{CircuitVerifyingKey, TestCircuit, VarunaHidingMode, VarunaSNARK, ahp::AHPForR1CS}, }; use snarkvm_curves::bls12_377::{Bls12_377, Fq, Fr}; use snarkvm_utilities::{CanonicalDeserialize, CanonicalSerialize, TestRng}; diff --git a/algorithms/cuda/Cargo.toml b/algorithms/cuda/Cargo.toml index 3c1ff3f252..16affe4cbd 100644 --- a/algorithms/cuda/Cargo.toml +++ b/algorithms/cuda/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-algorithms-cuda" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Cuda optimizations for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", diff --git a/algorithms/cuda/build.rs b/algorithms/cuda/build.rs index 8e85744b6c..174110d885 100644 --- a/algorithms/cuda/build.rs +++ b/algorithms/cuda/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,9 +18,6 @@ use std::{env, path::PathBuf}; fn main() { let curve = "FEATURE_BLS12_377"; - // account for cross-compilation [by examining environment variable] - let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); - // Set CC environment variable to choose an alternative C compiler. // Optimization level depends on whether or not --release is passed // or implied. @@ -29,28 +27,22 @@ fn main() { let files = vec![c_src_dir.join("lib.c")]; let mut cc_opt = None; - match (cfg!(feature = "portable"), cfg!(feature = "force-adx")) { - (true, false) => { + match cfg!(feature = "portable") { + true => { println!("Compiling in portable mode without ISA extensions"); cc_opt = Some("__BLST_PORTABLE__"); } - (false, true) => { - if target_arch.eq("x86_64") { - println!("Enabling ADX support via `force-adx` feature"); - cc_opt = Some("__ADX__"); - } else { - println!("`force-adx` is ignored for non-x86_64 targets"); - } - } - (false, false) => - { + false => { #[cfg(target_arch = "x86_64")] - if target_arch.eq("x86_64") && std::is_x86_feature_detected!("adx") { - println!("Enabling ADX because it was detected on the host"); - cc_opt = Some("__ADX__"); + { + // account for cross-compilation [by examining environment variable] + let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default(); + if target_arch.eq("x86_64") && std::is_x86_feature_detected!("adx") { + println!("Enabling ADX because it was detected on the host"); + cc_opt = Some("__ADX__"); + } } } - (true, true) => panic!("Cannot compile with both `portable` and `force-adx` features"), } cc.flag_if_supported("-mno-avx") // avoid costly transitions @@ -85,8 +77,6 @@ fn main() { nvcc.flag("-Xcompiler").flag("-Wno-unused-function"); nvcc.flag("-Xcompiler").flag("-Wno-subobject-linkage"); nvcc.define("TAKE_RESPONSIBILITY_FOR_ERROR_MESSAGE", None); - #[cfg(feature = "cuda-mobile")] - nvcc.define("NTHREADS", "128"); nvcc.define(curve, None); if let Some(def) = cc_opt { nvcc.define(def, None); diff --git a/algorithms/cuda/cuda/polynomial.cuh b/algorithms/cuda/cuda/polynomial.cuh index 745075accc..cea65f8d3f 100644 --- a/algorithms/cuda/cuda/polynomial.cuh +++ b/algorithms/cuda/cuda/polynomial.cuh @@ -1,18 +1,17 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. -// The snarkVM library 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. +// 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: -// The snarkVM library 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. +// http://www.apache.org/licenses/LICENSE-2.0 -// You should have received a copy of the GNU General Public License -// along with the snarkVM library. If not, see . +// 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. #ifndef __POLYNOMIAL_CUH__ #define __POLYNOMIAL_CUH__ diff --git a/algorithms/cuda/cuda/snarkvm.cu b/algorithms/cuda/cuda/snarkvm.cu index 483a038095..b9e5e6892b 100644 --- a/algorithms/cuda/cuda/snarkvm.cu +++ b/algorithms/cuda/cuda/snarkvm.cu @@ -1,18 +1,17 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. -// The snarkVM library 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. +// 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: -// The snarkVM library 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. +// http://www.apache.org/licenses/LICENSE-2.0 -// You should have received a copy of the GNU General Public License -// along with the snarkVM library. If not, see . +// 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. #include diff --git a/algorithms/cuda/cuda/snarkvm_api.cu b/algorithms/cuda/cuda/snarkvm_api.cu index 83468342bc..978cc21504 100644 --- a/algorithms/cuda/cuda/snarkvm_api.cu +++ b/algorithms/cuda/cuda/snarkvm_api.cu @@ -1,18 +1,17 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. -// The snarkVM library 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. +// 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: -// The snarkVM library 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. +// http://www.apache.org/licenses/LICENSE-2.0 -// You should have received a copy of the GNU General Public License -// along with the snarkVM library. If not, see . +// 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. #include diff --git a/algorithms/cuda/src/lib.c b/algorithms/cuda/src/lib.c index 2f3f795914..137acd8f31 100644 --- a/algorithms/cuda/src/lib.c +++ b/algorithms/cuda/src/lib.c @@ -1,15 +1,14 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. -// The snarkVM library 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. +// 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: -// The snarkVM library 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. +// http://www.apache.org/licenses/LICENSE-2.0 -// You should have received a copy of the GNU General Public License -// along with the snarkVM library. If not, see . +// 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. diff --git a/algorithms/cuda/src/lib.rs b/algorithms/cuda/src/lib.rs index 11b4218a69..6a4b61527e 100644 --- a/algorithms/cuda/src/lib.rs +++ b/algorithms/cuda/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/examples/msm.rs b/algorithms/examples/msm.rs index c3abbff5ab..0a89b71b61 100644 --- a/algorithms/examples/msm.rs +++ b/algorithms/examples/msm.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/crypto_hash/mod.rs b/algorithms/src/crypto_hash/mod.rs index 2f59d8c8e4..cb9ea1f720 100644 --- a/algorithms/src/crypto_hash/mod.rs +++ b/algorithms/src/crypto_hash/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/crypto_hash/poseidon.rs b/algorithms/src/crypto_hash/poseidon.rs index 77a28d8d47..71ffd5a02d 100644 --- a/algorithms/src/crypto_hash/poseidon.rs +++ b/algorithms/src/crypto_hash/poseidon.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{nonnative_params::*, AlgebraicSponge, DuplexSpongeMode}; +use crate::{AlgebraicSponge, DuplexSpongeMode, nonnative_params::*}; use snarkvm_fields::{FieldParameters, PoseidonParameters, PrimeField, ToConstraintField}; use snarkvm_utilities::{BigInteger, FromBits, ToBits}; diff --git a/algorithms/src/crypto_hash/sha256.rs b/algorithms/src/crypto_hash/sha256.rs index db8a50957c..ed8f7f7365 100644 --- a/algorithms/src/crypto_hash/sha256.rs +++ b/algorithms/src/crypto_hash/sha256.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/crypto_hash/tests.rs b/algorithms/src/crypto_hash/tests.rs index ffd51f01ad..90021f055f 100644 --- a/algorithms/src/crypto_hash/tests.rs +++ b/algorithms/src/crypto_hash/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{crypto_hash::PoseidonSponge, AlgebraicSponge, DuplexSpongeMode}; +use crate::{AlgebraicSponge, DuplexSpongeMode, crypto_hash::PoseidonSponge}; use snarkvm_curves::bls12_377::Fr; use snarkvm_fields::{PoseidonDefaultField, PoseidonGrainLFSR}; diff --git a/algorithms/src/errors.rs b/algorithms/src/errors.rs index dd932b2b28..7002591676 100644 --- a/algorithms/src/errors.rs +++ b/algorithms/src/errors.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/fft/domain.rs b/algorithms/src/fft/domain.rs index bbac0f4c1d..64cd932d55 100644 --- a/algorithms/src/fft/domain.rs +++ b/algorithms/src/fft/domain.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -31,7 +32,7 @@ use crate::{ cfg_iter_mut, fft::{DomainCoeff, SparsePolynomial}, }; -use snarkvm_fields::{batch_inversion, FftField, FftParameters, Field}; +use snarkvm_fields::{FftField, FftParameters, Field, batch_inversion}; #[cfg(not(feature = "serial"))] use snarkvm_utilities::max_available_threads; use snarkvm_utilities::{execute_with_max_available_threads, serialize::*}; @@ -39,7 +40,7 @@ use snarkvm_utilities::{execute_with_max_available_threads, serialize::*}; use rand::Rng; use std::{borrow::Cow, fmt}; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/algorithms/src/fft/evaluations.rs b/algorithms/src/fft/evaluations.rs index 532e06756b..fe6b8724cd 100644 --- a/algorithms/src/fft/evaluations.rs +++ b/algorithms/src/fft/evaluations.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/fft/mod.rs b/algorithms/src/fft/mod.rs index 55dcef322b..6a6855d424 100644 --- a/algorithms/src/fft/mod.rs +++ b/algorithms/src/fft/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/fft/polynomial/dense.rs b/algorithms/src/fft/polynomial/dense.rs index 80b9658fc1..735e1ab71f 100644 --- a/algorithms/src/fft/polynomial/dense.rs +++ b/algorithms/src/fft/polynomial/dense.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/fft/polynomial/mod.rs b/algorithms/src/fft/polynomial/mod.rs index 8fcb907408..33f57ccd4d 100644 --- a/algorithms/src/fft/polynomial/mod.rs +++ b/algorithms/src/fft/polynomial/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,11 +16,11 @@ //! Work with sparse and dense polynomials. use crate::fft::{EvaluationDomain, Evaluations}; -use snarkvm_fields::{Field, PrimeField}; -use snarkvm_utilities::{cfg_iter_mut, serialize::*, SerializationError}; use Polynomial::*; +use snarkvm_fields::{Field, PrimeField}; +use snarkvm_utilities::{SerializationError, cfg_iter_mut, serialize::*}; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; use std::{borrow::Cow, convert::TryInto}; #[cfg(not(feature = "serial"))] diff --git a/algorithms/src/fft/polynomial/multiplier.rs b/algorithms/src/fft/polynomial/multiplier.rs index 0c7519ca5d..3bdcb76bdd 100644 --- a/algorithms/src/fft/polynomial/multiplier.rs +++ b/algorithms/src/fft/polynomial/multiplier.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,7 +19,7 @@ use crate::fft::domain::{FFTPrecomputation, IFFTPrecomputation}; /// A struct that helps multiply a batch of polynomials use super::*; -use snarkvm_utilities::{cfg_into_iter, cfg_iter, cfg_iter_mut, cfg_reduce_with, ExecutionPool}; +use snarkvm_utilities::{ExecutionPool, cfg_into_iter, cfg_iter, cfg_iter_mut, cfg_reduce_with}; #[derive(Default)] pub struct PolyMultiplier<'a, F: PrimeField> { diff --git a/algorithms/src/fft/polynomial/sparse.rs b/algorithms/src/fft/polynomial/sparse.rs index 16e397e357..1dae7e126b 100644 --- a/algorithms/src/fft/polynomial/sparse.rs +++ b/algorithms/src/fft/polynomial/sparse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/fft/tests.rs b/algorithms/src/fft/tests.rs index a6733f4eda..b717d7badf 100644 --- a/algorithms/src/fft/tests.rs +++ b/algorithms/src/fft/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::fft::{domain::*, DensePolynomial}; +use crate::fft::{DensePolynomial, domain::*}; use rand::Rng; use snarkvm_curves::bls12_377::{Fr, G1Projective}; use snarkvm_fields::{FftField, Field, One, Zero}; diff --git a/algorithms/src/lib.rs b/algorithms/src/lib.rs index 6d0f9613d3..66b56cbd75 100644 --- a/algorithms/src/lib.rs +++ b/algorithms/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/msm/fixed_base.rs b/algorithms/src/msm/fixed_base.rs index 5b167a6d96..8c6ef90094 100644 --- a/algorithms/src/msm/fixed_base.rs +++ b/algorithms/src/msm/fixed_base.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use snarkvm_curves::traits::ProjectiveCurve; use snarkvm_fields::{FieldParameters, PrimeField}; -use snarkvm_utilities::{cfg_into_iter, cfg_iter, cfg_iter_mut, ToBits}; +use snarkvm_utilities::{ToBits, cfg_into_iter, cfg_iter, cfg_iter_mut}; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/algorithms/src/msm/mod.rs b/algorithms/src/msm/mod.rs index 97fe46858e..3ef50eac63 100644 --- a/algorithms/src/msm/mod.rs +++ b/algorithms/src/msm/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/msm/tests.rs b/algorithms/src/msm/tests.rs index 80f9e5faf2..2fd1c243bd 100644 --- a/algorithms/src/msm/tests.rs +++ b/algorithms/src/msm/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,8 +20,8 @@ use snarkvm_curves::{ }; use snarkvm_fields::{PrimeField, Zero}; use snarkvm_utilities::{ - rand::{TestRng, Uniform}, BitIteratorBE, + rand::{TestRng, Uniform}, }; fn naive_variable_base_msm( diff --git a/algorithms/src/msm/variable_base/batched.rs b/algorithms/src/msm/variable_base/batched.rs index fe8b44c071..0c284754bf 100644 --- a/algorithms/src/msm/variable_base/batched.rs +++ b/algorithms/src/msm/variable_base/batched.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use snarkvm_curves::{AffineCurve, ProjectiveCurve}; use snarkvm_fields::{Field, One, PrimeField, Zero}; -use snarkvm_utilities::{cfg_into_iter, BigInteger, BitIteratorBE}; +use snarkvm_utilities::{BigInteger, BitIteratorBE, cfg_into_iter}; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/algorithms/src/msm/variable_base/mod.rs b/algorithms/src/msm/variable_base/mod.rs index 11d4910bf3..c5af69c50f 100644 --- a/algorithms/src/msm/variable_base/mod.rs +++ b/algorithms/src/msm/variable_base/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/msm/variable_base/prefetch.rs b/algorithms/src/msm/variable_base/prefetch.rs index 65b7592c5d..1cae8015a4 100644 --- a/algorithms/src/msm/variable_base/prefetch.rs +++ b/algorithms/src/msm/variable_base/prefetch.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/msm/variable_base/standard.rs b/algorithms/src/msm/variable_base/standard.rs index ddba995b4f..5fb1399d0f 100644 --- a/algorithms/src/msm/variable_base/standard.rs +++ b/algorithms/src/msm/variable_base/standard.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use snarkvm_curves::{AffineCurve, ProjectiveCurve}; use snarkvm_fields::{One, PrimeField, Zero}; -use snarkvm_utilities::{cfg_into_iter, BigInteger}; +use snarkvm_utilities::{BigInteger, cfg_into_iter}; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/algorithms/src/polycommit/error.rs b/algorithms/src/polycommit/error.rs index f101d30224..c5f2b38c69 100644 --- a/algorithms/src/polycommit/error.rs +++ b/algorithms/src/polycommit/error.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/polycommit/kzg10/data_structures.rs b/algorithms/src/polycommit/kzg10/data_structures.rs index 0ceae0b654..d8b2aa91e0 100644 --- a/algorithms/src/polycommit/kzg10/data_structures.rs +++ b/algorithms/src/polycommit/kzg10/data_structures.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,19 +14,19 @@ // limitations under the License. use crate::{ - fft::{DensePolynomial, EvaluationDomain}, AlgebraicSponge, + fft::{DensePolynomial, EvaluationDomain}, }; use snarkvm_curves::{AffineCurve, PairingCurve, PairingEngine, ProjectiveCurve}; use snarkvm_fields::{ConstraintFieldError, ToConstraintField, Zero}; use snarkvm_parameters::mainnet::PowersOfG; use snarkvm_utilities::{ + FromBytes, + ToBytes, borrow::Cow, error, io::{Read, Write}, serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, Valid, Validate}, - FromBytes, - ToBytes, }; use crate::srs::{UniversalProver, UniversalVerifier}; diff --git a/algorithms/src/polycommit/kzg10/mod.rs b/algorithms/src/polycommit/kzg10/mod.rs index e6fe95d534..986dd3713e 100644 --- a/algorithms/src/polycommit/kzg10/mod.rs +++ b/algorithms/src/polycommit/kzg10/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -26,9 +27,9 @@ use crate::{ }; use snarkvm_curves::traits::{AffineCurve, PairingCurve, PairingEngine, ProjectiveCurve}; use snarkvm_fields::{One, PrimeField, Zero}; -use snarkvm_utilities::{cfg_iter, cfg_iter_mut, rand::Uniform, BitIteratorBE}; +use snarkvm_utilities::{BitIteratorBE, cfg_iter, cfg_iter_mut, rand::Uniform}; -use anyhow::{anyhow, ensure, Result}; +use anyhow::{Result, anyhow, ensure}; use core::{marker::PhantomData, ops::Mul}; use itertools::Itertools; use rand_core::RngCore; @@ -478,7 +479,7 @@ mod tests { #![allow(clippy::needless_borrow)] use super::*; use snarkvm_curves::bls12_377::{Bls12_377, Fr}; - use snarkvm_utilities::{rand::TestRng, FromBytes, ToBytes}; + use snarkvm_utilities::{FromBytes, ToBytes, rand::TestRng}; use std::borrow::Cow; diff --git a/algorithms/src/polycommit/mod.rs b/algorithms/src/polycommit/mod.rs index 3cc32b5e1d..4e574a395e 100644 --- a/algorithms/src/polycommit/mod.rs +++ b/algorithms/src/polycommit/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/polycommit/optional_rng.rs b/algorithms/src/polycommit/optional_rng.rs index 9e662591e4..8a2e6f2d74 100644 --- a/algorithms/src/polycommit/optional_rng.rs +++ b/algorithms/src/polycommit/optional_rng.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/polycommit/sonic_pc/data_structures.rs b/algorithms/src/polycommit/sonic_pc/data_structures.rs index 6504d198fa..a7aaa6d7b3 100644 --- a/algorithms/src/polycommit/sonic_pc/data_structures.rs +++ b/algorithms/src/polycommit/sonic_pc/data_structures.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use super::{LabeledPolynomial, PolynomialInfo}; use crate::{crypto_hash::sha256::sha256, fft::EvaluationDomain, polycommit::kzg10}; use snarkvm_curves::PairingEngine; use snarkvm_fields::{ConstraintFieldError, Field, PrimeField, ToConstraintField}; -use snarkvm_utilities::{error, serialize::*, FromBytes, ToBytes}; +use snarkvm_utilities::{FromBytes, ToBytes, error, serialize::*}; use hashbrown::HashMap; use std::{ diff --git a/algorithms/src/polycommit/sonic_pc/mod.rs b/algorithms/src/polycommit/sonic_pc/mod.rs index 847483ca69..1f295182b2 100644 --- a/algorithms/src/polycommit/sonic_pc/mod.rs +++ b/algorithms/src/polycommit/sonic_pc/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,18 +14,18 @@ // limitations under the License. use crate::{ + AlgebraicSponge, fft::DensePolynomial, msm::variable_base::VariableBase, - polycommit::{kzg10, optional_rng::OptionalRng, PCError}, + polycommit::{PCError, kzg10, optional_rng::OptionalRng}, srs::{UniversalProver, UniversalVerifier}, - AlgebraicSponge, }; use hashbrown::HashMap; use itertools::Itertools; use snarkvm_curves::traits::{AffineCurve, PairingCurve, PairingEngine, ProjectiveCurve}; use snarkvm_fields::{One, Zero}; -use anyhow::{bail, ensure, Result}; +use anyhow::{Result, bail, ensure}; use core::{convert::TryInto, marker::PhantomData, ops::Mul}; use rand_core::{RngCore, SeedableRng}; use std::{ @@ -684,7 +685,7 @@ mod tests { use super::{CommitterKey, SonicKZG10}; use crate::{crypto_hash::PoseidonSponge, polycommit::test_templates::*}; use snarkvm_curves::bls12_377::{Bls12_377, Fq}; - use snarkvm_utilities::{rand::TestRng, FromBytes, ToBytes}; + use snarkvm_utilities::{FromBytes, ToBytes, rand::TestRng}; use rand::distributions::Distribution; diff --git a/algorithms/src/polycommit/sonic_pc/polynomial.rs b/algorithms/src/polycommit/sonic_pc/polynomial.rs index a18a0bbace..912905e35d 100644 --- a/algorithms/src/polycommit/sonic_pc/polynomial.rs +++ b/algorithms/src/polycommit/sonic_pc/polynomial.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,7 +16,7 @@ use super::PolynomialLabel; use crate::fft::{DensePolynomial, EvaluationDomain, Evaluations as EvaluationsOnDomain, Polynomial, SparsePolynomial}; use snarkvm_fields::{Field, PrimeField}; -use snarkvm_utilities::{cfg_iter, cfg_iter_mut, CanonicalDeserialize, CanonicalSerialize}; +use snarkvm_utilities::{CanonicalDeserialize, CanonicalSerialize, cfg_iter, cfg_iter_mut}; use anyhow::Result; use std::borrow::Cow; diff --git a/algorithms/src/polycommit/test_templates.rs b/algorithms/src/polycommit/test_templates.rs index 60f73f027f..47288962ff 100644 --- a/algorithms/src/polycommit/test_templates.rs +++ b/algorithms/src/polycommit/test_templates.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,13 +25,13 @@ use super::sonic_pc::{ SonicKZG10, }; use crate::{ + AlgebraicSponge, fft::DensePolynomial, polycommit::{ - sonic_pc::{LabeledPolynomial, LabeledPolynomialWithBasis, LinearCombination}, PCError, + sonic_pc::{LabeledPolynomial, LabeledPolynomialWithBasis, LinearCombination}, }, srs::UniversalVerifier, - AlgebraicSponge, }; use snarkvm_curves::PairingEngine; use snarkvm_fields::{One, Zero}; @@ -38,8 +39,8 @@ use snarkvm_utilities::rand::{TestRng, Uniform}; use itertools::Itertools; use rand::{ - distributions::{self, Distribution}, Rng, + distributions::{self, Distribution}, }; use std::marker::PhantomData; diff --git a/algorithms/src/r1cs/assignment.rs b/algorithms/src/r1cs/assignment.rs index a59e637dbd..8049c5f5d9 100644 --- a/algorithms/src/r1cs/assignment.rs +++ b/algorithms/src/r1cs/assignment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/r1cs/constraint_counter.rs b/algorithms/src/r1cs/constraint_counter.rs index a76360f261..af59d4626c 100644 --- a/algorithms/src/r1cs/constraint_counter.rs +++ b/algorithms/src/r1cs/constraint_counter.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, ConstraintSystem, Index, LinearCombination, Variable}; +use crate::r1cs::{ConstraintSystem, Index, LinearCombination, Variable, errors::SynthesisError}; use snarkvm_fields::Field; /// Constraint counter for testing purposes. diff --git a/algorithms/src/r1cs/constraint_system.rs b/algorithms/src/r1cs/constraint_system.rs index 0c73678a1a..1c9ac45a09 100644 --- a/algorithms/src/r1cs/constraint_system.rs +++ b/algorithms/src/r1cs/constraint_system.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, Index, LinearCombination, Namespace, Variable}; +use crate::r1cs::{Index, LinearCombination, Namespace, Variable, errors::SynthesisError}; use snarkvm_fields::Field; use std::marker::PhantomData; diff --git a/algorithms/src/r1cs/errors.rs b/algorithms/src/r1cs/errors.rs index 52b386e137..64ee84abcb 100644 --- a/algorithms/src/r1cs/errors.rs +++ b/algorithms/src/r1cs/errors.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/r1cs/linear_combination.rs b/algorithms/src/r1cs/linear_combination.rs index 20465fca64..50fc5f92b1 100644 --- a/algorithms/src/r1cs/linear_combination.rs +++ b/algorithms/src/r1cs/linear_combination.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/r1cs/mod.rs b/algorithms/src/r1cs/mod.rs index 4dd40feaa0..2001c0810f 100644 --- a/algorithms/src/r1cs/mod.rs +++ b/algorithms/src/r1cs/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/r1cs/namespace.rs b/algorithms/src/r1cs/namespace.rs index 0b4369fad4..cb863d1c2f 100644 --- a/algorithms/src/r1cs/namespace.rs +++ b/algorithms/src/r1cs/namespace.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, ConstraintSystem, LinearCombination, Variable}; +use crate::r1cs::{ConstraintSystem, LinearCombination, Variable, errors::SynthesisError}; use snarkvm_fields::Field; use std::marker::PhantomData; diff --git a/algorithms/src/r1cs/optional_vec.rs b/algorithms/src/r1cs/optional_vec.rs index bdbcb88b24..d00febfe6c 100644 --- a/algorithms/src/r1cs/optional_vec.rs +++ b/algorithms/src/r1cs/optional_vec.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/r1cs/test_constraint_checker.rs b/algorithms/src/r1cs/test_constraint_checker.rs index 019e85f9c0..04fadafe58 100644 --- a/algorithms/src/r1cs/test_constraint_checker.rs +++ b/algorithms/src/r1cs/test_constraint_checker.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, ConstraintSystem, Index, LinearCombination, Variable}; +use crate::r1cs::{ConstraintSystem, Index, LinearCombination, Variable, errors::SynthesisError}; use snarkvm_fields::Field; /// Constraint system for testing purposes. diff --git a/algorithms/src/r1cs/test_constraint_system.rs b/algorithms/src/r1cs/test_constraint_system.rs index d43b3d161c..6995e80e56 100644 --- a/algorithms/src/r1cs/test_constraint_system.rs +++ b/algorithms/src/r1cs/test_constraint_system.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,17 +13,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, ConstraintSystem, Index, LinearCombination, OptionalVec, Variable}; +use crate::r1cs::{ConstraintSystem, Index, LinearCombination, OptionalVec, Variable, errors::SynthesisError}; use snarkvm_fields::Field; use cfg_if::cfg_if; use fxhash::{FxBuildHasher, FxHashMap}; -use indexmap::{map::Entry, IndexMap, IndexSet}; +use indexmap::{IndexMap, IndexSet, map::Entry}; use itertools::Itertools; /// This field is the scalar field (Fr) of BLS12-377. pub type Fr = snarkvm_curves::bls12_377::Fr; +#[allow(dead_code)] #[derive(Debug, Clone)] enum NamedObject { Constraint(usize), diff --git a/algorithms/src/snark/mod.rs b/algorithms/src/snark/mod.rs index d856b63db4..18d74c4f72 100644 --- a/algorithms/src/snark/mod.rs +++ b/algorithms/src/snark/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/ahp.rs b/algorithms/src/snark/varuna/ahp/ahp.rs index 4446eacca3..dca44cab16 100644 --- a/algorithms/src/snark/varuna/ahp/ahp.rs +++ b/algorithms/src/snark/varuna/ahp/ahp.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,20 +15,20 @@ use crate::{ fft::{ - domain::{FFTPrecomputation, IFFTPrecomputation}, EvaluationDomain, + domain::{FFTPrecomputation, IFFTPrecomputation}, }, polycommit::sonic_pc::{LCTerm, LabeledPolynomial, LinearCombination}, r1cs::SynthesisError, snark::varuna::{ - ahp::{verifier, AHPError, CircuitId, CircuitInfo}, + SNARKMode, + ahp::{AHPError, CircuitId, CircuitInfo, verifier}, prover, selectors::precompute_selectors, verifier::QueryPoints, - SNARKMode, }, }; -use anyhow::{anyhow, ensure, Result}; +use anyhow::{Result, anyhow, ensure}; use snarkvm_fields::{Field, PrimeField}; use core::{borrow::Borrow, marker::PhantomData}; diff --git a/algorithms/src/snark/varuna/ahp/errors.rs b/algorithms/src/snark/varuna/ahp/errors.rs index a18dfb46b2..3fa39f84b3 100644 --- a/algorithms/src/snark/varuna/ahp/errors.rs +++ b/algorithms/src/snark/varuna/ahp/errors.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/indexer/circuit.rs b/algorithms/src/snark/varuna/ahp/indexer/circuit.rs index 8c18494223..fb48461b83 100644 --- a/algorithms/src/snark/varuna/ahp/indexer/circuit.rs +++ b/algorithms/src/snark/varuna/ahp/indexer/circuit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,24 +17,24 @@ use core::marker::PhantomData; use crate::{ fft::{ - domain::{FFTPrecomputation, IFFTPrecomputation}, EvaluationDomain, + domain::{FFTPrecomputation, IFFTPrecomputation}, }, polycommit::sonic_pc::LabeledPolynomial, snark::varuna::{ - ahp::matrices::MatrixEvals, - matrices::MatrixArithmetization, AHPForR1CS, CircuitInfo, Matrix, SNARKMode, + ahp::matrices::MatrixEvals, + matrices::MatrixArithmetization, }, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use blake2::Digest; use hex::FromHex; use snarkvm_fields::PrimeField; -use snarkvm_utilities::{serialize::*, SerializationError}; +use snarkvm_utilities::{SerializationError, serialize::*}; #[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, CanonicalSerialize, CanonicalDeserialize)] pub struct CircuitId(pub [u8; 32]); diff --git a/algorithms/src/snark/varuna/ahp/indexer/circuit_info.rs b/algorithms/src/snark/varuna/ahp/indexer/circuit_info.rs index 9884410159..cb586e5cc4 100644 --- a/algorithms/src/snark/varuna/ahp/indexer/circuit_info.rs +++ b/algorithms/src/snark/varuna/ahp/indexer/circuit_info.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::snark::varuna::{ahp::AHPForR1CS, SNARKMode}; +use crate::snark::varuna::{SNARKMode, ahp::AHPForR1CS}; use anyhow::Result; use snarkvm_fields::PrimeField; -use snarkvm_utilities::{serialize::*, ToBytes}; +use snarkvm_utilities::{ToBytes, serialize::*}; /// Information about the circuit, including the field of definition, the number of /// variables, the number of constraints, and the maximum number of non-zero diff --git a/algorithms/src/snark/varuna/ahp/indexer/constraint_system.rs b/algorithms/src/snark/varuna/ahp/indexer/constraint_system.rs index 1ad2024797..2bc8e5a59a 100644 --- a/algorithms/src/snark/varuna/ahp/indexer/constraint_system.rs +++ b/algorithms/src/snark/varuna/ahp/indexer/constraint_system.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, ConstraintSystem as CS, Index as VarIndex, LinearCombination, Variable}; +use crate::r1cs::{ConstraintSystem as CS, Index as VarIndex, LinearCombination, Variable, errors::SynthesisError}; use snarkvm_fields::Field; use snarkvm_utilities::serialize::*; diff --git a/algorithms/src/snark/varuna/ahp/indexer/indexer.rs b/algorithms/src/snark/varuna/ahp/indexer/indexer.rs index d03ba3bbea..b89889d344 100644 --- a/algorithms/src/snark/varuna/ahp/indexer/indexer.rs +++ b/algorithms/src/snark/varuna/ahp/indexer/indexer.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,28 +16,27 @@ use crate::{ fft::EvaluationDomain, polycommit::sonic_pc::{LinearCombination, PolynomialInfo, PolynomialLabel}, - r1cs::{errors::SynthesisError, ConstraintSynthesizer}, + r1cs::{ConstraintSynthesizer, errors::SynthesisError}, snark::varuna::{ + SNARKMode, ahp::{ - indexer::{Circuit, CircuitId, CircuitInfo, ConstraintSystem as IndexerConstraintSystem}, AHPForR1CS, + indexer::{Circuit, CircuitId, CircuitInfo, ConstraintSystem as IndexerConstraintSystem}, }, - matrices::{into_matrix_helper, matrix_evals, MatrixEvals}, + matrices::{MatrixEvals, into_matrix_helper, matrix_evals}, num_non_zero, - SNARKMode, }, }; use snarkvm_fields::PrimeField; use snarkvm_utilities::cfg_into_iter; -use anyhow::{anyhow, ensure, Result}; +use anyhow::{Result, anyhow, ensure}; use core::marker::PhantomData; use itertools::Itertools; use std::collections::BTreeMap; #[cfg(not(feature = "serial"))] use rayon::prelude::*; -#[cfg(not(feature = "std"))] use snarkvm_utilities::println; use super::Matrix; diff --git a/algorithms/src/snark/varuna/ahp/indexer/mod.rs b/algorithms/src/snark/varuna/ahp/indexer/mod.rs index 94ab917619..d36f6dce0f 100644 --- a/algorithms/src/snark/varuna/ahp/indexer/mod.rs +++ b/algorithms/src/snark/varuna/ahp/indexer/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/matrices.rs b/algorithms/src/snark/varuna/ahp/matrices.rs index 99dfbc6968..4f57b78d9b 100644 --- a/algorithms/src/snark/varuna/ahp/matrices.rs +++ b/algorithms/src/snark/varuna/ahp/matrices.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,14 +20,14 @@ use crate::{ polycommit::sonic_pc::LabeledPolynomial, r1cs::{ConstraintSystem, Index as VarIndex}, snark::varuna::{ - ahp::{indexer::Matrix, AHPForR1CS, CircuitId}, VarunaHidingMode, + ahp::{AHPForR1CS, CircuitId, indexer::Matrix}, }, }; use snarkvm_fields::{Field, PrimeField}; use snarkvm_utilities::{cfg_into_iter, cfg_iter, cfg_iter_mut, serialize::*}; -use anyhow::{anyhow, ensure, Result}; +use anyhow::{Result, anyhow, ensure}; #[cfg(feature = "serial")] use itertools::Itertools; diff --git a/algorithms/src/snark/varuna/ahp/mod.rs b/algorithms/src/snark/varuna/ahp/mod.rs index f6e10fb207..a9638332b0 100644 --- a/algorithms/src/snark/varuna/ahp/mod.rs +++ b/algorithms/src/snark/varuna/ahp/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/prover/constraint_system.rs b/algorithms/src/snark/varuna/ahp/prover/constraint_system.rs index 8a4b2d7d50..dcd046a519 100644 --- a/algorithms/src/snark/varuna/ahp/prover/constraint_system.rs +++ b/algorithms/src/snark/varuna/ahp/prover/constraint_system.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::r1cs::{errors::SynthesisError, ConstraintSystem as CS, Index as VarIndex, LinearCombination, Variable}; +use crate::r1cs::{ConstraintSystem as CS, Index as VarIndex, LinearCombination, Variable, errors::SynthesisError}; use snarkvm_fields::Field; pub(crate) struct ConstraintSystem { diff --git a/algorithms/src/snark/varuna/ahp/prover/message.rs b/algorithms/src/snark/varuna/ahp/prover/message.rs index c13ed2fc26..b97e17eb60 100644 --- a/algorithms/src/snark/varuna/ahp/prover/message.rs +++ b/algorithms/src/snark/varuna/ahp/prover/message.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,9 +15,9 @@ use std::collections::BTreeMap; -use crate::snark::varuna::{verifier::BatchCombiners, CircuitId}; +use crate::snark::varuna::{CircuitId, verifier::BatchCombiners}; use snarkvm_fields::PrimeField; -use snarkvm_utilities::{error, serialize::*, ToBytes, Write}; +use snarkvm_utilities::{ToBytes, Write, error, serialize::*}; #[derive(Clone, Debug, Default, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct MatrixSums { diff --git a/algorithms/src/snark/varuna/ahp/prover/mod.rs b/algorithms/src/snark/varuna/ahp/prover/mod.rs index 68adb3038c..3474672b1f 100644 --- a/algorithms/src/snark/varuna/ahp/prover/mod.rs +++ b/algorithms/src/snark/varuna/ahp/prover/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/prover/oracles.rs b/algorithms/src/snark/varuna/ahp/prover/oracles.rs index 37b1c94728..b4ebaf8760 100644 --- a/algorithms/src/snark/varuna/ahp/prover/oracles.rs +++ b/algorithms/src/snark/varuna/ahp/prover/oracles.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs index e393d8ed28..ee695bc4c0 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,9 +19,9 @@ use crate::{ fft::DensePolynomial, polycommit::sonic_pc::{LabeledPolynomial, PolynomialInfo, PolynomialLabel}, snark::varuna::{ - ahp::{verifier, AHPError, AHPForR1CS}, - prover, SNARKMode, + ahp::{AHPError, AHPForR1CS, verifier}, + prover, }, }; use snarkvm_fields::PrimeField; diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/first.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/first.rs index df9d33a72c..35787e0ec6 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/first.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/first.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,12 +17,12 @@ use crate::{ fft::{DensePolynomial, EvaluationDomain, Evaluations as EvaluationsOnDomain, SparsePolynomial}, polycommit::sonic_pc::{LabeledPolynomial, PolynomialInfo, PolynomialLabel}, snark::varuna::{ - ahp::{AHPError, AHPForR1CS}, - prover, - witness_label, Circuit, CircuitId, SNARKMode, + ahp::{AHPError, AHPForR1CS}, + prover, + witness_label, }, }; use snarkvm_fields::PrimeField; diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/fourth.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/fourth.rs index 17d1789961..840b421bd6 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/fourth.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/fourth.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,24 +15,24 @@ use crate::{ fft::{ - domain::{FFTPrecomputation, IFFTPrecomputation}, - polynomial::PolyMultiplier, DensePolynomial, EvaluationDomain, Evaluations as EvaluationsOnDomain, + domain::{FFTPrecomputation, IFFTPrecomputation}, + polynomial::PolyMultiplier, }, polycommit::sonic_pc::{LabeledPolynomial, PolynomialInfo, PolynomialLabel}, snark::varuna::{ - ahp::{indexer::CircuitInfo, verifier, AHPError, AHPForR1CS, CircuitId}, + SNARKMode, + ahp::{AHPError, AHPForR1CS, CircuitId, indexer::CircuitInfo, verifier}, matrices::MatrixEvals, prover, selectors::apply_randomized_selector, witness_label, - SNARKMode, }, }; -use snarkvm_fields::{batch_inversion_and_mul, PrimeField}; -use snarkvm_utilities::{cfg_iter, cfg_iter_mut, ExecutionPool}; +use snarkvm_fields::{PrimeField, batch_inversion_and_mul}; +use snarkvm_utilities::{ExecutionPool, cfg_iter, cfg_iter_mut}; use anyhow::Result; use core::convert::TryInto; diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/mod.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/mod.rs index 34665b8482..652d58bb55 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/mod.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,9 +16,9 @@ use crate::{ r1cs::ConstraintSynthesizer, snark::varuna::{ - ahp::{indexer::Circuit, AHPError, AHPForR1CS}, - prover, SNARKMode, + ahp::{AHPError, AHPForR1CS, indexer::Circuit}, + prover, }, }; use snarkvm_fields::PrimeField; @@ -28,9 +29,7 @@ use rand::Rng; use rand_core::CryptoRng; use std::collections::BTreeMap; -use snarkvm_utilities::cfg_iter; -#[cfg(not(feature = "std"))] -use snarkvm_utilities::println; +use snarkvm_utilities::{cfg_iter, println}; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/second.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/second.rs index 9060e7746e..46538ef089 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/second.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/second.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,22 +16,22 @@ use std::collections::BTreeMap; use crate::{ - fft::{polynomial::PolyMultiplier, DensePolynomial, EvaluationDomain, Evaluations as EvaluationsOnDomain}, + fft::{DensePolynomial, EvaluationDomain, Evaluations as EvaluationsOnDomain, polynomial::PolyMultiplier}, polycommit::sonic_pc::{LabeledPolynomial, PolynomialInfo, PolynomialLabel}, snark::varuna::{ - ahp::{verifier, AHPForR1CS}, - prover, - selectors::apply_randomized_selector, - witness_label, Circuit, CircuitId, SNARKMode, + ahp::{AHPForR1CS, verifier}, + prover, + selectors::apply_randomized_selector, + witness_label, }, }; use anyhow::Result; use rand_core::RngCore; use snarkvm_fields::PrimeField; -use snarkvm_utilities::{cfg_into_iter, cfg_iter_mut, cfg_reduce, ExecutionPool}; +use snarkvm_utilities::{ExecutionPool, cfg_into_iter, cfg_iter_mut, cfg_reduce}; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs index 95ba4d7f1a..674c13b036 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,27 +15,27 @@ use crate::{ fft::{ - domain::{FFTPrecomputation, IFFTPrecomputation}, - polynomial::PolyMultiplier, DensePolynomial, EvaluationDomain, Evaluations, + domain::{FFTPrecomputation, IFFTPrecomputation}, + polynomial::PolyMultiplier, }, polycommit::sonic_pc::{LabeledPolynomial, PolynomialInfo, PolynomialLabel}, snark::varuna::{ - ahp::{indexer::CircuitId, verifier, AHPForR1CS}, - matrices::transpose, - prover::{self, MatrixSums, ThirdMessage}, - selectors::apply_randomized_selector, AHPError, Matrix, SNARKMode, + ahp::{AHPForR1CS, indexer::CircuitId, verifier}, + matrices::transpose, + prover::{self, MatrixSums, ThirdMessage}, + selectors::apply_randomized_selector, }, }; use snarkvm_fields::PrimeField; -use snarkvm_utilities::{cfg_iter, ExecutionPool}; +use snarkvm_utilities::{ExecutionPool, cfg_iter}; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; use itertools::Itertools; use rand_core::RngCore; use std::collections::BTreeMap; diff --git a/algorithms/src/snark/varuna/ahp/prover/state.rs b/algorithms/src/snark/varuna/ahp/prover/state.rs index f41cf53cae..a22cc0f7e2 100644 --- a/algorithms/src/snark/varuna/ahp/prover/state.rs +++ b/algorithms/src/snark/varuna/ahp/prover/state.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/selectors.rs b/algorithms/src/snark/varuna/ahp/selectors.rs index 6bf9744ae2..a202e51222 100644 --- a/algorithms/src/snark/varuna/ahp/selectors.rs +++ b/algorithms/src/snark/varuna/ahp/selectors.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,10 +15,10 @@ use super::verifier::QueryPoints; use crate::fft::{DensePolynomial, EvaluationDomain}; -use snarkvm_fields::{batch_inversion, PrimeField}; +use snarkvm_fields::{PrimeField, batch_inversion}; use snarkvm_utilities::{cfg_into_iter, cfg_iter_mut, serialize::*}; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; use itertools::Itertools; use std::collections::{BTreeMap, HashSet}; diff --git a/algorithms/src/snark/varuna/ahp/verifier/messages.rs b/algorithms/src/snark/varuna/ahp/verifier/messages.rs index 1abd254d6d..9b995415b3 100644 --- a/algorithms/src/snark/varuna/ahp/verifier/messages.rs +++ b/algorithms/src/snark/varuna/ahp/verifier/messages.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::snark::varuna::{witness_label, CircuitId, SNARKMode}; +use crate::snark::varuna::{CircuitId, SNARKMode, witness_label}; use snarkvm_fields::PrimeField; use itertools::Itertools; diff --git a/algorithms/src/snark/varuna/ahp/verifier/mod.rs b/algorithms/src/snark/varuna/ahp/verifier/mod.rs index c0562670b6..063c50d867 100644 --- a/algorithms/src/snark/varuna/ahp/verifier/mod.rs +++ b/algorithms/src/snark/varuna/ahp/verifier/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/ahp/verifier/state.rs b/algorithms/src/snark/varuna/ahp/verifier/state.rs index 4fbd079c09..486f31e4da 100644 --- a/algorithms/src/snark/varuna/ahp/verifier/state.rs +++ b/algorithms/src/snark/varuna/ahp/verifier/state.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,9 +18,9 @@ use core::marker::PhantomData; use crate::{ fft::EvaluationDomain, snark::varuna::{ - ahp::verifier::{FirstMessage, FourthMessage, SecondMessage, ThirdMessage}, CircuitId, SNARKMode, + ahp::verifier::{FirstMessage, FourthMessage, SecondMessage, ThirdMessage}, }, }; use snarkvm_fields::PrimeField; diff --git a/algorithms/src/snark/varuna/ahp/verifier/verifier.rs b/algorithms/src/snark/varuna/ahp/verifier/verifier.rs index 680854f348..935778eb26 100644 --- a/algorithms/src/snark/varuna/ahp/verifier/verifier.rs +++ b/algorithms/src/snark/varuna/ahp/verifier/verifier.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,20 +16,20 @@ use core::marker::PhantomData; use crate::{ + AlgebraicSponge, fft::EvaluationDomain, snark::varuna::{ + SNARKMode, ahp::{ - indexer::{CircuitId, CircuitInfo}, - verifier::{BatchCombiners, FirstMessage, FourthMessage, QuerySet, SecondMessage, State, ThirdMessage}, AHPError, AHPForR1CS, + indexer::{CircuitId, CircuitInfo}, + verifier::{BatchCombiners, FirstMessage, FourthMessage, QuerySet, SecondMessage, State, ThirdMessage}, }, verifier::CircuitSpecificState, - SNARKMode, }, - AlgebraicSponge, }; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; use smallvec::SmallVec; use snarkvm_fields::PrimeField; use std::collections::BTreeMap; diff --git a/algorithms/src/snark/varuna/data_structures/certificate.rs b/algorithms/src/snark/varuna/data_structures/certificate.rs index 15d71851de..48511857d9 100644 --- a/algorithms/src/snark/varuna/data_structures/certificate.rs +++ b/algorithms/src/snark/varuna/data_structures/certificate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,11 +16,11 @@ use crate::polycommit::sonic_pc; use snarkvm_curves::PairingEngine; use snarkvm_utilities::{ + FromBytes, + ToBytes, error, io::{self, Read, Write}, serialize::*, - FromBytes, - ToBytes, }; /// A certificate for the verifying key. diff --git a/algorithms/src/snark/varuna/data_structures/circuit_proving_key.rs b/algorithms/src/snark/varuna/data_structures/circuit_proving_key.rs index 5848743d0f..789be2ba68 100644 --- a/algorithms/src/snark/varuna/data_structures/circuit_proving_key.rs +++ b/algorithms/src/snark/varuna/data_structures/circuit_proving_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,14 +15,14 @@ use crate::{ polycommit::sonic_pc, - snark::varuna::{ahp::indexer::*, CircuitVerifyingKey, SNARKMode}, + snark::varuna::{CircuitVerifyingKey, SNARKMode, ahp::indexer::*}, }; use snarkvm_curves::PairingEngine; use snarkvm_utilities::{ - io::{self, Read, Write}, - serialize::*, FromBytes, ToBytes, + io::{self, Read, Write}, + serialize::*, }; use std::{cmp::Ordering, sync::Arc}; diff --git a/algorithms/src/snark/varuna/data_structures/circuit_verifying_key.rs b/algorithms/src/snark/varuna/data_structures/circuit_verifying_key.rs index 6f6aea970c..186b2cc3d1 100644 --- a/algorithms/src/snark/varuna/data_structures/circuit_verifying_key.rs +++ b/algorithms/src/snark/varuna/data_structures/circuit_verifying_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,19 +16,19 @@ use crate::{polycommit::sonic_pc, snark::varuna::ahp::indexer::*}; use snarkvm_curves::PairingEngine; use snarkvm_utilities::{ - error, - io::{self, Read, Write}, - serialize::*, - string::String, FromBytes, FromBytesDeserializer, ToBytes, ToBytesSerializer, + error, + io::{self, Read, Write}, + serialize::*, + string::String, }; use anyhow::Result; use core::{fmt, str::FromStr}; -use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; use std::cmp::Ordering; /// Verification key for a specific index (i.e., R1CS matrices). diff --git a/algorithms/src/snark/varuna/data_structures/mod.rs b/algorithms/src/snark/varuna/data_structures/mod.rs index 5b13c0c597..52326c4f1f 100644 --- a/algorithms/src/snark/varuna/data_structures/mod.rs +++ b/algorithms/src/snark/varuna/data_structures/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/data_structures/proof.rs b/algorithms/src/snark/varuna/data_structures/proof.rs index 87625cf960..d2c4c9c831 100644 --- a/algorithms/src/snark/varuna/data_structures/proof.rs +++ b/algorithms/src/snark/varuna/data_structures/proof.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,20 +14,20 @@ // limitations under the License. use crate::{ - polycommit::sonic_pc, - snark::varuna::{ahp, CircuitId}, SNARKError, + polycommit::sonic_pc, + snark::varuna::{CircuitId, ahp}, }; use ahp::prover::{FourthMessage, ThirdMessage}; use snarkvm_curves::PairingEngine; use snarkvm_fields::PrimeField; use snarkvm_utilities::{ + FromBytes, + ToBytes, error, io::{self, Read, Write}, serialize::*, - FromBytes, - ToBytes, }; use std::collections::BTreeMap; @@ -392,8 +393,8 @@ mod test { snark::varuna::prover::MatrixSums, }; use snarkvm_curves::{ - bls12_377::{Bls12_377, Fr, G1Affine}, AffineCurve, + bls12_377::{Bls12_377, Fr, G1Affine}, }; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/algorithms/src/snark/varuna/data_structures/test_circuit.rs b/algorithms/src/snark/varuna/data_structures/test_circuit.rs index 6af4ae7f98..6f10c2548e 100644 --- a/algorithms/src/snark/varuna/data_structures/test_circuit.rs +++ b/algorithms/src/snark/varuna/data_structures/test_circuit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/mod.rs b/algorithms/src/snark/varuna/mod.rs index 0e16caae80..59ea76f9bd 100644 --- a/algorithms/src/snark/varuna/mod.rs +++ b/algorithms/src/snark/varuna/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/mode.rs b/algorithms/src/snark/varuna/mode.rs index f5fd98680e..ef982e526f 100644 --- a/algorithms/src/snark/varuna/mode.rs +++ b/algorithms/src/snark/varuna/mode.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/snark/varuna/tests.rs b/algorithms/src/snark/varuna/tests.rs index c8707256a1..ef8fe24049 100644 --- a/algorithms/src/snark/varuna/tests.rs +++ b/algorithms/src/snark/varuna/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,13 +17,13 @@ mod varuna { use crate::{ snark::varuna::{ - mode::SNARKMode, - test_circuit::TestCircuit, AHPForR1CS, CircuitVerifyingKey, VarunaHidingMode, VarunaNonHidingMode, VarunaSNARK, + mode::SNARKMode, + test_circuit::TestCircuit, }, traits::{AlgebraicSponge, SNARK}, }; @@ -31,8 +32,8 @@ mod varuna { use snarkvm_curves::bls12_377::{Bls12_377, Fq, Fr}; use snarkvm_utilities::{ - rand::{TestRng, Uniform}, ToBytes, + rand::{TestRng, Uniform}, }; type FS = crate::crypto_hash::PoseidonSponge; @@ -304,19 +305,19 @@ mod varuna_hiding { use crate::{ crypto_hash::PoseidonSponge, snark::varuna::{ - ahp::AHPForR1CS, - test_circuit::TestCircuit, CircuitVerifyingKey, VarunaHidingMode, VarunaSNARK, + ahp::AHPForR1CS, + test_circuit::TestCircuit, }, traits::{AlgebraicSponge, SNARK}, }; use snarkvm_curves::bls12_377::{Bls12_377, Fq, Fr}; use snarkvm_utilities::{ - rand::{TestRng, Uniform}, FromBytes, ToBytes, + rand::{TestRng, Uniform}, }; use std::str::FromStr; @@ -532,7 +533,7 @@ mod varuna_hiding { mod varuna_test_vectors { use crate::{ fft::EvaluationDomain, - snark::varuna::{ahp::verifier, AHPForR1CS, TestCircuit, VarunaNonHidingMode, VarunaSNARK}, + snark::varuna::{AHPForR1CS, TestCircuit, VarunaNonHidingMode, VarunaSNARK, ahp::verifier}, traits::snark::SNARK, }; use snarkvm_curves::bls12_377::{Bls12_377, Fq, Fr}; diff --git a/algorithms/src/snark/varuna/varuna.rs b/algorithms/src/snark/varuna/varuna.rs index d41aab6a16..f4fa998a14 100644 --- a/algorithms/src/snark/varuna/varuna.rs +++ b/algorithms/src/snark/varuna/varuna.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,6 +15,9 @@ use super::Certificate; use crate::{ + AlgebraicSponge, + SNARK, + SNARKError, fft::EvaluationDomain, polycommit::sonic_pc::{ Commitment, @@ -26,34 +30,30 @@ use crate::{ }, r1cs::{ConstraintSynthesizer, SynthesisError}, snark::varuna::{ - ahp::{AHPError, AHPForR1CS, CircuitId, EvaluationsProvider}, - proof, - prover, - witness_label, CircuitProvingKey, CircuitVerifyingKey, Proof, SNARKMode, UniversalSRS, + ahp::{AHPError, AHPForR1CS, CircuitId, EvaluationsProvider}, + proof, + prover, + witness_label, }, srs::UniversalVerifier, - AlgebraicSponge, - SNARKError, - SNARK, }; use rand::RngCore; use snarkvm_curves::PairingEngine; use snarkvm_fields::{One, PrimeField, ToConstraintField, Zero}; -use snarkvm_utilities::{to_bytes_le, ToBytes}; +use snarkvm_utilities::{ToBytes, to_bytes_le}; -use anyhow::{anyhow, bail, ensure, Result}; +use anyhow::{Result, anyhow, bail, ensure}; use core::marker::PhantomData; use itertools::Itertools; use rand::{CryptoRng, Rng}; use std::{borrow::Borrow, collections::BTreeMap, ops::Deref, sync::Arc}; use crate::srs::UniversalProver; -#[cfg(not(feature = "std"))] use snarkvm_utilities::println; /// The Varuna proof system. @@ -332,7 +332,7 @@ where /// This is the main entrypoint for creating proofs. /// You can find a specification of the prover algorithm in: - /// https://github.com/AleoHQ/protocol-docs + /// https://github.com/AleoNet/protocol-docs fn prove_batch, R: Rng + CryptoRng>( universal_prover: &Self::UniversalProver, fs_parameters: &Self::FSParameters, @@ -621,7 +621,7 @@ where /// This is the main entrypoint for verifying proofs. /// You can find a specification of the verifier algorithm in: - /// https://github.com/AleoHQ/protocol-docs + /// https://github.com/AleoNet/protocol-docs fn verify_batch>( universal_verifier: &Self::UniversalVerifier, fs_parameters: &Self::FSParameters, diff --git a/algorithms/src/srs/mod.rs b/algorithms/src/srs/mod.rs index ac2d48cea8..f8b1fcdde0 100644 --- a/algorithms/src/srs/mod.rs +++ b/algorithms/src/srs/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/srs/universal_prover.rs b/algorithms/src/srs/universal_prover.rs index 057aee80b1..aefbc60778 100644 --- a/algorithms/src/srs/universal_prover.rs +++ b/algorithms/src/srs/universal_prover.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/srs/universal_verifier.rs b/algorithms/src/srs/universal_verifier.rs index cf5e6f27a4..c7481f8d65 100644 --- a/algorithms/src/srs/universal_verifier.rs +++ b/algorithms/src/srs/universal_verifier.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/traits/algebraic_sponge.rs b/algorithms/src/traits/algebraic_sponge.rs index 7cf9025cad..042e9f9e27 100644 --- a/algorithms/src/traits/algebraic_sponge.rs +++ b/algorithms/src/traits/algebraic_sponge.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/traits/mod.rs b/algorithms/src/traits/mod.rs index 0938424081..b27b127327 100644 --- a/algorithms/src/traits/mod.rs +++ b/algorithms/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/algorithms/src/traits/snark.rs b/algorithms/src/traits/snark.rs index a5f48c456b..cbf1ea6087 100644 --- a/algorithms/src/traits/snark.rs +++ b/algorithms/src/traits/snark.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{r1cs::ConstraintSynthesizer, AlgebraicSponge}; +use crate::{AlgebraicSponge, r1cs::ConstraintSynthesizer}; use snarkvm_fields::PrimeField; use snarkvm_utilities::{CanonicalDeserialize, CanonicalSerialize, FromBytes, ToBytes}; diff --git a/build.rs b/build.rs index 0f309c6106..8d74d23780 100644 --- a/build.rs +++ b/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/Cargo.toml b/circuit/Cargo.toml index bfc0896c5f..d602ae10e9 100644 --- a/circuit/Cargo.toml +++ b/circuit/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-circuit" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Circuits for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -25,28 +25,28 @@ edition = "2021" [dependencies.snarkvm-circuit-account] path = "./account" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-algorithms] path = "./algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-collections] path = "./collections" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-environment] path = "./environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-network] path = "./network" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-program] path = "./program" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types] path = "./types" -version = "=0.16.19" +version = "=1.0.0" diff --git a/circuit/account/Cargo.toml b/circuit/account/Cargo.toml index 8c493b19bc..c4fd74edef 100644 --- a/circuit/account/Cargo.toml +++ b/circuit/account/Cargo.toml @@ -1,28 +1,30 @@ [package] name = "snarkvm-circuit-account" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Account circuit library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-account" path = "../../console/account" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.snarkvm-utilities] path = "../../utilities" diff --git a/circuit/account/build.rs b/circuit/account/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/account/build.rs +++ b/circuit/account/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/account/src/compute_key/equal.rs b/circuit/account/src/compute_key/equal.rs index 18be73b2b5..83661d7fcb 100644 --- a/circuit/account/src/compute_key/equal.rs +++ b/circuit/account/src/compute_key/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl Equal for ComputeKey { type Output = Boolean; @@ -66,7 +67,7 @@ impl OutputMode, Output = Boolean>> for Comp } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -97,12 +98,12 @@ mod tests { console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(), ); - CurrentAleo::scope(&format!("{mode_a} {mode_a} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_a} {i}"), || { let equals = a.is_equal(&a); assert!(equals.eject_value()); }); - CurrentAleo::scope(&format!("{mode_a} {mode_b} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_b} {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -130,12 +131,12 @@ mod tests { console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(), ); - CurrentAleo::scope(&format!("{mode_a} {mode_a} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_a} {i}"), || { let equals = a.is_not_equal(&a); assert!(!equals.eject_value()); }); - CurrentAleo::scope(&format!("{mode_a} {mode_b} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_b} {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/account/src/compute_key/from.rs b/circuit/account/src/compute_key/from.rs index 2cc69ea16e..a3a8557e82 100644 --- a/circuit/account/src/compute_key/from.rs +++ b/circuit/account/src/compute_key/from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,10 +25,10 @@ impl From<(Group, Group)> for ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; use snarkvm_circuit_network::AleoV0; @@ -49,7 +50,7 @@ mod tests { let pk_sig = Group::new(mode, compute_key.pk_sig()); let pr_sig = Group::new(mode, compute_key.pr_sig()); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = ComputeKey::::from((pk_sig, pr_sig)); assert_eq!(compute_key, candidate.eject_value()); if i > 0 { diff --git a/circuit/account/src/compute_key/from_private_key.rs b/circuit/account/src/compute_key/from_private_key.rs index 26f88c4f0b..e0c7d0aecf 100644 --- a/circuit/account/src/compute_key/from_private_key.rs +++ b/circuit/account/src/compute_key/from_private_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -32,10 +33,10 @@ impl ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; @@ -55,7 +56,7 @@ mod tests { // Initialize the private key. let private_key = PrivateKey::::new(mode, private_key); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = ComputeKey::from_private_key(&private_key); assert_eq!(compute_key, candidate.eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/account/src/compute_key/helpers/from_bits.rs b/circuit/account/src/compute_key/helpers/from_bits.rs index ada16ba6e7..0e8c0b6466 100644 --- a/circuit/account/src/compute_key/helpers/from_bits.rs +++ b/circuit/account/src/compute_key/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl FromBits for ComputeKey { type Boolean = Boolean; @@ -53,7 +54,7 @@ impl FromBits for ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -72,7 +73,7 @@ mod tests { let expected = console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(); let candidate = ComputeKey::::new(mode, expected).to_bits_le(); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = ComputeKey::::from_bits_le(&candidate); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -89,7 +90,7 @@ mod tests { let expected = console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(); let candidate = ComputeKey::::new(mode, expected).to_bits_be(); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = ComputeKey::::from_bits_be(&candidate); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/account/src/compute_key/helpers/mod.rs b/circuit/account/src/compute_key/helpers/mod.rs index 10a4036948..b5a7ea8481 100644 --- a/circuit/account/src/compute_key/helpers/mod.rs +++ b/circuit/account/src/compute_key/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/account/src/compute_key/helpers/to_bits.rs b/circuit/account/src/compute_key/helpers/to_bits.rs index 172b6b1e0c..21fdad5fb7 100644 --- a/circuit/account/src/compute_key/helpers/to_bits.rs +++ b/circuit/account/src/compute_key/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl ToBits for ComputeKey { type Boolean = Boolean; @@ -29,7 +30,7 @@ impl ToBits for ComputeKey { } } -#[cfg(console)] +#[cfg(feature = "console")] impl ToBits for &ComputeKey { type Boolean = Boolean; @@ -50,7 +51,7 @@ impl ToBits for &ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -71,7 +72,7 @@ mod tests { let expected = console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(); let candidate = ComputeKey::::new(mode, expected); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_le(); assert_eq!(expected_number_of_bits, candidate.len()); @@ -98,7 +99,7 @@ mod tests { let expected = console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(); let candidate = ComputeKey::::new(mode, expected); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_be(); assert_eq!(expected_number_of_bits, candidate.len()); diff --git a/circuit/account/src/compute_key/helpers/to_fields.rs b/circuit/account/src/compute_key/helpers/to_fields.rs index a292a47f4c..b4281e750f 100644 --- a/circuit/account/src/compute_key/helpers/to_fields.rs +++ b/circuit/account/src/compute_key/helpers/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,7 +24,7 @@ impl ToFields for ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -44,7 +45,7 @@ mod tests { let expected = console::ComputeKey::try_from(console::PrivateKey::new(rng).unwrap()).unwrap(); let candidate = ComputeKey::::new(mode, expected); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = candidate.to_fields(); assert_eq!(candidate.len(), 2); diff --git a/circuit/account/src/compute_key/mod.rs b/circuit/account/src/compute_key/mod.rs index 478e7b1ce6..68a1507253 100644 --- a/circuit/account/src/compute_key/mod.rs +++ b/circuit/account/src/compute_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,7 +25,7 @@ use snarkvm_circuit_types::environment::{assert_count, assert_output_mode, asser use crate::PrivateKey; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field, Group, Scalar}; +use snarkvm_circuit_types::{Address, Boolean, Field, Group, Scalar, environment::prelude::*}; #[derive(Clone)] pub struct ComputeKey { @@ -36,7 +37,7 @@ pub struct ComputeKey { sk_prf: Scalar, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for ComputeKey { type Primitive = console::ComputeKey; @@ -68,7 +69,7 @@ impl ComputeKey { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for ComputeKey { type Primitive = console::ComputeKey; @@ -86,10 +87,10 @@ impl Eject for ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] pub(crate) mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; diff --git a/circuit/account/src/compute_key/ternary.rs b/circuit/account/src/compute_key/ternary.rs index 93867ee829..85128d63e9 100644 --- a/circuit/account/src/compute_key/ternary.rs +++ b/circuit/account/src/compute_key/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -58,7 +59,7 @@ impl OutputMode, Output = Self>> for C } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/account/src/compute_key/to_address.rs b/circuit/account/src/compute_key/to_address.rs index c7a0dfd7d1..2d25308bb9 100644 --- a/circuit/account/src/compute_key/to_address.rs +++ b/circuit/account/src/compute_key/to_address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,10 +25,10 @@ impl ComputeKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; @@ -47,7 +48,7 @@ mod tests { // Initialize the compute key. let candidate = ComputeKey::::new(mode, compute_key); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_address(); assert_eq!(*address, candidate.to_group().eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/account/src/graph_key/mod.rs b/circuit/account/src/graph_key/mod.rs index d464180843..2f357682f9 100644 --- a/circuit/account/src/graph_key/mod.rs +++ b/circuit/account/src/graph_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,14 +17,14 @@ use snarkvm_circuit_types::environment::assert_scope; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Field}; +use snarkvm_circuit_types::{Field, environment::prelude::*}; pub struct GraphKey { /// The graph key `sk_tag` := Hash(view_key || ctr). sk_tag: Field, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for GraphKey { type Primitive = console::GraphKey; @@ -43,7 +44,7 @@ impl GraphKey { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for GraphKey { type Primitive = console::GraphKey; @@ -61,10 +62,10 @@ impl Eject for GraphKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] pub(crate) mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; diff --git a/circuit/account/src/lib.rs b/circuit/account/src/lib.rs index 5b912dc4b4..836f7248e6 100644 --- a/circuit/account/src/lib.rs +++ b/circuit/account/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -33,7 +34,7 @@ pub use signature::*; pub mod view_key; pub use view_key::*; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] pub(crate) mod helpers { use snarkvm_circuit_network::AleoV0; use snarkvm_circuit_types::environment::Environment; diff --git a/circuit/account/src/private_key/mod.rs b/circuit/account/src/private_key/mod.rs index 28376d742d..58c6890e18 100644 --- a/circuit/account/src/private_key/mod.rs +++ b/circuit/account/src/private_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ use snarkvm_circuit_types::environment::assert_scope; use crate::{ComputeKey, ViewKey}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Scalar}; +use snarkvm_circuit_types::{Scalar, environment::prelude::*}; pub struct PrivateKey { /// The signature secret key. @@ -29,7 +30,7 @@ pub struct PrivateKey { r_sig: Scalar, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for PrivateKey { type Primitive = console::PrivateKey; @@ -51,7 +52,7 @@ impl PrivateKey { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for PrivateKey { type Primitive = (console::Scalar, console::Scalar); @@ -66,10 +67,10 @@ impl Eject for PrivateKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; diff --git a/circuit/account/src/private_key/to_compute_key.rs b/circuit/account/src/private_key/to_compute_key.rs index 2d1f2efd81..2150da9191 100644 --- a/circuit/account/src/private_key/to_compute_key.rs +++ b/circuit/account/src/private_key/to_compute_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,10 +22,10 @@ impl PrivateKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; @@ -44,7 +45,7 @@ mod tests { // Initialize the private key. let candidate = PrivateKey::::new(mode, private_key); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_compute_key(); assert_eq!(compute_key, candidate.eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/account/src/private_key/to_view_key.rs b/circuit/account/src/private_key/to_view_key.rs index cb0170b30e..5544a769da 100644 --- a/circuit/account/src/private_key/to_view_key.rs +++ b/circuit/account/src/private_key/to_view_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,10 +22,10 @@ impl PrivateKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; @@ -44,7 +45,7 @@ mod tests { // Initialize the private key. let candidate = PrivateKey::::new(mode, private_key); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_view_key(); assert_eq!(view_key, candidate.eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/account/src/signature/equal.rs b/circuit/account/src/signature/equal.rs index f85dab3dda..b4da29cfe7 100644 --- a/circuit/account/src/signature/equal.rs +++ b/circuit/account/src/signature/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl Equal for Signature { type Output = Boolean; @@ -66,7 +67,7 @@ impl OutputMode, Output = Boolean>> for Signa } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -91,12 +92,12 @@ mod tests { let a = Signature::::new(mode_a, crate::helpers::generate_signature(i, rng)); let b = Signature::::new(mode_b, crate::helpers::generate_signature(i, rng)); - CurrentAleo::scope(&format!("{mode_a} {mode_a} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_a} {i}"), || { let equals = a.is_equal(&a); assert!(equals.eject_value()); }); - CurrentAleo::scope(&format!("{mode_a} {mode_b} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_b} {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -118,12 +119,12 @@ mod tests { let a = Signature::::new(mode_a, crate::helpers::generate_signature(i, rng)); let b = Signature::::new(mode_b, crate::helpers::generate_signature(i, rng)); - CurrentAleo::scope(&format!("{mode_a} {mode_a} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_a} {i}"), || { let equals = a.is_not_equal(&a); assert!(!equals.eject_value()); }); - CurrentAleo::scope(&format!("{mode_a} {mode_b} {i}"), || { + CurrentAleo::scope(format!("{mode_a} {mode_b} {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/account/src/signature/helpers/from_bits.rs b/circuit/account/src/signature/helpers/from_bits.rs index 04e028231f..1d8d8737d6 100644 --- a/circuit/account/src/signature/helpers/from_bits.rs +++ b/circuit/account/src/signature/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl FromBits for Signature { type Boolean = Boolean; @@ -71,7 +72,7 @@ impl FromBits for Signature { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -90,7 +91,7 @@ mod tests { let expected = crate::helpers::generate_signature(i, rng); let candidate = Signature::::new(mode, expected).to_bits_le(); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = Signature::::from_bits_le(&candidate); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -107,7 +108,7 @@ mod tests { let expected = crate::helpers::generate_signature(i, rng); let candidate = Signature::::new(mode, expected).to_bits_be(); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = Signature::::from_bits_be(&candidate); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/account/src/signature/helpers/mod.rs b/circuit/account/src/signature/helpers/mod.rs index 10a4036948..b5a7ea8481 100644 --- a/circuit/account/src/signature/helpers/mod.rs +++ b/circuit/account/src/signature/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/account/src/signature/helpers/to_bits.rs b/circuit/account/src/signature/helpers/to_bits.rs index b719a7ac11..d924e0bfa0 100644 --- a/circuit/account/src/signature/helpers/to_bits.rs +++ b/circuit/account/src/signature/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl ToBits for Signature { type Boolean = Boolean; @@ -29,7 +30,7 @@ impl ToBits for Signature { } } -#[cfg(console)] +#[cfg(feature = "console")] impl ToBits for &Signature { type Boolean = Boolean; @@ -54,7 +55,7 @@ impl ToBits for &Signature { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; @@ -75,7 +76,7 @@ mod tests { let expected = crate::helpers::generate_signature(i, rng); let candidate = Signature::::new(mode, expected); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_le(); assert_eq!(expected_number_of_bits, candidate.len()); @@ -103,7 +104,7 @@ mod tests { let expected = crate::helpers::generate_signature(i, rng); let candidate = Signature::::new(mode, expected); - CurrentAleo::scope(&format!("{mode} {i}"), || { + CurrentAleo::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_be(); assert_eq!(expected_number_of_bits, candidate.len()); diff --git a/circuit/account/src/signature/helpers/to_fields.rs b/circuit/account/src/signature/helpers/to_fields.rs index aa20d8f9c1..20c945917c 100644 --- a/circuit/account/src/signature/helpers/to_fields.rs +++ b/circuit/account/src/signature/helpers/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl ToFields for Signature { type Field = Field; @@ -26,7 +27,7 @@ impl ToFields for Signature { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/account/src/signature/mod.rs b/circuit/account/src/signature/mod.rs index 19b02b4c26..8583113a48 100644 --- a/circuit/account/src/signature/mod.rs +++ b/circuit/account/src/signature/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,7 +23,7 @@ use snarkvm_circuit_types::environment::{assert_count, assert_output_mode, asser use crate::ComputeKey; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field, Scalar}; +use snarkvm_circuit_types::{Address, Boolean, Field, Scalar, environment::prelude::*}; #[derive(Clone)] pub struct Signature { @@ -34,7 +35,7 @@ pub struct Signature { compute_key: ComputeKey, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Signature { type Primitive = console::Signature; @@ -65,7 +66,7 @@ impl Signature { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Signature { type Primitive = console::Signature; @@ -80,7 +81,7 @@ impl Eject for Signature { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Signature { /// Parses a string into a signature circuit. #[inline] @@ -97,7 +98,7 @@ impl Parser for Signature { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Signature { type Err = Error; @@ -116,7 +117,7 @@ impl FromStr for Signature { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Signature { /// Returns the type name of the circuit as a string. #[inline] @@ -125,24 +126,24 @@ impl TypeName for Signature { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Signature { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Signature { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use snarkvm_utilities::{TestRng, Uniform}; use anyhow::Result; diff --git a/circuit/account/src/signature/ternary.rs b/circuit/account/src/signature/ternary.rs index 62aa03c9c1..2fdf9b6e20 100644 --- a/circuit/account/src/signature/ternary.rs +++ b/circuit/account/src/signature/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -58,7 +59,7 @@ impl OutputMode, Output = Self>> for S } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/account/src/signature/verify.rs b/circuit/account/src/signature/verify.rs index cdaebe9cdd..1dd98f89e3 100644 --- a/circuit/account/src/signature/verify.rs +++ b/circuit/account/src/signature/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -41,10 +42,10 @@ impl Signature { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] pub(crate) mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use snarkvm_circuit_types::Group; use snarkvm_utilities::{TestRng, Uniform}; @@ -73,7 +74,7 @@ pub(crate) mod tests { let signature = Signature::::new(mode, signature); let address = Address::new(mode, address); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = signature.verify(&address, &message); assert!(candidate.eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. @@ -113,7 +114,7 @@ pub(crate) mod tests { let signature = Signature::::new(mode, signature); let address = Address::new(mode, address); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = signature.verify(&address, &message); assert!(candidate.eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/account/src/view_key/from_private_key.rs b/circuit/account/src/view_key/from_private_key.rs index 6bd1ddc7ea..d0ab79a4bc 100644 --- a/circuit/account/src/view_key/from_private_key.rs +++ b/circuit/account/src/view_key/from_private_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,10 +25,10 @@ impl ViewKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; @@ -47,7 +48,7 @@ mod tests { // Initialize the private key. let private_key = PrivateKey::::new(mode, private_key); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = ViewKey::from_private_key(&private_key); assert_eq!(view_key, candidate.eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/account/src/view_key/mod.rs b/circuit/account/src/view_key/mod.rs index 9b9f0b87ef..1227ef6f7a 100644 --- a/circuit/account/src/view_key/mod.rs +++ b/circuit/account/src/view_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,14 +21,14 @@ use snarkvm_circuit_types::environment::assert_scope; use crate::PrivateKey; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Scalar}; +use snarkvm_circuit_types::{Address, Scalar, environment::prelude::*}; use core::ops::Deref; /// The account view key is able to decrypt records and ciphertext. pub struct ViewKey(Scalar, OnceCell>); -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for ViewKey { type Primitive = console::ViewKey; @@ -37,7 +38,7 @@ impl Inject for ViewKey { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for ViewKey { type Primitive = console::ViewKey; @@ -60,10 +61,10 @@ impl Deref for ViewKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; diff --git a/circuit/account/src/view_key/to_address.rs b/circuit/account/src/view_key/to_address.rs index 148bc3e7d9..f4aa01e0a1 100644 --- a/circuit/account/src/view_key/to_address.rs +++ b/circuit/account/src/view_key/to_address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,10 +22,10 @@ impl ViewKey { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{helpers::generate_account, Circuit}; + use crate::{Circuit, helpers::generate_account}; use anyhow::Result; @@ -44,7 +45,7 @@ mod tests { // Initialize the view key. let candidate = ViewKey::::new(mode, view_key); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_address(); assert_eq!(*address, candidate.to_group().eject_value()); // TODO (howardwu): Resolve skipping the cost count checks for the burn-in round. diff --git a/circuit/algorithms/Cargo.toml b/circuit/algorithms/Cargo.toml index 8749d46f84..2480979f49 100644 --- a/circuit/algorithms/Cargo.toml +++ b/circuit/algorithms/Cargo.toml @@ -1,24 +1,26 @@ [package] name = "snarkvm-circuit-algorithms" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Algorithm circuit library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-algorithms" path = "../../console/algorithms" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dev-dependencies.anyhow] diff --git a/circuit/algorithms/build.rs b/circuit/algorithms/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/algorithms/build.rs +++ b/circuit/algorithms/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/algorithms/src/bhp/commit.rs b/circuit/algorithms/src/bhp/commit.rs index bb8c7923ca..3d14287636 100644 --- a/circuit/algorithms/src/bhp/commit.rs +++ b/circuit/algorithms/src/bhp/commit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,7 +26,7 @@ impl Commit for BH } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/bhp/commit_uncompressed.rs b/circuit/algorithms/src/bhp/commit_uncompressed.rs index 36e31a25a0..ba79a19055 100644 --- a/circuit/algorithms/src/bhp/commit_uncompressed.rs +++ b/circuit/algorithms/src/bhp/commit_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -35,7 +36,7 @@ impl CommitUncompr } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/bhp/hash.rs b/circuit/algorithms/src/bhp/hash.rs index ad529f5a56..54839026d0 100644 --- a/circuit/algorithms/src/bhp/hash.rs +++ b/circuit/algorithms/src/bhp/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,7 +25,7 @@ impl Hash for BHP< } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/bhp/hash_uncompressed.rs b/circuit/algorithms/src/bhp/hash_uncompressed.rs index 2bcac4d09a..4179c545e3 100644 --- a/circuit/algorithms/src/bhp/hash_uncompressed.rs +++ b/circuit/algorithms/src/bhp/hash_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -70,7 +71,7 @@ impl HashUncompres } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/bhp/hasher/hash_uncompressed.rs b/circuit/algorithms/src/bhp/hasher/hash_uncompressed.rs index 4783a24d7b..7872933e80 100644 --- a/circuit/algorithms/src/bhp/hasher/hash_uncompressed.rs +++ b/circuit/algorithms/src/bhp/hasher/hash_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -157,7 +158,8 @@ impl HashUncompres // Otherwise, call `montgomery_add` to add to the accumulating sum. Some((sum_x, sum_y)) => { // Sum the new Montgomery point into the accumulating sum. - sum = Some(montgomery_add((sum_x, sum_y), (&montgomery_x, &montgomery_y))); // 3 constraints + sum = Some(montgomery_add((sum_x, sum_y), (&montgomery_x, &montgomery_y))); + // 3 constraints } } }); @@ -168,7 +170,8 @@ impl HashUncompres // Convert the accumulated sum into a point on the twisted Edwards curve. let edwards_x = sum_x.div_unchecked(sum_y); // 1 constraint (`sum_y` is never 0) let edwards_y = (sum_x - &one).div_unchecked(&(sum_x + &one)); // 1 constraint (numerator & denominator are never both 0) - Group::from_xy_coordinates_unchecked(edwards_x, edwards_y) // 0 constraints (this is safe) + Group::from_xy_coordinates_unchecked(edwards_x, edwards_y) + // 0 constraints (this is safe) } None => E::halt("Invalid iteration of BHP detected, a window was not evaluated"), } @@ -177,7 +180,7 @@ impl HashUncompres } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/bhp/hasher/mod.rs b/circuit/algorithms/src/bhp/hasher/mod.rs index 63bee114d3..a79715a29b 100644 --- a/circuit/algorithms/src/bhp/hasher/mod.rs +++ b/circuit/algorithms/src/bhp/hasher/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ mod hash_uncompressed; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] use snarkvm_circuit_types::environment::assert_scope; use crate::HashUncompressed; @@ -55,7 +56,7 @@ impl BHPHasher Inject for BHPHasher { type Primitive = console::BHP; @@ -99,7 +100,7 @@ impl Inject for BH } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::{Circuit, Eject}; diff --git a/circuit/algorithms/src/bhp/mod.rs b/circuit/algorithms/src/bhp/mod.rs index 6845dd343b..946aecb207 100644 --- a/circuit/algorithms/src/bhp/mod.rs +++ b/circuit/algorithms/src/bhp/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ mod commit_uncompressed; mod hash; mod hash_uncompressed; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] use snarkvm_circuit_types::environment::assert_scope; use crate::{Commit, CommitUncompressed, Hash, HashUncompressed}; @@ -59,7 +60,7 @@ pub struct BHP { hasher: BHPHasher, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for BHP { type Primitive = console::BHP; @@ -84,7 +85,7 @@ impl Inject for BH } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::{Circuit, Eject}; diff --git a/circuit/algorithms/src/elligator2/encode.rs b/circuit/algorithms/src/elligator2/encode.rs index 62db70c64d..2dc4853a62 100644 --- a/circuit/algorithms/src/elligator2/encode.rs +++ b/circuit/algorithms/src/elligator2/encode.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -126,7 +127,7 @@ impl Elligator2 { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/elligator2/mod.rs b/circuit/algorithms/src/elligator2/mod.rs index 270f7f396b..aff5ab78c9 100644 --- a/circuit/algorithms/src/elligator2/mod.rs +++ b/circuit/algorithms/src/elligator2/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ mod encode; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] use snarkvm_circuit_types::environment::assert_scope; use snarkvm_circuit_types::prelude::*; diff --git a/circuit/algorithms/src/keccak/hash.rs b/circuit/algorithms/src/keccak/hash.rs index 66c9919f63..bee4fa598b 100644 --- a/circuit/algorithms/src/keccak/hash.rs +++ b/circuit/algorithms/src/keccak/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -281,7 +282,7 @@ impl Keccak = Keccak; diff --git a/circuit/algorithms/src/lib.rs b/circuit/algorithms/src/lib.rs index 8e23ee9f96..8501a008f3 100644 --- a/circuit/algorithms/src/lib.rs +++ b/circuit/algorithms/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/algorithms/src/pedersen/commit.rs b/circuit/algorithms/src/pedersen/commit.rs index 157504b7f2..94bf0ee949 100644 --- a/circuit/algorithms/src/pedersen/commit.rs +++ b/circuit/algorithms/src/pedersen/commit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -94,7 +95,7 @@ impl } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/pedersen/commit_uncompressed.rs b/circuit/algorithms/src/pedersen/commit_uncompressed.rs index b0f539e069..a38eeceef4 100644 --- a/circuit/algorithms/src/pedersen/commit_uncompressed.rs +++ b/circuit/algorithms/src/pedersen/commit_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -104,7 +105,7 @@ impl } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/pedersen/hash.rs b/circuit/algorithms/src/pedersen/hash.rs index 40027d5f5b..cd10747163 100644 --- a/circuit/algorithms/src/pedersen/hash.rs +++ b/circuit/algorithms/src/pedersen/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -47,7 +48,7 @@ impl OutputMode, } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/pedersen/hash_uncompressed.rs b/circuit/algorithms/src/pedersen/hash_uncompressed.rs index c9216207ba..1f756efa8f 100644 --- a/circuit/algorithms/src/pedersen/hash_uncompressed.rs +++ b/circuit/algorithms/src/pedersen/hash_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -101,7 +102,7 @@ impl OutputMode { random_base: Vec>, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Pedersen { type Primitive = console::Pedersen; @@ -55,7 +56,7 @@ impl Inject for Pedersen { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/poseidon/hash.rs b/circuit/algorithms/src/poseidon/hash.rs index 168c566e56..2666ea75ad 100644 --- a/circuit/algorithms/src/poseidon/hash.rs +++ b/circuit/algorithms/src/poseidon/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,7 +25,7 @@ impl Hash for Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/poseidon/hash_many.rs b/circuit/algorithms/src/poseidon/hash_many.rs index d2baf7fcc5..0e5a1ad687 100644 --- a/circuit/algorithms/src/poseidon/hash_many.rs +++ b/circuit/algorithms/src/poseidon/hash_many.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -192,7 +193,7 @@ impl Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/poseidon/hash_to_group.rs b/circuit/algorithms/src/poseidon/hash_to_group.rs index 4b526432b7..4176805beb 100644 --- a/circuit/algorithms/src/poseidon/hash_to_group.rs +++ b/circuit/algorithms/src/poseidon/hash_to_group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -35,7 +36,7 @@ impl HashToGroup for Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/poseidon/hash_to_scalar.rs b/circuit/algorithms/src/poseidon/hash_to_scalar.rs index 0de7fef0ad..512dc4ad63 100644 --- a/circuit/algorithms/src/poseidon/hash_to_scalar.rs +++ b/circuit/algorithms/src/poseidon/hash_to_scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -30,7 +31,7 @@ impl HashToScalar for Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/poseidon/mod.rs b/circuit/algorithms/src/poseidon/mod.rs index 932413c171..b65115236f 100644 --- a/circuit/algorithms/src/poseidon/mod.rs +++ b/circuit/algorithms/src/poseidon/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,13 +19,13 @@ mod hash_to_group; mod hash_to_scalar; mod prf; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] use snarkvm_circuit_types::environment::assert_scope; #[cfg(test)] use snarkvm_utilities::{TestRng, Uniform}; use crate::{Elligator2, Hash, HashMany, HashToGroup, HashToScalar, PRF}; -use snarkvm_circuit_types::{environment::prelude::*, Field, Group, Scalar}; +use snarkvm_circuit_types::{Field, Group, Scalar, environment::prelude::*}; /// Poseidon2 is a cryptographic hash function of input rate 2. pub type Poseidon2 = Poseidon; @@ -67,7 +68,7 @@ pub struct Poseidon { mds: Vec>>, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Poseidon { type Primitive = console::Poseidon; diff --git a/circuit/algorithms/src/poseidon/prf.rs b/circuit/algorithms/src/poseidon/prf.rs index 460a9b0805..292ab181af 100644 --- a/circuit/algorithms/src/poseidon/prf.rs +++ b/circuit/algorithms/src/poseidon/prf.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -31,7 +32,7 @@ impl PRF for Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_types::environment::Circuit; diff --git a/circuit/algorithms/src/traits.rs b/circuit/algorithms/src/traits.rs index 85437d05a6..64dcbb98e8 100644 --- a/circuit/algorithms/src/traits.rs +++ b/circuit/algorithms/src/traits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/collections/Cargo.toml b/circuit/collections/Cargo.toml index 6cc949c5b9..9576e444bb 100644 --- a/circuit/collections/Cargo.toml +++ b/circuit/collections/Cargo.toml @@ -1,24 +1,26 @@ [package] name = "snarkvm-circuit-collections" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Collections circuit library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-collections" path = "../../console/collections" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.snarkvm-circuit-network] path = "../network" diff --git a/circuit/collections/build.rs b/circuit/collections/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/collections/build.rs +++ b/circuit/collections/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/collections/src/kary_merkle_tree/helpers/leaf_hash.rs b/circuit/collections/src/kary_merkle_tree/helpers/leaf_hash.rs index b60c2b4931..5a05eda3da 100644 --- a/circuit/collections/src/kary_merkle_tree/helpers/leaf_hash.rs +++ b/circuit/collections/src/kary_merkle_tree/helpers/leaf_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_circuit_algorithms::{Hash, Keccak, Poseidon, BHP}; +use snarkvm_circuit_algorithms::{BHP, Hash, Keccak, Poseidon}; /// A trait for a Merkle leaf hash function. pub trait LeafHash { @@ -73,10 +74,10 @@ impl LeafHash for Keccak Default for BooleanHash { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for BooleanHash { type Primitive = console::kary_merkle_tree::BooleanHash; @@ -47,7 +48,7 @@ impl Inject for BooleanHash { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for BooleanHash { type Primitive = console::kary_merkle_tree::BooleanHash; diff --git a/circuit/collections/src/kary_merkle_tree/helpers/path_hash.rs b/circuit/collections/src/kary_merkle_tree/helpers/path_hash.rs index c2ae5f49f9..1cb44c200e 100644 --- a/circuit/collections/src/kary_merkle_tree/helpers/path_hash.rs +++ b/circuit/collections/src/kary_merkle_tree/helpers/path_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_circuit_algorithms::{Hash, Keccak, Poseidon, BHP}; +use snarkvm_circuit_algorithms::{BHP, Hash, Keccak, Poseidon}; /// A trait for a Merkle path hash function. pub trait PathHash { @@ -90,10 +91,10 @@ impl PathHash for Kecca } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use snarkvm_circuit_algorithms::{Keccak256, Poseidon2, Sha3_256, BHP512}; + use snarkvm_circuit_algorithms::{BHP512, Keccak256, Poseidon2, Sha3_256}; use snarkvm_circuit_types::environment::Circuit; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/circuit/collections/src/kary_merkle_tree/mod.rs b/circuit/collections/src/kary_merkle_tree/mod.rs index dc43e3e740..dea7af97cf 100644 --- a/circuit/collections/src/kary_merkle_tree/mod.rs +++ b/circuit/collections/src/kary_merkle_tree/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,10 +18,10 @@ pub use helpers::{BooleanHash, LeafHash, PathHash}; mod verify; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] use snarkvm_circuit_types::environment::assert_scope; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U16, U64}; +use snarkvm_circuit_types::{Boolean, Field, U16, U64, environment::prelude::*}; pub struct KaryMerklePath, const DEPTH: u8, const ARITY: u8> { /// The leaf index for the path. @@ -29,7 +30,7 @@ pub struct KaryMerklePath, const DEPTH: u8, cons siblings: Vec>, } -#[cfg(console)] +#[cfg(feature = "console")] impl, const DEPTH: u8, const ARITY: u8> Inject for KaryMerklePath { type Primitive = console::kary_merkle_tree::KaryMerklePath; @@ -59,7 +60,7 @@ impl, const DEPTH: u8, const ARITY: u8> Inject f } } -#[cfg(console)] +#[cfg(feature = "console")] impl, const DEPTH: u8, const ARITY: u8> Eject for KaryMerklePath { type Primitive = console::kary_merkle_tree::KaryMerklePath; @@ -77,11 +78,11 @@ impl, const DEPTH: u8, const ARITY: u8> Eject fo } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use console::{ - algorithms::{BHP1024 as NativeBHP1024, BHP512 as NativeBHP512}, + algorithms::{BHP512 as NativeBHP512, BHP1024 as NativeBHP1024}, kary_merkle_tree::KaryMerkleTree, }; use snarkvm_circuit_algorithms::BHP512; diff --git a/circuit/collections/src/kary_merkle_tree/verify.rs b/circuit/collections/src/kary_merkle_tree/verify.rs index 613fd80c94..f3e76d5cc0 100644 --- a/circuit/collections/src/kary_merkle_tree/verify.rs +++ b/circuit/collections/src/kary_merkle_tree/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -102,10 +103,10 @@ impl, const DEPTH: u8, const ARITY: u8> KaryMerk } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use snarkvm_circuit_algorithms::{Keccak256, Poseidon2, Poseidon4, Sha3_256, BHP1024, BHP512}; + use snarkvm_circuit_algorithms::{BHP512, BHP1024, Keccak256, Poseidon2, Poseidon4, Sha3_256}; use snarkvm_circuit_types::environment::Circuit; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/circuit/collections/src/lib.rs b/circuit/collections/src/lib.rs index 70e1e74edd..3c72d01606 100644 --- a/circuit/collections/src/lib.rs +++ b/circuit/collections/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/collections/src/merkle_tree/helpers/leaf_hash.rs b/circuit/collections/src/merkle_tree/helpers/leaf_hash.rs index 79f8883af8..1f33c070a7 100644 --- a/circuit/collections/src/merkle_tree/helpers/leaf_hash.rs +++ b/circuit/collections/src/merkle_tree/helpers/leaf_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_circuit_algorithms::{Hash, Poseidon, BHP}; +use snarkvm_circuit_algorithms::{BHP, Hash, Poseidon}; /// A trait for a Merkle leaf hash function. pub trait LeafHash { @@ -54,10 +55,10 @@ impl LeafHash for Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use snarkvm_circuit_algorithms::{Poseidon4, BHP1024}; + use snarkvm_circuit_algorithms::{BHP1024, Poseidon4}; use snarkvm_circuit_types::environment::Circuit; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/circuit/collections/src/merkle_tree/helpers/mod.rs b/circuit/collections/src/merkle_tree/helpers/mod.rs index 9bfbdc3744..25278aadfb 100644 --- a/circuit/collections/src/merkle_tree/helpers/mod.rs +++ b/circuit/collections/src/merkle_tree/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/collections/src/merkle_tree/helpers/path_hash.rs b/circuit/collections/src/merkle_tree/helpers/path_hash.rs index bd5f8578cf..2b90ddff3f 100644 --- a/circuit/collections/src/merkle_tree/helpers/path_hash.rs +++ b/circuit/collections/src/merkle_tree/helpers/path_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_circuit_algorithms::{Hash, Poseidon, BHP}; +use snarkvm_circuit_algorithms::{BHP, Hash, Poseidon}; /// A trait for a Merkle path hash function. pub trait PathHash { @@ -55,10 +56,10 @@ impl PathHash for Poseidon { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use snarkvm_circuit_algorithms::{Poseidon2, BHP512}; + use snarkvm_circuit_algorithms::{BHP512, Poseidon2}; use snarkvm_circuit_types::environment::Circuit; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/circuit/collections/src/merkle_tree/mod.rs b/circuit/collections/src/merkle_tree/mod.rs index 2c85087b47..2d58338d9f 100644 --- a/circuit/collections/src/merkle_tree/mod.rs +++ b/circuit/collections/src/merkle_tree/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,10 +18,10 @@ use helpers::{LeafHash, PathHash}; mod verify; -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] use snarkvm_circuit_types::environment::assert_scope; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U64}; +use snarkvm_circuit_types::{Boolean, Field, U64, environment::prelude::*}; pub struct MerklePath { /// The leaf index for the path. @@ -29,7 +30,7 @@ pub struct MerklePath { siblings: Vec>, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for MerklePath { type Primitive = console::merkle_tree::MerklePath; @@ -48,7 +49,7 @@ impl Inject for MerklePath { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for MerklePath { type Primitive = console::merkle_tree::MerklePath; @@ -66,7 +67,7 @@ impl Eject for MerklePath { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_network::AleoV0 as Circuit; diff --git a/circuit/collections/src/merkle_tree/verify.rs b/circuit/collections/src/merkle_tree/verify.rs index bd36950cbc..1d72a31b11 100644 --- a/circuit/collections/src/merkle_tree/verify.rs +++ b/circuit/collections/src/merkle_tree/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -55,10 +56,10 @@ impl MerklePath { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use snarkvm_circuit_algorithms::{Poseidon2, Poseidon4, BHP1024, BHP512}; + use snarkvm_circuit_algorithms::{BHP512, BHP1024, Poseidon2, Poseidon4}; use snarkvm_circuit_types::environment::Circuit; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/circuit/environment/Cargo.toml b/circuit/environment/Cargo.toml index 894d81274c..042e844f1b 100644 --- a/circuit/environment/Cargo.toml +++ b/circuit/environment/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-circuit-environment" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Circuit environment for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -14,32 +16,32 @@ harness = false [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "r1cs" ] [dependencies.snarkvm-circuit-environment-witness] path = "./witness" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.indexmap] diff --git a/circuit/environment/benches/linear_combination.rs b/circuit/environment/benches/linear_combination.rs index ca8f7df1d1..bb5b089519 100644 --- a/circuit/environment/benches/linear_combination.rs +++ b/circuit/environment/benches/linear_combination.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ extern crate criterion; use snarkvm_circuit::{ - environment::{prelude::num_traits::One as _, Circuit, Eject, Environment, Inject, LinearCombination, Mode, One}, + environment::{Circuit, Eject, Environment, Inject, LinearCombination, Mode, One, prelude::num_traits::One as _}, types::Field, }; diff --git a/circuit/environment/src/canary_circuit.rs b/circuit/environment/src/canary_circuit.rs index 230e51265e..99edef9eba 100644 --- a/circuit/environment/src/canary_circuit.rs +++ b/circuit/environment/src/canary_circuit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{helpers::Constraint, Mode, *}; +use crate::{Mode, helpers::Constraint, *}; use core::{ cell::{Cell, RefCell}, @@ -22,10 +23,10 @@ use core::{ type Field = ::Field; thread_local! { - static VARIABLE_LIMIT: Cell> = Cell::new(None); - static CONSTRAINT_LIMIT: Cell> = Cell::new(None); + static VARIABLE_LIMIT: Cell> = const { Cell::new(None) }; + static CONSTRAINT_LIMIT: Cell> = const { Cell::new(None) }; pub(super) static CANARY_CIRCUIT: RefCell> = RefCell::new(R1CS::new()); - static IN_WITNESS: Cell = Cell::new(false); + static IN_WITNESS: Cell = const { Cell::new(false) }; static ZERO: LinearCombination = LinearCombination::zero(); static ONE: LinearCombination = LinearCombination::one(); } diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index b1edb6e9d9..3bf3742a40 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{helpers::Constraint, Mode, *}; +use crate::{Mode, helpers::Constraint, *}; use core::{ cell::{Cell, RefCell}, @@ -22,10 +23,10 @@ use core::{ type Field = ::Field; thread_local! { - static VARIABLE_LIMIT: Cell> = Cell::new(None); - static CONSTRAINT_LIMIT: Cell> = Cell::new(None); + static VARIABLE_LIMIT: Cell> = const { Cell::new(None) }; + static CONSTRAINT_LIMIT: Cell> = const { Cell::new(None) }; pub(super) static CIRCUIT: RefCell> = RefCell::new(R1CS::new()); - static IN_WITNESS: Cell = Cell::new(false); + static IN_WITNESS: Cell = const { Cell::new(false) }; static ZERO: LinearCombination = LinearCombination::zero(); static ONE: LinearCombination = LinearCombination::one(); } diff --git a/circuit/environment/src/environment.rs b/circuit/environment/src/environment.rs index b993588b1d..f58fd7d7ea 100644 --- a/circuit/environment/src/environment.rs +++ b/circuit/environment/src/environment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{witness_mode, Assignment, Inject, LinearCombination, Mode, Variable, R1CS}; +use crate::{Assignment, Inject, LinearCombination, Mode, R1CS, Variable, witness_mode}; use snarkvm_curves::AffineCurve; use snarkvm_fields::traits::*; diff --git a/circuit/environment/src/helpers/assignment.rs b/circuit/environment/src/helpers/assignment.rs index 4bc0d07e3f..d8181dbdad 100644 --- a/circuit/environment/src/helpers/assignment.rs +++ b/circuit/environment/src/helpers/assignment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -283,7 +284,7 @@ impl snarkvm_algorithms::r1cs::ConstraintSynthesizer for Assig #[cfg(test)] mod tests { - use snarkvm_algorithms::{r1cs::ConstraintSynthesizer, AlgebraicSponge, SNARK}; + use snarkvm_algorithms::{AlgebraicSponge, SNARK, r1cs::ConstraintSynthesizer}; use snarkvm_circuit::prelude::*; use snarkvm_curves::bls12_377::Fr; @@ -344,7 +345,7 @@ mod tests { use snarkvm_algorithms::{ crypto_hash::PoseidonSponge, - snark::varuna::{ahp::AHPForR1CS, VarunaHidingMode, VarunaSNARK}, + snark::varuna::{VarunaHidingMode, VarunaSNARK, ahp::AHPForR1CS}, }; use snarkvm_curves::bls12_377::{Bls12_377, Fq}; use snarkvm_utilities::rand::TestRng; diff --git a/circuit/environment/src/helpers/circuit_type.rs b/circuit/environment/src/helpers/circuit_type.rs index 7f66a26514..ee3603c1e1 100644 --- a/circuit/environment/src/helpers/circuit_type.rs +++ b/circuit/environment/src/helpers/circuit_type.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/constraint.rs b/circuit/environment/src/helpers/constraint.rs index f3ee765b2d..5dad958730 100644 --- a/circuit/environment/src/helpers/constraint.rs +++ b/circuit/environment/src/helpers/constraint.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/converter.rs b/circuit/environment/src/helpers/converter.rs index 9ba96a4142..f404d17078 100644 --- a/circuit/environment/src/helpers/converter.rs +++ b/circuit/environment/src/helpers/converter.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{CanaryCircuit, Circuit, LinearCombination, TestnetCircuit, Variable, R1CS}; +use crate::{CanaryCircuit, Circuit, LinearCombination, R1CS, TestnetCircuit, Variable}; use snarkvm_curves::edwards_bls12::Fq; use snarkvm_fields::PrimeField; @@ -200,7 +201,7 @@ impl R1CS { #[cfg(test)] mod tests { - use snarkvm_algorithms::{r1cs::ConstraintSynthesizer, AlgebraicSponge, SNARK}; + use snarkvm_algorithms::{AlgebraicSponge, SNARK, r1cs::ConstraintSynthesizer}; use snarkvm_circuit::prelude::*; use snarkvm_curves::bls12_377::Fr; @@ -252,7 +253,7 @@ mod tests { use snarkvm_algorithms::{ crypto_hash::PoseidonSponge, - snark::varuna::{ahp::AHPForR1CS, VarunaHidingMode, VarunaSNARK}, + snark::varuna::{VarunaHidingMode, VarunaSNARK, ahp::AHPForR1CS}, }; use snarkvm_curves::bls12_377::{Bls12_377, Fq}; use snarkvm_utilities::rand::TestRng; diff --git a/circuit/environment/src/helpers/count.rs b/circuit/environment/src/helpers/count.rs index 98a92472c2..4c8799372c 100644 --- a/circuit/environment/src/helpers/count.rs +++ b/circuit/environment/src/helpers/count.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/counter.rs b/circuit/environment/src/helpers/counter.rs index 8631f95af1..3f59d12fa0 100644 --- a/circuit/environment/src/helpers/counter.rs +++ b/circuit/environment/src/helpers/counter.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/linear_combination.rs b/circuit/environment/src/helpers/linear_combination.rs index 4d33d210ff..dbff6c06c2 100644 --- a/circuit/environment/src/helpers/linear_combination.rs +++ b/circuit/environment/src/helpers/linear_combination.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/mod.rs b/circuit/environment/src/helpers/mod.rs index 35d948a7da..8237d3ff3d 100644 --- a/circuit/environment/src/helpers/mod.rs +++ b/circuit/environment/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/mode.rs b/circuit/environment/src/helpers/mode.rs index 886a305f4d..ff1d9296e8 100644 --- a/circuit/environment/src/helpers/mode.rs +++ b/circuit/environment/src/helpers/mode.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,10 +15,10 @@ use crate::prelude::*; use snarkvm_utilities::{ - error, - io::{Read, Result as IoResult, Write}, FromBytes, ToBytes, + error, + io::{Read, Result as IoResult, Write}, }; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] diff --git a/circuit/environment/src/helpers/r1cs.rs b/circuit/environment/src/helpers/r1cs.rs index 11209e0e3f..4003775b53 100644 --- a/circuit/environment/src/helpers/r1cs.rs +++ b/circuit/environment/src/helpers/r1cs.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/helpers/updatable_count.rs b/circuit/environment/src/helpers/updatable_count.rs index 9193237af0..122db5c861 100644 --- a/circuit/environment/src/helpers/updatable_count.rs +++ b/circuit/environment/src/helpers/updatable_count.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -32,7 +33,7 @@ static WORKSPACE_ROOT: OnceCell = OnceCell::new(); /// To update the arguments to `count_is!`, run cargo test with the `UPDATE_COUNT` flag set to the name of the file containing the macro invocation. /// e.g. `UPDATE_COUNT=boolean cargo test -/// See https://github.com/AleoHQ/snarkVM/pull/1688 for more details. +/// See https://github.com/AleoNet/snarkVM/pull/1688 for more details. #[macro_export] macro_rules! count_is { ($num_constants:literal, $num_public:literal, $num_private:literal, $num_constraints:literal) => { @@ -50,7 +51,7 @@ macro_rules! count_is { /// To update the arguments to `count_less_than!`, run cargo test with the `UPDATE_COUNT` flag set to the name of the file containing the macro invocation. /// e.g. `UPDATE_COUNT=boolean cargo test -/// See https://github.com/AleoHQ/snarkVM/pull/1688 for more details. +/// See https://github.com/AleoNet/snarkVM/pull/1688 for more details. #[macro_export] macro_rules! count_less_than { ($num_constants:literal, $num_public:literal, $num_private:literal, $num_constraints:literal) => { @@ -498,7 +499,7 @@ mod test { fn check_position() { let count = count_is!(0, 0, 0, 0); assert_eq!(count.file, "circuit/environment/src/helpers/updatable_count.rs"); - assert_eq!(count.line, 499); + assert_eq!(count.line, 500); assert_eq!(count.column, 21); } diff --git a/circuit/environment/src/helpers/variable.rs b/circuit/environment/src/helpers/variable.rs index 6dd7012af4..80abeb4531 100644 --- a/circuit/environment/src/helpers/variable.rs +++ b/circuit/environment/src/helpers/variable.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/lib.rs b/circuit/environment/src/lib.rs index eb6ac980c9..6b9da587d3 100644 --- a/circuit/environment/src/lib.rs +++ b/circuit/environment/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -43,6 +44,13 @@ pub use traits::*; pub mod prelude { pub use crate::{ + CircuitType, + Count, + Environment, + LinearCombination, + Mode, + OutputMode, + Variable, count, count_is, count_less_than, @@ -51,20 +59,12 @@ pub mod prelude { traits::*, witness, witness_mode, - CircuitType, - Count, - Environment, - LinearCombination, - Mode, - OutputMode, - Variable, }; pub use console::{ + Parser, + ParserResult, + TypeName, prelude::{ - bail, - ensure, - fmt, - has_duplicates, Debug, Display, Error, @@ -73,23 +73,24 @@ pub mod prelude { One as _, Result, Zero as _, + bail, + ensure, + fmt, + has_duplicates, }, traits::{ - string_parser, - types::{ - integer_magnitude::Magnitude, - integer_type::{CheckedPow, IntegerProperties, IntegerType, WrappingDiv, WrappingPow, WrappingRem}, - }, Double as _, FromBits as _, Inverse as _, Square as _, SquareRoot as _, ToBits as _, + string_parser, + types::{ + integer_magnitude::Magnitude, + integer_type::{CheckedPow, IntegerProperties, IntegerType, WrappingDiv, WrappingPow, WrappingRem}, + }, }, - Parser, - ParserResult, - TypeName, }; pub use snarkvm_fields::{self, Field as _, PrimeField, Zero as _}; diff --git a/circuit/environment/src/macros/metrics.rs b/circuit/environment/src/macros/metrics.rs index 5717abbceb..b6e4881631 100644 --- a/circuit/environment/src/macros/metrics.rs +++ b/circuit/environment/src/macros/metrics.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/macros/mod.rs b/circuit/environment/src/macros/mod.rs index bed7fb825f..5a0c0c473d 100644 --- a/circuit/environment/src/macros/mod.rs +++ b/circuit/environment/src/macros/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/macros/scope.rs b/circuit/environment/src/macros/scope.rs index 07290ec0cd..e8080c4bc1 100644 --- a/circuit/environment/src/macros/scope.rs +++ b/circuit/environment/src/macros/scope.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/macros/witness.rs b/circuit/environment/src/macros/witness.rs index af498e6aab..789c4744fd 100644 --- a/circuit/environment/src/macros/witness.rs +++ b/circuit/environment/src/macros/witness.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/testnet_circuit.rs b/circuit/environment/src/testnet_circuit.rs index 5e3d69b564..add19ad89a 100644 --- a/circuit/environment/src/testnet_circuit.rs +++ b/circuit/environment/src/testnet_circuit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{helpers::Constraint, Mode, *}; +use crate::{Mode, helpers::Constraint, *}; use core::{ cell::{Cell, RefCell}, @@ -22,10 +23,10 @@ use core::{ type Field = ::Field; thread_local! { - static VARIABLE_LIMIT: Cell> = Cell::new(None); - static CONSTRAINT_LIMIT: Cell> = Cell::new(None); + static VARIABLE_LIMIT: Cell> = const { Cell::new(None) }; + static CONSTRAINT_LIMIT: Cell> = const { Cell::new(None) }; pub(super) static TESTNET_CIRCUIT: RefCell> = RefCell::new(R1CS::new()); - static IN_WITNESS: Cell = Cell::new(false); + static IN_WITNESS: Cell = const { Cell::new(false) }; static ZERO: LinearCombination = LinearCombination::zero(); static ONE: LinearCombination = LinearCombination::one(); } diff --git a/circuit/environment/src/traits/eject.rs b/circuit/environment/src/traits/eject.rs index 46fc73c6ed..c65df118d9 100644 --- a/circuit/environment/src/traits/eject.rs +++ b/circuit/environment/src/traits/eject.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/from.rs b/circuit/environment/src/traits/from.rs index c7b266cb6a..fb0d9eb1bd 100644 --- a/circuit/environment/src/traits/from.rs +++ b/circuit/environment/src/traits/from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/inject.rs b/circuit/environment/src/traits/inject.rs index cebff36ee3..0de38db025 100644 --- a/circuit/environment/src/traits/inject.rs +++ b/circuit/environment/src/traits/inject.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/metrics.rs b/circuit/environment/src/traits/metrics.rs index d46d59967a..6a301d4380 100644 --- a/circuit/environment/src/traits/metrics.rs +++ b/circuit/environment/src/traits/metrics.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/mod.rs b/circuit/environment/src/traits/mod.rs index f1cfa96d20..8cce823148 100644 --- a/circuit/environment/src/traits/mod.rs +++ b/circuit/environment/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/operators.rs b/circuit/environment/src/traits/operators.rs index 39d8eac78b..a678e94148 100644 --- a/circuit/environment/src/traits/operators.rs +++ b/circuit/environment/src/traits/operators.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/to.rs b/circuit/environment/src/traits/to.rs index 80ac4f7c12..79f90b2c6e 100644 --- a/circuit/environment/src/traits/to.rs +++ b/circuit/environment/src/traits/to.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/to_bits.rs b/circuit/environment/src/traits/to_bits.rs index a090eddca3..4a6d408086 100644 --- a/circuit/environment/src/traits/to_bits.rs +++ b/circuit/environment/src/traits/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/address.rs b/circuit/environment/src/traits/types/address.rs index d388d9a1ae..f14a972b60 100644 --- a/circuit/environment/src/traits/types/address.rs +++ b/circuit/environment/src/traits/types/address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/boolean.rs b/circuit/environment/src/traits/types/boolean.rs index 7e5a53c3d0..9fed1f5914 100644 --- a/circuit/environment/src/traits/types/boolean.rs +++ b/circuit/environment/src/traits/types/boolean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/field.rs b/circuit/environment/src/traits/types/field.rs index 04369108cf..3261974210 100644 --- a/circuit/environment/src/traits/types/field.rs +++ b/circuit/environment/src/traits/types/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/group.rs b/circuit/environment/src/traits/types/group.rs index dc56893e53..7e858bd30e 100644 --- a/circuit/environment/src/traits/types/group.rs +++ b/circuit/environment/src/traits/types/group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/integers.rs b/circuit/environment/src/traits/types/integers.rs index f6f7e388c4..00d1337ddd 100644 --- a/circuit/environment/src/traits/types/integers.rs +++ b/circuit/environment/src/traits/types/integers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/mod.rs b/circuit/environment/src/traits/types/mod.rs index f57ced5233..7d551ecd10 100644 --- a/circuit/environment/src/traits/types/mod.rs +++ b/circuit/environment/src/traits/types/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/scalar.rs b/circuit/environment/src/traits/types/scalar.rs index 50a980456c..0d7f9fd488 100644 --- a/circuit/environment/src/traits/types/scalar.rs +++ b/circuit/environment/src/traits/types/scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/src/traits/types/string.rs b/circuit/environment/src/traits/types/string.rs index 9039ef4d30..30ec503e3b 100644 --- a/circuit/environment/src/traits/types/string.rs +++ b/circuit/environment/src/traits/types/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/environment/witness/Cargo.toml b/circuit/environment/witness/Cargo.toml index a6660d0684..ce639ac43e 100644 --- a/circuit/environment/witness/Cargo.toml +++ b/circuit/environment/witness/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-circuit-environment-witness" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A procedural macro to construct a witness in an environment" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2018" diff --git a/circuit/environment/witness/src/lib.rs b/circuit/environment/witness/src/lib.rs index 3d4c8c085d..4b0728347d 100644 --- a/circuit/environment/witness/src/lib.rs +++ b/circuit/environment/witness/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/network/Cargo.toml b/circuit/network/Cargo.toml index efd63a8cdc..7205d3eaed 100644 --- a/circuit/network/Cargo.toml +++ b/circuit/network/Cargo.toml @@ -1,28 +1,30 @@ [package] name = "snarkvm-circuit-network" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Network circuit library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.snarkvm-console-types] path = "../../console/types" diff --git a/circuit/network/build.rs b/circuit/network/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/network/build.rs +++ b/circuit/network/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/network/src/canary_v0.rs b/circuit/network/src/canary_v0.rs index 94238bf55b..6480f58fe6 100644 --- a/circuit/network/src/canary_v0.rs +++ b/circuit/network/src/canary_v0.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,6 +15,10 @@ use crate::Aleo; use snarkvm_circuit_algorithms::{ + BHP256, + BHP512, + BHP768, + BHP1024, Commit, CommitUncompressed, Hash, @@ -24,26 +29,22 @@ use snarkvm_circuit_algorithms::{ Keccak256, Keccak384, Keccak512, - Pedersen128, Pedersen64, + Pedersen128, Poseidon2, Poseidon4, Poseidon8, Sha3_256, Sha3_384, Sha3_512, - BHP1024, - BHP256, - BHP512, - BHP768, }; use snarkvm_circuit_collections::merkle_tree::MerklePath; use snarkvm_circuit_types::{ - environment::{prelude::*, Assignment, CanaryCircuit, R1CS}, Boolean, Field, Group, Scalar, + environment::{Assignment, CanaryCircuit, R1CS, prelude::*}, }; use core::fmt; diff --git a/circuit/network/src/lib.rs b/circuit/network/src/lib.rs index 464e4e7ea4..d2558eb9a9 100644 --- a/circuit/network/src/lib.rs +++ b/circuit/network/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,7 +26,7 @@ pub mod v0; pub use v0::*; use snarkvm_circuit_collections::merkle_tree::MerklePath; -use snarkvm_circuit_types::{environment::Environment, Boolean, Field, Group, Scalar}; +use snarkvm_circuit_types::{Boolean, Field, Group, Scalar, environment::Environment}; /// Attention: Do not use `Send + Sync` on this trait, as it is not thread-safe. pub trait Aleo: Environment { diff --git a/circuit/network/src/testnet_v0.rs b/circuit/network/src/testnet_v0.rs index d755c142ba..0bfcd7437c 100644 --- a/circuit/network/src/testnet_v0.rs +++ b/circuit/network/src/testnet_v0.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,6 +15,10 @@ use crate::Aleo; use snarkvm_circuit_algorithms::{ + BHP256, + BHP512, + BHP768, + BHP1024, Commit, CommitUncompressed, Hash, @@ -24,26 +29,22 @@ use snarkvm_circuit_algorithms::{ Keccak256, Keccak384, Keccak512, - Pedersen128, Pedersen64, + Pedersen128, Poseidon2, Poseidon4, Poseidon8, Sha3_256, Sha3_384, Sha3_512, - BHP1024, - BHP256, - BHP512, - BHP768, }; use snarkvm_circuit_collections::merkle_tree::MerklePath; use snarkvm_circuit_types::{ - environment::{prelude::*, Assignment, TestnetCircuit, R1CS}, Boolean, Field, Group, Scalar, + environment::{Assignment, R1CS, TestnetCircuit, prelude::*}, }; use core::fmt; diff --git a/circuit/network/src/v0.rs b/circuit/network/src/v0.rs index 3fe996de7e..5d595220b0 100644 --- a/circuit/network/src/v0.rs +++ b/circuit/network/src/v0.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,6 +15,10 @@ use crate::Aleo; use snarkvm_circuit_algorithms::{ + BHP256, + BHP512, + BHP768, + BHP1024, Commit, CommitUncompressed, Hash, @@ -24,26 +29,22 @@ use snarkvm_circuit_algorithms::{ Keccak256, Keccak384, Keccak512, - Pedersen128, Pedersen64, + Pedersen128, Poseidon2, Poseidon4, Poseidon8, Sha3_256, Sha3_384, Sha3_512, - BHP1024, - BHP256, - BHP512, - BHP768, }; use snarkvm_circuit_collections::merkle_tree::MerklePath; use snarkvm_circuit_types::{ - environment::{prelude::*, Assignment, Circuit, R1CS}, Boolean, Field, Group, Scalar, + environment::{Assignment, Circuit, R1CS, prelude::*}, }; use core::fmt; diff --git a/circuit/program/Cargo.toml b/circuit/program/Cargo.toml index 2a222e0093..221c24c450 100644 --- a/circuit/program/Cargo.toml +++ b/circuit/program/Cargo.toml @@ -1,40 +1,42 @@ [package] name = "snarkvm-circuit-program" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Program circuit library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-program" path = "../../console/program" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-account] path = "../account" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.paste] version = "1.0" diff --git a/circuit/program/build.rs b/circuit/program/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/program/build.rs +++ b/circuit/program/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/access/mod.rs b/circuit/program/src/data/access/mod.rs index 04928f3e96..62f919dc54 100644 --- a/circuit/program/src/data/access/mod.rs +++ b/circuit/program/src/data/access/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use crate::Identifier; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, U32}; +use snarkvm_circuit_types::{U32, environment::prelude::*}; use std::{ fmt, @@ -31,7 +32,7 @@ pub enum Access { Index(U32), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Access { type Primitive = console::Access; @@ -45,7 +46,7 @@ impl Inject for Access { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Access { type Primitive = console::Access; @@ -66,7 +67,7 @@ impl Eject for Access { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Access { /// Parses a UTF-8 string into an access. #[inline] @@ -78,7 +79,7 @@ impl Parser for Access { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Access { type Err = Error; @@ -97,14 +98,14 @@ impl FromStr for Access { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Access { fn fmt(&self, f: &mut Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Access { /// Prints the identifier as a string. fn fmt(&self, f: &mut Formatter) -> fmt::Result { diff --git a/circuit/program/src/data/ciphertext/decrypt.rs b/circuit/program/src/data/ciphertext/decrypt.rs index e734b56a9c..007dd1baaf 100644 --- a/circuit/program/src/data/ciphertext/decrypt.rs +++ b/circuit/program/src/data/ciphertext/decrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -38,7 +39,7 @@ impl Ciphertext { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::{Circuit, Literal}; diff --git a/circuit/program/src/data/ciphertext/equal.rs b/circuit/program/src/data/ciphertext/equal.rs index b31007a190..3dcf7c18ce 100644 --- a/circuit/program/src/data/ciphertext/equal.rs +++ b/circuit/program/src/data/ciphertext/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/ciphertext/from_bits.rs b/circuit/program/src/data/ciphertext/from_bits.rs index 2e3ed21e1e..fc21034810 100644 --- a/circuit/program/src/data/ciphertext/from_bits.rs +++ b/circuit/program/src/data/ciphertext/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/ciphertext/from_fields.rs b/circuit/program/src/data/ciphertext/from_fields.rs index 0fa73cd0f6..b42125de83 100644 --- a/circuit/program/src/data/ciphertext/from_fields.rs +++ b/circuit/program/src/data/ciphertext/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/ciphertext/mod.rs b/circuit/program/src/data/ciphertext/mod.rs index 24b73dc65d..29b553e442 100644 --- a/circuit/program/src/data/ciphertext/mod.rs +++ b/circuit/program/src/data/ciphertext/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,14 +24,14 @@ mod to_fields; use crate::{Plaintext, Visibility}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field}; +use snarkvm_circuit_types::{Boolean, Field, environment::prelude::*}; use core::ops::Deref; #[derive(Clone)] pub struct Ciphertext(Vec>); -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Ciphertext { type Primitive = console::Ciphertext; @@ -44,7 +45,7 @@ impl Inject for Ciphertext { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Ciphertext { type Primitive = console::Ciphertext; diff --git a/circuit/program/src/data/ciphertext/num_randomizers.rs b/circuit/program/src/data/ciphertext/num_randomizers.rs index 20370cff0d..af0faba0a6 100644 --- a/circuit/program/src/data/ciphertext/num_randomizers.rs +++ b/circuit/program/src/data/ciphertext/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/ciphertext/size_in_fields.rs b/circuit/program/src/data/ciphertext/size_in_fields.rs index 1b98c6d428..0374a8e943 100644 --- a/circuit/program/src/data/ciphertext/size_in_fields.rs +++ b/circuit/program/src/data/ciphertext/size_in_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/ciphertext/to_bits.rs b/circuit/program/src/data/ciphertext/to_bits.rs index 6814096498..f263b3e36c 100644 --- a/circuit/program/src/data/ciphertext/to_bits.rs +++ b/circuit/program/src/data/ciphertext/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/ciphertext/to_fields.rs b/circuit/program/src/data/ciphertext/to_fields.rs index 0287585919..6d5763dbf8 100644 --- a/circuit/program/src/data/ciphertext/to_fields.rs +++ b/circuit/program/src/data/ciphertext/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/future/argument.rs b/circuit/program/src/data/future/argument.rs index 7037efbb08..47da91d032 100644 --- a/circuit/program/src/data/future/argument.rs +++ b/circuit/program/src/data/future/argument.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/future/equal.rs b/circuit/program/src/data/future/equal.rs index 91dd2badf8..e3cc06a0b9 100644 --- a/circuit/program/src/data/future/equal.rs +++ b/circuit/program/src/data/future/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/future/find.rs b/circuit/program/src/data/future/find.rs index 4f99a98673..d2d1c70a7b 100644 --- a/circuit/program/src/data/future/find.rs +++ b/circuit/program/src/data/future/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/future/mod.rs b/circuit/program/src/data/future/mod.rs index d9e74f3ba3..31d9bcc4c6 100644 --- a/circuit/program/src/data/future/mod.rs +++ b/circuit/program/src/data/future/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,7 +23,7 @@ mod to_fields; use crate::{Access, Identifier, Plaintext, ProgramID, Value}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U16}; +use snarkvm_circuit_types::{Boolean, Field, U16, environment::prelude::*}; /// A future. #[derive(Clone)] diff --git a/circuit/program/src/data/future/to_bits.rs b/circuit/program/src/data/future/to_bits.rs index 3d5a86fdeb..92346fccb5 100644 --- a/circuit/program/src/data/future/to_bits.rs +++ b/circuit/program/src/data/future/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/future/to_fields.rs b/circuit/program/src/data/future/to_fields.rs index 3952031e1f..f45f66b12c 100644 --- a/circuit/program/src/data/future/to_fields.rs +++ b/circuit/program/src/data/future/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/identifier/equal.rs b/circuit/program/src/data/identifier/equal.rs index a3a3aa859a..378bf11485 100644 --- a/circuit/program/src/data/identifier/equal.rs +++ b/circuit/program/src/data/identifier/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/identifier/from_bits.rs b/circuit/program/src/data/identifier/from_bits.rs index f1b8d0fc8a..1ba41b149b 100644 --- a/circuit/program/src/data/identifier/from_bits.rs +++ b/circuit/program/src/data/identifier/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -48,10 +49,10 @@ impl FromBits for Identifier { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{data::identifier::tests::sample_console_identifier, Circuit}; + use crate::{Circuit, data::identifier::tests::sample_console_identifier}; use anyhow::Result; diff --git a/circuit/program/src/data/identifier/from_field.rs b/circuit/program/src/data/identifier/from_field.rs index a65a4cf445..4d9124e12b 100644 --- a/circuit/program/src/data/identifier/from_field.rs +++ b/circuit/program/src/data/identifier/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -24,10 +25,10 @@ impl FromField for Identifier { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{data::identifier::tests::sample_console_identifier, Circuit}; + use crate::{Circuit, data::identifier::tests::sample_console_identifier}; use anyhow::Result; diff --git a/circuit/program/src/data/identifier/mod.rs b/circuit/program/src/data/identifier/mod.rs index a2a75b0e18..8cff8d1009 100644 --- a/circuit/program/src/data/identifier/mod.rs +++ b/circuit/program/src/data/identifier/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,7 +24,7 @@ mod to_bits; mod to_field; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U8}; +use snarkvm_circuit_types::{Boolean, Field, U8, environment::prelude::*}; use snarkvm_utilities::ToBits as TB; /// An identifier is an **immutable** UTF-8 string, @@ -38,7 +39,7 @@ use snarkvm_utilities::ToBits as TB; #[derive(Clone)] pub struct Identifier(Field, u8); // Number of bytes in the identifier. -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Identifier { type Primitive = console::Identifier; @@ -57,7 +58,7 @@ impl Inject for Identifier { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Identifier { type Primitive = console::Identifier; @@ -76,7 +77,7 @@ impl Eject for Identifier { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Identifier { /// Parses a UTF-8 string into an identifier. #[inline] @@ -88,7 +89,7 @@ impl Parser for Identifier { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Identifier { type Err = Error; @@ -107,14 +108,14 @@ impl FromStr for Identifier { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Identifier { fn fmt(&self, f: &mut Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Identifier { /// Prints the identifier as a string. fn fmt(&self, f: &mut Formatter) -> fmt::Result { @@ -152,13 +153,13 @@ impl From<&Identifier> for LinearCombination { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] pub(crate) mod tests { use super::*; use crate::Circuit; use console::{Rng, TestRng}; - use anyhow::{bail, Result}; + use anyhow::{Result, bail}; use core::str::FromStr; use rand::distributions::Alphanumeric; diff --git a/circuit/program/src/data/identifier/size_in_bits.rs b/circuit/program/src/data/identifier/size_in_bits.rs index dc6f29dc5b..344c61dee9 100644 --- a/circuit/program/src/data/identifier/size_in_bits.rs +++ b/circuit/program/src/data/identifier/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/identifier/to_bits.rs b/circuit/program/src/data/identifier/to_bits.rs index 6bbaf91b4b..24094acfd7 100644 --- a/circuit/program/src/data/identifier/to_bits.rs +++ b/circuit/program/src/data/identifier/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -46,10 +47,10 @@ impl ToBits for &Identifier { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; - use crate::{data::identifier::tests::sample_console_identifier, Circuit}; + use crate::{Circuit, data::identifier::tests::sample_console_identifier}; use anyhow::Result; diff --git a/circuit/program/src/data/identifier/to_field.rs b/circuit/program/src/data/identifier/to_field.rs index 6e8e04814c..1bfe10444a 100644 --- a/circuit/program/src/data/identifier/to_field.rs +++ b/circuit/program/src/data/identifier/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/literal/cast/boolean.rs b/circuit/program/src/data/literal/cast/boolean.rs index 6753261ca3..cfe01a9142 100644 --- a/circuit/program/src/data/literal/cast/boolean.rs +++ b/circuit/program/src/data/literal/cast/boolean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -67,7 +68,7 @@ mod tests { use super::*; use console::Cast as _; use console_root::{network::MainnetV0, prelude::TestRng}; - use snarkvm_circuit_types::environment::{count_is, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast/field.rs b/circuit/program/src/data/literal/cast/field.rs index 9331231a68..bd9e712b9b 100644 --- a/circuit/program/src/data/literal/cast/field.rs +++ b/circuit/program/src/data/literal/cast/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -88,7 +89,7 @@ mod tests { network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; - use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is, count_less_than}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast/integer.rs b/circuit/program/src/data/literal/cast/integer.rs index c25eab04a5..aad1cc56f0 100644 --- a/circuit/program/src/data/literal/cast/integer.rs +++ b/circuit/program/src/data/literal/cast/integer.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -146,7 +147,7 @@ mod tests { network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; - use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is, count_less_than}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast/mod.rs b/circuit/program/src/data/literal/cast/mod.rs index 2c2010f16e..8b08c2bf97 100644 --- a/circuit/program/src/data/literal/cast/mod.rs +++ b/circuit/program/src/data/literal/cast/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,8 +22,6 @@ use crate::data::{CastLossy, Literal}; use console::LiteralType; use snarkvm_circuit_network::Aleo; use snarkvm_circuit_types::prelude::{ - bail, - integers::Integer, Address, BitOr, Boolean, @@ -33,6 +32,7 @@ use snarkvm_circuit_types::prelude::{ FromGroup, Group, IntegerType, + MSB, One, Result, Scalar, @@ -40,11 +40,12 @@ use snarkvm_circuit_types::prelude::{ ToField, ToGroup, Zero, - MSB, + bail, + integers::Integer, }; #[cfg(test)] -use snarkvm_circuit_types::prelude::{I128, I16, I32, I64, I8, U128, U16, U32, U64, U8}; +use snarkvm_circuit_types::prelude::{I8, I16, I32, I64, I128, U8, U16, U32, U64, U128}; /// Unary operator for casting values of one type to another. pub trait Cast { @@ -64,6 +65,7 @@ impl Literal { /// - (`Address`, `Group`) <-> `Field` <-> `Scalar` <-> `Integer` <-> `Boolean` /// - `Signature` (not supported) /// - `String` (not supported) + /// /// Note that casting to left along the hierarchy always preserves information. pub fn cast(&self, to_type: LiteralType) -> Result { match self { diff --git a/circuit/program/src/data/literal/cast/scalar.rs b/circuit/program/src/data/literal/cast/scalar.rs index e9b0e53819..93e4df7b81 100644 --- a/circuit/program/src/data/literal/cast/scalar.rs +++ b/circuit/program/src/data/literal/cast/scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -90,7 +91,7 @@ mod tests { network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; - use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is, count_less_than}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast_lossy/boolean.rs b/circuit/program/src/data/literal/cast_lossy/boolean.rs index 64ac477894..b371082c7b 100644 --- a/circuit/program/src/data/literal/cast_lossy/boolean.rs +++ b/circuit/program/src/data/literal/cast_lossy/boolean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -78,7 +79,7 @@ mod tests { use super::*; use console::CastLossy as _; use console_root::{network::MainnetV0, prelude::TestRng}; - use snarkvm_circuit_types::environment::{count_is, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast_lossy/field.rs b/circuit/program/src/data/literal/cast_lossy/field.rs index 705443d022..f865d70e8e 100644 --- a/circuit/program/src/data/literal/cast_lossy/field.rs +++ b/circuit/program/src/data/literal/cast_lossy/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -119,7 +120,7 @@ mod tests { network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; - use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is, count_less_than}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast_lossy/integer.rs b/circuit/program/src/data/literal/cast_lossy/integer.rs index 1a50e3e8ca..f93ed065b7 100644 --- a/circuit/program/src/data/literal/cast_lossy/integer.rs +++ b/circuit/program/src/data/literal/cast_lossy/integer.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -94,7 +95,7 @@ mod tests { network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; - use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is, count_less_than}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/cast_lossy/mod.rs b/circuit/program/src/data/literal/cast_lossy/mod.rs index ff36351fde..764763a665 100644 --- a/circuit/program/src/data/literal/cast_lossy/mod.rs +++ b/circuit/program/src/data/literal/cast_lossy/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,8 +23,6 @@ use console::LiteralType; use snarkvm_circuit_algorithms::Elligator2; use snarkvm_circuit_network::Aleo; use snarkvm_circuit_types::prelude::{ - bail, - integers::Integer, Address, Boolean, Environment, @@ -34,6 +33,7 @@ use snarkvm_circuit_types::prelude::{ Group, Inject, IntegerType, + MSB, One, Result, Scalar, @@ -42,11 +42,12 @@ use snarkvm_circuit_types::prelude::{ ToField, ToGroup, Zero, - MSB, + bail, + integers::Integer, }; #[cfg(test)] -use snarkvm_circuit_types::prelude::{I128, I16, I32, I64, I8, U128, U16, U32, U64, U8}; +use snarkvm_circuit_types::prelude::{I8, I16, I32, I64, I128, U8, U16, U32, U64, U128}; /// Unary operator for casting values of one type to another, with lossy truncation. pub trait CastLossy { @@ -67,6 +68,7 @@ impl Literal { /// - (`Address`, `Group`) <-> `Field` <-> `Scalar` <-> `Integer` <-> `Boolean` /// - `Signature` (not supported) /// - `String` (not supported) + /// /// Note that casting to left along the hierarchy always preserves information. pub fn cast_lossy(&self, to_type: LiteralType) -> Result { match self { diff --git a/circuit/program/src/data/literal/cast_lossy/scalar.rs b/circuit/program/src/data/literal/cast_lossy/scalar.rs index 2913265440..aa02eb8ded 100644 --- a/circuit/program/src/data/literal/cast_lossy/scalar.rs +++ b/circuit/program/src/data/literal/cast_lossy/scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -92,7 +93,7 @@ mod tests { network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; - use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; + use snarkvm_circuit_types::environment::{Circuit, Eject, Inject, Mode, UpdatableCount, count_is, count_less_than}; use std::fmt::Debug; diff --git a/circuit/program/src/data/literal/equal.rs b/circuit/program/src/data/literal/equal.rs index f72c3bd4b8..5ab0fd9681 100644 --- a/circuit/program/src/data/literal/equal.rs +++ b/circuit/program/src/data/literal/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/literal/from_bits.rs b/circuit/program/src/data/literal/from_bits.rs index fbb5a2f5d7..cfc59dbfbd 100644 --- a/circuit/program/src/data/literal/from_bits.rs +++ b/circuit/program/src/data/literal/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -66,7 +67,7 @@ impl Literal { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/program/src/data/literal/mod.rs b/circuit/program/src/data/literal/mod.rs index e5fdd94e52..89df765a19 100644 --- a/circuit/program/src/data/literal/mod.rs +++ b/circuit/program/src/data/literal/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -71,7 +72,7 @@ pub enum Literal { String(StringType), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Literal { type Primitive = console::Literal; @@ -99,7 +100,7 @@ impl Inject for Literal { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Literal { type Primitive = console::Literal; @@ -150,7 +151,7 @@ impl Eject for Literal { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Literal { /// Parses a string into a literal. #[inline] @@ -177,7 +178,7 @@ impl Parser for Literal { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Literal { type Err = Error; @@ -196,7 +197,7 @@ impl FromStr for Literal { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Literal { /// Returns the type name of the literal. pub fn type_name(&self) -> &str { @@ -222,14 +223,14 @@ impl Literal { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Literal { fn fmt(&self, f: &mut Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Literal { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { diff --git a/circuit/program/src/data/literal/size_in_bits.rs b/circuit/program/src/data/literal/size_in_bits.rs index 4f68ac652d..09805b12b7 100644 --- a/circuit/program/src/data/literal/size_in_bits.rs +++ b/circuit/program/src/data/literal/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/literal/to_bits.rs b/circuit/program/src/data/literal/to_bits.rs index 8457b4e08d..f5063bf36f 100644 --- a/circuit/program/src/data/literal/to_bits.rs +++ b/circuit/program/src/data/literal/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/literal/to_fields.rs b/circuit/program/src/data/literal/to_fields.rs index 758346e463..3d59b1fe4f 100644 --- a/circuit/program/src/data/literal/to_fields.rs +++ b/circuit/program/src/data/literal/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/literal/to_type.rs b/circuit/program/src/data/literal/to_type.rs index b83d0efecd..299aad2c06 100644 --- a/circuit/program/src/data/literal/to_type.rs +++ b/circuit/program/src/data/literal/to_type.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -#[cfg(console)] +#[cfg(feature = "console")] impl Literal { /// Returns the type name of the literal. pub fn to_type(&self) -> console::LiteralType { diff --git a/circuit/program/src/data/literal/variant.rs b/circuit/program/src/data/literal/variant.rs index e268d5808c..5e7b107958 100644 --- a/circuit/program/src/data/literal/variant.rs +++ b/circuit/program/src/data/literal/variant.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/mod.rs b/circuit/program/src/data/mod.rs index e6e5ad4157..8cad02f72f 100644 --- a/circuit/program/src/data/mod.rs +++ b/circuit/program/src/data/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/encrypt.rs b/circuit/program/src/data/plaintext/encrypt.rs index e70de87059..774395258e 100644 --- a/circuit/program/src/data/plaintext/encrypt.rs +++ b/circuit/program/src/data/plaintext/encrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/equal.rs b/circuit/program/src/data/plaintext/equal.rs index 92eaa21ff5..d5711b23be 100644 --- a/circuit/program/src/data/plaintext/equal.rs +++ b/circuit/program/src/data/plaintext/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/find.rs b/circuit/program/src/data/plaintext/find.rs index 7fc7e9ceaa..b41e8ccf9f 100644 --- a/circuit/program/src/data/plaintext/find.rs +++ b/circuit/program/src/data/plaintext/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/from_bits.rs b/circuit/program/src/data/plaintext/from_bits.rs index b4c92164d3..4d9f3e4a64 100644 --- a/circuit/program/src/data/plaintext/from_bits.rs +++ b/circuit/program/src/data/plaintext/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/from_fields.rs b/circuit/program/src/data/plaintext/from_fields.rs index e812e86e10..aac5ed9506 100644 --- a/circuit/program/src/data/plaintext/from_fields.rs +++ b/circuit/program/src/data/plaintext/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/mod.rs b/circuit/program/src/data/plaintext/mod.rs index 8f717c34ea..af772d60cd 100644 --- a/circuit/program/src/data/plaintext/mod.rs +++ b/circuit/program/src/data/plaintext/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -27,7 +28,7 @@ mod to_fields; use crate::{Access, Ciphertext, Identifier, Literal, Visibility}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field, Scalar, U16, U32, U8}; +use snarkvm_circuit_types::{Address, Boolean, Field, Scalar, U8, U16, U32, environment::prelude::*}; #[derive(Clone)] pub enum Plaintext { @@ -39,7 +40,7 @@ pub enum Plaintext { Array(Vec>, OnceCell>>), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Plaintext { type Primitive = console::Plaintext; @@ -53,7 +54,7 @@ impl Inject for Plaintext { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Plaintext { type Primitive = console::Plaintext; @@ -98,7 +99,7 @@ impl From<&Literal> for Plaintext { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/program/src/data/plaintext/num_randomizers.rs b/circuit/program/src/data/plaintext/num_randomizers.rs index 086feca1b7..a1e58f3d42 100644 --- a/circuit/program/src/data/plaintext/num_randomizers.rs +++ b/circuit/program/src/data/plaintext/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/size_in_fields.rs b/circuit/program/src/data/plaintext/size_in_fields.rs index c7603a81ad..401daf414f 100644 --- a/circuit/program/src/data/plaintext/size_in_fields.rs +++ b/circuit/program/src/data/plaintext/size_in_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/plaintext/to_bits.rs b/circuit/program/src/data/plaintext/to_bits.rs index c2bea90341..06f9a814cf 100644 --- a/circuit/program/src/data/plaintext/to_bits.rs +++ b/circuit/program/src/data/plaintext/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,10 +24,12 @@ impl ToBits for Plaintext { Self::Literal(literal, bits_le) => { // Compute the bits of the literal. let bits = bits_le.get_or_init(|| { - let mut bits_le = vec![Boolean::constant(false), Boolean::constant(false)]; // Variant bit. + let mut bits_le = Vec::new(); + bits_le.extend([Boolean::constant(false), Boolean::constant(false)]); // Variant bit. literal.variant().write_bits_le(&mut bits_le); literal.size_in_bits().write_bits_le(&mut bits_le); literal.write_bits_le(&mut bits_le); + bits_le.shrink_to_fit(); bits_le }); // Extend the vector with the bits of the literal. @@ -35,15 +38,17 @@ impl ToBits for Plaintext { Self::Struct(members, bits_le) => { // Compute the bits of the struct. let bits = bits_le.get_or_init(|| { - let mut bits_le = vec![Boolean::constant(false), Boolean::constant(true)]; // Variant bit. + let mut bits_le = Vec::new(); + bits_le.extend([Boolean::constant(false), Boolean::constant(true)]); // Variant bit. U8::constant(console::U8::new(members.len() as u8)).write_bits_le(&mut bits_le); for (identifier, value) in members { let value_bits = value.to_bits_le(); identifier.size_in_bits().write_bits_le(&mut bits_le); identifier.write_bits_le(&mut bits_le); U16::constant(console::U16::new(value_bits.len() as u16)).write_bits_le(&mut bits_le); - bits_le.extend_from_slice(&value_bits); + bits_le.extend(value_bits); } + bits_le.shrink_to_fit(); bits_le }); // Extend the vector with the bits of the struct. @@ -52,13 +57,15 @@ impl ToBits for Plaintext { Self::Array(elements, bits_le) => { // Compute the bits of the array. let bits = bits_le.get_or_init(|| { - let mut bits_le = vec![Boolean::constant(true), Boolean::constant(false)]; // Variant bit. + let mut bits_le = Vec::new(); + bits_le.extend([Boolean::constant(true), Boolean::constant(false)]); // Variant bit. U32::constant(console::U32::new(elements.len() as u32)).write_bits_le(&mut bits_le); for value in elements { let value_bits = value.to_bits_le(); U16::constant(console::U16::new(value_bits.len() as u16)).write_bits_le(&mut bits_le); bits_le.extend(value_bits); } + bits_le.shrink_to_fit(); bits_le }); // Extend the vector with the bits of the array. @@ -73,10 +80,12 @@ impl ToBits for Plaintext { Self::Literal(literal, bits_be) => { // Compute the bits of the literal. let bits = bits_be.get_or_init(|| { - let mut bits_be = vec![Boolean::constant(false), Boolean::constant(false)]; // Variant bit. + let mut bits_be = Vec::new(); + bits_be.extend([Boolean::constant(false), Boolean::constant(false)]); // Variant bit. literal.variant().write_bits_be(&mut bits_be); literal.size_in_bits().write_bits_be(&mut bits_be); literal.write_bits_be(&mut bits_be); + bits_be.shrink_to_fit(); bits_be }); // Extend the vector with the bits of the literal. @@ -85,15 +94,17 @@ impl ToBits for Plaintext { Self::Struct(members, bits_be) => { // Compute the bits of the struct. let bits = bits_be.get_or_init(|| { - let mut bits_be = vec![Boolean::constant(false), Boolean::constant(true)]; // Variant bit. + let mut bits_be = Vec::new(); + bits_be.extend([Boolean::constant(false), Boolean::constant(true)]); // Variant bit. U8::constant(console::U8::new(members.len() as u8)).write_bits_be(&mut bits_be); for (identifier, value) in members { let value_bits = value.to_bits_be(); identifier.size_in_bits().write_bits_be(&mut bits_be); identifier.write_bits_be(&mut bits_be); U16::constant(console::U16::new(value_bits.len() as u16)).write_bits_be(&mut bits_be); - bits_be.extend_from_slice(&value_bits); + bits_be.extend(value_bits); } + bits_be.shrink_to_fit(); bits_be }); // Extend the vector with the bits of the struct. @@ -102,13 +113,15 @@ impl ToBits for Plaintext { Self::Array(elements, bits_be) => { // Compute the bits of the array. let bits = bits_be.get_or_init(|| { - let mut bits_be = vec![Boolean::constant(true), Boolean::constant(false)]; // Variant bit. + let mut bits_be = Vec::new(); + bits_be.extend([Boolean::constant(true), Boolean::constant(false)]); // Variant bit. U32::constant(console::U32::new(elements.len() as u32)).write_bits_be(&mut bits_be); for value in elements { let value_bits = value.to_bits_be(); U16::constant(console::U16::new(value_bits.len() as u16)).write_bits_be(&mut bits_be); bits_be.extend(value_bits); } + bits_be.shrink_to_fit(); bits_be }); // Extend the vector with the bits of the array. diff --git a/circuit/program/src/data/plaintext/to_fields.rs b/circuit/program/src/data/plaintext/to_fields.rs index f3b11ef1b0..23e468e3d1 100644 --- a/circuit/program/src/data/plaintext/to_fields.rs +++ b/circuit/program/src/data/plaintext/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/decrypt.rs b/circuit/program/src/data/record/decrypt.rs index b7f9d1a0bd..5474423bf5 100644 --- a/circuit/program/src/data/record/decrypt.rs +++ b/circuit/program/src/data/record/decrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -82,7 +83,7 @@ impl Record> { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::{Circuit, Literal}; diff --git a/circuit/program/src/data/record/encrypt.rs b/circuit/program/src/data/record/encrypt.rs index 6b5b7250b0..f1ebdee8e9 100644 --- a/circuit/program/src/data/record/encrypt.rs +++ b/circuit/program/src/data/record/encrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/entry/equal.rs b/circuit/program/src/data/record/entry/equal.rs index 41944b49f1..6c6e4c0b5b 100644 --- a/circuit/program/src/data/record/entry/equal.rs +++ b/circuit/program/src/data/record/entry/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/entry/find.rs b/circuit/program/src/data/record/entry/find.rs index c11d6b9044..7b9d8963f7 100644 --- a/circuit/program/src/data/record/entry/find.rs +++ b/circuit/program/src/data/record/entry/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/entry/mod.rs b/circuit/program/src/data/record/entry/mod.rs index d622921958..95c958681e 100644 --- a/circuit/program/src/data/record/entry/mod.rs +++ b/circuit/program/src/data/record/entry/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ mod to_bits; use crate::{Access, Ciphertext, Plaintext, Visibility}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean}; +use snarkvm_circuit_types::{Boolean, environment::prelude::*}; /// An entry stored in program data. #[derive(Clone)] @@ -32,7 +33,7 @@ pub enum Entry> { Private(Private), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Entry> { type Primitive = console::Entry>; @@ -46,7 +47,7 @@ impl Inject for Entry> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Entry> { type Primitive = console::Entry>; @@ -60,7 +61,7 @@ impl Inject for Entry> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Entry> { type Primitive = console::Entry>; @@ -83,7 +84,7 @@ impl Eject for Entry> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Entry> { type Primitive = console::Entry>; diff --git a/circuit/program/src/data/record/entry/num_randomizers.rs b/circuit/program/src/data/record/entry/num_randomizers.rs index c1817982d7..ecb0d44484 100644 --- a/circuit/program/src/data/record/entry/num_randomizers.rs +++ b/circuit/program/src/data/record/entry/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/entry/to_bits.rs b/circuit/program/src/data/record/entry/to_bits.rs index f7a7576a26..121740d034 100644 --- a/circuit/program/src/data/record/entry/to_bits.rs +++ b/circuit/program/src/data/record/entry/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/equal.rs b/circuit/program/src/data/record/equal.rs index cf55bf5ab7..560ccef0e4 100644 --- a/circuit/program/src/data/record/equal.rs +++ b/circuit/program/src/data/record/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/find.rs b/circuit/program/src/data/record/find.rs index 577a7025cb..e382cb7738 100644 --- a/circuit/program/src/data/record/find.rs +++ b/circuit/program/src/data/record/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/helpers/mod.rs b/circuit/program/src/data/record/helpers/mod.rs index 1770e4373a..16918fea74 100644 --- a/circuit/program/src/data/record/helpers/mod.rs +++ b/circuit/program/src/data/record/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/helpers/owner.rs b/circuit/program/src/data/record/helpers/owner.rs index 93cfb9ac21..351e163745 100644 --- a/circuit/program/src/data/record/helpers/owner.rs +++ b/circuit/program/src/data/record/helpers/owner.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use crate::{Ciphertext, Entry, Literal, Plaintext, Visibility}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field}; +use snarkvm_circuit_types::{Address, Boolean, Field, environment::prelude::*}; /// A value stored in program data. #[derive(Clone)] @@ -25,7 +26,7 @@ pub enum Owner> { Private(Private), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Owner> { type Primitive = console::Owner>; @@ -44,7 +45,7 @@ impl Inject for Owner> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Owner> { type Primitive = console::Owner>; diff --git a/circuit/program/src/data/record/mod.rs b/circuit/program/src/data/record/mod.rs index cd1fdc47e5..7d92025424 100644 --- a/circuit/program/src/data/record/mod.rs +++ b/circuit/program/src/data/record/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -35,7 +36,7 @@ mod to_fields; use crate::{Access, Ciphertext, Identifier, Plaintext, ProgramID, Visibility}; use snarkvm_circuit_account::{PrivateKey, ViewKey}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, Group, Scalar, U32}; +use snarkvm_circuit_types::{Boolean, Field, Group, Scalar, U32, environment::prelude::*}; #[derive(Clone)] pub struct Record> { @@ -47,7 +48,7 @@ pub struct Record> { nonce: Group, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Record> { type Primitive = console::Record>; @@ -61,7 +62,7 @@ impl Inject for Record> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Record> { type Primitive = console::Record>; @@ -75,7 +76,7 @@ impl Inject for Record> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl> Record { /// Initializes a new record plaintext. pub fn from_plaintext( @@ -131,7 +132,7 @@ impl> Record { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Record> { type Primitive = console::Record>; @@ -172,7 +173,7 @@ impl Eject for Record> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Record> { type Primitive = console::Record>; @@ -213,7 +214,7 @@ impl Eject for Record> { } } -#[cfg(console)] +#[cfg(feature = "console")] impl> TypeName for Record { fn type_name() -> &'static str { "record" diff --git a/circuit/program/src/data/record/num_randomizers.rs b/circuit/program/src/data/record/num_randomizers.rs index 7c0fd9e51a..12e6f8419f 100644 --- a/circuit/program/src/data/record/num_randomizers.rs +++ b/circuit/program/src/data/record/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/serial_number.rs b/circuit/program/src/data/record/serial_number.rs index 746b9b1bc3..3b76769b91 100644 --- a/circuit/program/src/data/record/serial_number.rs +++ b/circuit/program/src/data/record/serial_number.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/tag.rs b/circuit/program/src/data/record/tag.rs index d62d66b12b..3273aae525 100644 --- a/circuit/program/src/data/record/tag.rs +++ b/circuit/program/src/data/record/tag.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/to_bits.rs b/circuit/program/src/data/record/to_bits.rs index f49a8757f5..8cb1d5b148 100644 --- a/circuit/program/src/data/record/to_bits.rs +++ b/circuit/program/src/data/record/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/to_commitment.rs b/circuit/program/src/data/record/to_commitment.rs index ced6f5dbf4..22a5936447 100644 --- a/circuit/program/src/data/record/to_commitment.rs +++ b/circuit/program/src/data/record/to_commitment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/record/to_fields.rs b/circuit/program/src/data/record/to_fields.rs index d05627178a..3d745e56b5 100644 --- a/circuit/program/src/data/record/to_fields.rs +++ b/circuit/program/src/data/record/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/value/equal.rs b/circuit/program/src/data/value/equal.rs index 719de326ab..e83a2e7681 100644 --- a/circuit/program/src/data/value/equal.rs +++ b/circuit/program/src/data/value/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/value/find.rs b/circuit/program/src/data/value/find.rs index 487a69eb67..0d4a3efd78 100644 --- a/circuit/program/src/data/value/find.rs +++ b/circuit/program/src/data/value/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/value/mod.rs b/circuit/program/src/data/value/mod.rs index 5d7dd965ae..4f0f862acd 100644 --- a/circuit/program/src/data/value/mod.rs +++ b/circuit/program/src/data/value/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ mod to_fields; use crate::{Access, Entry, Future, Plaintext, Record}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field}; +use snarkvm_circuit_types::{Boolean, Field, environment::prelude::*}; #[derive(Clone)] pub enum Value { diff --git a/circuit/program/src/data/value/to_bits.rs b/circuit/program/src/data/value/to_bits.rs index 67765029fc..ac3c385cb4 100644 --- a/circuit/program/src/data/value/to_bits.rs +++ b/circuit/program/src/data/value/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/data/value/to_fields.rs b/circuit/program/src/data/value/to_fields.rs index fad34f0c1d..518d4d2917 100644 --- a/circuit/program/src/data/value/to_fields.rs +++ b/circuit/program/src/data/value/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/function_id/mod.rs b/circuit/program/src/function_id/mod.rs index af13541502..14e6c37777 100644 --- a/circuit/program/src/function_id/mod.rs +++ b/circuit/program/src/function_id/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use crate::{Identifier, ProgramID}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Field, U16}; +use snarkvm_circuit_types::{Field, U16, environment::prelude::*}; /// Compute the function ID as `Hash(network_id, program_id.len(), program_id, function_name.len(), function_name)`. pub fn compute_function_id( diff --git a/circuit/program/src/id/mod.rs b/circuit/program/src/id/mod.rs index 623480f6c8..9028322ade 100644 --- a/circuit/program/src/id/mod.rs +++ b/circuit/program/src/id/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,7 +22,7 @@ mod to_fields; use crate::Identifier; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field}; +use snarkvm_circuit_types::{Address, Boolean, Field, environment::prelude::*}; /// A program ID is of the form `{name}.{network}`. /// If no `network`-level domain is specified, the default network is used. @@ -33,7 +34,7 @@ pub struct ProgramID { network: Identifier, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for ProgramID { type Primitive = console::ProgramID; @@ -60,7 +61,7 @@ impl ProgramID { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for ProgramID { type Primitive = console::ProgramID; diff --git a/circuit/program/src/id/to_address.rs b/circuit/program/src/id/to_address.rs index dc1ee1c5a9..81c14f6ea9 100644 --- a/circuit/program/src/id/to_address.rs +++ b/circuit/program/src/id/to_address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -27,7 +28,7 @@ impl ProgramID { #[cfg(test)] mod tests { use super::*; - use crate::{data::identifier::tests::sample_lowercase_console_identifier_as_string, Circuit}; + use crate::{Circuit, data::identifier::tests::sample_lowercase_console_identifier_as_string}; use anyhow::Result; diff --git a/circuit/program/src/id/to_bits.rs b/circuit/program/src/id/to_bits.rs index ca35033269..5d6867bb24 100644 --- a/circuit/program/src/id/to_bits.rs +++ b/circuit/program/src/id/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -47,7 +48,7 @@ impl ToBits for &ProgramID { #[cfg(test)] mod tests { use super::*; - use crate::{data::identifier::tests::sample_lowercase_console_identifier_as_string, Circuit}; + use crate::{Circuit, data::identifier::tests::sample_lowercase_console_identifier_as_string}; use anyhow::Result; diff --git a/circuit/program/src/id/to_fields.rs b/circuit/program/src/id/to_fields.rs index c30e6f8988..eb12fe1d02 100644 --- a/circuit/program/src/id/to_fields.rs +++ b/circuit/program/src/id/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/lib.rs b/circuit/program/src/lib.rs index ffc7c64960..450a5c42a1 100644 --- a/circuit/program/src/lib.rs +++ b/circuit/program/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -38,7 +39,7 @@ mod state_path; pub use state_path::*; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean}; +use snarkvm_circuit_types::{Boolean, environment::prelude::*}; pub trait Visibility: Equal::Boolean> + ToBits> + FromBits + ToFields + FromFields diff --git a/circuit/program/src/request/mod.rs b/circuit/program/src/request/mod.rs index b1c2c161ca..a388909d37 100644 --- a/circuit/program/src/request/mod.rs +++ b/circuit/program/src/request/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,10 +19,10 @@ use snarkvm_circuit_types::environment::assert_scope; mod to_tpk; mod verify; -use crate::{compute_function_id, Identifier, Plaintext, ProgramID, Record, Value}; +use crate::{Identifier, Plaintext, ProgramID, Record, Value, compute_function_id}; use snarkvm_circuit_account::Signature; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field, Group, U16}; +use snarkvm_circuit_types::{Address, Boolean, Field, Group, U16, environment::prelude::*}; pub enum InputID { /// The hash of the constant input. @@ -36,7 +37,7 @@ pub enum InputID { ExternalRecord(Field), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for InputID { type Primitive = console::InputID; @@ -62,7 +63,7 @@ impl Inject for InputID { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for InputID { type Primitive = console::InputID; @@ -140,7 +141,7 @@ pub struct Request { scm: Field, } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Request { type Primitive = console::Request; @@ -285,7 +286,7 @@ impl Request { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Request { type Primitive = console::Request; diff --git a/circuit/program/src/request/to_tpk.rs b/circuit/program/src/request/to_tpk.rs index 122bef71f8..59e51833fb 100644 --- a/circuit/program/src/request/to_tpk.rs +++ b/circuit/program/src/request/to_tpk.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 30b3e3d5ae..fa42a83521 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -307,7 +308,7 @@ impl Request { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/program/src/response/from_outputs.rs b/circuit/program/src/response/from_outputs.rs index b42ef9d875..efff43271c 100644 --- a/circuit/program/src/response/from_outputs.rs +++ b/circuit/program/src/response/from_outputs.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -174,7 +175,7 @@ impl Response { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/program/src/response/mod.rs b/circuit/program/src/response/mod.rs index 288e8f4653..b61f6cbabf 100644 --- a/circuit/program/src/response/mod.rs +++ b/circuit/program/src/response/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,9 +19,9 @@ use snarkvm_circuit_types::environment::assert_scope; mod from_outputs; mod process_outputs_from_callback; -use crate::{compute_function_id, Identifier, ProgramID, Value}; +use crate::{Identifier, ProgramID, Value, compute_function_id}; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Field, U16}; +use snarkvm_circuit_types::{Field, U16, environment::prelude::*}; pub enum OutputID { /// The hash of the constant output. @@ -37,7 +38,7 @@ pub enum OutputID { Future(Field), } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for OutputID { type Primitive = console::OutputID; @@ -126,7 +127,7 @@ impl OutputID { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for OutputID { type Primitive = console::OutputID; @@ -176,7 +177,7 @@ impl Response { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Response { type Primitive = console::Response; diff --git a/circuit/program/src/response/process_outputs_from_callback.rs b/circuit/program/src/response/process_outputs_from_callback.rs index dfadc178e3..1a985d2f8b 100644 --- a/circuit/program/src/response/process_outputs_from_callback.rs +++ b/circuit/program/src/response/process_outputs_from_callback.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -189,7 +190,7 @@ impl Response { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/program/src/state_path/helpers/header_leaf.rs b/circuit/program/src/state_path/helpers/header_leaf.rs index 9f3f0903d3..fd32096809 100644 --- a/circuit/program/src/state_path/helpers/header_leaf.rs +++ b/circuit/program/src/state_path/helpers/header_leaf.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U8}; +use snarkvm_circuit_types::{Boolean, Field, U8, environment::prelude::*}; #[derive(Clone)] pub struct HeaderLeaf { diff --git a/circuit/program/src/state_path/helpers/mod.rs b/circuit/program/src/state_path/helpers/mod.rs index f2fbeff848..8a19668c44 100644 --- a/circuit/program/src/state_path/helpers/mod.rs +++ b/circuit/program/src/state_path/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/program/src/state_path/helpers/transaction_leaf.rs b/circuit/program/src/state_path/helpers/transaction_leaf.rs index 8248cd6683..564033d9df 100644 --- a/circuit/program/src/state_path/helpers/transaction_leaf.rs +++ b/circuit/program/src/state_path/helpers/transaction_leaf.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U16, U8}; +use snarkvm_circuit_types::{Boolean, Field, U8, U16, environment::prelude::*}; #[derive(Clone)] pub struct TransactionLeaf { diff --git a/circuit/program/src/state_path/helpers/transition_leaf.rs b/circuit/program/src/state_path/helpers/transition_leaf.rs index 2ec99163de..b2ffb4c243 100644 --- a/circuit/program/src/state_path/helpers/transition_leaf.rs +++ b/circuit/program/src/state_path/helpers/transition_leaf.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U8}; +use snarkvm_circuit_types::{Boolean, Field, U8, environment::prelude::*}; #[derive(Clone)] pub struct TransitionLeaf { diff --git a/circuit/program/src/state_path/mod.rs b/circuit/program/src/state_path/mod.rs index 6e8a30ed74..66a1fc5b49 100644 --- a/circuit/program/src/state_path/mod.rs +++ b/circuit/program/src/state_path/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,7 +23,7 @@ use snarkvm_circuit_types::environment::assert_scope; use snarkvm_circuit_collections::merkle_tree::MerklePath; use snarkvm_circuit_network::Aleo; -use snarkvm_circuit_types::{environment::prelude::*, Boolean, Field, U8}; +use snarkvm_circuit_types::{Boolean, Field, U8, environment::prelude::*}; /// The depth of the Merkle tree for the blocks. const BLOCKS_DEPTH: u8 = console::BLOCKS_DEPTH; @@ -152,7 +153,7 @@ impl Eject for StatePath { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use crate::Circuit; diff --git a/circuit/program/src/state_path/verify.rs b/circuit/program/src/state_path/verify.rs index 9101486ff9..d94dc49bd1 100644 --- a/circuit/program/src/state_path/verify.rs +++ b/circuit/program/src/state_path/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/src/lib.rs b/circuit/src/lib.rs index 48991bc63a..c5ee310244 100644 --- a/circuit/src/lib.rs +++ b/circuit/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/Cargo.toml b/circuit/types/Cargo.toml index b2448c60b3..4ec3be91b6 100644 --- a/circuit/types/Cargo.toml +++ b/circuit/types/Cargo.toml @@ -1,42 +1,44 @@ [package] name = "snarkvm-circuit-types" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Primitive circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-circuit-environment] path = "../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-address] path = "./address" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "./boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-field] path = "./field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-group] path = "./group" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-integers] path = "./integers" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-scalar] path = "./scalar" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-string] path = "./string" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.console] package = "snarkvm-console" diff --git a/circuit/types/address/Cargo.toml b/circuit/types/address/Cargo.toml index d859d594f7..40cd55d3d6 100644 --- a/circuit/types/address/Cargo.toml +++ b/circuit/types/address/Cargo.toml @@ -1,36 +1,38 @@ [package] name = "snarkvm-circuit-types-address" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Address circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-types-address" path = "../../../console/types/address" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-group] path = "../group" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.19" +version = "=1.0.0" [features] default = [ "enable_console" ] diff --git a/circuit/types/address/build.rs b/circuit/types/address/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/address/build.rs +++ b/circuit/types/address/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/address/src/compare.rs b/circuit/types/address/src/compare.rs index 078bb3365d..a17747f633 100644 --- a/circuit/types/address/src/compare.rs +++ b/circuit/types/address/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/address/src/equal.rs b/circuit/types/address/src/equal.rs index a173a7d73c..1902464f77 100644 --- a/circuit/types/address/src/equal.rs +++ b/circuit/types/address/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -28,7 +29,7 @@ impl Equal for Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; @@ -49,12 +50,12 @@ mod tests { let a = Address::::from_group(Group::new(mode_a, Uniform::rand(rng))); let b = Address::::from_group(Group::new(mode_b, Uniform::rand(rng))); - Circuit::scope(&format!("{mode_a} {mode_a} {i}"), || { + Circuit::scope(format!("{mode_a} {mode_a} {i}"), || { let equals = a.is_equal(&a); assert!(equals.eject_value()); }); - Circuit::scope(&format!("{mode_a} {mode_b} {i}"), || { + Circuit::scope(format!("{mode_a} {mode_b} {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -76,12 +77,12 @@ mod tests { let a = Address::::from_group(Group::new(mode_a, Uniform::rand(rng))); let b = Address::::from_group(Group::new(mode_b, Uniform::rand(rng))); - Circuit::scope(&format!("{mode_a} {mode_a} {i}"), || { + Circuit::scope(format!("{mode_a} {mode_a} {i}"), || { let equals = a.is_not_equal(&a); assert!(!equals.eject_value()); }); - Circuit::scope(&format!("{mode_a} {mode_b} {i}"), || { + Circuit::scope(format!("{mode_a} {mode_b} {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/types/address/src/helpers/from_bits.rs b/circuit/types/address/src/helpers/from_bits.rs index 712068da2b..0cfc1c8600 100644 --- a/circuit/types/address/src/helpers/from_bits.rs +++ b/circuit/types/address/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -28,7 +29,7 @@ impl FromBits for Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; @@ -43,7 +44,7 @@ mod tests { let expected: console::Group<::Network> = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected).to_bits_le(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Address::::from_bits_le(&candidate); assert_eq!(expected, *candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -60,7 +61,7 @@ mod tests { let expected: console::Group<::Network> = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected).to_bits_be(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Address::::from_bits_be(&candidate); assert_eq!(expected, *candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/types/address/src/helpers/from_field.rs b/circuit/types/address/src/helpers/from_field.rs index 74aaf1459f..ae73fa5c5b 100644 --- a/circuit/types/address/src/helpers/from_field.rs +++ b/circuit/types/address/src/helpers/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -37,7 +38,7 @@ impl FromField for Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; @@ -52,7 +53,7 @@ mod tests { let expected: console::Group<::Network> = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected).to_x_coordinate(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Address::from_field(candidate); assert_eq!(expected.to_x_coordinate(), candidate.eject_value().to_x_coordinate()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/types/address/src/helpers/from_group.rs b/circuit/types/address/src/helpers/from_group.rs index 8ce7398f23..bc60ea526e 100644 --- a/circuit/types/address/src/helpers/from_group.rs +++ b/circuit/types/address/src/helpers/from_group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -38,7 +39,7 @@ impl FromGroup for Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; diff --git a/circuit/types/address/src/helpers/mod.rs b/circuit/types/address/src/helpers/mod.rs index b8274b53e2..fe505fc1c7 100644 --- a/circuit/types/address/src/helpers/mod.rs +++ b/circuit/types/address/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/address/src/helpers/to_bits.rs b/circuit/types/address/src/helpers/to_bits.rs index f13850cb66..bfe4170d54 100644 --- a/circuit/types/address/src/helpers/to_bits.rs +++ b/circuit/types/address/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -42,7 +43,7 @@ impl ToBits for &Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; @@ -59,7 +60,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Address::::from_group(Group::new(mode, expected)); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_le(); assert_eq!(expected_number_of_bits, candidate.len()); for (expected_bit, candidate_bit) in @@ -82,7 +83,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Address::::from_group(Group::new(mode, expected)); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_be(); assert_eq!(expected_number_of_bits, candidate.len()); for (expected_bit, candidate_bit) in diff --git a/circuit/types/address/src/helpers/to_field.rs b/circuit/types/address/src/helpers/to_field.rs index c73d427945..e8664ba2dc 100644 --- a/circuit/types/address/src/helpers/to_field.rs +++ b/circuit/types/address/src/helpers/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -37,7 +38,7 @@ impl ToField for Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; @@ -52,7 +53,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Address::::from_group(Group::new(mode, expected)); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_field(); assert_eq!(expected.to_x_coordinate(), candidate.eject_value()); assert_scope!(0, 0, 0, 0); diff --git a/circuit/types/address/src/helpers/to_group.rs b/circuit/types/address/src/helpers/to_group.rs index 66bee8f575..b2a30bcb3c 100644 --- a/circuit/types/address/src/helpers/to_group.rs +++ b/circuit/types/address/src/helpers/to_group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -38,7 +39,7 @@ impl ToGroup for Address { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; diff --git a/circuit/types/address/src/lib.rs b/circuit/types/address/src/lib.rs index 0e4dec4b5d..6d5cffb295 100644 --- a/circuit/types/address/src/lib.rs +++ b/circuit/types/address/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -47,7 +48,7 @@ impl Address { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Address { type Primitive = console::Address; @@ -57,7 +58,7 @@ impl Inject for Address { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Address { type Primitive = console::Address; @@ -72,7 +73,7 @@ impl Eject for Address { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Address { /// Parses a string into an address circuit. #[inline] @@ -89,7 +90,7 @@ impl Parser for Address { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Address { type Err = Error; @@ -108,7 +109,7 @@ impl FromStr for Address { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Address { /// Returns the type name of the circuit as a string. #[inline] @@ -117,14 +118,14 @@ impl TypeName for Address { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Address { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Address { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) @@ -143,7 +144,7 @@ impl From<&Address> for LinearCombination { } } -#[cfg(all(test, console))] +#[cfg(all(test, feature = "console"))] mod tests { use super::*; use snarkvm_circuit_environment::Circuit; diff --git a/circuit/types/address/src/ternary.rs b/circuit/types/address/src/ternary.rs index 67298d8865..b807ed9ff2 100644 --- a/circuit/types/address/src/ternary.rs +++ b/circuit/types/address/src/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/Cargo.toml b/circuit/types/boolean/Cargo.toml index 6f9e9f2e3b..c018e7d923 100644 --- a/circuit/types/boolean/Cargo.toml +++ b/circuit/types/boolean/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-circuit-types-boolean" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Boolean circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -14,12 +16,12 @@ harness = false [dependencies.console] package = "snarkvm-console-types-boolean" path = "../../../console/types/boolean" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.criterion] version = "0.5" diff --git a/circuit/types/boolean/benches/and.rs b/circuit/types/boolean/benches/and.rs index 53beb519da..ea8d23c2e9 100644 --- a/circuit/types/boolean/benches/and.rs +++ b/circuit/types/boolean/benches/and.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/build.rs b/circuit/types/boolean/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/boolean/build.rs +++ b/circuit/types/boolean/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/and.rs b/circuit/types/boolean/src/and.rs index 07db5e2cb4..f11c315ed8 100644 --- a/circuit/types/boolean/src/and.rs +++ b/circuit/types/boolean/src/and.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/equal.rs b/circuit/types/boolean/src/equal.rs index 7d5e732f21..30f9eac5d6 100644 --- a/circuit/types/boolean/src/equal.rs +++ b/circuit/types/boolean/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/helpers/adder.rs b/circuit/types/boolean/src/helpers/adder.rs index eb9d6064f5..c7598557ed 100644 --- a/circuit/types/boolean/src/helpers/adder.rs +++ b/circuit/types/boolean/src/helpers/adder.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -256,7 +257,8 @@ mod tests { check_true_add_false_with_false(Mode::Constant, Mode::Public, Mode::Constant, 0, 0, 0, 0); check_true_add_false_with_true(Mode::Constant, Mode::Public, Mode::Constant, 0, 0, 1, 1); // <- Differs check_true_add_true_with_false(Mode::Constant, Mode::Public, Mode::Constant, 0, 0, 0, 0); - check_true_add_true_with_true(Mode::Constant, Mode::Public, Mode::Constant, 0, 0, 1, 1); // <- Differs + check_true_add_true_with_true(Mode::Constant, Mode::Public, Mode::Constant, 0, 0, 1, 1); + // <- Differs } #[test] @@ -268,7 +270,8 @@ mod tests { check_true_add_false_with_false(Mode::Constant, Mode::Public, Mode::Public, 0, 0, 3, 3); // <- Differs check_true_add_false_with_true(Mode::Constant, Mode::Public, Mode::Public, 0, 0, 3, 3); // <- Differs check_true_add_true_with_false(Mode::Constant, Mode::Public, Mode::Public, 0, 0, 3, 3); // <- Differs - check_true_add_true_with_true(Mode::Constant, Mode::Public, Mode::Public, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Constant, Mode::Public, Mode::Public, 0, 0, 3, 3); + // <- Differs } #[test] @@ -280,7 +283,8 @@ mod tests { check_true_add_false_with_false(Mode::Constant, Mode::Public, Mode::Private, 0, 0, 3, 3); // <- Differs check_true_add_false_with_true(Mode::Constant, Mode::Public, Mode::Private, 0, 0, 3, 3); // <- Differs check_true_add_true_with_false(Mode::Constant, Mode::Public, Mode::Private, 0, 0, 3, 3); // <- Differs - check_true_add_true_with_true(Mode::Constant, Mode::Public, Mode::Private, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Constant, Mode::Public, Mode::Private, 0, 0, 3, 3); + // <- Differs } #[test] @@ -292,7 +296,8 @@ mod tests { check_true_add_false_with_false(Mode::Constant, Mode::Private, Mode::Constant, 0, 0, 0, 0); check_true_add_false_with_true(Mode::Constant, Mode::Private, Mode::Constant, 0, 0, 1, 1); // <- Differs check_true_add_true_with_false(Mode::Constant, Mode::Private, Mode::Constant, 0, 0, 0, 0); - check_true_add_true_with_true(Mode::Constant, Mode::Private, Mode::Constant, 0, 0, 1, 1); // <- Differs + check_true_add_true_with_true(Mode::Constant, Mode::Private, Mode::Constant, 0, 0, 1, 1); + // <- Differs } #[test] @@ -304,7 +309,8 @@ mod tests { check_true_add_false_with_false(Mode::Constant, Mode::Private, Mode::Public, 0, 0, 3, 3); // <- Differs check_true_add_false_with_true(Mode::Constant, Mode::Private, Mode::Public, 0, 0, 3, 3); // <- Differs check_true_add_true_with_false(Mode::Constant, Mode::Private, Mode::Public, 0, 0, 3, 3); // <- Differs - check_true_add_true_with_true(Mode::Constant, Mode::Private, Mode::Public, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Constant, Mode::Private, Mode::Public, 0, 0, 3, 3); + // <- Differs } #[test] @@ -316,7 +322,8 @@ mod tests { check_true_add_false_with_false(Mode::Constant, Mode::Private, Mode::Private, 0, 0, 3, 3); // <- Differs check_true_add_false_with_true(Mode::Constant, Mode::Private, Mode::Private, 0, 0, 3, 3); // <- Differs check_true_add_true_with_false(Mode::Constant, Mode::Private, Mode::Private, 0, 0, 3, 3); // <- Differs - check_true_add_true_with_true(Mode::Constant, Mode::Private, Mode::Private, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Constant, Mode::Private, Mode::Private, 0, 0, 3, 3); + // <- Differs } #[test] @@ -328,7 +335,8 @@ mod tests { check_true_add_false_with_false(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 0, 0); check_true_add_false_with_true(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 0, 0); check_true_add_true_with_false(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 0, 0); - check_true_add_true_with_true(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 1, 1); // <- Differs + check_true_add_true_with_true(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 1, 1); + // <- Differs } #[test] @@ -340,7 +348,8 @@ mod tests { check_true_add_false_with_false(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 2, 2); check_true_add_false_with_true(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 2, 2); check_true_add_true_with_false(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 3, 3); // <- Differs - check_true_add_true_with_true(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 3, 3); + // <- Differs } #[test] @@ -352,7 +361,8 @@ mod tests { check_true_add_false_with_false(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 2, 2); check_true_add_false_with_true(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 2, 2); check_true_add_true_with_false(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 3, 3); // <- Differs - check_true_add_true_with_true(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 3, 3); + // <- Differs } #[test] @@ -364,7 +374,8 @@ mod tests { check_true_add_false_with_false(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 2, 2); check_true_add_false_with_true(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 3, 3); // <- Differs check_true_add_true_with_false(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 2, 2); - check_true_add_true_with_true(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 3, 3); + // <- Differs } #[test] @@ -400,7 +411,8 @@ mod tests { check_true_add_false_with_false(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 2, 2); check_true_add_false_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); // <- Differs check_true_add_true_with_false(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 2, 2); - check_true_add_true_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); // <- Differs + check_true_add_true_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); + // <- Differs } #[test] diff --git a/circuit/types/boolean/src/helpers/bits_are_zero.rs b/circuit/types/boolean/src/helpers/bits_are_zero.rs index 1ade4290e1..307ed0e43c 100644 --- a/circuit/types/boolean/src/helpers/bits_are_zero.rs +++ b/circuit/types/boolean/src/helpers/bits_are_zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/helpers/comparator.rs b/circuit/types/boolean/src/helpers/comparator.rs index 974a21912e..38efb3e6eb 100644 --- a/circuit/types/boolean/src/helpers/comparator.rs +++ b/circuit/types/boolean/src/helpers/comparator.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/helpers/from_bits.rs b/circuit/types/boolean/src/helpers/from_bits.rs index 3a77ad8783..0ce682c41f 100644 --- a/circuit/types/boolean/src/helpers/from_bits.rs +++ b/circuit/types/boolean/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/helpers/mod.rs b/circuit/types/boolean/src/helpers/mod.rs index 2ddc308466..74c2aa5bd7 100644 --- a/circuit/types/boolean/src/helpers/mod.rs +++ b/circuit/types/boolean/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/helpers/subtractor.rs b/circuit/types/boolean/src/helpers/subtractor.rs index 6981d2058c..349ccffb55 100644 --- a/circuit/types/boolean/src/helpers/subtractor.rs +++ b/circuit/types/boolean/src/helpers/subtractor.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -328,7 +329,8 @@ mod tests { check_true_sub_false_with_false(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 0, 0); check_true_sub_false_with_true(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 0, 0); check_true_sub_true_with_false(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 0, 0); - check_true_sub_true_with_true(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 1, 1); // <- Differs + check_true_sub_true_with_true(Mode::Public, Mode::Constant, Mode::Constant, 0, 0, 1, 1); + // <- Differs } #[test] @@ -340,7 +342,8 @@ mod tests { check_true_sub_false_with_false(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 2, 2); check_true_sub_false_with_true(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 2, 2); check_true_sub_true_with_false(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 3, 3); // <- Differs - check_true_sub_true_with_true(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 3, 3); // <- Differs + check_true_sub_true_with_true(Mode::Public, Mode::Constant, Mode::Public, 0, 0, 3, 3); + // <- Differs } #[test] @@ -352,7 +355,8 @@ mod tests { check_true_sub_false_with_false(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 2, 2); check_true_sub_false_with_true(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 2, 2); check_true_sub_true_with_false(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 3, 3); // <- Differs - check_true_sub_true_with_true(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 3, 3); // <- Differs + check_true_sub_true_with_true(Mode::Public, Mode::Constant, Mode::Private, 0, 0, 3, 3); + // <- Differs } #[test] @@ -364,7 +368,8 @@ mod tests { check_true_sub_false_with_false(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 2, 2); check_true_sub_false_with_true(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 3, 3); // <- Differs check_true_sub_true_with_false(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 2, 2); - check_true_sub_true_with_true(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 3, 3); // <- Differs + check_true_sub_true_with_true(Mode::Public, Mode::Public, Mode::Constant, 0, 0, 3, 3); + // <- Differs } #[test] @@ -400,7 +405,8 @@ mod tests { check_true_sub_false_with_false(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 2, 2); check_true_sub_false_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); // <- Differs check_true_sub_true_with_false(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 2, 2); - check_true_sub_true_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); // <- Differs + check_true_sub_true_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); + // <- Differs } #[test] diff --git a/circuit/types/boolean/src/helpers/to_bits.rs b/circuit/types/boolean/src/helpers/to_bits.rs index 35adfacaf3..e95a1c60b7 100644 --- a/circuit/types/boolean/src/helpers/to_bits.rs +++ b/circuit/types/boolean/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/lib.rs b/circuit/types/boolean/src/lib.rs index 77013c3e75..a34eea4d1f 100644 --- a/circuit/types/boolean/src/lib.rs +++ b/circuit/types/boolean/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -51,7 +52,7 @@ impl Boolean { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Boolean { type Primitive = bool; @@ -78,7 +79,7 @@ impl Inject for Boolean { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Boolean { type Primitive = bool; @@ -99,7 +100,7 @@ impl Eject for Boolean { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Boolean { /// Parses a string into a boolean circuit. #[inline] @@ -116,7 +117,7 @@ impl Parser for Boolean { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Boolean { type Err = Error; @@ -135,7 +136,7 @@ impl FromStr for Boolean { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Boolean { /// Returns the type name of the circuit as a string. #[inline] @@ -144,14 +145,14 @@ impl TypeName for Boolean { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Boolean { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Boolean { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) diff --git a/circuit/types/boolean/src/nand.rs b/circuit/types/boolean/src/nand.rs index 3af34de703..f547814c5a 100644 --- a/circuit/types/boolean/src/nand.rs +++ b/circuit/types/boolean/src/nand.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/nor.rs b/circuit/types/boolean/src/nor.rs index f93b1d49bb..83dbed4611 100644 --- a/circuit/types/boolean/src/nor.rs +++ b/circuit/types/boolean/src/nor.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/not.rs b/circuit/types/boolean/src/not.rs index b4aec24f37..fa755483ca 100644 --- a/circuit/types/boolean/src/not.rs +++ b/circuit/types/boolean/src/not.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/or.rs b/circuit/types/boolean/src/or.rs index ec6d0a0eac..ed447edc32 100644 --- a/circuit/types/boolean/src/or.rs +++ b/circuit/types/boolean/src/or.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/ternary.rs b/circuit/types/boolean/src/ternary.rs index 237b0d00bd..dbe30d3e38 100644 --- a/circuit/types/boolean/src/ternary.rs +++ b/circuit/types/boolean/src/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/boolean/src/xor.rs b/circuit/types/boolean/src/xor.rs index 591b30b68a..c6840dd038 100644 --- a/circuit/types/boolean/src/xor.rs +++ b/circuit/types/boolean/src/xor.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/Cargo.toml b/circuit/types/field/Cargo.toml index acc1367886..786e51d016 100644 --- a/circuit/types/field/Cargo.toml +++ b/circuit/types/field/Cargo.toml @@ -1,24 +1,26 @@ [package] name = "snarkvm-circuit-types-field" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Field circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-types-field" path = "../../../console/types/field" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [features] default = [ "enable_console" ] diff --git a/circuit/types/field/build.rs b/circuit/types/field/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/field/build.rs +++ b/circuit/types/field/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/add.rs b/circuit/types/field/src/add.rs index 2e5a5a7714..8206d01d25 100644 --- a/circuit/types/field/src/add.rs +++ b/circuit/types/field/src/add.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/compare.rs b/circuit/types/field/src/compare.rs index 40bbe811ec..870af6579d 100644 --- a/circuit/types/field/src/compare.rs +++ b/circuit/types/field/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/div.rs b/circuit/types/field/src/div.rs index dc420d2c59..f59b691ecb 100644 --- a/circuit/types/field/src/div.rs +++ b/circuit/types/field/src/div.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -101,7 +102,7 @@ impl OutputMode, Output = Field>> for Field< #[cfg(test)] mod tests { use super::*; - use snarkvm_circuit_environment::{assert_count_fails, Circuit}; + use snarkvm_circuit_environment::{Circuit, assert_count_fails}; const ITERATIONS: u64 = 1000; diff --git a/circuit/types/field/src/div_unchecked.rs b/circuit/types/field/src/div_unchecked.rs index 4e819f5981..97b6e16837 100644 --- a/circuit/types/field/src/div_unchecked.rs +++ b/circuit/types/field/src/div_unchecked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -81,7 +82,7 @@ impl OutputMode, Output = Field>> f #[cfg(test)] mod tests { use super::*; - use snarkvm_circuit_environment::{assert_count_fails, Circuit}; + use snarkvm_circuit_environment::{Circuit, assert_count_fails}; const ITERATIONS: u64 = 1000; diff --git a/circuit/types/field/src/double.rs b/circuit/types/field/src/double.rs index bf77a3c5ad..f64dde9c04 100644 --- a/circuit/types/field/src/double.rs +++ b/circuit/types/field/src/double.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/equal.rs b/circuit/types/field/src/equal.rs index 05df630115..92d1e2c145 100644 --- a/circuit/types/field/src/equal.rs +++ b/circuit/types/field/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/helpers/from_bits.rs b/circuit/types/field/src/helpers/from_bits.rs index 3376cfa199..9e5bdc5e4e 100644 --- a/circuit/types/field/src/helpers/from_bits.rs +++ b/circuit/types/field/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -128,7 +129,7 @@ mod tests { // Add excess zero bits. let candidate = [given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); - Circuit::scope(&format!("Excess {mode} {i}"), || { + Circuit::scope(format!("Excess {mode} {i}"), || { let candidate = Field::::from_bits_le(&candidate); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.get().expect("Caching failed").len()); @@ -173,7 +174,7 @@ mod tests { // Add excess zero bits. let candidate = [vec![Boolean::new(mode, false); i as usize], given_bits].concat(); - Circuit::scope(&format!("Excess {mode} {i}"), || { + Circuit::scope(format!("Excess {mode} {i}"), || { let candidate = Field::::from_bits_be(&candidate); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.get().expect("Caching failed").len()); diff --git a/circuit/types/field/src/helpers/from_boolean.rs b/circuit/types/field/src/helpers/from_boolean.rs index 84975991d4..33a06b4f19 100644 --- a/circuit/types/field/src/helpers/from_boolean.rs +++ b/circuit/types/field/src/helpers/from_boolean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/helpers/mod.rs b/circuit/types/field/src/helpers/mod.rs index c3873b2b82..ac05a44587 100644 --- a/circuit/types/field/src/helpers/mod.rs +++ b/circuit/types/field/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/helpers/one.rs b/circuit/types/field/src/helpers/one.rs index 10786f33e4..b79cd50243 100644 --- a/circuit/types/field/src/helpers/one.rs +++ b/circuit/types/field/src/helpers/one.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/helpers/to_bits.rs b/circuit/types/field/src/helpers/to_bits.rs index e58952e47d..0eeb16cede 100644 --- a/circuit/types/field/src/helpers/to_bits.rs +++ b/circuit/types/field/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -122,7 +123,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Field::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate_bits = candidate.to_bits_le(); assert_eq!(expected_number_of_bits, candidate_bits.len()); for (expected_bit, candidate_bit) in expected.to_bits_le().iter().zip_eq(&candidate_bits) { @@ -150,7 +151,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Field::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate_bits = candidate.to_bits_be(); assert_eq!(expected_number_of_bits, candidate_bits.len()); for (expected_bit, candidate_bit) in expected.to_bits_be().iter().zip_eq(&candidate_bits) { diff --git a/circuit/types/field/src/helpers/to_lower_bits.rs b/circuit/types/field/src/helpers/to_lower_bits.rs index c94f43c01b..00522b326f 100644 --- a/circuit/types/field/src/helpers/to_lower_bits.rs +++ b/circuit/types/field/src/helpers/to_lower_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -102,7 +103,7 @@ mod tests { // Construct the unsigned integer as a field element. let candidate = Field::::new(mode, console::Field::from_bits_le(&expected).unwrap()); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_lower_bits_le(I::BITS as usize); assert_eq!(I::BITS, candidate.len() as u64); for (i, (expected_bit, candidate_bit)) in expected.iter().zip_eq(candidate.iter()).enumerate() { diff --git a/circuit/types/field/src/helpers/to_upper_bits.rs b/circuit/types/field/src/helpers/to_upper_bits.rs index bd7112a229..46af42f528 100644 --- a/circuit/types/field/src/helpers/to_upper_bits.rs +++ b/circuit/types/field/src/helpers/to_upper_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -129,7 +130,7 @@ mod tests { Field::::new(mode, console::Field::from_bits_be(&bits_be).unwrap()) }; - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let num_bits_with_capacity = I::BITS + 1; let candidate = candidate.to_upper_bits_be(num_bits_with_capacity as usize); assert_eq!(num_bits_with_capacity, candidate.len() as u64); diff --git a/circuit/types/field/src/helpers/zero.rs b/circuit/types/field/src/helpers/zero.rs index 73a56ba1b9..5608c30402 100644 --- a/circuit/types/field/src/helpers/zero.rs +++ b/circuit/types/field/src/helpers/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/inverse.rs b/circuit/types/field/src/inverse.rs index a5ced6ce18..bbb432b515 100644 --- a/circuit/types/field/src/inverse.rs +++ b/circuit/types/field/src/inverse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/lib.rs b/circuit/types/field/src/lib.rs index 1c29b437ee..82711ef158 100644 --- a/circuit/types/field/src/lib.rs +++ b/circuit/types/field/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -59,7 +60,7 @@ impl Default for Field { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Field { type Primitive = console::Field; @@ -69,7 +70,7 @@ impl Inject for Field { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Field { type Primitive = console::Field; @@ -84,7 +85,7 @@ impl Eject for Field { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Field { /// Parses a string into a field circuit. #[inline] @@ -101,7 +102,7 @@ impl Parser for Field { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Field { type Err = Error; @@ -120,7 +121,7 @@ impl FromStr for Field { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Field { /// Returns the type name of the circuit as a string. #[inline] @@ -129,14 +130,14 @@ impl TypeName for Field { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Field { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Field { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) diff --git a/circuit/types/field/src/mul.rs b/circuit/types/field/src/mul.rs index 8a0e9baba8..bcfcd52c56 100644 --- a/circuit/types/field/src/mul.rs +++ b/circuit/types/field/src/mul.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/neg.rs b/circuit/types/field/src/neg.rs index c7b8387b0c..20d189e595 100644 --- a/circuit/types/field/src/neg.rs +++ b/circuit/types/field/src/neg.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/pow.rs b/circuit/types/field/src/pow.rs index 7cbd84f551..015105759a 100644 --- a/circuit/types/field/src/pow.rs +++ b/circuit/types/field/src/pow.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/square.rs b/circuit/types/field/src/square.rs index 0e5193e809..2e92c3e3ad 100644 --- a/circuit/types/field/src/square.rs +++ b/circuit/types/field/src/square.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index be7d350f71..67743b3519 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/sub.rs b/circuit/types/field/src/sub.rs index a5293a90d3..c4d579901c 100644 --- a/circuit/types/field/src/sub.rs +++ b/circuit/types/field/src/sub.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/field/src/ternary.rs b/circuit/types/field/src/ternary.rs index cc3673cdf9..94247c9d63 100644 --- a/circuit/types/field/src/ternary.rs +++ b/circuit/types/field/src/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/Cargo.toml b/circuit/types/group/Cargo.toml index c633da70d9..0c1d6cae1e 100644 --- a/circuit/types/group/Cargo.toml +++ b/circuit/types/group/Cargo.toml @@ -1,32 +1,34 @@ [package] name = "snarkvm-circuit-types-group" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Group circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-types-group" path = "../../../console/types/group" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/group/build.rs b/circuit/types/group/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/group/build.rs +++ b/circuit/types/group/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/add.rs b/circuit/types/group/src/add.rs index 7e2cc0b0db..57c73ff090 100644 --- a/circuit/types/group/src/add.rs +++ b/circuit/types/group/src/add.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/double.rs b/circuit/types/group/src/double.rs index b565c607ca..e3c210255b 100644 --- a/circuit/types/group/src/double.rs +++ b/circuit/types/group/src/double.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -105,7 +106,7 @@ mod tests { // Constant variable let affine = Group::::new(Mode::Constant, point); - Circuit::scope(&format!("Constant {i}"), || { + Circuit::scope(format!("Constant {i}"), || { let candidate = affine.double(); assert_eq!(expected, candidate.eject_value()); assert_scope!(3, 0, 0, 0); @@ -115,7 +116,7 @@ mod tests { // Public variable let affine = Group::::new(Mode::Public, point); - Circuit::scope(&format!("Public {i}"), || { + Circuit::scope(format!("Public {i}"), || { let candidate = affine.double(); assert_eq!(expected, candidate.eject_value()); assert_scope!(1, 0, 5, 5); @@ -125,7 +126,7 @@ mod tests { // Private variable let affine = Group::::new(Mode::Private, point); - Circuit::scope(&format!("Private {i}"), || { + Circuit::scope(format!("Private {i}"), || { let candidate = affine.double(); assert_eq!(expected, candidate.eject_value()); assert_scope!(1, 0, 5, 5); diff --git a/circuit/types/group/src/equal.rs b/circuit/types/group/src/equal.rs index a0fb4b81c0..3c685a2f6f 100644 --- a/circuit/types/group/src/equal.rs +++ b/circuit/types/group/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -61,14 +62,14 @@ mod tests { let a = Group::::new(Mode::Constant, a); let b = Group::::new(Mode::Constant, b); - Circuit::scope(&format!("Constant Equals {i}"), || { + Circuit::scope(format!("Constant Equals {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(2, 0, 0, 0); }); Circuit::reset(); - Circuit::scope(&format!("Constant Not Equals {i}"), || { + Circuit::scope(format!("Constant Not Equals {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(2, 0, 0, 0); @@ -85,14 +86,14 @@ mod tests { let a = Group::::new(Mode::Constant, a); let b = Group::::new(Mode::Public, b); - Circuit::scope(&format!("Constant and Public Equals {i}"), || { + Circuit::scope(format!("Constant and Public Equals {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(0, 0, 5, 5); }); Circuit::reset(); - Circuit::scope(&format!("Constant and Public Not Equals {i}"), || { + Circuit::scope(format!("Constant and Public Not Equals {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(0, 0, 5, 5); @@ -109,14 +110,14 @@ mod tests { let a = Group::::new(Mode::Public, a); let b = Group::::new(Mode::Constant, b); - Circuit::scope(&format!("Public and Constant Equals {i}"), || { + Circuit::scope(format!("Public and Constant Equals {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(0, 0, 5, 5); }); Circuit::reset(); - Circuit::scope(&format!("Public and Constant Not Equals {i}"), || { + Circuit::scope(format!("Public and Constant Not Equals {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(0, 0, 5, 5); @@ -133,14 +134,14 @@ mod tests { let a = Group::::new(Mode::Public, a); let b = Group::::new(Mode::Public, b); - Circuit::scope(&format!("Public Equals {i}"), || { + Circuit::scope(format!("Public Equals {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(0, 0, 5, 5); }); Circuit::reset(); - Circuit::scope(&format!("Public Not Equals {i}"), || { + Circuit::scope(format!("Public Not Equals {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(0, 0, 5, 5); @@ -157,14 +158,14 @@ mod tests { let a = Group::::new(Mode::Private, a); let b = Group::::new(Mode::Private, b); - Circuit::scope(&format!("Private Equals {i}"), || { + Circuit::scope(format!("Private Equals {i}"), || { let equals = a.is_equal(&b); assert!(!equals.eject_value()); assert_scope!(0, 0, 5, 5); }); Circuit::reset(); - Circuit::scope(&format!("Private Not Equals {i}"), || { + Circuit::scope(format!("Private Not Equals {i}"), || { let equals = a.is_not_equal(&b); assert!(equals.eject_value()); assert_scope!(0, 0, 5, 5); diff --git a/circuit/types/group/src/helpers/from_bits.rs b/circuit/types/group/src/helpers/from_bits.rs index 7cd06656e2..f6991ffbd6 100644 --- a/circuit/types/group/src/helpers/from_bits.rs +++ b/circuit/types/group/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -49,7 +50,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected).to_bits_le(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Group::::from_bits_le(&candidate); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -66,7 +67,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected).to_bits_be(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Group::::from_bits_be(&candidate); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index 5dd2191060..f819d5f5ea 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/helpers/from_xy_coordinates.rs b/circuit/types/group/src/helpers/from_xy_coordinates.rs index ecce200d4d..bd521a368d 100644 --- a/circuit/types/group/src/helpers/from_xy_coordinates.rs +++ b/circuit/types/group/src/helpers/from_xy_coordinates.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/helpers/mod.rs b/circuit/types/group/src/helpers/mod.rs index 11ad03ce22..d60543ad79 100644 --- a/circuit/types/group/src/helpers/mod.rs +++ b/circuit/types/group/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/helpers/mul_by_cofactor.rs b/circuit/types/group/src/helpers/mul_by_cofactor.rs index be32b66eff..1d385279f8 100644 --- a/circuit/types/group/src/helpers/mul_by_cofactor.rs +++ b/circuit/types/group/src/helpers/mul_by_cofactor.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -46,7 +47,7 @@ mod tests { // Initialize the input. let affine = Group::::new(mode, input); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = affine.mul_by_cofactor(); assert_eq!(expected, candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -86,7 +87,7 @@ mod tests { // Initialize the input. let affine = Group::::new(Mode::Private, input); - Circuit::scope(&format!("Constant {i}"), || { + Circuit::scope(format!("Constant {i}"), || { let candidate = affine * Scalar::constant(console::Scalar::new(::ScalarField::from(4u128))); assert_eq!(expected, candidate.eject_value()); diff --git a/circuit/types/group/src/helpers/to_bits.rs b/circuit/types/group/src/helpers/to_bits.rs index 50cf0db7d5..76284375d4 100644 --- a/circuit/types/group/src/helpers/to_bits.rs +++ b/circuit/types/group/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -59,7 +60,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_le(); assert_eq!(expected_number_of_bits, candidate.len()); for (expected_bit, candidate_bit) in @@ -82,7 +83,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_be(); assert_eq!(expected_number_of_bits, candidate.len()); for (expected_bit, candidate_bit) in diff --git a/circuit/types/group/src/helpers/to_field.rs b/circuit/types/group/src/helpers/to_field.rs index e3c0bbddeb..0b14035ce9 100644 --- a/circuit/types/group/src/helpers/to_field.rs +++ b/circuit/types/group/src/helpers/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -40,7 +41,7 @@ mod tests { let expected = Uniform::rand(rng); let candidate = Group::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_field(); assert_eq!(expected.to_field().unwrap(), candidate.eject_value()); assert_scope!(0, 0, 0, 0); diff --git a/circuit/types/group/src/helpers/to_x_coordinate.rs b/circuit/types/group/src/helpers/to_x_coordinate.rs index 623295b7b1..47b7293041 100644 --- a/circuit/types/group/src/helpers/to_x_coordinate.rs +++ b/circuit/types/group/src/helpers/to_x_coordinate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -34,7 +35,7 @@ mod tests { let expected = Uniform::rand(&mut TestRng::default()); let candidate = Group::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_x_coordinate(); assert_eq!(expected.to_x_coordinate(), candidate.eject_value()); assert_scope!(0, 0, 0, 0); diff --git a/circuit/types/group/src/helpers/to_y_coordinate.rs b/circuit/types/group/src/helpers/to_y_coordinate.rs index 8e5f291d57..e5e04f450f 100644 --- a/circuit/types/group/src/helpers/to_y_coordinate.rs +++ b/circuit/types/group/src/helpers/to_y_coordinate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -36,7 +37,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Group::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_y_coordinate(); assert_eq!(expected.to_y_coordinate(), candidate.eject_value()); assert_scope!(0, 0, 0, 0); diff --git a/circuit/types/group/src/helpers/zero.rs b/circuit/types/group/src/helpers/zero.rs index 63c7d029b1..31790492d1 100644 --- a/circuit/types/group/src/helpers/zero.rs +++ b/circuit/types/group/src/helpers/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/lib.rs b/circuit/types/group/src/lib.rs index a0f636b435..65d7ef2a36 100644 --- a/circuit/types/group/src/lib.rs +++ b/circuit/types/group/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -52,7 +53,7 @@ impl Group { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Group { type Primitive = console::Group; @@ -147,7 +148,7 @@ impl Group { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Group { type Primitive = console::Group; @@ -162,7 +163,7 @@ impl Eject for Group { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Group { /// Parses a string into a group circuit. #[inline] @@ -179,7 +180,7 @@ impl Parser for Group { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Group { type Err = Error; @@ -198,7 +199,7 @@ impl FromStr for Group { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Group { /// Returns the type name of the circuit as a string. #[inline] @@ -207,14 +208,14 @@ impl TypeName for Group { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Group { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Group { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) @@ -258,7 +259,7 @@ mod tests { // Sample a random element. let point = Uniform::rand(&mut rng); - Circuit::scope(&format!("Constant {i}"), || { + Circuit::scope(format!("Constant {i}"), || { let affine = Group::::new(Mode::Constant, point); assert_eq!(point, affine.eject_value()); assert_scope!(10, 0, 0, 0); @@ -270,7 +271,7 @@ mod tests { // Sample a random element. let point = Uniform::rand(&mut rng); - Circuit::scope(&format!("Public {i}"), || { + Circuit::scope(format!("Public {i}"), || { let affine = Group::::new(Mode::Public, point); assert_eq!(point, affine.eject_value()); assert_scope!(4, 2, 12, 13); @@ -282,7 +283,7 @@ mod tests { // Sample a random element. let point = Uniform::rand(&mut rng); - Circuit::scope(&format!("Private {i}"), || { + Circuit::scope(format!("Private {i}"), || { let affine = Group::::new(Mode::Private, point); assert_eq!(point, affine.eject_value()); assert_scope!(4, 0, 14, 13); diff --git a/circuit/types/group/src/mul.rs b/circuit/types/group/src/mul.rs index 0c592ebe7c..8a11579dc5 100644 --- a/circuit/types/group/src/mul.rs +++ b/circuit/types/group/src/mul.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/neg.rs b/circuit/types/group/src/neg.rs index c8a8b45d5b..22732ab847 100644 --- a/circuit/types/group/src/neg.rs +++ b/circuit/types/group/src/neg.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/sub.rs b/circuit/types/group/src/sub.rs index 219da59d10..0bbc2ea1c8 100644 --- a/circuit/types/group/src/sub.rs +++ b/circuit/types/group/src/sub.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/group/src/ternary.rs b/circuit/types/group/src/ternary.rs index 201a320fc1..5647a0ff0d 100644 --- a/circuit/types/group/src/ternary.rs +++ b/circuit/types/group/src/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/Cargo.toml b/circuit/types/integers/Cargo.toml index 5903640f3f..8d49d2e750 100644 --- a/circuit/types/integers/Cargo.toml +++ b/circuit/types/integers/Cargo.toml @@ -1,32 +1,34 @@ [package] name = "snarkvm-circuit-types-integers" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Integer circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-types-integers" path = "../../../console/types/integers" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/integers/build.rs b/circuit/types/integers/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/integers/build.rs +++ b/circuit/types/integers/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/abs_checked.rs b/circuit/types/integers/src/abs_checked.rs index 35332e2ee1..9bae13124d 100644 --- a/circuit/types/integers/src/abs_checked.rs +++ b/circuit/types/integers/src/abs_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/abs_wrapped.rs b/circuit/types/integers/src/abs_wrapped.rs index 698d029fe7..61f11968d1 100644 --- a/circuit/types/integers/src/abs_wrapped.rs +++ b/circuit/types/integers/src/abs_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/add_checked.rs b/circuit/types/integers/src/add_checked.rs index 2616f57d5f..ebd395c7ff 100644 --- a/circuit/types/integers/src/add_checked.rs +++ b/circuit/types/integers/src/add_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/add_wrapped.rs b/circuit/types/integers/src/add_wrapped.rs index aa30bd482e..5d920fe416 100644 --- a/circuit/types/integers/src/add_wrapped.rs +++ b/circuit/types/integers/src/add_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/and.rs b/circuit/types/integers/src/and.rs index 846876d6b5..50e328ed24 100644 --- a/circuit/types/integers/src/and.rs +++ b/circuit/types/integers/src/and.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/compare.rs b/circuit/types/integers/src/compare.rs index 7e0acdf44e..21ed0a4ed9 100644 --- a/circuit/types/integers/src/compare.rs +++ b/circuit/types/integers/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/div_checked.rs b/circuit/types/integers/src/div_checked.rs index 67446c02c9..484e016f8d 100644 --- a/circuit/types/integers/src/div_checked.rs +++ b/circuit/types/integers/src/div_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/div_wrapped.rs b/circuit/types/integers/src/div_wrapped.rs index 9098069608..a507f97331 100644 --- a/circuit/types/integers/src/div_wrapped.rs +++ b/circuit/types/integers/src/div_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/equal.rs b/circuit/types/integers/src/equal.rs index 955ddaf7bd..baecd8cbb4 100644 --- a/circuit/types/integers/src/equal.rs +++ b/circuit/types/integers/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/from_bits.rs b/circuit/types/integers/src/helpers/from_bits.rs index 8919575dd8..5d6953f75a 100644 --- a/circuit/types/integers/src/helpers/from_bits.rs +++ b/circuit/types/integers/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -66,7 +67,7 @@ mod tests { let given_bits = Integer::::new(mode, expected).to_bits_le(); let expected_size_in_bits = given_bits.len(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Integer::::from_bits_le(&given_bits); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.len()); @@ -76,7 +77,7 @@ mod tests { // Add excess zero bits. let candidate = [given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); - Circuit::scope(&format!("Excess {mode} {i}"), || { + Circuit::scope(format!("Excess {mode} {i}"), || { let candidate = Integer::::from_bits_le(&candidate); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.len()); @@ -106,7 +107,7 @@ mod tests { let given_bits = Integer::::new(mode, expected).to_bits_be(); let expected_size_in_bits = given_bits.len(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Integer::::from_bits_be(&given_bits); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.len()); @@ -116,7 +117,7 @@ mod tests { // Add excess zero bits. let candidate = [vec![Boolean::new(mode, false); i as usize], given_bits].concat(); - Circuit::scope(&format!("Excess {mode} {i}"), || { + Circuit::scope(format!("Excess {mode} {i}"), || { let candidate = Integer::::from_bits_be(&candidate); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.len()); diff --git a/circuit/types/integers/src/helpers/from_field.rs b/circuit/types/integers/src/helpers/from_field.rs index 3b5e80c3dd..b2fb99bab3 100644 --- a/circuit/types/integers/src/helpers/from_field.rs +++ b/circuit/types/integers/src/helpers/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/from_field_lossy.rs b/circuit/types/integers/src/helpers/from_field_lossy.rs index 990d2cb477..1ab412fc70 100644 --- a/circuit/types/integers/src/helpers/from_field_lossy.rs +++ b/circuit/types/integers/src/helpers/from_field_lossy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/mod.rs b/circuit/types/integers/src/helpers/mod.rs index 75018c91d9..da1aeec8dc 100644 --- a/circuit/types/integers/src/helpers/mod.rs +++ b/circuit/types/integers/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/msb.rs b/circuit/types/integers/src/helpers/msb.rs index 6ac6f3157b..419017df0b 100644 --- a/circuit/types/integers/src/helpers/msb.rs +++ b/circuit/types/integers/src/helpers/msb.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/one.rs b/circuit/types/integers/src/helpers/one.rs index 747f2f7427..dd49ad7994 100644 --- a/circuit/types/integers/src/helpers/one.rs +++ b/circuit/types/integers/src/helpers/one.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/to_bits.rs b/circuit/types/integers/src/helpers/to_bits.rs index 8df5b8e35f..924cca44f9 100644 --- a/circuit/types/integers/src/helpers/to_bits.rs +++ b/circuit/types/integers/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -65,7 +66,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Integer::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_le(); assert_eq!(I::BITS, candidate.len() as u64); @@ -94,7 +95,7 @@ mod tests { let expected = Uniform::rand(&mut rng); let candidate = Integer::::new(mode, expected); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_be(); assert_eq!(I::BITS, candidate.len() as u64); diff --git a/circuit/types/integers/src/helpers/to_field.rs b/circuit/types/integers/src/helpers/to_field.rs index 1eb5d17ca5..2a21d3a7ec 100644 --- a/circuit/types/integers/src/helpers/to_field.rs +++ b/circuit/types/integers/src/helpers/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/to_fields.rs b/circuit/types/integers/src/helpers/to_fields.rs index 49a60aa132..d10fbb81ff 100644 --- a/circuit/types/integers/src/helpers/to_fields.rs +++ b/circuit/types/integers/src/helpers/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/to_scalar.rs b/circuit/types/integers/src/helpers/to_scalar.rs index a3088e13da..e29f19497c 100644 --- a/circuit/types/integers/src/helpers/to_scalar.rs +++ b/circuit/types/integers/src/helpers/to_scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/helpers/zero.rs b/circuit/types/integers/src/helpers/zero.rs index e44fcba22c..d75963d66a 100644 --- a/circuit/types/integers/src/helpers/zero.rs +++ b/circuit/types/integers/src/helpers/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/lib.rs b/circuit/types/integers/src/lib.rs index c2d7a318b7..82f6e91b23 100644 --- a/circuit/types/integers/src/lib.rs +++ b/circuit/types/integers/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -98,7 +99,7 @@ impl Integer { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Integer { type Primitive = console::Integer; @@ -114,7 +115,7 @@ impl Inject for Integer { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Integer { type Primitive = console::Integer; @@ -132,7 +133,7 @@ impl Eject for Integer { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Integer { /// Parses a string into an integer circuit. #[inline] @@ -149,7 +150,7 @@ impl Parser for Integer { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Integer { type Err = Error; @@ -168,7 +169,7 @@ impl FromStr for Integer { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Integer { /// Returns the type name of the circuit as a string. #[inline] @@ -177,14 +178,14 @@ impl TypeName for Integer { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Integer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Integer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) diff --git a/circuit/types/integers/src/modulo.rs b/circuit/types/integers/src/modulo.rs index a249848957..a9584a9ba2 100644 --- a/circuit/types/integers/src/modulo.rs +++ b/circuit/types/integers/src/modulo.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/mul_checked.rs b/circuit/types/integers/src/mul_checked.rs index 1cf4588fff..fccbb0b84b 100644 --- a/circuit/types/integers/src/mul_checked.rs +++ b/circuit/types/integers/src/mul_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/mul_wrapped.rs b/circuit/types/integers/src/mul_wrapped.rs index 1feae66671..e96a9f0e53 100644 --- a/circuit/types/integers/src/mul_wrapped.rs +++ b/circuit/types/integers/src/mul_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/neg.rs b/circuit/types/integers/src/neg.rs index 33723809c8..3718b6ef96 100644 --- a/circuit/types/integers/src/neg.rs +++ b/circuit/types/integers/src/neg.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/not.rs b/circuit/types/integers/src/not.rs index e324707e57..5619c3a6c6 100644 --- a/circuit/types/integers/src/not.rs +++ b/circuit/types/integers/src/not.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/or.rs b/circuit/types/integers/src/or.rs index b3f23a64cb..d74a10e3b9 100644 --- a/circuit/types/integers/src/or.rs +++ b/circuit/types/integers/src/or.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/pow_checked.rs b/circuit/types/integers/src/pow_checked.rs index 170211d7ef..427899e188 100644 --- a/circuit/types/integers/src/pow_checked.rs +++ b/circuit/types/integers/src/pow_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/pow_wrapped.rs b/circuit/types/integers/src/pow_wrapped.rs index bb66551ded..337763474c 100644 --- a/circuit/types/integers/src/pow_wrapped.rs +++ b/circuit/types/integers/src/pow_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/rem_checked.rs b/circuit/types/integers/src/rem_checked.rs index c4958580b3..477f5c0771 100644 --- a/circuit/types/integers/src/rem_checked.rs +++ b/circuit/types/integers/src/rem_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/rem_wrapped.rs b/circuit/types/integers/src/rem_wrapped.rs index edc2f26f9c..5b2b53514f 100644 --- a/circuit/types/integers/src/rem_wrapped.rs +++ b/circuit/types/integers/src/rem_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/shl_checked.rs b/circuit/types/integers/src/shl_checked.rs index 18b5f3545e..87109fcde7 100644 --- a/circuit/types/integers/src/shl_checked.rs +++ b/circuit/types/integers/src/shl_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/shl_wrapped.rs b/circuit/types/integers/src/shl_wrapped.rs index 4414d05965..82d53b2411 100644 --- a/circuit/types/integers/src/shl_wrapped.rs +++ b/circuit/types/integers/src/shl_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/shr_checked.rs b/circuit/types/integers/src/shr_checked.rs index f7a065eb14..41f24fb66b 100644 --- a/circuit/types/integers/src/shr_checked.rs +++ b/circuit/types/integers/src/shr_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/shr_wrapped.rs b/circuit/types/integers/src/shr_wrapped.rs index 09cf3cceda..2c8a541301 100644 --- a/circuit/types/integers/src/shr_wrapped.rs +++ b/circuit/types/integers/src/shr_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/sub_checked.rs b/circuit/types/integers/src/sub_checked.rs index bbaec84520..588987ddea 100644 --- a/circuit/types/integers/src/sub_checked.rs +++ b/circuit/types/integers/src/sub_checked.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/sub_wrapped.rs b/circuit/types/integers/src/sub_wrapped.rs index afe68b6398..46d62209ee 100644 --- a/circuit/types/integers/src/sub_wrapped.rs +++ b/circuit/types/integers/src/sub_wrapped.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/ternary.rs b/circuit/types/integers/src/ternary.rs index 924b5c9097..27de2d6b61 100644 --- a/circuit/types/integers/src/ternary.rs +++ b/circuit/types/integers/src/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/integers/src/xor.rs b/circuit/types/integers/src/xor.rs index bc6fc66376..458f246360 100644 --- a/circuit/types/integers/src/xor.rs +++ b/circuit/types/integers/src/xor.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/Cargo.toml b/circuit/types/scalar/Cargo.toml index 99e813f11b..e8bb5a0584 100644 --- a/circuit/types/scalar/Cargo.toml +++ b/circuit/types/scalar/Cargo.toml @@ -1,28 +1,30 @@ [package] name = "snarkvm-circuit-types-scalar" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Scalar circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-types-scalar" path = "../../../console/types/scalar" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [features] default = [ "enable_console" ] diff --git a/circuit/types/scalar/build.rs b/circuit/types/scalar/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/scalar/build.rs +++ b/circuit/types/scalar/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/add.rs b/circuit/types/scalar/src/add.rs index bfb016425d..ca57e8a9aa 100644 --- a/circuit/types/scalar/src/add.rs +++ b/circuit/types/scalar/src/add.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/compare.rs b/circuit/types/scalar/src/compare.rs index d0799bfc41..77f82f564a 100644 --- a/circuit/types/scalar/src/compare.rs +++ b/circuit/types/scalar/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -83,7 +84,7 @@ mod tests { let candidate_b = Scalar::::new(mode_b, expected_b); // Perform the less than comparison. - Circuit::scope(&format!("{mode_a} {mode_b} {i}"), || { + Circuit::scope(format!("{mode_a} {mode_b} {i}"), || { let candidate = candidate_a.is_less_than(&candidate_b); assert_eq!(expected_a < expected_b, candidate.eject_value()); assert_scope!(<=num_constants, <=num_public, <=num_private, <=num_constraints); diff --git a/circuit/types/scalar/src/equal.rs b/circuit/types/scalar/src/equal.rs index 0b312901c3..c59692d5ed 100644 --- a/circuit/types/scalar/src/equal.rs +++ b/circuit/types/scalar/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/from_bits.rs b/circuit/types/scalar/src/helpers/from_bits.rs index 2422607938..4458224043 100644 --- a/circuit/types/scalar/src/helpers/from_bits.rs +++ b/circuit/types/scalar/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -107,7 +108,7 @@ mod tests { let given_bits = Scalar::::new(mode, expected).to_bits_le(); let expected_size_in_bits = given_bits.len(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Scalar::::from_bits_le(&given_bits); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.get().unwrap().len()); @@ -118,7 +119,7 @@ mod tests { // Add excess zero bits. let candidate = [given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); - Circuit::scope(&format!("Excess {mode} {i}"), || { + Circuit::scope(format!("Excess {mode} {i}"), || { let candidate = Scalar::::from_bits_le(&candidate); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.get().unwrap().len()); @@ -148,7 +149,7 @@ mod tests { let given_bits = Scalar::::new(mode, expected).to_bits_be(); let expected_size_in_bits = given_bits.len(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = Scalar::::from_bits_be(&given_bits); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.get().unwrap().len()); @@ -159,7 +160,7 @@ mod tests { // Add excess zero bits. let candidate = [vec![Boolean::new(mode, false); i as usize], given_bits].concat(); - Circuit::scope(&format!("Excess {mode} {i}"), || { + Circuit::scope(format!("Excess {mode} {i}"), || { let candidate = Scalar::::from_bits_be(&candidate); assert_eq!(expected, candidate.eject_value()); assert_eq!(expected_size_in_bits, candidate.bits_le.get().unwrap().len()); diff --git a/circuit/types/scalar/src/helpers/from_field.rs b/circuit/types/scalar/src/helpers/from_field.rs index 1ee4bd5864..da4be32cee 100644 --- a/circuit/types/scalar/src/helpers/from_field.rs +++ b/circuit/types/scalar/src/helpers/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,8 +23,8 @@ impl FromField for Scalar { /// This method guarantees the following: /// 1. If the field element is larger than the scalar field modulus, then the operation will fail. /// 2. If the field element is smaller than the scalar field modulus, then the operation will succeed. - /// - This is particularly useful for the case where a user called, `Scalar::from_field(scalar.to_field())`, - /// and the scalar bit representation is between `size_in_data_bits < bits.len() < size_in_bits`. + /// - This is particularly useful for the case where a user called, `Scalar::from_field(scalar.to_field())`, + /// and the scalar bit representation is between `size_in_data_bits < bits.len() < size_in_bits`. fn from_field(field: Self::Field) -> Self { // Note: We are reconstituting the integer from the base field. // This is safe as the number of bits in the integer is less than the base field modulus, diff --git a/circuit/types/scalar/src/helpers/from_field_lossy.rs b/circuit/types/scalar/src/helpers/from_field_lossy.rs index f30298623b..e28d18650e 100644 --- a/circuit/types/scalar/src/helpers/from_field_lossy.rs +++ b/circuit/types/scalar/src/helpers/from_field_lossy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/mod.rs b/circuit/types/scalar/src/helpers/mod.rs index a6cd87b320..e8ebeba2f8 100644 --- a/circuit/types/scalar/src/helpers/mod.rs +++ b/circuit/types/scalar/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/one.rs b/circuit/types/scalar/src/helpers/one.rs index 1f3e0c4d13..7476f6fc84 100644 --- a/circuit/types/scalar/src/helpers/one.rs +++ b/circuit/types/scalar/src/helpers/one.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/to_bits.rs b/circuit/types/scalar/src/helpers/to_bits.rs index 3f80ad2e60..171c28e036 100644 --- a/circuit/types/scalar/src/helpers/to_bits.rs +++ b/circuit/types/scalar/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/to_field.rs b/circuit/types/scalar/src/helpers/to_field.rs index 7d4a096544..1fad8a15b9 100644 --- a/circuit/types/scalar/src/helpers/to_field.rs +++ b/circuit/types/scalar/src/helpers/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/to_fields.rs b/circuit/types/scalar/src/helpers/to_fields.rs index 64ec4adb78..816033a5e8 100644 --- a/circuit/types/scalar/src/helpers/to_fields.rs +++ b/circuit/types/scalar/src/helpers/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/helpers/zero.rs b/circuit/types/scalar/src/helpers/zero.rs index 287a523e4e..dfb1cf9efe 100644 --- a/circuit/types/scalar/src/helpers/zero.rs +++ b/circuit/types/scalar/src/helpers/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/scalar/src/lib.rs b/circuit/types/scalar/src/lib.rs index 8076064f25..1dde301382 100644 --- a/circuit/types/scalar/src/lib.rs +++ b/circuit/types/scalar/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -43,7 +44,7 @@ pub struct Scalar { impl ScalarTrait for Scalar {} -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for Scalar { type Primitive = console::Scalar; @@ -62,7 +63,7 @@ impl Inject for Scalar { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for Scalar { type Primitive = console::Scalar; @@ -80,7 +81,7 @@ impl Eject for Scalar { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for Scalar { /// Parses a string into a scalar circuit. #[inline] @@ -97,7 +98,7 @@ impl Parser for Scalar { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for Scalar { type Err = Error; @@ -116,7 +117,7 @@ impl FromStr for Scalar { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for Scalar { /// Returns the type name of the circuit as a string. #[inline] @@ -125,14 +126,14 @@ impl TypeName for Scalar { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for Scalar { fn fmt(&self, f: &mut Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for Scalar { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) diff --git a/circuit/types/scalar/src/ternary.rs b/circuit/types/scalar/src/ternary.rs index f1f400bda6..927dafeb08 100644 --- a/circuit/types/scalar/src/ternary.rs +++ b/circuit/types/scalar/src/ternary.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/src/lib.rs b/circuit/types/src/lib.rs index d5af6980e3..4c10089dab 100644 --- a/circuit/types/src/lib.rs +++ b/circuit/types/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -32,7 +33,7 @@ pub mod modules { pub use snarkvm_circuit_types_group::Group; pub use snarkvm_circuit_types_integers as integers; - pub use snarkvm_circuit_types_integers::{I128, I16, I32, I64, I8, U128, U16, U32, U64, U8}; + pub use snarkvm_circuit_types_integers::{I8, I16, I32, I64, I128, U8, U16, U32, U64, U128}; pub use snarkvm_circuit_types_scalar as scalar; pub use snarkvm_circuit_types_scalar::Scalar; diff --git a/circuit/types/string/Cargo.toml b/circuit/types/string/Cargo.toml index 716f2593c2..543c38e74b 100644 --- a/circuit/types/string/Cargo.toml +++ b/circuit/types/string/Cargo.toml @@ -1,32 +1,34 @@ [package] name = "snarkvm-circuit-types-string" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "String circuit for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.console] package = "snarkvm-console-types-string" path = "../../../console/types/string" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-circuit-types-integers] path = "../integers" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/string/build.rs b/circuit/types/string/build.rs index ff14549b2c..1d0fe74e7c 100644 --- a/circuit/types/string/build.rs +++ b/circuit/types/string/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/string/src/equal.rs b/circuit/types/string/src/equal.rs index 74f6fac743..6f0fdc19d6 100644 --- a/circuit/types/string/src/equal.rs +++ b/circuit/types/string/src/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/string/src/helpers/from_bits.rs b/circuit/types/string/src/helpers/from_bits.rs index 8f4822cb85..000c98f8e5 100644 --- a/circuit/types/string/src/helpers/from_bits.rs +++ b/circuit/types/string/src/helpers/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -85,7 +86,7 @@ mod tests { let candidate = StringType::::new(mode, console::StringType::new(&expected)).to_bits_le(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = StringType::::from_bits_le(&candidate); assert_eq!(expected, *candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); @@ -105,7 +106,7 @@ mod tests { let candidate = StringType::::new(mode, console::StringType::new(&expected)).to_bits_be(); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = StringType::::from_bits_be(&candidate); assert_eq!(expected, *candidate.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); diff --git a/circuit/types/string/src/helpers/mod.rs b/circuit/types/string/src/helpers/mod.rs index 10a4036948..b5a7ea8481 100644 --- a/circuit/types/string/src/helpers/mod.rs +++ b/circuit/types/string/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/circuit/types/string/src/helpers/to_bits.rs b/circuit/types/string/src/helpers/to_bits.rs index 7aef96d4d1..4cc4ec32cc 100644 --- a/circuit/types/string/src/helpers/to_bits.rs +++ b/circuit/types/string/src/helpers/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -60,7 +61,7 @@ mod tests { let candidate = StringType::::new(mode, console::StringType::new(&expected)); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_le(); assert_eq!(expected_num_bytes * 8, candidate.len()); @@ -85,7 +86,7 @@ mod tests { let candidate = StringType::::new(mode, console::StringType::new(&expected)); - Circuit::scope(&format!("{mode} {i}"), || { + Circuit::scope(format!("{mode} {i}"), || { let candidate = candidate.to_bits_be(); assert_eq!(expected_num_bytes * 8, candidate.len()); diff --git a/circuit/types/string/src/helpers/to_fields.rs b/circuit/types/string/src/helpers/to_fields.rs index 99c92633a6..ca1017a5f4 100644 --- a/circuit/types/string/src/helpers/to_fields.rs +++ b/circuit/types/string/src/helpers/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -31,7 +32,7 @@ impl ToFields for StringType { mod tests { use super::*; use snarkvm_circuit_environment::Circuit; - use snarkvm_utilities::{bytes_from_bits_le, FromBytes}; + use snarkvm_utilities::{FromBytes, bytes_from_bits_le}; fn native_string_to_fields(string: &str) -> Vec::Network>> { string diff --git a/circuit/types/string/src/lib.rs b/circuit/types/string/src/lib.rs index 7e602fb756..16e6545d88 100644 --- a/circuit/types/string/src/lib.rs +++ b/circuit/types/string/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -37,7 +38,7 @@ pub struct StringType { impl StringTrait for StringType {} -#[cfg(console)] +#[cfg(feature = "console")] impl Inject for StringType { type Primitive = console::StringType; @@ -67,7 +68,7 @@ impl Inject for StringType { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Eject for StringType { type Primitive = console::StringType; @@ -93,7 +94,7 @@ impl Eject for StringType { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Parser for StringType { /// Parses a string into a string circuit. #[inline] @@ -110,7 +111,7 @@ impl Parser for StringType { } } -#[cfg(console)] +#[cfg(feature = "console")] impl FromStr for StringType { type Err = Error; @@ -129,7 +130,7 @@ impl FromStr for StringType { } } -#[cfg(console)] +#[cfg(feature = "console")] impl TypeName for StringType { /// Returns the type name of the circuit as a string. #[inline] @@ -138,14 +139,14 @@ impl TypeName for StringType { } } -#[cfg(console)] +#[cfg(feature = "console")] impl Debug for StringType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Display::fmt(self, f) } } -#[cfg(console)] +#[cfg(feature = "console")] impl Display for StringType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}", self.eject_value(), self.eject_mode()) diff --git a/console/Cargo.toml b/console/Cargo.toml index a860213836..198cb6dd62 100644 --- a/console/Cargo.toml +++ b/console/Cargo.toml @@ -1,39 +1,41 @@ [package] name = "snarkvm-console" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Console environment for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-account] path = "./account" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-algorithms] path = "./algorithms" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-collections] path = "./collections" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-network] path = "./network" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-program] path = "./program" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types] path = "./types" -version = "=0.16.19" +version = "=1.0.0" optional = true [features] diff --git a/console/account/Cargo.toml b/console/account/Cargo.toml index 568551104a..6dead1526e 100644 --- a/console/account/Cargo.toml +++ b/console/account/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-console-account" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Account operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -13,11 +15,11 @@ harness = false [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "address", "boolean", "field", "group", "scalar" ] diff --git a/console/account/benches/account.rs b/console/account/benches/account.rs index ce8b6d7500..b22db044f9 100644 --- a/console/account/benches/account.rs +++ b/console/account/benches/account.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ extern crate criterion; use snarkvm_console_account::{Address, PrivateKey, ViewKey}; -use snarkvm_console_network::{environment::prelude::*, MainnetV0}; +use snarkvm_console_network::{MainnetV0, environment::prelude::*}; use criterion::Criterion; diff --git a/console/account/src/address/mod.rs b/console/account/src/address/mod.rs index 807a00f000..2c644034be 100644 --- a/console/account/src/address/mod.rs +++ b/console/account/src/address/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/address/try_from.rs b/console/account/src/address/try_from.rs index 6080a5009e..4872bfc0d3 100644 --- a/console/account/src/address/try_from.rs +++ b/console/account/src/address/try_from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/bitwise.rs b/console/account/src/compute_key/bitwise.rs index 6a0f014586..d2f7fd2ff7 100644 --- a/console/account/src/compute_key/bitwise.rs +++ b/console/account/src/compute_key/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/bytes.rs b/console/account/src/compute_key/bytes.rs index cd0e64edec..10fbbb982d 100644 --- a/console/account/src/compute_key/bytes.rs +++ b/console/account/src/compute_key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/from_bits.rs b/console/account/src/compute_key/from_bits.rs index 923689ddc3..5f95f23de0 100644 --- a/console/account/src/compute_key/from_bits.rs +++ b/console/account/src/compute_key/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/mod.rs b/console/account/src/compute_key/mod.rs index 5b7e827f7d..b3f980ea08 100644 --- a/console/account/src/compute_key/mod.rs +++ b/console/account/src/compute_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/serialize.rs b/console/account/src/compute_key/serialize.rs index 9089c77a9d..85f61d90d5 100644 --- a/console/account/src/compute_key/serialize.rs +++ b/console/account/src/compute_key/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/size_in_bits.rs b/console/account/src/compute_key/size_in_bits.rs index 0d7993bb0e..7f518cb569 100644 --- a/console/account/src/compute_key/size_in_bits.rs +++ b/console/account/src/compute_key/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/size_in_bytes.rs b/console/account/src/compute_key/size_in_bytes.rs index 68bd892bef..4ab6e4bf18 100644 --- a/console/account/src/compute_key/size_in_bytes.rs +++ b/console/account/src/compute_key/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/to_address.rs b/console/account/src/compute_key/to_address.rs index fc18b59910..efcf7d11b0 100644 --- a/console/account/src/compute_key/to_address.rs +++ b/console/account/src/compute_key/to_address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/to_bits.rs b/console/account/src/compute_key/to_bits.rs index 78536394d4..c1c405c211 100644 --- a/console/account/src/compute_key/to_bits.rs +++ b/console/account/src/compute_key/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/to_fields.rs b/console/account/src/compute_key/to_fields.rs index f111be955b..54b42e173d 100644 --- a/console/account/src/compute_key/to_fields.rs +++ b/console/account/src/compute_key/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/compute_key/try_from.rs b/console/account/src/compute_key/try_from.rs index 591452f87e..b77c1c9c7d 100644 --- a/console/account/src/compute_key/try_from.rs +++ b/console/account/src/compute_key/try_from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/graph_key/bytes.rs b/console/account/src/graph_key/bytes.rs index 8637453dea..ab8ba23d8e 100644 --- a/console/account/src/graph_key/bytes.rs +++ b/console/account/src/graph_key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/graph_key/mod.rs b/console/account/src/graph_key/mod.rs index bff18db0dd..40bd23d987 100644 --- a/console/account/src/graph_key/mod.rs +++ b/console/account/src/graph_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/graph_key/serialize.rs b/console/account/src/graph_key/serialize.rs index 9592af6f03..b622b8e689 100644 --- a/console/account/src/graph_key/serialize.rs +++ b/console/account/src/graph_key/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/graph_key/string.rs b/console/account/src/graph_key/string.rs index 57198c01e6..4739ff42b9 100644 --- a/console/account/src/graph_key/string.rs +++ b/console/account/src/graph_key/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/graph_key/try_from.rs b/console/account/src/graph_key/try_from.rs index 13d95c65be..2ea32b21fd 100644 --- a/console/account/src/graph_key/try_from.rs +++ b/console/account/src/graph_key/try_from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/lib.rs b/console/account/src/lib.rs index c06cea96e5..66ffd4008f 100644 --- a/console/account/src/lib.rs +++ b/console/account/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ #![warn(clippy::cast_possible_truncation)] #![cfg_attr(test, allow(clippy::assertions_on_result_states))] -pub use snarkvm_console_types::{environment::prelude::*, Address, Field, Group, Scalar}; +pub use snarkvm_console_types::{Address, Field, Group, Scalar, environment::prelude::*}; mod address; @@ -49,7 +50,7 @@ pub use view_key::*; #[cfg(test)] mod tests { use crate::{Address, ComputeKey, PrivateKey, Signature, ViewKey}; - use snarkvm_console_network::{prelude::*, MainnetV0}; + use snarkvm_console_network::{MainnetV0, prelude::*}; type CurrentNetwork = MainnetV0; diff --git a/console/account/src/private_key/bytes.rs b/console/account/src/private_key/bytes.rs index 14fe867ef9..3d28ff62de 100644 --- a/console/account/src/private_key/bytes.rs +++ b/console/account/src/private_key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/private_key/mod.rs b/console/account/src/private_key/mod.rs index 612054fe60..34cb60bf82 100644 --- a/console/account/src/private_key/mod.rs +++ b/console/account/src/private_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/private_key/serialize.rs b/console/account/src/private_key/serialize.rs index 44fdf3611f..ff26213c66 100644 --- a/console/account/src/private_key/serialize.rs +++ b/console/account/src/private_key/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/private_key/sign.rs b/console/account/src/private_key/sign.rs index 3ced01a359..374e88aa6b 100644 --- a/console/account/src/private_key/sign.rs +++ b/console/account/src/private_key/sign.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/private_key/string.rs b/console/account/src/private_key/string.rs index f9a9705152..e735f94001 100644 --- a/console/account/src/private_key/string.rs +++ b/console/account/src/private_key/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/private_key/try_from.rs b/console/account/src/private_key/try_from.rs index 16dfce2d13..046694c7fb 100644 --- a/console/account/src/private_key/try_from.rs +++ b/console/account/src/private_key/try_from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/bitwise.rs b/console/account/src/signature/bitwise.rs index edd09082b1..196a146164 100644 --- a/console/account/src/signature/bitwise.rs +++ b/console/account/src/signature/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/bytes.rs b/console/account/src/signature/bytes.rs index 9f3714a7d6..e1712bc091 100644 --- a/console/account/src/signature/bytes.rs +++ b/console/account/src/signature/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/from_bits.rs b/console/account/src/signature/from_bits.rs index 83eebac6ae..9101025d88 100644 --- a/console/account/src/signature/from_bits.rs +++ b/console/account/src/signature/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/mod.rs b/console/account/src/signature/mod.rs index efa92938a6..b688fa93f2 100644 --- a/console/account/src/signature/mod.rs +++ b/console/account/src/signature/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/parse.rs b/console/account/src/signature/parse.rs index 161054709c..e3f3cbc3c6 100644 --- a/console/account/src/signature/parse.rs +++ b/console/account/src/signature/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -112,7 +113,7 @@ mod tests { // Check the string representation. let candidate = format!("{expected}"); assert_eq!(expected, Signature::from_str(&candidate)?); - assert_eq!(SIGNATURE_PREFIX, candidate.to_string().split('1').next().unwrap()); + assert_eq!(SIGNATURE_PREFIX, candidate.split('1').next().unwrap()); } Ok(()) } diff --git a/console/account/src/signature/serialize.rs b/console/account/src/signature/serialize.rs index 623e83b104..04b29661b2 100644 --- a/console/account/src/signature/serialize.rs +++ b/console/account/src/signature/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/sign.rs b/console/account/src/signature/sign.rs index 037425b371..97459a68f8 100644 --- a/console/account/src/signature/sign.rs +++ b/console/account/src/signature/sign.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/size_in_bits.rs b/console/account/src/signature/size_in_bits.rs index 2da01be67f..66a0e53e9f 100644 --- a/console/account/src/signature/size_in_bits.rs +++ b/console/account/src/signature/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/size_in_bytes.rs b/console/account/src/signature/size_in_bytes.rs index 7f1e9dced8..8e7c66e045 100644 --- a/console/account/src/signature/size_in_bytes.rs +++ b/console/account/src/signature/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/to_bits.rs b/console/account/src/signature/to_bits.rs index d7da5ab2ca..a49fa7655e 100644 --- a/console/account/src/signature/to_bits.rs +++ b/console/account/src/signature/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/to_fields.rs b/console/account/src/signature/to_fields.rs index 32763477f2..b061273cdc 100644 --- a/console/account/src/signature/to_fields.rs +++ b/console/account/src/signature/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/signature/verify.rs b/console/account/src/signature/verify.rs index 65247213ab..13e4a962bf 100644 --- a/console/account/src/signature/verify.rs +++ b/console/account/src/signature/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/view_key/bytes.rs b/console/account/src/view_key/bytes.rs index 61631562d6..a0337fe532 100644 --- a/console/account/src/view_key/bytes.rs +++ b/console/account/src/view_key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/view_key/mod.rs b/console/account/src/view_key/mod.rs index 28a02c5d1a..2913ed9207 100644 --- a/console/account/src/view_key/mod.rs +++ b/console/account/src/view_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/view_key/serialize.rs b/console/account/src/view_key/serialize.rs index a49ebf3fea..973b683d66 100644 --- a/console/account/src/view_key/serialize.rs +++ b/console/account/src/view_key/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/view_key/string.rs b/console/account/src/view_key/string.rs index a341c0067d..7a605e3b7e 100644 --- a/console/account/src/view_key/string.rs +++ b/console/account/src/view_key/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/view_key/to_address.rs b/console/account/src/view_key/to_address.rs index 055a040c84..fb5809a42a 100644 --- a/console/account/src/view_key/to_address.rs +++ b/console/account/src/view_key/to_address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/account/src/view_key/try_from.rs b/console/account/src/view_key/try_from.rs index df148f0c66..81e64b701a 100644 --- a/console/account/src/view_key/try_from.rs +++ b/console/account/src/view_key/try_from.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/Cargo.toml b/console/algorithms/Cargo.toml index 575d0c8173..d2f11c6e74 100644 --- a/console/algorithms/Cargo.toml +++ b/console/algorithms/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-console-algorithms" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Console algorithms for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -23,18 +25,18 @@ harness = false [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "field", "group", "integers", "scalar" ] [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.blake2s_simd] version = "1.0" diff --git a/console/algorithms/benches/bhp.rs b/console/algorithms/benches/bhp.rs index d13f4fd63a..2ba3e2b6b9 100644 --- a/console/algorithms/benches/bhp.rs +++ b/console/algorithms/benches/bhp.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,7 +16,7 @@ #[macro_use] extern crate criterion; -use snarkvm_console_algorithms::{BHP1024, BHP256, BHP512, BHP768}; +use snarkvm_console_algorithms::{BHP256, BHP512, BHP768, BHP1024}; use snarkvm_console_types::prelude::*; use snarkvm_utilities::{TestRng, Uniform}; diff --git a/console/algorithms/benches/elligator2.rs b/console/algorithms/benches/elligator2.rs index 055aa977b6..4fc094431c 100644 --- a/console/algorithms/benches/elligator2.rs +++ b/console/algorithms/benches/elligator2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/benches/poseidon.rs b/console/algorithms/benches/poseidon.rs index be7a74b426..71256bd345 100644 --- a/console/algorithms/benches/poseidon.rs +++ b/console/algorithms/benches/poseidon.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/commit.rs b/console/algorithms/src/bhp/commit.rs index 10d19c818d..38fdcf7ce6 100644 --- a/console/algorithms/src/bhp/commit.rs +++ b/console/algorithms/src/bhp/commit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/commit_uncompressed.rs b/console/algorithms/src/bhp/commit_uncompressed.rs index d772973a30..e9950044ec 100644 --- a/console/algorithms/src/bhp/commit_uncompressed.rs +++ b/console/algorithms/src/bhp/commit_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/hash.rs b/console/algorithms/src/bhp/hash.rs index f5e64ecfd7..88ccd14bd2 100644 --- a/console/algorithms/src/bhp/hash.rs +++ b/console/algorithms/src/bhp/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/hash_uncompressed.rs b/console/algorithms/src/bhp/hash_uncompressed.rs index 85d16ec591..5bb1d9d974 100644 --- a/console/algorithms/src/bhp/hash_uncompressed.rs +++ b/console/algorithms/src/bhp/hash_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/hasher/hash_uncompressed.rs b/console/algorithms/src/bhp/hasher/hash_uncompressed.rs index afad77765a..18236a03c8 100644 --- a/console/algorithms/src/bhp/hasher/hash_uncompressed.rs +++ b/console/algorithms/src/bhp/hasher/hash_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/hasher/mod.rs b/console/algorithms/src/bhp/hasher/mod.rs index 929f5be16f..1de1958378 100644 --- a/console/algorithms/src/bhp/hasher/mod.rs +++ b/console/algorithms/src/bhp/hasher/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/bhp/mod.rs b/console/algorithms/src/bhp/mod.rs index 801b0f7fa6..bff928e025 100644 --- a/console/algorithms/src/bhp/mod.rs +++ b/console/algorithms/src/bhp/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/blake2xs/hash_to_curve.rs b/console/algorithms/src/blake2xs/hash_to_curve.rs index afbf7acedf..1fa3e1bbad 100644 --- a/console/algorithms/src/blake2xs/hash_to_curve.rs +++ b/console/algorithms/src/blake2xs/hash_to_curve.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/blake2xs/mod.rs b/console/algorithms/src/blake2xs/mod.rs index 8ebc5bf1c6..af4e6a7239 100644 --- a/console/algorithms/src/blake2xs/mod.rs +++ b/console/algorithms/src/blake2xs/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/elligator2/decode.rs b/console/algorithms/src/elligator2/decode.rs index fcfb8a0086..500ef7aec0 100644 --- a/console/algorithms/src/elligator2/decode.rs +++ b/console/algorithms/src/elligator2/decode.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/elligator2/encode.rs b/console/algorithms/src/elligator2/encode.rs index ea9110830f..d1b800aa39 100644 --- a/console/algorithms/src/elligator2/encode.rs +++ b/console/algorithms/src/elligator2/encode.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/elligator2/mod.rs b/console/algorithms/src/elligator2/mod.rs index 16c09b83a9..8b7792c355 100644 --- a/console/algorithms/src/elligator2/mod.rs +++ b/console/algorithms/src/elligator2/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/keccak/hash.rs b/console/algorithms/src/keccak/hash.rs index 52dc3ecb29..afd3ddced1 100644 --- a/console/algorithms/src/keccak/hash.rs +++ b/console/algorithms/src/keccak/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/keccak/mod.rs b/console/algorithms/src/keccak/mod.rs index b1c54e931a..f1fc3efe02 100644 --- a/console/algorithms/src/keccak/mod.rs +++ b/console/algorithms/src/keccak/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/lib.rs b/console/algorithms/src/lib.rs index 9c6c5e13dc..44df2a4007 100644 --- a/console/algorithms/src/lib.rs +++ b/console/algorithms/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ pub use snarkvm_console_types::prelude::*; pub mod bhp; -pub use bhp::{BHP, BHP1024, BHP256, BHP512, BHP768}; +pub use bhp::{BHP, BHP256, BHP512, BHP768, BHP1024}; mod blake2xs; pub use blake2xs::Blake2Xs; @@ -32,7 +33,7 @@ mod keccak; pub use keccak::*; mod pedersen; -pub use pedersen::{Pedersen, Pedersen128, Pedersen64}; +pub use pedersen::{Pedersen, Pedersen64, Pedersen128}; mod poseidon; pub use poseidon::{Poseidon, Poseidon2, Poseidon4, Poseidon8}; diff --git a/console/algorithms/src/pedersen/commit.rs b/console/algorithms/src/pedersen/commit.rs index 66575599f5..0311a481fe 100644 --- a/console/algorithms/src/pedersen/commit.rs +++ b/console/algorithms/src/pedersen/commit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/pedersen/commit_uncompressed.rs b/console/algorithms/src/pedersen/commit_uncompressed.rs index 519b0656d6..14203457bf 100644 --- a/console/algorithms/src/pedersen/commit_uncompressed.rs +++ b/console/algorithms/src/pedersen/commit_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/pedersen/hash.rs b/console/algorithms/src/pedersen/hash.rs index e9fc9885ec..0718b135f5 100644 --- a/console/algorithms/src/pedersen/hash.rs +++ b/console/algorithms/src/pedersen/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/pedersen/hash_uncompressed.rs b/console/algorithms/src/pedersen/hash_uncompressed.rs index 9bac454ac1..70fcc01b60 100644 --- a/console/algorithms/src/pedersen/hash_uncompressed.rs +++ b/console/algorithms/src/pedersen/hash_uncompressed.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/pedersen/mod.rs b/console/algorithms/src/pedersen/mod.rs index 349a8d2c2c..ceeee73dab 100644 --- a/console/algorithms/src/pedersen/mod.rs +++ b/console/algorithms/src/pedersen/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/poseidon/hash.rs b/console/algorithms/src/poseidon/hash.rs index aef86d3ae2..bedaf4e54e 100644 --- a/console/algorithms/src/poseidon/hash.rs +++ b/console/algorithms/src/poseidon/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/poseidon/hash_many.rs b/console/algorithms/src/poseidon/hash_many.rs index fa789d900e..df516db2bd 100644 --- a/console/algorithms/src/poseidon/hash_many.rs +++ b/console/algorithms/src/poseidon/hash_many.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/poseidon/hash_to_group.rs b/console/algorithms/src/poseidon/hash_to_group.rs index 746e5612bd..399d8e5225 100644 --- a/console/algorithms/src/poseidon/hash_to_group.rs +++ b/console/algorithms/src/poseidon/hash_to_group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/poseidon/hash_to_scalar.rs b/console/algorithms/src/poseidon/hash_to_scalar.rs index 5042d130dd..cfe8eb1460 100644 --- a/console/algorithms/src/poseidon/hash_to_scalar.rs +++ b/console/algorithms/src/poseidon/hash_to_scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/algorithms/src/poseidon/helpers/mod.rs b/console/algorithms/src/poseidon/helpers/mod.rs index 1f33f86842..afa0964b89 100644 --- a/console/algorithms/src/poseidon/helpers/mod.rs +++ b/console/algorithms/src/poseidon/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,7 +19,7 @@ pub(super) use sponge::*; mod state; pub(super) use state::*; -use snarkvm_console_types::{prelude::*, Field}; +use snarkvm_console_types::{Field, prelude::*}; use smallvec::SmallVec; diff --git a/console/algorithms/src/poseidon/helpers/sponge.rs b/console/algorithms/src/poseidon/helpers/sponge.rs index 92fd0b626c..7d005868f6 100644 --- a/console/algorithms/src/poseidon/helpers/sponge.rs +++ b/console/algorithms/src/poseidon/helpers/sponge.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::poseidon::{ - helpers::{AlgebraicSponge, DuplexSpongeMode}, State, + helpers::{AlgebraicSponge, DuplexSpongeMode}, }; -use snarkvm_console_types::{prelude::*, Field}; +use snarkvm_console_types::{Field, prelude::*}; use snarkvm_fields::PoseidonParameters; use smallvec::SmallVec; diff --git a/console/algorithms/src/poseidon/helpers/state.rs b/console/algorithms/src/poseidon/helpers/state.rs index 08896fdb53..083789b1ac 100644 --- a/console/algorithms/src/poseidon/helpers/state.rs +++ b/console/algorithms/src/poseidon/helpers/state.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_console_types::{prelude::*, Field}; +use snarkvm_console_types::{Field, prelude::*}; use core::ops::{Index, IndexMut, Range}; diff --git a/console/algorithms/src/poseidon/mod.rs b/console/algorithms/src/poseidon/mod.rs index c780dc9dbd..ca5da7f42a 100644 --- a/console/algorithms/src/poseidon/mod.rs +++ b/console/algorithms/src/poseidon/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ mod hash_to_group; mod hash_to_scalar; mod prf; -use crate::{poseidon::helpers::*, Elligator2}; +use crate::{Elligator2, poseidon::helpers::*}; use snarkvm_console_types::prelude::*; use snarkvm_fields::{PoseidonDefaultField, PoseidonParameters}; diff --git a/console/algorithms/src/poseidon/prf.rs b/console/algorithms/src/poseidon/prf.rs index 8b71fdb5d9..405e8f43ec 100644 --- a/console/algorithms/src/poseidon/prf.rs +++ b/console/algorithms/src/poseidon/prf.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/Cargo.toml b/console/collections/Cargo.toml index c853649f27..3d0f60dfce 100644 --- a/console/collections/Cargo.toml +++ b/console/collections/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-console-collections" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Collections for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -18,11 +20,11 @@ harness = false [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "field", "integers" ] diff --git a/console/collections/benches/kary_merkle_tree.rs b/console/collections/benches/kary_merkle_tree.rs index 0ce72772c8..fe2e4e0840 100644 --- a/console/collections/benches/kary_merkle_tree.rs +++ b/console/collections/benches/kary_merkle_tree.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,8 +19,8 @@ extern crate criterion; use snarkvm_console_algorithms::Sha3_256; use snarkvm_console_collections::kary_merkle_tree::KaryMerkleTree; use snarkvm_console_network::{ - prelude::{TestRng, ToBits, Uniform}, MainnetV0, + prelude::{TestRng, ToBits, Uniform}, }; use snarkvm_console_types::Field; diff --git a/console/collections/benches/merkle_tree.rs b/console/collections/benches/merkle_tree.rs index ec15aee461..e1cd6289b2 100644 --- a/console/collections/benches/merkle_tree.rs +++ b/console/collections/benches/merkle_tree.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,9 +17,9 @@ extern crate criterion; use snarkvm_console_network::{ - prelude::{TestRng, ToBits, Uniform}, MainnetV0, Network, + prelude::{TestRng, ToBits, Uniform}, }; use snarkvm_console_types::Field; @@ -163,12 +164,12 @@ fn update_vs_update_many(c: &mut Criterion) { let index = index % num_leaves; let new_leaf = generate_leaves!(1, &mut rng).pop().unwrap(); // Benchmark the standard update operation. - group.bench_with_input(BenchmarkId::new("Single", &format!("{depth}")), &new_leaf, |b, new_leaf| { + group.bench_with_input(BenchmarkId::new("Single", format!("{depth}")), &new_leaf, |b, new_leaf| { b.iter_batched(|| tree.clone(), |mut tree| tree.update(index, new_leaf), BatchSize::SmallInput) }); // Benchmark the `update_many` operation. group.bench_with_input( - BenchmarkId::new("Batch", &format!("{depth}")), + BenchmarkId::new("Batch", format!("{depth}")), &BTreeMap::from([(index, new_leaf)]), |b, updates| b.iter_batched(|| tree.clone(), |mut tree| tree.update_many(updates), BatchSize::SmallInput), ); diff --git a/console/collections/src/kary_merkle_tree/helpers/leaf_hash.rs b/console/collections/src/kary_merkle_tree/helpers/leaf_hash.rs index a48486e371..cfcd566dd4 100644 --- a/console/collections/src/kary_merkle_tree/helpers/leaf_hash.rs +++ b/console/collections/src/kary_merkle_tree/helpers/leaf_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_console_algorithms::{Keccak, Poseidon, BHP}; +use snarkvm_console_algorithms::{BHP, Keccak, Poseidon}; use snarkvm_console_types::prelude::*; use crate::kary_merkle_tree::BooleanHash; diff --git a/console/collections/src/kary_merkle_tree/helpers/mod.rs b/console/collections/src/kary_merkle_tree/helpers/mod.rs index df71d870df..1d06917d43 100644 --- a/console/collections/src/kary_merkle_tree/helpers/mod.rs +++ b/console/collections/src/kary_merkle_tree/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/kary_merkle_tree/helpers/path_hash.rs b/console/collections/src/kary_merkle_tree/helpers/path_hash.rs index 85ca8f5924..5998e3c688 100644 --- a/console/collections/src/kary_merkle_tree/helpers/path_hash.rs +++ b/console/collections/src/kary_merkle_tree/helpers/path_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::BooleanHash; -use snarkvm_console_algorithms::{Keccak, Poseidon, BHP}; +use snarkvm_console_algorithms::{BHP, Keccak, Poseidon}; use snarkvm_console_types::prelude::*; #[cfg(not(feature = "serial"))] diff --git a/console/collections/src/kary_merkle_tree/mod.rs b/console/collections/src/kary_merkle_tree/mod.rs index 3ee7eaf113..5b05a7672a 100644 --- a/console/collections/src/kary_merkle_tree/mod.rs +++ b/console/collections/src/kary_merkle_tree/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/kary_merkle_tree/path/mod.rs b/console/collections/src/kary_merkle_tree/path/mod.rs index 3fa0f4a354..f3dedfccdf 100644 --- a/console/collections/src/kary_merkle_tree/path/mod.rs +++ b/console/collections/src/kary_merkle_tree/path/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/kary_merkle_tree/tests/mod.rs b/console/collections/src/kary_merkle_tree/tests/mod.rs index 10a99f6a0f..4ee1a09cb2 100644 --- a/console/collections/src/kary_merkle_tree/tests/mod.rs +++ b/console/collections/src/kary_merkle_tree/tests/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_console_algorithms::{Keccak256, Poseidon, Sha3_256, BHP1024, BHP512}; +use snarkvm_console_algorithms::{BHP512, BHP1024, Keccak256, Poseidon, Sha3_256}; use snarkvm_console_types::prelude::Console; type CurrentEnvironment = Console; diff --git a/console/collections/src/lib.rs b/console/collections/src/lib.rs index 2e44497dbc..06094faab2 100644 --- a/console/collections/src/lib.rs +++ b/console/collections/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/merkle_tree/helpers/leaf_hash.rs b/console/collections/src/merkle_tree/helpers/leaf_hash.rs index 11cd1fc04f..c0cac0875d 100644 --- a/console/collections/src/merkle_tree/helpers/leaf_hash.rs +++ b/console/collections/src/merkle_tree/helpers/leaf_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_console_algorithms::{Poseidon, BHP}; +use snarkvm_console_algorithms::{BHP, Poseidon}; use snarkvm_console_types::prelude::*; #[cfg(not(feature = "serial"))] diff --git a/console/collections/src/merkle_tree/helpers/mod.rs b/console/collections/src/merkle_tree/helpers/mod.rs index f4a8b75691..cfcfd418cb 100644 --- a/console/collections/src/merkle_tree/helpers/mod.rs +++ b/console/collections/src/merkle_tree/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/merkle_tree/helpers/path_hash.rs b/console/collections/src/merkle_tree/helpers/path_hash.rs index fc9841672c..b026beb77a 100644 --- a/console/collections/src/merkle_tree/helpers/path_hash.rs +++ b/console/collections/src/merkle_tree/helpers/path_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_console_algorithms::{Poseidon, BHP}; +use snarkvm_console_algorithms::{BHP, Poseidon}; use snarkvm_console_types::prelude::*; #[cfg(not(feature = "serial"))] diff --git a/console/collections/src/merkle_tree/mod.rs b/console/collections/src/merkle_tree/mod.rs index cf3d2aeb61..e4fa6e7037 100644 --- a/console/collections/src/merkle_tree/mod.rs +++ b/console/collections/src/merkle_tree/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/merkle_tree/path/mod.rs b/console/collections/src/merkle_tree/path/mod.rs index b7dbcf47b8..d69e6066f9 100644 --- a/console/collections/src/merkle_tree/path/mod.rs +++ b/console/collections/src/merkle_tree/path/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/merkle_tree/tests/append.rs b/console/collections/src/merkle_tree/tests/append.rs index 41c21102fa..acb5230600 100644 --- a/console/collections/src/merkle_tree/tests/append.rs +++ b/console/collections/src/merkle_tree/tests/append.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_console_algorithms::{Poseidon, BHP1024, BHP512}; +use snarkvm_console_algorithms::{BHP512, BHP1024, Poseidon}; use snarkvm_console_types::prelude::Console; type CurrentEnvironment = Console; diff --git a/console/collections/src/merkle_tree/tests/mod.rs b/console/collections/src/merkle_tree/tests/mod.rs index 81e53307a8..f09bb19eba 100644 --- a/console/collections/src/merkle_tree/tests/mod.rs +++ b/console/collections/src/merkle_tree/tests/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/collections/src/merkle_tree/tests/remove.rs b/console/collections/src/merkle_tree/tests/remove.rs index f7f737437f..317c2b53cb 100644 --- a/console/collections/src/merkle_tree/tests/remove.rs +++ b/console/collections/src/merkle_tree/tests/remove.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_console_algorithms::{Poseidon, BHP1024, BHP512}; +use snarkvm_console_algorithms::{BHP512, BHP1024, Poseidon}; use snarkvm_console_types::prelude::Console; type CurrentEnvironment = Console; diff --git a/console/collections/src/merkle_tree/tests/update.rs b/console/collections/src/merkle_tree/tests/update.rs index cf3f81f71e..7e82045862 100644 --- a/console/collections/src/merkle_tree/tests/update.rs +++ b/console/collections/src/merkle_tree/tests/update.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_console_algorithms::{Poseidon, BHP1024, BHP512}; +use snarkvm_console_algorithms::{BHP512, BHP1024, Poseidon}; use snarkvm_console_types::prelude::Console; use indexmap::IndexMap; diff --git a/console/collections/src/merkle_tree/tests/update_many.rs b/console/collections/src/merkle_tree/tests/update_many.rs index b09a417716..9890777b26 100644 --- a/console/collections/src/merkle_tree/tests/update_many.rs +++ b/console/collections/src/merkle_tree/tests/update_many.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use super::*; -use snarkvm_console_algorithms::{Poseidon, BHP1024, BHP512}; +use snarkvm_console_algorithms::{BHP512, BHP1024, Poseidon}; use snarkvm_console_types::prelude::Console; use indexmap::IndexMap; diff --git a/console/network/Cargo.toml b/console/network/Cargo.toml index 551bd13eee..6632c3711e 100644 --- a/console/network/Cargo.toml +++ b/console/network/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-console-network" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Network console library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -12,49 +14,49 @@ wasm = [ "snarkvm-algorithms/polycommit_wasm", "snarkvm-parameters/wasm" ] -test = [] +test = [ ] [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "snark" ] [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-network-environment] path = "./environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "field", "group", "scalar" ] [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-parameters] path = "../../parameters" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.anyhow] version = "1.0.73" diff --git a/console/network/environment/Cargo.toml b/console/network/environment/Cargo.toml index 63b459700f..53bf99a9b0 100644 --- a/console/network/environment/Cargo.toml +++ b/console/network/environment/Cargo.toml @@ -1,24 +1,26 @@ [package] name = "snarkvm-console-network-environment" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Environment console library for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-curves] path = "../../../curves" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-fields] path = "../../../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-utilities] path = "../../../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.anyhow] version = "1.0.73" diff --git a/console/network/environment/src/environment.rs b/console/network/environment/src/environment.rs index a5b87438a0..d675b6c71f 100644 --- a/console/network/environment/src/environment.rs +++ b/console/network/environment/src/environment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,13 +15,13 @@ use crate::prelude::{Deserialize, DeserializeOwned, Serialize}; use snarkvm_curves::{ - bls12_377::Bls12_377, - edwards_bls12::{EdwardsAffine, EdwardsParameters}, AffineCurve, MontgomeryParameters, PairingEngine, ProjectiveCurve, TwistedEdwardsParameters, + bls12_377::Bls12_377, + edwards_bls12::{EdwardsAffine, EdwardsParameters}, }; use snarkvm_fields::{PrimeField, SquareRootField}; use snarkvm_utilities::BigInteger; diff --git a/console/network/environment/src/helpers/mod.rs b/console/network/environment/src/helpers/mod.rs index 40505277ec..ad4cdb2ae7 100644 --- a/console/network/environment/src/helpers/mod.rs +++ b/console/network/environment/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/helpers/or_halt.rs b/console/network/environment/src/helpers/or_halt.rs index 7312e977c0..a241b4b42b 100644 --- a/console/network/environment/src/helpers/or_halt.rs +++ b/console/network/environment/src/helpers/or_halt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/helpers/sanitizer.rs b/console/network/environment/src/helpers/sanitizer.rs index bceed0e0b1..2da244374b 100644 --- a/console/network/environment/src/helpers/sanitizer.rs +++ b/console/network/environment/src/helpers/sanitizer.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{string_parser::is_char_supported, ParserResult}; +use crate::{ParserResult, string_parser::is_char_supported}; use nom::{ branch::alt, diff --git a/console/network/environment/src/helpers/variable_length.rs b/console/network/environment/src/helpers/variable_length.rs index 2a8115e421..63d94b9aac 100644 --- a/console/network/environment/src/helpers/variable_length.rs +++ b/console/network/environment/src/helpers/variable_length.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use snarkvm_utilities::{ + FromBytes, error, io::{Read, Result as IoResult}, - FromBytes, }; /// Returns the variable length integer of the given value. diff --git a/console/network/environment/src/lib.rs b/console/network/environment/src/lib.rs index 454a33b44f..cfd4ec6452 100644 --- a/console/network/environment/src/lib.rs +++ b/console/network/environment/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -29,6 +30,7 @@ pub mod prelude { environment::*, helpers::*, traits::{ + ToBits, algorithms::*, arithmetic::*, bitwise::*, @@ -53,13 +55,22 @@ pub mod prelude { *, }, visibility::*, - ToBits, }, }; pub use snarkvm_curves::{AffineCurve, MontgomeryParameters, ProjectiveCurve, TwistedEdwardsParameters}; pub use snarkvm_fields::{Field as _, PrimeField as _, SquareRootField as _, Zero as _}; pub use snarkvm_utilities::{ + DeserializeExt, + FromBits as _, + FromBytes, + FromBytesDeserializer, + LimitedWriter, + TestRng, + ToBits as _, + ToBytes, + ToBytesSerializer, + Uniform, cfg_chunks, cfg_find, cfg_find_map, @@ -72,16 +83,6 @@ pub mod prelude { error, has_duplicates, io::{Read, Result as IoResult, Write}, - DeserializeExt, - FromBits as _, - FromBytes, - FromBytesDeserializer, - LimitedWriter, - TestRng, - ToBits as _, - ToBytes, - ToBytesSerializer, - Uniform, }; pub use core::{ @@ -118,7 +119,7 @@ pub mod prelude { str::{self, FromStr}, }; - pub use anyhow::{anyhow, bail, ensure, Error, Result}; + pub use anyhow::{Error, Result, anyhow, bail, ensure}; pub use bech32::{self, FromBase32, ToBase32}; pub use itertools::Itertools; pub use nom::{ @@ -131,17 +132,17 @@ pub mod prelude { }; pub use num_traits::{AsPrimitive, One, Pow, Zero}; pub use rand::{ - distributions::{Alphanumeric, Distribution, Standard}, CryptoRng, Rng, + distributions::{Alphanumeric, Distribution, Standard}, }; pub use serde::{ - de, - de::{DeserializeOwned, EnumAccess, MapAccess, SeqAccess, VariantAccess, Visitor}, - ser::{self, SerializeSeq, SerializeStruct}, Deserialize, Deserializer, Serialize, Serializer, + de, + de::{DeserializeOwned, EnumAccess, MapAccess, SeqAccess, VariantAccess, Visitor}, + ser::{self, SerializeSeq, SerializeStruct}, }; } diff --git a/console/network/environment/src/traits/algorithms.rs b/console/network/environment/src/traits/algorithms.rs index 378f78d325..d486cd8c78 100644 --- a/console/network/environment/src/traits/algorithms.rs +++ b/console/network/environment/src/traits/algorithms.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/arithmetic.rs b/console/network/environment/src/traits/arithmetic.rs index d3f516994c..677efe5bae 100644 --- a/console/network/environment/src/traits/arithmetic.rs +++ b/console/network/environment/src/traits/arithmetic.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/bitwise.rs b/console/network/environment/src/traits/bitwise.rs index b499132fb9..7aaac6644b 100644 --- a/console/network/environment/src/traits/bitwise.rs +++ b/console/network/environment/src/traits/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/from_bits.rs b/console/network/environment/src/traits/from_bits.rs index eab07e64f9..1fbbd94846 100644 --- a/console/network/environment/src/traits/from_bits.rs +++ b/console/network/environment/src/traits/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/from_field.rs b/console/network/environment/src/traits/from_field.rs index 6d3b3bd072..aaf537c40f 100644 --- a/console/network/environment/src/traits/from_field.rs +++ b/console/network/environment/src/traits/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/mod.rs b/console/network/environment/src/traits/mod.rs index aaeb41611f..125b4000c7 100644 --- a/console/network/environment/src/traits/mod.rs +++ b/console/network/environment/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -pub use snarkvm_utilities::{to_bits_le, ToBits}; +pub use snarkvm_utilities::{ToBits, to_bits_le}; pub mod algorithms; pub use algorithms::*; diff --git a/console/network/environment/src/traits/parse.rs b/console/network/environment/src/traits/parse.rs index 7c8dbd6f7c..b5931b3d4a 100644 --- a/console/network/environment/src/traits/parse.rs +++ b/console/network/environment/src/traits/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use nom::{ - error::{convert_error, VerboseError}, Err as NomErr, IResult, + error::{VerboseError, convert_error}, }; /// The `nom`-compatible parser return type. diff --git a/console/network/environment/src/traits/parse_string.rs b/console/network/environment/src/traits/parse_string.rs index 64df8531a1..854f9731fa 100644 --- a/console/network/environment/src/traits/parse_string.rs +++ b/console/network/environment/src/traits/parse_string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,18 +15,19 @@ /// From https://github.com/Geal/nom/blob/main/examples/string.rs pub mod string_parser { - //! This example shows an example of how to parse an escaped string. The - //! rules for the string are similar to JSON and rust. A string is: - //! - //! - Enclosed by double quotes - //! - Can contain any raw unescaped code point besides \ and " - //! - Matches the following escape sequences: \b, \f, \n, \r, \t, \", \\, \/ - //! - Matches code points like Rust: \u{XXXX}, where XXXX can be up to 6 - //! hex characters - //! - an escape followed by whitespace consumes all whitespace between the - //! escape and the next non-whitespace character - + /// This example shows an example of how to parse an escaped string. The + /// rules for the string are similar to JSON and rust. A string is: + /// + /// - Enclosed by double quotes + /// - Can contain any raw unescaped code point besides \ and " + /// - Matches the following escape sequences: \b, \f, \n, \r, \t, \", \\, \/ + /// - Matches code points like Rust: \u{XXXX}, where XXXX can be up to 6 + /// hex characters + /// - an escape followed by whitespace consumes all whitespace between the + /// escape and the next non-whitespace character use nom::{ + Err::Error, + IResult, branch::alt, bytes::streaming::{is_not, take_while_m_n}, character::streaming::{char, multispace1}, @@ -33,8 +35,6 @@ pub mod string_parser { error::{ErrorKind, FromExternalError, ParseError}, multi::fold_many0, sequence::{delimited, preceded}, - Err::Error, - IResult, }; /// Checks for supported code points. diff --git a/console/network/environment/src/traits/to_field.rs b/console/network/environment/src/traits/to_field.rs index 40c39c379b..324114117c 100644 --- a/console/network/environment/src/traits/to_field.rs +++ b/console/network/environment/src/traits/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/type_name.rs b/console/network/environment/src/traits/type_name.rs index 7e25a89613..d9ef32ff57 100644 --- a/console/network/environment/src/traits/type_name.rs +++ b/console/network/environment/src/traits/type_name.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/types.rs b/console/network/environment/src/traits/types.rs index a57bc0aa84..273304eed0 100644 --- a/console/network/environment/src/traits/types.rs +++ b/console/network/environment/src/traits/types.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/environment/src/traits/visibility.rs b/console/network/environment/src/traits/visibility.rs index 24f9667c0b..bd4745ac8c 100644 --- a/console/network/environment/src/traits/visibility.rs +++ b/console/network/environment/src/traits/visibility.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/src/canary_v0.rs b/console/network/src/canary_v0.rs index 1fb44dbb4a..f0a973acd9 100644 --- a/console/network/src/canary_v0.rs +++ b/console/network/src/canary_v0.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,22 +16,22 @@ use super::*; use crate::TRANSACTION_PREFIX; use snarkvm_console_algorithms::{ + BHP256, + BHP512, + BHP768, + BHP1024, Blake2Xs, Keccak256, Keccak384, Keccak512, - Pedersen128, Pedersen64, + Pedersen128, Poseidon2, Poseidon4, Poseidon8, Sha3_256, Sha3_384, Sha3_512, - BHP1024, - BHP256, - BHP512, - BHP768, }; lazy_static! { @@ -129,6 +130,8 @@ impl Network for CanaryV0 { type TransactionID = AleoID, { hrp2!(TRANSACTION_PREFIX) }>; /// The transition ID type. type TransitionID = AleoID, { hrp2!("au") }>; + /// The transmission checksum type. + type TransmissionChecksum = u128; /// The network edition. const EDITION: u16 = 0; diff --git a/console/network/src/helpers/id.rs b/console/network/src/helpers/id.rs index 77d3ae6056..a7d20b5e3b 100644 --- a/console/network/src/helpers/id.rs +++ b/console/network/src/helpers/id.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use crate::prelude::*; use anyhow::Result; use bech32::{self, FromBase32, ToBase32}; -use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; use std::borrow::Borrow; pub trait Bech32ID: diff --git a/console/network/src/helpers/mod.rs b/console/network/src/helpers/mod.rs index bd239df4d4..5e5f6124f3 100644 --- a/console/network/src/helpers/mod.rs +++ b/console/network/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/network/src/helpers/object.rs b/console/network/src/helpers/object.rs index fbffb39e35..2771858872 100644 --- a/console/network/src/helpers/object.rs +++ b/console/network/src/helpers/object.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use crate::prelude::*; use anyhow::Result; use bech32::{self, FromBase32, ToBase32}; -use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; use std::borrow::Borrow; pub trait Bech32Object: diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 80c392e097..099044f171 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -35,17 +36,17 @@ mod testnet_v0; pub use testnet_v0::*; pub mod prelude { - pub use crate::{environment::prelude::*, Network}; + pub use crate::{Network, environment::prelude::*}; } use crate::environment::prelude::*; use snarkvm_algorithms::{ + AlgebraicSponge, crypto_hash::PoseidonSponge, snark::varuna::{CircuitProvingKey, CircuitVerifyingKey, VarunaHidingMode}, srs::{UniversalProver, UniversalVerifier}, - AlgebraicSponge, }; -use snarkvm_console_algorithms::{Poseidon2, Poseidon4, BHP1024, BHP512}; +use snarkvm_console_algorithms::{BHP512, BHP1024, Poseidon2, Poseidon4}; use snarkvm_console_collections::merkle_tree::{MerklePath, MerkleTree}; use snarkvm_console_types::{Field, Group, Scalar}; use snarkvm_curves::PairingEngine; @@ -215,6 +216,8 @@ pub trait Network: type TransactionID: Bech32ID>; /// The transition ID type. type TransitionID: Bech32ID>; + /// The transmission checksum type. + type TransmissionChecksum: IntegerType; /// Returns the genesis block bytes. fn genesis_bytes() -> &'static [u8]; diff --git a/console/network/src/mainnet_v0.rs b/console/network/src/mainnet_v0.rs index 16640a0d43..6aadaa3f38 100644 --- a/console/network/src/mainnet_v0.rs +++ b/console/network/src/mainnet_v0.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,22 +15,22 @@ use super::*; use snarkvm_console_algorithms::{ + BHP256, + BHP512, + BHP768, + BHP1024, Blake2Xs, Keccak256, Keccak384, Keccak512, - Pedersen128, Pedersen64, + Pedersen128, Poseidon2, Poseidon4, Poseidon8, Sha3_256, Sha3_384, Sha3_512, - BHP1024, - BHP256, - BHP512, - BHP768, }; lazy_static! { @@ -130,6 +131,8 @@ impl Network for MainnetV0 { type TransactionID = AleoID, { hrp2!(TRANSACTION_PREFIX) }>; /// The transition ID type. type TransitionID = AleoID, { hrp2!("au") }>; + /// The transmission checksum type. + type TransmissionChecksum = u128; /// The network edition. const EDITION: u16 = 0; @@ -148,13 +151,13 @@ impl Network for MainnetV0 { #[cfg(feature = "test")] const GENESIS_PROOF_TARGET: u64 = 1u64 << 3; /// The fixed timestamp of the genesis block. - const GENESIS_TIMESTAMP: i64 = 1696118400 /* 2023-10-01 00:00:00 UTC */; + const GENESIS_TIMESTAMP: i64 = 1725462000 /* 2024-09-04 11:00:00 UTC */; /// The network ID. const ID: u16 = 0; /// The function name for the inclusion circuit. const INCLUSION_FUNCTION_NAME: &'static str = snarkvm_parameters::mainnet::NETWORK_INCLUSION_FUNCTION_NAME; /// The maximum number of certificates in a batch. - const MAX_CERTIFICATES: u16 = 15; + const MAX_CERTIFICATES: u16 = 16; /// The network name. const NAME: &'static str = "Aleo Mainnet (v0)"; diff --git a/console/network/src/testnet_v0.rs b/console/network/src/testnet_v0.rs index a33c96f0ad..fd793055a4 100644 --- a/console/network/src/testnet_v0.rs +++ b/console/network/src/testnet_v0.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,22 +16,22 @@ use super::*; use crate::TRANSACTION_PREFIX; use snarkvm_console_algorithms::{ + BHP256, + BHP512, + BHP768, + BHP1024, Blake2Xs, Keccak256, Keccak384, Keccak512, - Pedersen128, Pedersen64, + Pedersen128, Poseidon2, Poseidon4, Poseidon8, Sha3_256, Sha3_384, Sha3_512, - BHP1024, - BHP256, - BHP512, - BHP768, }; lazy_static! { @@ -129,6 +130,8 @@ impl Network for TestnetV0 { type TransactionID = AleoID, { hrp2!(TRANSACTION_PREFIX) }>; /// The transition ID type. type TransitionID = AleoID, { hrp2!("au") }>; + /// The transmission checksum type. + type TransmissionChecksum = u128; /// The network edition. const EDITION: u16 = 0; diff --git a/console/program/Cargo.toml b/console/program/Cargo.toml index 8f20c2f8ee..bff029e6d6 100644 --- a/console/program/Cargo.toml +++ b/console/program/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-console-program" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Program operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -12,27 +14,27 @@ test = [ ] [dependencies.snarkvm-console-account] path = "../account" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.enum_index] version = "0.2" diff --git a/console/program/src/data/access/bytes.rs b/console/program/src/data/access/bytes.rs index 561c4c04e1..13dde1b46f 100644 --- a/console/program/src/data/access/bytes.rs +++ b/console/program/src/data/access/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/access/mod.rs b/console/program/src/data/access/mod.rs index f2d3f56827..ddedaa6de1 100644 --- a/console/program/src/data/access/mod.rs +++ b/console/program/src/data/access/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/access/parse.rs b/console/program/src/data/access/parse.rs index 8c5ff6c3a3..7d4def4593 100644 --- a/console/program/src/data/access/parse.rs +++ b/console/program/src/data/access/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/access/serialize.rs b/console/program/src/data/access/serialize.rs index 8a48e236ea..50daa1c745 100644 --- a/console/program/src/data/access/serialize.rs +++ b/console/program/src/data/access/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/bytes.rs b/console/program/src/data/ciphertext/bytes.rs index 80b0c2d6d8..28d8214405 100644 --- a/console/program/src/data/ciphertext/bytes.rs +++ b/console/program/src/data/ciphertext/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/decrypt.rs b/console/program/src/data/ciphertext/decrypt.rs index 5b10d4a9be..95db6025db 100644 --- a/console/program/src/data/ciphertext/decrypt.rs +++ b/console/program/src/data/ciphertext/decrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/equal.rs b/console/program/src/data/ciphertext/equal.rs index 31bbd5fffc..2c3a1db1da 100644 --- a/console/program/src/data/ciphertext/equal.rs +++ b/console/program/src/data/ciphertext/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/from_bits.rs b/console/program/src/data/ciphertext/from_bits.rs index 45c818a82e..b143c22e49 100644 --- a/console/program/src/data/ciphertext/from_bits.rs +++ b/console/program/src/data/ciphertext/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/from_fields.rs b/console/program/src/data/ciphertext/from_fields.rs index 2d01debc66..e5eb336ee5 100644 --- a/console/program/src/data/ciphertext/from_fields.rs +++ b/console/program/src/data/ciphertext/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/mod.rs b/console/program/src/data/ciphertext/mod.rs index 344ec2c256..bcc4877a22 100644 --- a/console/program/src/data/ciphertext/mod.rs +++ b/console/program/src/data/ciphertext/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/num_randomizers.rs b/console/program/src/data/ciphertext/num_randomizers.rs index f5af31439c..ee503849be 100644 --- a/console/program/src/data/ciphertext/num_randomizers.rs +++ b/console/program/src/data/ciphertext/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/parse.rs b/console/program/src/data/ciphertext/parse.rs index 185a8b2c29..693b84fc25 100644 --- a/console/program/src/data/ciphertext/parse.rs +++ b/console/program/src/data/ciphertext/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -113,7 +114,7 @@ mod tests { // Check the string representation. let candidate = format!("{expected}"); assert_eq!(expected, Ciphertext::from_str(&candidate)?); - assert_eq!(CIPHERTEXT_PREFIX, candidate.to_string().split('1').next().unwrap()); + assert_eq!(CIPHERTEXT_PREFIX, candidate.split('1').next().unwrap()); } Ok(()) } diff --git a/console/program/src/data/ciphertext/serialize.rs b/console/program/src/data/ciphertext/serialize.rs index 318fe2998b..09740f25ae 100644 --- a/console/program/src/data/ciphertext/serialize.rs +++ b/console/program/src/data/ciphertext/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/size_in_fields.rs b/console/program/src/data/ciphertext/size_in_fields.rs index 6aa25689a8..54f39a84d2 100644 --- a/console/program/src/data/ciphertext/size_in_fields.rs +++ b/console/program/src/data/ciphertext/size_in_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/to_bits.rs b/console/program/src/data/ciphertext/to_bits.rs index bc9f619268..418fded54b 100644 --- a/console/program/src/data/ciphertext/to_bits.rs +++ b/console/program/src/data/ciphertext/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/ciphertext/to_fields.rs b/console/program/src/data/ciphertext/to_fields.rs index c4f91d6999..a33953d0b4 100644 --- a/console/program/src/data/ciphertext/to_fields.rs +++ b/console/program/src/data/ciphertext/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/argument.rs b/console/program/src/data/future/argument.rs index f87392dc7c..c539c26d8f 100644 --- a/console/program/src/data/future/argument.rs +++ b/console/program/src/data/future/argument.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/bytes.rs b/console/program/src/data/future/bytes.rs index b60b2ede0c..4a33965ba0 100644 --- a/console/program/src/data/future/bytes.rs +++ b/console/program/src/data/future/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/equal.rs b/console/program/src/data/future/equal.rs index 5384724749..efc8f26687 100644 --- a/console/program/src/data/future/equal.rs +++ b/console/program/src/data/future/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/find.rs b/console/program/src/data/future/find.rs index 7885c3a7b2..d8c9a74c12 100644 --- a/console/program/src/data/future/find.rs +++ b/console/program/src/data/future/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/mod.rs b/console/program/src/data/future/mod.rs index 437b01d96b..d4cfb621ef 100644 --- a/console/program/src/data/future/mod.rs +++ b/console/program/src/data/future/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/parse.rs b/console/program/src/data/future/parse.rs index 6fd88bf6c2..ed0f071d24 100644 --- a/console/program/src/data/future/parse.rs +++ b/console/program/src/data/future/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/serialize.rs b/console/program/src/data/future/serialize.rs index 134e358e00..ca8173b366 100644 --- a/console/program/src/data/future/serialize.rs +++ b/console/program/src/data/future/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/to_bits.rs b/console/program/src/data/future/to_bits.rs index c91ce27734..adfc260e80 100644 --- a/console/program/src/data/future/to_bits.rs +++ b/console/program/src/data/future/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/future/to_fields.rs b/console/program/src/data/future/to_fields.rs index e24c85d3f8..031a8d98e2 100644 --- a/console/program/src/data/future/to_fields.rs +++ b/console/program/src/data/future/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/bytes.rs b/console/program/src/data/identifier/bytes.rs index 967feee7cc..d0b979cceb 100644 --- a/console/program/src/data/identifier/bytes.rs +++ b/console/program/src/data/identifier/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/equal.rs b/console/program/src/data/identifier/equal.rs index 4c4586da7a..0d7f6db331 100644 --- a/console/program/src/data/identifier/equal.rs +++ b/console/program/src/data/identifier/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/from_bits.rs b/console/program/src/data/identifier/from_bits.rs index c0c7e1d098..97757be808 100644 --- a/console/program/src/data/identifier/from_bits.rs +++ b/console/program/src/data/identifier/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/from_field.rs b/console/program/src/data/identifier/from_field.rs index e5ea3bede8..bd667b3f52 100644 --- a/console/program/src/data/identifier/from_field.rs +++ b/console/program/src/data/identifier/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/mod.rs b/console/program/src/data/identifier/mod.rs index 0dde199981..fa064fc5ed 100644 --- a/console/program/src/data/identifier/mod.rs +++ b/console/program/src/data/identifier/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,7 +24,7 @@ mod to_bits; mod to_field; use snarkvm_console_network::Network; -use snarkvm_console_types::{prelude::*, Field}; +use snarkvm_console_types::{Field, prelude::*}; /// An identifier is an **immutable** UTF-8 string, /// represented as a **constant** field element in the CurrentNetwork. diff --git a/console/program/src/data/identifier/parse.rs b/console/program/src/data/identifier/parse.rs index 1ab087141b..ce58a86e0e 100644 --- a/console/program/src/data/identifier/parse.rs +++ b/console/program/src/data/identifier/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/serialize.rs b/console/program/src/data/identifier/serialize.rs index 0d2e4ee766..5b3a0a65b9 100644 --- a/console/program/src/data/identifier/serialize.rs +++ b/console/program/src/data/identifier/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/size_in_bits.rs b/console/program/src/data/identifier/size_in_bits.rs index ec3c113b47..c677fc42e7 100644 --- a/console/program/src/data/identifier/size_in_bits.rs +++ b/console/program/src/data/identifier/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/to_bits.rs b/console/program/src/data/identifier/to_bits.rs index efe0520ca7..8909c486ff 100644 --- a/console/program/src/data/identifier/to_bits.rs +++ b/console/program/src/data/identifier/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/identifier/to_field.rs b/console/program/src/data/identifier/to_field.rs index 815e79d7b2..c8dc8df285 100644 --- a/console/program/src/data/identifier/to_field.rs +++ b/console/program/src/data/identifier/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/bytes.rs b/console/program/src/data/literal/bytes.rs index d5386a2aa2..d93bc1c405 100644 --- a/console/program/src/data/literal/bytes.rs +++ b/console/program/src/data/literal/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast/boolean.rs b/console/program/src/data/literal/cast/boolean.rs index 2ea3d30d8d..12bc5ef1d5 100644 --- a/console/program/src/data/literal/cast/boolean.rs +++ b/console/program/src/data/literal/cast/boolean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast/field.rs b/console/program/src/data/literal/cast/field.rs index 3329c84e9d..91334cbcf0 100644 --- a/console/program/src/data/literal/cast/field.rs +++ b/console/program/src/data/literal/cast/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast/integer.rs b/console/program/src/data/literal/cast/integer.rs index d262aaad4d..d34c012fcb 100644 --- a/console/program/src/data/literal/cast/integer.rs +++ b/console/program/src/data/literal/cast/integer.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast/mod.rs b/console/program/src/data/literal/cast/mod.rs index a673740786..77cde083e9 100644 --- a/console/program/src/data/literal/cast/mod.rs +++ b/console/program/src/data/literal/cast/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ mod scalar; use crate::{Literal, LiteralType}; use snarkvm_console_network::Network; -use snarkvm_console_types::{integers::Integer, prelude::*, Boolean}; +use snarkvm_console_types::{Boolean, integers::Integer, prelude::*}; /// Unary operator for casting values of one type to another. pub trait Cast { @@ -40,6 +41,7 @@ impl Literal { /// - (`Address`, `Group`) <-> `Field` <-> `Scalar` <-> `Integer` <-> `Boolean` /// - `Signature` (not supported) /// - `String` (not supported) + /// /// Note that casting to left along the hierarchy always preserves information. pub fn cast(&self, to_type: LiteralType) -> Result { match self { diff --git a/console/program/src/data/literal/cast/scalar.rs b/console/program/src/data/literal/cast/scalar.rs index 140bb7a52f..c240c480e8 100644 --- a/console/program/src/data/literal/cast/scalar.rs +++ b/console/program/src/data/literal/cast/scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast_lossy/boolean.rs b/console/program/src/data/literal/cast_lossy/boolean.rs index 56c655cede..64301d3ba2 100644 --- a/console/program/src/data/literal/cast_lossy/boolean.rs +++ b/console/program/src/data/literal/cast_lossy/boolean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast_lossy/field.rs b/console/program/src/data/literal/cast_lossy/field.rs index f5b7a15339..9677978455 100644 --- a/console/program/src/data/literal/cast_lossy/field.rs +++ b/console/program/src/data/literal/cast_lossy/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast_lossy/integer.rs b/console/program/src/data/literal/cast_lossy/integer.rs index efd351ad58..76c3bfd1b7 100644 --- a/console/program/src/data/literal/cast_lossy/integer.rs +++ b/console/program/src/data/literal/cast_lossy/integer.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/cast_lossy/mod.rs b/console/program/src/data/literal/cast_lossy/mod.rs index 997ecd7774..0b6c11eeef 100644 --- a/console/program/src/data/literal/cast_lossy/mod.rs +++ b/console/program/src/data/literal/cast_lossy/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ mod scalar; use crate::{Literal, LiteralType}; use snarkvm_console_algorithms::Elligator2; use snarkvm_console_network::Network; -use snarkvm_console_types::{integers::Integer, prelude::*, Boolean}; +use snarkvm_console_types::{Boolean, integers::Integer, prelude::*}; /// Unary operator for casting values of one type to another, with lossy truncation. pub trait CastLossy { @@ -41,6 +42,7 @@ impl Literal { /// - (`Address`, `Group`) <-> `Field` <-> `Scalar` <-> `Integer` <-> `Boolean` /// - `Signature` (not supported) /// - `String` (not supported) + /// /// Note that casting to left along the hierarchy always preserves information. pub fn cast_lossy(&self, to_type: LiteralType) -> Result { match self { @@ -114,10 +116,7 @@ fn cast_lossy_group_to_type(input: &Group, to_type: LiteralType) } /// Casts an integer literal to the given literal type, with lossy truncation. -fn cast_lossy_integer_to_type( - input: &Integer, - to_type: LiteralType, -) -> Result> +fn cast_lossy_integer_to_type(input: &Integer, to_type: LiteralType) -> Result> where I: AsPrimitive + AsPrimitive @@ -128,7 +127,8 @@ where + AsPrimitive + AsPrimitive + AsPrimitive - + AsPrimitive, + + AsPrimitive + + IntegerType, { impl_cast_lossy_body!(integer, cast_lossy, input, to_type) } diff --git a/console/program/src/data/literal/cast_lossy/scalar.rs b/console/program/src/data/literal/cast_lossy/scalar.rs index 24cb95db4f..3e5b51c5b0 100644 --- a/console/program/src/data/literal/cast_lossy/scalar.rs +++ b/console/program/src/data/literal/cast_lossy/scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/equal.rs b/console/program/src/data/literal/equal.rs index a1c4cf61be..7718a78561 100644 --- a/console/program/src/data/literal/equal.rs +++ b/console/program/src/data/literal/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/from_bits.rs b/console/program/src/data/literal/from_bits.rs index 57bdbe1111..8f6798941b 100644 --- a/console/program/src/data/literal/from_bits.rs +++ b/console/program/src/data/literal/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/mod.rs b/console/program/src/data/literal/mod.rs index 62777da9d8..4f33462ef6 100644 --- a/console/program/src/data/literal/mod.rs +++ b/console/program/src/data/literal/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -32,7 +33,7 @@ mod variant; use crate::{LiteralType, ProgramID}; use snarkvm_console_account::{ComputeKey, PrivateKey, Signature}; use snarkvm_console_network::Network; -use snarkvm_console_types::{prelude::*, Boolean}; +use snarkvm_console_types::{Boolean, prelude::*}; /// The literal enum represents all supported types in snarkVM. #[derive(Clone)] diff --git a/console/program/src/data/literal/parse.rs b/console/program/src/data/literal/parse.rs index bada3c011b..2290e93dbc 100644 --- a/console/program/src/data/literal/parse.rs +++ b/console/program/src/data/literal/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/sample.rs b/console/program/src/data/literal/sample.rs index dd8f2876ec..9d197c298a 100644 --- a/console/program/src/data/literal/sample.rs +++ b/console/program/src/data/literal/sample.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/serialize.rs b/console/program/src/data/literal/serialize.rs index 5bad54669a..56ac64e0f1 100644 --- a/console/program/src/data/literal/serialize.rs +++ b/console/program/src/data/literal/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/size_in_bits.rs b/console/program/src/data/literal/size_in_bits.rs index b07ac4083e..b22e42a614 100644 --- a/console/program/src/data/literal/size_in_bits.rs +++ b/console/program/src/data/literal/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/size_in_bytes.rs b/console/program/src/data/literal/size_in_bytes.rs index cc3a434ec1..212b32ceda 100644 --- a/console/program/src/data/literal/size_in_bytes.rs +++ b/console/program/src/data/literal/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/to_bits.rs b/console/program/src/data/literal/to_bits.rs index 4951011b8f..07b9f88d02 100644 --- a/console/program/src/data/literal/to_bits.rs +++ b/console/program/src/data/literal/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/to_type.rs b/console/program/src/data/literal/to_type.rs index 220fb571dd..d325132560 100644 --- a/console/program/src/data/literal/to_type.rs +++ b/console/program/src/data/literal/to_type.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/literal/variant.rs b/console/program/src/data/literal/variant.rs index da1470cf86..5a6fb64c6d 100644 --- a/console/program/src/data/literal/variant.rs +++ b/console/program/src/data/literal/variant.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/mod.rs b/console/program/src/data/mod.rs index 231cb6437a..944afd57e2 100644 --- a/console/program/src/data/mod.rs +++ b/console/program/src/data/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/bytes.rs b/console/program/src/data/plaintext/bytes.rs index 73a4e7670e..e537b52bdc 100644 --- a/console/program/src/data/plaintext/bytes.rs +++ b/console/program/src/data/plaintext/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/encrypt.rs b/console/program/src/data/plaintext/encrypt.rs index e0fb3da814..32828b2ec6 100644 --- a/console/program/src/data/plaintext/encrypt.rs +++ b/console/program/src/data/plaintext/encrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/equal.rs b/console/program/src/data/plaintext/equal.rs index 323feb8d84..38a090383d 100644 --- a/console/program/src/data/plaintext/equal.rs +++ b/console/program/src/data/plaintext/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/find.rs b/console/program/src/data/plaintext/find.rs index ea8843d881..5f8008e62e 100644 --- a/console/program/src/data/plaintext/find.rs +++ b/console/program/src/data/plaintext/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/from_bits.rs b/console/program/src/data/plaintext/from_bits.rs index a705b778ac..b40a00f7fb 100644 --- a/console/program/src/data/plaintext/from_bits.rs +++ b/console/program/src/data/plaintext/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/from_fields.rs b/console/program/src/data/plaintext/from_fields.rs index ac8a0d604c..0578ce13c6 100644 --- a/console/program/src/data/plaintext/from_fields.rs +++ b/console/program/src/data/plaintext/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/mod.rs b/console/program/src/data/plaintext/mod.rs index 8080557e4a..bb0b85f6c5 100644 --- a/console/program/src/data/plaintext/mod.rs +++ b/console/program/src/data/plaintext/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/num_randomizers.rs b/console/program/src/data/plaintext/num_randomizers.rs index cca77e1252..40ed5a6f81 100644 --- a/console/program/src/data/plaintext/num_randomizers.rs +++ b/console/program/src/data/plaintext/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/parse.rs b/console/program/src/data/plaintext/parse.rs index 594e38ce68..b3aeaa5467 100644 --- a/console/program/src/data/plaintext/parse.rs +++ b/console/program/src/data/plaintext/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/serialize.rs b/console/program/src/data/plaintext/serialize.rs index 82e7ac0b1c..797ad71df5 100644 --- a/console/program/src/data/plaintext/serialize.rs +++ b/console/program/src/data/plaintext/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/size_in_fields.rs b/console/program/src/data/plaintext/size_in_fields.rs index 5a1bcf13f4..5be2be4255 100644 --- a/console/program/src/data/plaintext/size_in_fields.rs +++ b/console/program/src/data/plaintext/size_in_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/to_bits.rs b/console/program/src/data/plaintext/to_bits.rs index 7b53f02b83..53b73f4041 100644 --- a/console/program/src/data/plaintext/to_bits.rs +++ b/console/program/src/data/plaintext/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/plaintext/to_fields.rs b/console/program/src/data/plaintext/to_fields.rs index ae4a101ff5..8741e8cf59 100644 --- a/console/program/src/data/plaintext/to_fields.rs +++ b/console/program/src/data/plaintext/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/bytes.rs b/console/program/src/data/record/bytes.rs index 4e06c3abbf..0cd1dd62e7 100644 --- a/console/program/src/data/record/bytes.rs +++ b/console/program/src/data/record/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/decrypt.rs b/console/program/src/data/record/decrypt.rs index d5d0f37b7f..d84fb9c695 100644 --- a/console/program/src/data/record/decrypt.rs +++ b/console/program/src/data/record/decrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/encrypt.rs b/console/program/src/data/record/encrypt.rs index bcfce3e770..28a8ce39d4 100644 --- a/console/program/src/data/record/encrypt.rs +++ b/console/program/src/data/record/encrypt.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/bytes.rs b/console/program/src/data/record/entry/bytes.rs index d38bfc17a3..221232fb64 100644 --- a/console/program/src/data/record/entry/bytes.rs +++ b/console/program/src/data/record/entry/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/equal.rs b/console/program/src/data/record/entry/equal.rs index 748858d58b..6ceb8a4ee9 100644 --- a/console/program/src/data/record/entry/equal.rs +++ b/console/program/src/data/record/entry/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/find.rs b/console/program/src/data/record/entry/find.rs index 94985f4d83..3a912298d2 100644 --- a/console/program/src/data/record/entry/find.rs +++ b/console/program/src/data/record/entry/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/mod.rs b/console/program/src/data/record/entry/mod.rs index ea2585ccdd..3bc197836e 100644 --- a/console/program/src/data/record/entry/mod.rs +++ b/console/program/src/data/record/entry/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/num_randomizers.rs b/console/program/src/data/record/entry/num_randomizers.rs index b03062ad7f..fd7534fe7e 100644 --- a/console/program/src/data/record/entry/num_randomizers.rs +++ b/console/program/src/data/record/entry/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/parse.rs b/console/program/src/data/record/entry/parse.rs index 8ab61f6fa5..8a76daae75 100644 --- a/console/program/src/data/record/entry/parse.rs +++ b/console/program/src/data/record/entry/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/entry/to_bits.rs b/console/program/src/data/record/entry/to_bits.rs index 9fe72b678d..0bedc64a50 100644 --- a/console/program/src/data/record/entry/to_bits.rs +++ b/console/program/src/data/record/entry/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/equal.rs b/console/program/src/data/record/equal.rs index c830b42b50..77e976a76a 100644 --- a/console/program/src/data/record/equal.rs +++ b/console/program/src/data/record/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/find.rs b/console/program/src/data/record/find.rs index 8a3a922101..9101686e70 100644 --- a/console/program/src/data/record/find.rs +++ b/console/program/src/data/record/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/helpers/mod.rs b/console/program/src/data/record/helpers/mod.rs index 1770e4373a..16918fea74 100644 --- a/console/program/src/data/record/helpers/mod.rs +++ b/console/program/src/data/record/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/helpers/owner.rs b/console/program/src/data/record/helpers/owner.rs index f4eff1b1fd..4a7472585a 100644 --- a/console/program/src/data/record/helpers/owner.rs +++ b/console/program/src/data/record/helpers/owner.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/is_owner.rs b/console/program/src/data/record/is_owner.rs index 06381ff9aa..a9f9153923 100644 --- a/console/program/src/data/record/is_owner.rs +++ b/console/program/src/data/record/is_owner.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,6 +16,7 @@ use super::*; impl Record> { + /// Returns `true` if the given view key corresponds to the owner of the record. /// Decrypts `self` into plaintext using the given view key. pub fn is_owner(&self, view_key: &ViewKey) -> bool { // Compute the address. @@ -23,6 +25,7 @@ impl Record> { self.is_owner_with_address_x_coordinate(view_key, &address.to_x_coordinate()) } + /// Returns `true` if the given view key and address x-coordinate corresponds to the owner of the record. /// Decrypts `self` into plaintext using the x-coordinate of the address corresponding to the given view key. pub fn is_owner_with_address_x_coordinate(&self, view_key: &ViewKey, address_x_coordinate: &Field) -> bool { // In debug mode, check that the address corresponds to the given view key. diff --git a/console/program/src/data/record/mod.rs b/console/program/src/data/record/mod.rs index 33bc202189..9700e5e3e2 100644 --- a/console/program/src/data/record/mod.rs +++ b/console/program/src/data/record/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/num_randomizers.rs b/console/program/src/data/record/num_randomizers.rs index fd4f7d12a1..4a53245e5a 100644 --- a/console/program/src/data/record/num_randomizers.rs +++ b/console/program/src/data/record/num_randomizers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/parse_ciphertext.rs b/console/program/src/data/record/parse_ciphertext.rs index c0ee86c91f..d4b70955a9 100644 --- a/console/program/src/data/record/parse_ciphertext.rs +++ b/console/program/src/data/record/parse_ciphertext.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/parse_plaintext.rs b/console/program/src/data/record/parse_plaintext.rs index 6179ac24a7..bec066f8e3 100644 --- a/console/program/src/data/record/parse_plaintext.rs +++ b/console/program/src/data/record/parse_plaintext.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/serial_number.rs b/console/program/src/data/record/serial_number.rs index b01676908d..5ec49c8684 100644 --- a/console/program/src/data/record/serial_number.rs +++ b/console/program/src/data/record/serial_number.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/serialize.rs b/console/program/src/data/record/serialize.rs index c5da3d5670..e94dcaca2f 100644 --- a/console/program/src/data/record/serialize.rs +++ b/console/program/src/data/record/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/tag.rs b/console/program/src/data/record/tag.rs index e5ca9dc235..3b72d2e090 100644 --- a/console/program/src/data/record/tag.rs +++ b/console/program/src/data/record/tag.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/to_bits.rs b/console/program/src/data/record/to_bits.rs index 63c39c9cb3..a726d9374c 100644 --- a/console/program/src/data/record/to_bits.rs +++ b/console/program/src/data/record/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/to_commitment.rs b/console/program/src/data/record/to_commitment.rs index 1a85677675..b9a9743cc3 100644 --- a/console/program/src/data/record/to_commitment.rs +++ b/console/program/src/data/record/to_commitment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/record/to_fields.rs b/console/program/src/data/record/to_fields.rs index 3a33a36e4f..a247bb3036 100644 --- a/console/program/src/data/record/to_fields.rs +++ b/console/program/src/data/record/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/register/bytes.rs b/console/program/src/data/register/bytes.rs index 0d24be259e..cca45a6224 100644 --- a/console/program/src/data/register/bytes.rs +++ b/console/program/src/data/register/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/register/mod.rs b/console/program/src/data/register/mod.rs index d0839dffef..adbd9bb7bd 100644 --- a/console/program/src/data/register/mod.rs +++ b/console/program/src/data/register/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/register/parse.rs b/console/program/src/data/register/parse.rs index d40a26a396..d784867d42 100644 --- a/console/program/src/data/register/parse.rs +++ b/console/program/src/data/register/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/register/serialize.rs b/console/program/src/data/register/serialize.rs index f5efb62e6f..e7c541299c 100644 --- a/console/program/src/data/register/serialize.rs +++ b/console/program/src/data/register/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/bytes.rs b/console/program/src/data/value/bytes.rs index c4f673d89c..a3b800a2ea 100644 --- a/console/program/src/data/value/bytes.rs +++ b/console/program/src/data/value/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/equal.rs b/console/program/src/data/value/equal.rs index b872f9953a..4aaaded955 100644 --- a/console/program/src/data/value/equal.rs +++ b/console/program/src/data/value/equal.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/find.rs b/console/program/src/data/value/find.rs index d5852bd95f..e0f8334c02 100644 --- a/console/program/src/data/value/find.rs +++ b/console/program/src/data/value/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/mod.rs b/console/program/src/data/value/mod.rs index c63ae9a87e..cac22c45a0 100644 --- a/console/program/src/data/value/mod.rs +++ b/console/program/src/data/value/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/parse.rs b/console/program/src/data/value/parse.rs index 9c5dddf1f8..681cd194ce 100644 --- a/console/program/src/data/value/parse.rs +++ b/console/program/src/data/value/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/serialize.rs b/console/program/src/data/value/serialize.rs index 61b94f0cba..0773c45be8 100644 --- a/console/program/src/data/value/serialize.rs +++ b/console/program/src/data/value/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/to_bits.rs b/console/program/src/data/value/to_bits.rs index a11f7d27b4..0783a9ed93 100644 --- a/console/program/src/data/value/to_bits.rs +++ b/console/program/src/data/value/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data/value/to_fields.rs b/console/program/src/data/value/to_fields.rs index 8c8898a430..3124772ff2 100644 --- a/console/program/src/data/value/to_fields.rs +++ b/console/program/src/data/value/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/array_type/bytes.rs b/console/program/src/data_types/array_type/bytes.rs index 3030b11635..83b8bdd693 100644 --- a/console/program/src/data_types/array_type/bytes.rs +++ b/console/program/src/data_types/array_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/array_type/mod.rs b/console/program/src/data_types/array_type/mod.rs index b3c781b744..618d547dae 100644 --- a/console/program/src/data_types/array_type/mod.rs +++ b/console/program/src/data_types/array_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/array_type/parse.rs b/console/program/src/data_types/array_type/parse.rs index 4f6fdc75c0..f3cefb3fb7 100644 --- a/console/program/src/data_types/array_type/parse.rs +++ b/console/program/src/data_types/array_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/array_type/serialize.rs b/console/program/src/data_types/array_type/serialize.rs index 72869ae263..4e7b3eb000 100644 --- a/console/program/src/data_types/array_type/serialize.rs +++ b/console/program/src/data_types/array_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/finalize_type/bytes.rs b/console/program/src/data_types/finalize_type/bytes.rs index b8f21e770f..a49cf1ec8a 100644 --- a/console/program/src/data_types/finalize_type/bytes.rs +++ b/console/program/src/data_types/finalize_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/finalize_type/mod.rs b/console/program/src/data_types/finalize_type/mod.rs index 3e025482b3..2eb03d0f20 100644 --- a/console/program/src/data_types/finalize_type/mod.rs +++ b/console/program/src/data_types/finalize_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/finalize_type/parse.rs b/console/program/src/data_types/finalize_type/parse.rs index a60a7a3462..9724cf0c5b 100644 --- a/console/program/src/data_types/finalize_type/parse.rs +++ b/console/program/src/data_types/finalize_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/finalize_type/serialize.rs b/console/program/src/data_types/finalize_type/serialize.rs index ef4794f47a..4f9e745c5d 100644 --- a/console/program/src/data_types/finalize_type/serialize.rs +++ b/console/program/src/data_types/finalize_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/literal_type/bytes.rs b/console/program/src/data_types/literal_type/bytes.rs index 145b312db4..3442e9523d 100644 --- a/console/program/src/data_types/literal_type/bytes.rs +++ b/console/program/src/data_types/literal_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/literal_type/mod.rs b/console/program/src/data_types/literal_type/mod.rs index 0f0dea6e75..4d0c765edb 100644 --- a/console/program/src/data_types/literal_type/mod.rs +++ b/console/program/src/data_types/literal_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ mod size_in_bytes; use snarkvm_console_account::Signature; use snarkvm_console_network::prelude::*; -use snarkvm_console_types::{prelude::*, Boolean}; +use snarkvm_console_types::{Boolean, prelude::*}; use core::fmt::{self, Debug, Display}; use enum_iterator::Sequence; diff --git a/console/program/src/data_types/literal_type/parse.rs b/console/program/src/data_types/literal_type/parse.rs index 806eee0dc2..be4b875445 100644 --- a/console/program/src/data_types/literal_type/parse.rs +++ b/console/program/src/data_types/literal_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/literal_type/serialize.rs b/console/program/src/data_types/literal_type/serialize.rs index 4bc21d6376..22ae04f7f0 100644 --- a/console/program/src/data_types/literal_type/serialize.rs +++ b/console/program/src/data_types/literal_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/literal_type/size_in_bits.rs b/console/program/src/data_types/literal_type/size_in_bits.rs index 19db4593a7..7b64d2fb22 100644 --- a/console/program/src/data_types/literal_type/size_in_bits.rs +++ b/console/program/src/data_types/literal_type/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/literal_type/size_in_bytes.rs b/console/program/src/data_types/literal_type/size_in_bytes.rs index 2862b0f218..28d064b415 100644 --- a/console/program/src/data_types/literal_type/size_in_bytes.rs +++ b/console/program/src/data_types/literal_type/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/mod.rs b/console/program/src/data_types/mod.rs index f86dee506d..4d3175b771 100644 --- a/console/program/src/data_types/mod.rs +++ b/console/program/src/data_types/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/plaintext_type/bytes.rs b/console/program/src/data_types/plaintext_type/bytes.rs index 0b3d5c92d2..c2ed22f16e 100644 --- a/console/program/src/data_types/plaintext_type/bytes.rs +++ b/console/program/src/data_types/plaintext_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/plaintext_type/mod.rs b/console/program/src/data_types/plaintext_type/mod.rs index dfc6e05f76..24603d6a56 100644 --- a/console/program/src/data_types/plaintext_type/mod.rs +++ b/console/program/src/data_types/plaintext_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/plaintext_type/parse.rs b/console/program/src/data_types/plaintext_type/parse.rs index 4e55c6498b..83a1850f1e 100644 --- a/console/program/src/data_types/plaintext_type/parse.rs +++ b/console/program/src/data_types/plaintext_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/plaintext_type/serialize.rs b/console/program/src/data_types/plaintext_type/serialize.rs index f80a3862a8..0b9fe5f5ac 100644 --- a/console/program/src/data_types/plaintext_type/serialize.rs +++ b/console/program/src/data_types/plaintext_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/bytes.rs b/console/program/src/data_types/record_type/bytes.rs index 172c41c631..5d36224ebb 100644 --- a/console/program/src/data_types/record_type/bytes.rs +++ b/console/program/src/data_types/record_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/entry_type/bytes.rs b/console/program/src/data_types/record_type/entry_type/bytes.rs index 4ae5e9c76e..8d8b7bade7 100644 --- a/console/program/src/data_types/record_type/entry_type/bytes.rs +++ b/console/program/src/data_types/record_type/entry_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/entry_type/mod.rs b/console/program/src/data_types/record_type/entry_type/mod.rs index 03d2657cab..411ed34250 100644 --- a/console/program/src/data_types/record_type/entry_type/mod.rs +++ b/console/program/src/data_types/record_type/entry_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/entry_type/parse.rs b/console/program/src/data_types/record_type/entry_type/parse.rs index 36b153bdbc..6eb364a5d2 100644 --- a/console/program/src/data_types/record_type/entry_type/parse.rs +++ b/console/program/src/data_types/record_type/entry_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/entry_type/serialize.rs b/console/program/src/data_types/record_type/entry_type/serialize.rs index 00884ef302..e6f14211b1 100644 --- a/console/program/src/data_types/record_type/entry_type/serialize.rs +++ b/console/program/src/data_types/record_type/entry_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/helpers/mod.rs b/console/program/src/data_types/record_type/helpers/mod.rs index 74f9493c56..ac523beb4a 100644 --- a/console/program/src/data_types/record_type/helpers/mod.rs +++ b/console/program/src/data_types/record_type/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/mod.rs b/console/program/src/data_types/record_type/mod.rs index d78438e843..263491dd11 100644 --- a/console/program/src/data_types/record_type/mod.rs +++ b/console/program/src/data_types/record_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/parse.rs b/console/program/src/data_types/record_type/parse.rs index d995622e7c..2cae3cd801 100644 --- a/console/program/src/data_types/record_type/parse.rs +++ b/console/program/src/data_types/record_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/record_type/serialize.rs b/console/program/src/data_types/record_type/serialize.rs index 40c94d2149..b546518174 100644 --- a/console/program/src/data_types/record_type/serialize.rs +++ b/console/program/src/data_types/record_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/register_type/bytes.rs b/console/program/src/data_types/register_type/bytes.rs index c2d939ca1b..345aeda4cf 100644 --- a/console/program/src/data_types/register_type/bytes.rs +++ b/console/program/src/data_types/register_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/register_type/mod.rs b/console/program/src/data_types/register_type/mod.rs index f8a0c856ca..9e745263e6 100644 --- a/console/program/src/data_types/register_type/mod.rs +++ b/console/program/src/data_types/register_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/register_type/parse.rs b/console/program/src/data_types/register_type/parse.rs index 6cd6f5b4fc..9e9ea58ddd 100644 --- a/console/program/src/data_types/register_type/parse.rs +++ b/console/program/src/data_types/register_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/register_type/serialize.rs b/console/program/src/data_types/register_type/serialize.rs index 919e750256..bb244a8513 100644 --- a/console/program/src/data_types/register_type/serialize.rs +++ b/console/program/src/data_types/register_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/struct_type/bytes.rs b/console/program/src/data_types/struct_type/bytes.rs index cdee12b982..da237669b5 100644 --- a/console/program/src/data_types/struct_type/bytes.rs +++ b/console/program/src/data_types/struct_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/struct_type/mod.rs b/console/program/src/data_types/struct_type/mod.rs index 1529ed7634..ca6b7e691f 100644 --- a/console/program/src/data_types/struct_type/mod.rs +++ b/console/program/src/data_types/struct_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/struct_type/parse.rs b/console/program/src/data_types/struct_type/parse.rs index 42ad3b7ca0..66d80fe347 100644 --- a/console/program/src/data_types/struct_type/parse.rs +++ b/console/program/src/data_types/struct_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/struct_type/serialize.rs b/console/program/src/data_types/struct_type/serialize.rs index b5e0c2065c..96660170bf 100644 --- a/console/program/src/data_types/struct_type/serialize.rs +++ b/console/program/src/data_types/struct_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/value_type/bytes.rs b/console/program/src/data_types/value_type/bytes.rs index 5fa6cdce9c..1b9504386c 100644 --- a/console/program/src/data_types/value_type/bytes.rs +++ b/console/program/src/data_types/value_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/value_type/mod.rs b/console/program/src/data_types/value_type/mod.rs index 9e0c8350d8..6eff21d476 100644 --- a/console/program/src/data_types/value_type/mod.rs +++ b/console/program/src/data_types/value_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/value_type/parse.rs b/console/program/src/data_types/value_type/parse.rs index e7ce5402a8..c744ee84b0 100644 --- a/console/program/src/data_types/value_type/parse.rs +++ b/console/program/src/data_types/value_type/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/data_types/value_type/serialize.rs b/console/program/src/data_types/value_type/serialize.rs index fc6f779555..3975a9f2d9 100644 --- a/console/program/src/data_types/value_type/serialize.rs +++ b/console/program/src/data_types/value_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/function_id/mod.rs b/console/program/src/function_id/mod.rs index 91c17ec162..6848822afc 100644 --- a/console/program/src/function_id/mod.rs +++ b/console/program/src/function_id/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use crate::{Identifier, ProgramID}; use snarkvm_console_account::ToBits; use snarkvm_console_algorithms::Result; use snarkvm_console_network::Network; -use snarkvm_console_types::{Field, U16, U8}; +use snarkvm_console_types::{Field, U8, U16}; /// Compute the function ID as `Hash(network_id, program_id.len(), program_id, function_name.len(), function_name)`. pub fn compute_function_id( diff --git a/console/program/src/id/bytes.rs b/console/program/src/id/bytes.rs index a3f50c772c..0245ec3e72 100644 --- a/console/program/src/id/bytes.rs +++ b/console/program/src/id/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/id/mod.rs b/console/program/src/id/mod.rs index da40170dda..2941febab9 100644 --- a/console/program/src/id/mod.rs +++ b/console/program/src/id/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/id/parse.rs b/console/program/src/id/parse.rs index 8fa8a7f613..9f1f58fc72 100644 --- a/console/program/src/id/parse.rs +++ b/console/program/src/id/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/id/serialize.rs b/console/program/src/id/serialize.rs index 7857a201e1..debab9eb1c 100644 --- a/console/program/src/id/serialize.rs +++ b/console/program/src/id/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/id/to_address.rs b/console/program/src/id/to_address.rs index 9eceaac445..665aa34338 100644 --- a/console/program/src/id/to_address.rs +++ b/console/program/src/id/to_address.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/id/to_bits.rs b/console/program/src/id/to_bits.rs index 3817a537f1..8ed486dad7 100644 --- a/console/program/src/id/to_bits.rs +++ b/console/program/src/id/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/id/to_fields.rs b/console/program/src/id/to_fields.rs index 85b1c9aac0..b3af51185d 100644 --- a/console/program/src/id/to_fields.rs +++ b/console/program/src/id/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/lib.rs b/console/program/src/lib.rs index bb14280f53..c648a3c703 100644 --- a/console/program/src/lib.rs +++ b/console/program/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/locator/bytes.rs b/console/program/src/locator/bytes.rs index f10aca712a..2f2268a965 100644 --- a/console/program/src/locator/bytes.rs +++ b/console/program/src/locator/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/locator/mod.rs b/console/program/src/locator/mod.rs index f4552b613c..da7f133628 100644 --- a/console/program/src/locator/mod.rs +++ b/console/program/src/locator/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/locator/parse.rs b/console/program/src/locator/parse.rs index 9f787423d1..12a8d326a4 100644 --- a/console/program/src/locator/parse.rs +++ b/console/program/src/locator/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/locator/serialize.rs b/console/program/src/locator/serialize.rs index 82dd9acb66..bb9932eedd 100644 --- a/console/program/src/locator/serialize.rs +++ b/console/program/src/locator/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/locator/to_fields.rs b/console/program/src/locator/to_fields.rs index d60472b481..69e92fbfb7 100644 --- a/console/program/src/locator/to_fields.rs +++ b/console/program/src/locator/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/owner/bytes.rs b/console/program/src/owner/bytes.rs index c827ccfb64..0328ed9cc8 100644 --- a/console/program/src/owner/bytes.rs +++ b/console/program/src/owner/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/owner/mod.rs b/console/program/src/owner/mod.rs index 4e7899b44d..6a3fe985e0 100644 --- a/console/program/src/owner/mod.rs +++ b/console/program/src/owner/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/owner/serialize.rs b/console/program/src/owner/serialize.rs index da1cb92f90..3b9cf8ddb5 100644 --- a/console/program/src/owner/serialize.rs +++ b/console/program/src/owner/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/owner/string.rs b/console/program/src/owner/string.rs index 9f0719ef44..28a0f222ef 100644 --- a/console/program/src/owner/string.rs +++ b/console/program/src/owner/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/bytes.rs b/console/program/src/request/bytes.rs index 84cb5ea1dd..0dd91fa9d0 100644 --- a/console/program/src/request/bytes.rs +++ b/console/program/src/request/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/input_id/bytes.rs b/console/program/src/request/input_id/bytes.rs index e0fafca73a..e55562c1a4 100644 --- a/console/program/src/request/input_id/bytes.rs +++ b/console/program/src/request/input_id/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/input_id/mod.rs b/console/program/src/request/input_id/mod.rs index dbca723728..72151123d5 100644 --- a/console/program/src/request/input_id/mod.rs +++ b/console/program/src/request/input_id/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/input_id/serialize.rs b/console/program/src/request/input_id/serialize.rs index c4961f18a4..94414f5a89 100644 --- a/console/program/src/request/input_id/serialize.rs +++ b/console/program/src/request/input_id/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/input_id/string.rs b/console/program/src/request/input_id/string.rs index b0cfc53652..c2f759e0ed 100644 --- a/console/program/src/request/input_id/string.rs +++ b/console/program/src/request/input_id/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/mod.rs b/console/program/src/request/mod.rs index a04784b76b..b9ca501e45 100644 --- a/console/program/src/request/mod.rs +++ b/console/program/src/request/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,7 +22,7 @@ mod sign; mod string; mod verify; -use crate::{compute_function_id, Identifier, Plaintext, ProgramID, Record, Value, ValueType}; +use crate::{Identifier, Plaintext, ProgramID, Record, Value, ValueType, compute_function_id}; use snarkvm_console_account::{Address, ComputeKey, GraphKey, PrivateKey, Signature, ViewKey}; use snarkvm_console_network::Network; use snarkvm_console_types::prelude::*; diff --git a/console/program/src/request/serialize.rs b/console/program/src/request/serialize.rs index 34c8f73ace..dff86791fa 100644 --- a/console/program/src/request/serialize.rs +++ b/console/program/src/request/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/sign.rs b/console/program/src/request/sign.rs index 47751b8bf7..a886d64acd 100644 --- a/console/program/src/request/sign.rs +++ b/console/program/src/request/sign.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/string.rs b/console/program/src/request/string.rs index d7179721cf..1165cd86e0 100644 --- a/console/program/src/request/string.rs +++ b/console/program/src/request/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/request/verify.rs b/console/program/src/request/verify.rs index d2f1f6739a..15570ee289 100644 --- a/console/program/src/request/verify.rs +++ b/console/program/src/request/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/response/mod.rs b/console/program/src/response/mod.rs index f54e7f9dca..6454192a36 100644 --- a/console/program/src/response/mod.rs +++ b/console/program/src/response/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{compute_function_id, Identifier, ProgramID, Register, Value, ValueType}; +use crate::{Identifier, ProgramID, Register, Value, ValueType, compute_function_id}; use snarkvm_console_network::Network; use snarkvm_console_types::prelude::*; diff --git a/console/program/src/state_path/bytes.rs b/console/program/src/state_path/bytes.rs index 4b4334fadd..fb98999329 100644 --- a/console/program/src/state_path/bytes.rs +++ b/console/program/src/state_path/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index 80b920510f..bc6939fa63 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/header_leaf/bytes.rs b/console/program/src/state_path/header_leaf/bytes.rs index 16f2b03bca..2d4d85e546 100644 --- a/console/program/src/state_path/header_leaf/bytes.rs +++ b/console/program/src/state_path/header_leaf/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/header_leaf/mod.rs b/console/program/src/state_path/header_leaf/mod.rs index ecfc8fc53f..b6ee91d308 100644 --- a/console/program/src/state_path/header_leaf/mod.rs +++ b/console/program/src/state_path/header_leaf/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/header_leaf/serialize.rs b/console/program/src/state_path/header_leaf/serialize.rs index 67dc881397..c332db8ad7 100644 --- a/console/program/src/state_path/header_leaf/serialize.rs +++ b/console/program/src/state_path/header_leaf/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/header_leaf/string.rs b/console/program/src/state_path/header_leaf/string.rs index e26ee3e8cb..d80da15dbe 100644 --- a/console/program/src/state_path/header_leaf/string.rs +++ b/console/program/src/state_path/header_leaf/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/header_leaf/to_bits.rs b/console/program/src/state_path/header_leaf/to_bits.rs index d12871ace3..d88b36a076 100644 --- a/console/program/src/state_path/header_leaf/to_bits.rs +++ b/console/program/src/state_path/header_leaf/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/mod.rs b/console/program/src/state_path/mod.rs index ce3b719d88..9666d0ef1b 100644 --- a/console/program/src/state_path/mod.rs +++ b/console/program/src/state_path/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/parse.rs b/console/program/src/state_path/parse.rs index cff85c3bdd..21edd0b8de 100644 --- a/console/program/src/state_path/parse.rs +++ b/console/program/src/state_path/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -113,7 +114,7 @@ mod tests { // Check the string representation. let candidate = format!("{expected}"); assert_eq!(expected, StatePath::from_str(&candidate).unwrap()); - assert_eq!(STATE_PATH_PREFIX, candidate.to_string().split('1').next().unwrap()); + assert_eq!(STATE_PATH_PREFIX, candidate.split('1').next().unwrap()); } } diff --git a/console/program/src/state_path/serialize.rs b/console/program/src/state_path/serialize.rs index 6ec1821db4..817b543186 100644 --- a/console/program/src/state_path/serialize.rs +++ b/console/program/src/state_path/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transaction_leaf/bytes.rs b/console/program/src/state_path/transaction_leaf/bytes.rs index db10cf1f90..c9e63f2017 100644 --- a/console/program/src/state_path/transaction_leaf/bytes.rs +++ b/console/program/src/state_path/transaction_leaf/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transaction_leaf/mod.rs b/console/program/src/state_path/transaction_leaf/mod.rs index ef824af4d2..d94cfcb507 100644 --- a/console/program/src/state_path/transaction_leaf/mod.rs +++ b/console/program/src/state_path/transaction_leaf/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transaction_leaf/serialize.rs b/console/program/src/state_path/transaction_leaf/serialize.rs index bff48a4718..06192df5a4 100644 --- a/console/program/src/state_path/transaction_leaf/serialize.rs +++ b/console/program/src/state_path/transaction_leaf/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transaction_leaf/string.rs b/console/program/src/state_path/transaction_leaf/string.rs index 6cf3d93ca5..f343073f62 100644 --- a/console/program/src/state_path/transaction_leaf/string.rs +++ b/console/program/src/state_path/transaction_leaf/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transaction_leaf/to_bits.rs b/console/program/src/state_path/transaction_leaf/to_bits.rs index eaa826f280..ead342d395 100644 --- a/console/program/src/state_path/transaction_leaf/to_bits.rs +++ b/console/program/src/state_path/transaction_leaf/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transition_leaf/bytes.rs b/console/program/src/state_path/transition_leaf/bytes.rs index b06f9def4e..d5c571b8b3 100644 --- a/console/program/src/state_path/transition_leaf/bytes.rs +++ b/console/program/src/state_path/transition_leaf/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transition_leaf/mod.rs b/console/program/src/state_path/transition_leaf/mod.rs index edd79d5e61..f5f3cfb4ee 100644 --- a/console/program/src/state_path/transition_leaf/mod.rs +++ b/console/program/src/state_path/transition_leaf/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transition_leaf/serialize.rs b/console/program/src/state_path/transition_leaf/serialize.rs index 6dbf3a2fd5..e9297ff2f7 100644 --- a/console/program/src/state_path/transition_leaf/serialize.rs +++ b/console/program/src/state_path/transition_leaf/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transition_leaf/string.rs b/console/program/src/state_path/transition_leaf/string.rs index 8a6368ad26..e7984e9360 100644 --- a/console/program/src/state_path/transition_leaf/string.rs +++ b/console/program/src/state_path/transition_leaf/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/transition_leaf/to_bits.rs b/console/program/src/state_path/transition_leaf/to_bits.rs index 9943d1a999..a421b29e5e 100644 --- a/console/program/src/state_path/transition_leaf/to_bits.rs +++ b/console/program/src/state_path/transition_leaf/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/program/src/state_path/verify.rs b/console/program/src/state_path/verify.rs index 8b93397e2d..debada94cb 100644 --- a/console/program/src/state_path/verify.rs +++ b/console/program/src/state_path/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -133,7 +134,7 @@ impl StatePath { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::{prelude::TestRng, MainnetV0}; + use snarkvm_console_network::{MainnetV0, prelude::TestRng}; type CurrentNetwork = MainnetV0; diff --git a/console/src/lib.rs b/console/src/lib.rs index b1b274234c..e638caf351 100644 --- a/console/src/lib.rs +++ b/console/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index f2b0d934ed..a69cf1ee4a 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snarkvm-console-types" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Console types for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" @@ -13,41 +15,41 @@ harness = false [dependencies.snarkvm-console-network-environment] path = "../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-address] path = "./address" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types-boolean] path = "./boolean" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types-field] path = "./field" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types-group] path = "./group" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types-integers] path = "./integers" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types-scalar] path = "./scalar" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-console-types-string] path = "./string" -version = "=0.16.19" +version = "=1.0.0" optional = true [dev-dependencies.criterion] diff --git a/console/types/address/Cargo.toml b/console/types/address/Cargo.toml index 92fa744b6d..b5ccecb2f7 100644 --- a/console/types/address/Cargo.toml +++ b/console/types/address/Cargo.toml @@ -1,26 +1,28 @@ [package] name = "snarkvm-console-types-address" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-group] path = "../group" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/address/src/bitwise.rs b/console/types/address/src/bitwise.rs index 498ca44207..d180490303 100644 --- a/console/types/address/src/bitwise.rs +++ b/console/types/address/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/bytes.rs b/console/types/address/src/bytes.rs index b76d6649b3..137a86c84d 100644 --- a/console/types/address/src/bytes.rs +++ b/console/types/address/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/from_bits.rs b/console/types/address/src/from_bits.rs index f344d1252c..a9b164b45d 100644 --- a/console/types/address/src/from_bits.rs +++ b/console/types/address/src/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/from_field.rs b/console/types/address/src/from_field.rs index 790a263bbe..0b4e522678 100644 --- a/console/types/address/src/from_field.rs +++ b/console/types/address/src/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/from_fields.rs b/console/types/address/src/from_fields.rs index 494de653d2..a8dc89d902 100644 --- a/console/types/address/src/from_fields.rs +++ b/console/types/address/src/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/lib.rs b/console/types/address/src/lib.rs index 8daa110c04..ba14b9a7ee 100644 --- a/console/types/address/src/lib.rs +++ b/console/types/address/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/parse.rs b/console/types/address/src/parse.rs index 29601042bd..d76461a559 100644 --- a/console/types/address/src/parse.rs +++ b/console/types/address/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -116,7 +117,7 @@ mod tests { // Check the string representation. let candidate = format!("{expected}"); assert_eq!(expected, Address::from_str(&candidate)?); - assert_eq!(ADDRESS_PREFIX, candidate.to_string().split('1').next().unwrap()); + assert_eq!(ADDRESS_PREFIX, candidate.split('1').next().unwrap()); } Ok(()) } diff --git a/console/types/address/src/random.rs b/console/types/address/src/random.rs index 405f1f28ff..f82d8877e3 100644 --- a/console/types/address/src/random.rs +++ b/console/types/address/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/serialize.rs b/console/types/address/src/serialize.rs index a2931fc5d0..0689b3f46b 100644 --- a/console/types/address/src/serialize.rs +++ b/console/types/address/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/size_in_bits.rs b/console/types/address/src/size_in_bits.rs index 34d341a9ab..f6b26c0b92 100644 --- a/console/types/address/src/size_in_bits.rs +++ b/console/types/address/src/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/size_in_bytes.rs b/console/types/address/src/size_in_bytes.rs index 6c05007488..b9d791096e 100644 --- a/console/types/address/src/size_in_bytes.rs +++ b/console/types/address/src/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/to_bits.rs b/console/types/address/src/to_bits.rs index dacb00462e..ebda5db4ec 100644 --- a/console/types/address/src/to_bits.rs +++ b/console/types/address/src/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/to_field.rs b/console/types/address/src/to_field.rs index e64515c763..6dee513171 100644 --- a/console/types/address/src/to_field.rs +++ b/console/types/address/src/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/to_fields.rs b/console/types/address/src/to_fields.rs index ac204d231f..a9088b7256 100644 --- a/console/types/address/src/to_fields.rs +++ b/console/types/address/src/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/address/src/to_group.rs b/console/types/address/src/to_group.rs index 3bad477f03..1e2e2a088f 100644 --- a/console/types/address/src/to_group.rs +++ b/console/types/address/src/to_group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/benches/group.rs b/console/types/benches/group.rs index 4bd36e6b31..a4687e7a73 100644 --- a/console/types/benches/group.rs +++ b/console/types/benches/group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ extern crate criterion; use criterion::Criterion; -use snarkvm_console_network::{environment::prelude::*, MainnetV0}; +use snarkvm_console_network::{MainnetV0, environment::prelude::*}; use snarkvm_console_types::{Field, Group}; type CurrentNetwork = MainnetV0; diff --git a/console/types/boolean/Cargo.toml b/console/types/boolean/Cargo.toml index 7403db92e6..a9df0b8cc8 100644 --- a/console/types/boolean/Cargo.toml +++ b/console/types/boolean/Cargo.toml @@ -1,14 +1,16 @@ [package] name = "snarkvm-console-types-boolean" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/boolean/src/bitwise.rs b/console/types/boolean/src/bitwise.rs index b7f3432bfa..970518a9ae 100644 --- a/console/types/boolean/src/bitwise.rs +++ b/console/types/boolean/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/bytes.rs b/console/types/boolean/src/bytes.rs index 5fe594418e..0461945141 100644 --- a/console/types/boolean/src/bytes.rs +++ b/console/types/boolean/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/from_bits.rs b/console/types/boolean/src/from_bits.rs index 173572f188..5a77d603b9 100644 --- a/console/types/boolean/src/from_bits.rs +++ b/console/types/boolean/src/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/lib.rs b/console/types/boolean/src/lib.rs index 42b7dfff51..85a6057730 100644 --- a/console/types/boolean/src/lib.rs +++ b/console/types/boolean/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/parse.rs b/console/types/boolean/src/parse.rs index 5a89318eb4..a3f431e074 100644 --- a/console/types/boolean/src/parse.rs +++ b/console/types/boolean/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/random.rs b/console/types/boolean/src/random.rs index 3b27178df0..6f882f26ee 100644 --- a/console/types/boolean/src/random.rs +++ b/console/types/boolean/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/serialize.rs b/console/types/boolean/src/serialize.rs index 2d5e3b063f..ffa2d87730 100644 --- a/console/types/boolean/src/serialize.rs +++ b/console/types/boolean/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/size_in_bits.rs b/console/types/boolean/src/size_in_bits.rs index 40dade5bc4..7f0518081e 100644 --- a/console/types/boolean/src/size_in_bits.rs +++ b/console/types/boolean/src/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/size_in_bytes.rs b/console/types/boolean/src/size_in_bytes.rs index f7c51b36ef..6c32b4c992 100644 --- a/console/types/boolean/src/size_in_bytes.rs +++ b/console/types/boolean/src/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/boolean/src/to_bits.rs b/console/types/boolean/src/to_bits.rs index 9879656dbd..bef762ca40 100644 --- a/console/types/boolean/src/to_bits.rs +++ b/console/types/boolean/src/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/Cargo.toml b/console/types/field/Cargo.toml index c8be7daf1d..20cfbd26bb 100644 --- a/console/types/field/Cargo.toml +++ b/console/types/field/Cargo.toml @@ -1,18 +1,20 @@ [package] name = "snarkvm-console-types-field" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.zeroize] version = "1" diff --git a/console/types/field/src/arithmetic.rs b/console/types/field/src/arithmetic.rs index ef102ff27f..f687f7a665 100644 --- a/console/types/field/src/arithmetic.rs +++ b/console/types/field/src/arithmetic.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/bitwise.rs b/console/types/field/src/bitwise.rs index 779404718c..e3cc7dff5d 100644 --- a/console/types/field/src/bitwise.rs +++ b/console/types/field/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/bytes.rs b/console/types/field/src/bytes.rs index e20dc6a8fe..ff4d7b8f49 100644 --- a/console/types/field/src/bytes.rs +++ b/console/types/field/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/compare.rs b/console/types/field/src/compare.rs index e89fe32da6..be945659da 100644 --- a/console/types/field/src/compare.rs +++ b/console/types/field/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/from_bits.rs b/console/types/field/src/from_bits.rs index ad79a3685e..49c33caf66 100644 --- a/console/types/field/src/from_bits.rs +++ b/console/types/field/src/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/lib.rs b/console/types/field/src/lib.rs index e63aafc883..63e2563cda 100644 --- a/console/types/field/src/lib.rs +++ b/console/types/field/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/one.rs b/console/types/field/src/one.rs index b6ed10deda..c1656ceceb 100644 --- a/console/types/field/src/one.rs +++ b/console/types/field/src/one.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/parse.rs b/console/types/field/src/parse.rs index 7718540875..940ef5c568 100644 --- a/console/types/field/src/parse.rs +++ b/console/types/field/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/random.rs b/console/types/field/src/random.rs index d5618f9009..603206e93e 100644 --- a/console/types/field/src/random.rs +++ b/console/types/field/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/serialize.rs b/console/types/field/src/serialize.rs index 56bc2b7e38..d4d4b0a8a5 100644 --- a/console/types/field/src/serialize.rs +++ b/console/types/field/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/size_in_bits.rs b/console/types/field/src/size_in_bits.rs index 4b5b83c1ef..89c6fc7763 100644 --- a/console/types/field/src/size_in_bits.rs +++ b/console/types/field/src/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/size_in_bytes.rs b/console/types/field/src/size_in_bytes.rs index 6b6764a82b..fdb3d1e1b3 100644 --- a/console/types/field/src/size_in_bytes.rs +++ b/console/types/field/src/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/to_bits.rs b/console/types/field/src/to_bits.rs index 748d021c0a..55dcf223b2 100644 --- a/console/types/field/src/to_bits.rs +++ b/console/types/field/src/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/field/src/zero.rs b/console/types/field/src/zero.rs index 0e4e2adc95..1afb176ea1 100644 --- a/console/types/field/src/zero.rs +++ b/console/types/field/src/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/Cargo.toml b/console/types/group/Cargo.toml index fd4bfc7611..b17b6409d8 100644 --- a/console/types/group/Cargo.toml +++ b/console/types/group/Cargo.toml @@ -1,26 +1,28 @@ [package] name = "snarkvm-console-types-group" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/group/src/arithmetic.rs b/console/types/group/src/arithmetic.rs index 818efba0da..4f47770faa 100644 --- a/console/types/group/src/arithmetic.rs +++ b/console/types/group/src/arithmetic.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/bitwise.rs b/console/types/group/src/bitwise.rs index ba1b30d51a..2b6a1e08d8 100644 --- a/console/types/group/src/bitwise.rs +++ b/console/types/group/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/bytes.rs b/console/types/group/src/bytes.rs index 04d6c8c3e5..78ad939e41 100644 --- a/console/types/group/src/bytes.rs +++ b/console/types/group/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/from_bits.rs b/console/types/group/src/from_bits.rs index d5c9188d54..d6a02d20b7 100644 --- a/console/types/group/src/from_bits.rs +++ b/console/types/group/src/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/from_field.rs b/console/types/group/src/from_field.rs index 6d48b22137..612a751f78 100644 --- a/console/types/group/src/from_field.rs +++ b/console/types/group/src/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/from_fields.rs b/console/types/group/src/from_fields.rs index 10ab239e1a..70addcc826 100644 --- a/console/types/group/src/from_fields.rs +++ b/console/types/group/src/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/from_x_coordinate.rs b/console/types/group/src/from_x_coordinate.rs index f8be208f71..04f0ed9edd 100644 --- a/console/types/group/src/from_x_coordinate.rs +++ b/console/types/group/src/from_x_coordinate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/from_xy_coordinates.rs b/console/types/group/src/from_xy_coordinates.rs index c4f3376003..a802eb0f0b 100644 --- a/console/types/group/src/from_xy_coordinates.rs +++ b/console/types/group/src/from_xy_coordinates.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/lib.rs b/console/types/group/src/lib.rs index db81d377dd..ef21f6a6fb 100644 --- a/console/types/group/src/lib.rs +++ b/console/types/group/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/parse.rs b/console/types/group/src/parse.rs index 09fe6e8bbc..83d348aecf 100644 --- a/console/types/group/src/parse.rs +++ b/console/types/group/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/random.rs b/console/types/group/src/random.rs index 0510f172b7..7875df1d6b 100644 --- a/console/types/group/src/random.rs +++ b/console/types/group/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/serialize.rs b/console/types/group/src/serialize.rs index 2c172d0edd..bf4ea426de 100644 --- a/console/types/group/src/serialize.rs +++ b/console/types/group/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/size_in_bits.rs b/console/types/group/src/size_in_bits.rs index d3260a8065..6643e3c3ab 100644 --- a/console/types/group/src/size_in_bits.rs +++ b/console/types/group/src/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/size_in_bytes.rs b/console/types/group/src/size_in_bytes.rs index 33c2292e95..e1221599eb 100644 --- a/console/types/group/src/size_in_bytes.rs +++ b/console/types/group/src/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/to_bits.rs b/console/types/group/src/to_bits.rs index 4de9d06155..9510939e4a 100644 --- a/console/types/group/src/to_bits.rs +++ b/console/types/group/src/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/to_field.rs b/console/types/group/src/to_field.rs index ffd8166fc8..a89fbf9bba 100644 --- a/console/types/group/src/to_field.rs +++ b/console/types/group/src/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/to_fields.rs b/console/types/group/src/to_fields.rs index 7d0b8ebda9..2327247088 100644 --- a/console/types/group/src/to_fields.rs +++ b/console/types/group/src/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/to_x_coordinate.rs b/console/types/group/src/to_x_coordinate.rs index 22b86e9708..143000dc6a 100644 --- a/console/types/group/src/to_x_coordinate.rs +++ b/console/types/group/src/to_x_coordinate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/to_xy_coordinates.rs b/console/types/group/src/to_xy_coordinates.rs index 041f6d5088..a6d9b83841 100644 --- a/console/types/group/src/to_xy_coordinates.rs +++ b/console/types/group/src/to_xy_coordinates.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/to_y_coordinate.rs b/console/types/group/src/to_y_coordinate.rs index fd5e3c3347..7933a40258 100644 --- a/console/types/group/src/to_y_coordinate.rs +++ b/console/types/group/src/to_y_coordinate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/group/src/zero.rs b/console/types/group/src/zero.rs index ec977396f9..8079b82587 100644 --- a/console/types/group/src/zero.rs +++ b/console/types/group/src/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/Cargo.toml b/console/types/integers/Cargo.toml index 1da2502c68..dd22a59a95 100644 --- a/console/types/integers/Cargo.toml +++ b/console/types/integers/Cargo.toml @@ -1,26 +1,28 @@ [package] name = "snarkvm-console-types-integers" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/integers/src/arithmetic.rs b/console/types/integers/src/arithmetic.rs index 66a780a7c0..fddca57b4d 100644 --- a/console/types/integers/src/arithmetic.rs +++ b/console/types/integers/src/arithmetic.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/bitwise.rs b/console/types/integers/src/bitwise.rs index 899c585ee4..8dfa007dbb 100644 --- a/console/types/integers/src/bitwise.rs +++ b/console/types/integers/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/bytes.rs b/console/types/integers/src/bytes.rs index 76cadcf2fa..3bccbab156 100644 --- a/console/types/integers/src/bytes.rs +++ b/console/types/integers/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/compare.rs b/console/types/integers/src/compare.rs index 691f92971b..133d170bb9 100644 --- a/console/types/integers/src/compare.rs +++ b/console/types/integers/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/from_bits.rs b/console/types/integers/src/from_bits.rs index 87290176de..d0cfc27546 100644 --- a/console/types/integers/src/from_bits.rs +++ b/console/types/integers/src/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/from_field.rs b/console/types/integers/src/from_field.rs index 7292b6e189..3222728452 100644 --- a/console/types/integers/src/from_field.rs +++ b/console/types/integers/src/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/from_field_lossy.rs b/console/types/integers/src/from_field_lossy.rs index bc3894cfa7..50c77a251e 100644 --- a/console/types/integers/src/from_field_lossy.rs +++ b/console/types/integers/src/from_field_lossy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/from_fields.rs b/console/types/integers/src/from_fields.rs index 1908a4e6d3..b977766842 100644 --- a/console/types/integers/src/from_fields.rs +++ b/console/types/integers/src/from_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/lib.rs b/console/types/integers/src/lib.rs index bfc0d0b2b7..64e48f28d0 100644 --- a/console/types/integers/src/lib.rs +++ b/console/types/integers/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/one.rs b/console/types/integers/src/one.rs index 039da5e333..8c403cdde9 100644 --- a/console/types/integers/src/one.rs +++ b/console/types/integers/src/one.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/parse.rs b/console/types/integers/src/parse.rs index 01a6214280..84277bb2ae 100644 --- a/console/types/integers/src/parse.rs +++ b/console/types/integers/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/random.rs b/console/types/integers/src/random.rs index 7f12fb9b4c..3b8292ae35 100644 --- a/console/types/integers/src/random.rs +++ b/console/types/integers/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/serialize.rs b/console/types/integers/src/serialize.rs index 6f2584c0d8..51f2335081 100644 --- a/console/types/integers/src/serialize.rs +++ b/console/types/integers/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/size_in_bits.rs b/console/types/integers/src/size_in_bits.rs index d520a0b1ab..d2c549d02d 100644 --- a/console/types/integers/src/size_in_bits.rs +++ b/console/types/integers/src/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/size_in_bytes.rs b/console/types/integers/src/size_in_bytes.rs index 887327c61a..d2756d76fd 100644 --- a/console/types/integers/src/size_in_bytes.rs +++ b/console/types/integers/src/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/to_bits.rs b/console/types/integers/src/to_bits.rs index 4d36f91b76..33c5fea463 100644 --- a/console/types/integers/src/to_bits.rs +++ b/console/types/integers/src/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/to_field.rs b/console/types/integers/src/to_field.rs index b51d4b7931..5771f07f83 100644 --- a/console/types/integers/src/to_field.rs +++ b/console/types/integers/src/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/to_fields.rs b/console/types/integers/src/to_fields.rs index a98d0808c8..c265920b31 100644 --- a/console/types/integers/src/to_fields.rs +++ b/console/types/integers/src/to_fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/to_scalar.rs b/console/types/integers/src/to_scalar.rs index 4a69bb5010..a64ab5b678 100644 --- a/console/types/integers/src/to_scalar.rs +++ b/console/types/integers/src/to_scalar.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/integers/src/zero.rs b/console/types/integers/src/zero.rs index 4dfeefe070..3c3f25ca97 100644 --- a/console/types/integers/src/zero.rs +++ b/console/types/integers/src/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/Cargo.toml b/console/types/scalar/Cargo.toml index 944a20d5d4..92ec2e63e3 100644 --- a/console/types/scalar/Cargo.toml +++ b/console/types/scalar/Cargo.toml @@ -1,22 +1,24 @@ [package] name = "snarkvm-console-types-scalar" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.zeroize] version = "1" diff --git a/console/types/scalar/src/arithmetic.rs b/console/types/scalar/src/arithmetic.rs index 0f3c3281f9..25f7c21a8f 100644 --- a/console/types/scalar/src/arithmetic.rs +++ b/console/types/scalar/src/arithmetic.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/bitwise.rs b/console/types/scalar/src/bitwise.rs index a6a10fdec4..86f9a017f1 100644 --- a/console/types/scalar/src/bitwise.rs +++ b/console/types/scalar/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/bytes.rs b/console/types/scalar/src/bytes.rs index 4fd3185c86..8f2c0bc990 100644 --- a/console/types/scalar/src/bytes.rs +++ b/console/types/scalar/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/compare.rs b/console/types/scalar/src/compare.rs index d3aca171f5..99fcaeaac7 100644 --- a/console/types/scalar/src/compare.rs +++ b/console/types/scalar/src/compare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/from_bits.rs b/console/types/scalar/src/from_bits.rs index 4f9a123bfb..aa7ff2b416 100644 --- a/console/types/scalar/src/from_bits.rs +++ b/console/types/scalar/src/from_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/from_field.rs b/console/types/scalar/src/from_field.rs index cbed014120..1f13d9e283 100644 --- a/console/types/scalar/src/from_field.rs +++ b/console/types/scalar/src/from_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,8 +23,8 @@ impl FromField for Scalar { /// This method guarantees the following: /// 1. If the field element is larger than the scalar field modulus, then the operation will fail. /// 2. If the field element is smaller than the scalar field modulus, then the operation will succeed. - /// - This is particularly useful for the case where a user called, `Scalar::from_field(scalar.to_field())`, - /// and the scalar bit representation is between `size_in_data_bits < bits.len() < size_in_bits`. + /// - This is particularly useful for the case where a user called, `Scalar::from_field(scalar.to_field())`, + /// and the scalar bit representation is between `size_in_data_bits < bits.len() < size_in_bits`. fn from_field(field: &Self::Field) -> Result { // Note: We are reconstituting the base field into a scalar field. // This is safe as the scalar field modulus is less than the base field modulus, diff --git a/console/types/scalar/src/from_field_lossy.rs b/console/types/scalar/src/from_field_lossy.rs index 072c93325b..038988ebda 100644 --- a/console/types/scalar/src/from_field_lossy.rs +++ b/console/types/scalar/src/from_field_lossy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/lib.rs b/console/types/scalar/src/lib.rs index 859b26ccb0..eeeba9d354 100644 --- a/console/types/scalar/src/lib.rs +++ b/console/types/scalar/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/one.rs b/console/types/scalar/src/one.rs index 9012ae060d..493a38bfb3 100644 --- a/console/types/scalar/src/one.rs +++ b/console/types/scalar/src/one.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/parse.rs b/console/types/scalar/src/parse.rs index 40b58259f2..d29b8f29d3 100644 --- a/console/types/scalar/src/parse.rs +++ b/console/types/scalar/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/random.rs b/console/types/scalar/src/random.rs index e967c8d455..b26d1ee4ef 100644 --- a/console/types/scalar/src/random.rs +++ b/console/types/scalar/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/serialize.rs b/console/types/scalar/src/serialize.rs index 2732ab62f6..f7abb1768f 100644 --- a/console/types/scalar/src/serialize.rs +++ b/console/types/scalar/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/size_in_bits.rs b/console/types/scalar/src/size_in_bits.rs index 066a007bab..c95f00a65a 100644 --- a/console/types/scalar/src/size_in_bits.rs +++ b/console/types/scalar/src/size_in_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/size_in_bytes.rs b/console/types/scalar/src/size_in_bytes.rs index a157aa6df1..de14c06835 100644 --- a/console/types/scalar/src/size_in_bytes.rs +++ b/console/types/scalar/src/size_in_bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/to_bits.rs b/console/types/scalar/src/to_bits.rs index e312b8f1c7..e8a749ee99 100644 --- a/console/types/scalar/src/to_bits.rs +++ b/console/types/scalar/src/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/to_field.rs b/console/types/scalar/src/to_field.rs index 0357a2ce47..c94b7ce99a 100644 --- a/console/types/scalar/src/to_field.rs +++ b/console/types/scalar/src/to_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/scalar/src/zero.rs b/console/types/scalar/src/zero.rs index f45666c061..1be3a3587f 100644 --- a/console/types/scalar/src/zero.rs +++ b/console/types/scalar/src/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/src/lib.rs b/console/types/src/lib.rs index 7c4d8f919a..7b7cf16ef5 100644 --- a/console/types/src/lib.rs +++ b/console/types/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -49,7 +50,7 @@ pub mod modules { #[cfg(feature = "integers")] pub use snarkvm_console_types_integers as integers; #[cfg(feature = "integers")] - pub use snarkvm_console_types_integers::{I128, I16, I32, I64, I8, U128, U16, U32, U64, U8}; + pub use snarkvm_console_types_integers::{I8, I16, I32, I64, I128, U8, U16, U32, U64, U128}; #[cfg(feature = "scalar")] pub use snarkvm_console_types_scalar as scalar; diff --git a/console/types/string/Cargo.toml b/console/types/string/Cargo.toml index aea2da4af3..f33bed0cfb 100644 --- a/console/types/string/Cargo.toml +++ b/console/types/string/Cargo.toml @@ -1,26 +1,28 @@ [package] name = "snarkvm-console-types-string" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" +homepage = "https://aleo.org" +repository = "https://github.com/AleoNet/snarkVM" license = "Apache-2.0" edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-console-types-integers] path = "../integers" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/string/src/bitwise.rs b/console/types/string/src/bitwise.rs index 5947598c88..97e8daec1f 100644 --- a/console/types/string/src/bitwise.rs +++ b/console/types/string/src/bitwise.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/string/src/bytes.rs b/console/types/string/src/bytes.rs index 46fd7fcf33..bfb9f760e0 100644 --- a/console/types/string/src/bytes.rs +++ b/console/types/string/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/string/src/lib.rs b/console/types/string/src/lib.rs index 550d96c3ee..91b2f92c62 100644 --- a/console/types/string/src/lib.rs +++ b/console/types/string/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/string/src/parse.rs b/console/types/string/src/parse.rs index c02f57f0bd..f67ff36f53 100644 --- a/console/types/string/src/parse.rs +++ b/console/types/string/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/string/src/random.rs b/console/types/string/src/random.rs index a963595b68..309a668a2b 100644 --- a/console/types/string/src/random.rs +++ b/console/types/string/src/random.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/console/types/string/src/serialize.rs b/console/types/string/src/serialize.rs index da2cded2fd..813c9fb6c7 100644 --- a/console/types/string/src/serialize.rs +++ b/console/types/string/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/Cargo.toml b/curves/Cargo.toml index 8d4c7c3dd0..7d2721fdb0 100644 --- a/curves/Cargo.toml +++ b/curves/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-curves" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Curves for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -36,12 +36,12 @@ harness = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.rand] diff --git a/curves/benches/bls12_377/ec.rs b/curves/benches/bls12_377/ec.rs index 3b0b28ccf4..c9fe867d87 100644 --- a/curves/benches/bls12_377/ec.rs +++ b/curves/benches/bls12_377/ec.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,9 +15,9 @@ pub(crate) mod g1 { use snarkvm_curves::{ + AffineCurve, bls12_377::{Fr, G1Affine, G1Projective as G1}, traits::ProjectiveCurve, - AffineCurve, }; use snarkvm_utilities::rand::{TestRng, Uniform}; diff --git a/curves/benches/bls12_377/fq.rs b/curves/benches/bls12_377/fq.rs index 02195b2175..ad81c65bbe 100644 --- a/curves/benches/bls12_377/fq.rs +++ b/curves/benches/bls12_377/fq.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/benches/bls12_377/fq12.rs b/curves/benches/bls12_377/fq12.rs index dd357ad923..34ccddd4d6 100644 --- a/curves/benches/bls12_377/fq12.rs +++ b/curves/benches/bls12_377/fq12.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/benches/bls12_377/fq2.rs b/curves/benches/bls12_377/fq2.rs index 3beff2af60..2e50232e43 100644 --- a/curves/benches/bls12_377/fq2.rs +++ b/curves/benches/bls12_377/fq2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/benches/bls12_377/fr.rs b/curves/benches/bls12_377/fr.rs index c9cf826335..37e64d0452 100644 --- a/curves/benches/bls12_377/fr.rs +++ b/curves/benches/bls12_377/fr.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/benches/bls12_377/mod.rs b/curves/benches/bls12_377/mod.rs index 145f6aabb7..3692f87e23 100644 --- a/curves/benches/bls12_377/mod.rs +++ b/curves/benches/bls12_377/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/benches/bls12_377/pairing.rs b/curves/benches/bls12_377/pairing.rs index 41bdd5114d..ff541a7ddd 100644 --- a/curves/benches/bls12_377/pairing.rs +++ b/curves/benches/bls12_377/pairing.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/benches/curves.rs b/curves/benches/curves.rs index cd173c4377..8f0f57ebfa 100644 --- a/curves/benches/curves.rs +++ b/curves/benches/curves.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/build.rs b/curves/build.rs index 6b3f8458d7..81fb6894f5 100644 --- a/curves/build.rs +++ b/curves/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. // Detect the rustc channel -use rustc_version::{version_meta, Channel}; +use rustc_version::{Channel, version_meta}; fn main() { // Set cfg flags depending on release channel diff --git a/curves/src/bls12_377/fq.rs b/curves/src/bls12_377/fq.rs index 1bcd522597..54fd3b9348 100644 --- a/curves/src/bls12_377/fq.rs +++ b/curves/src/bls12_377/fq.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/bls12_377/fq12.rs b/curves/src/bls12_377/fq12.rs index 165599a37f..00a98ecd9d 100644 --- a/curves/src/bls12_377/fq12.rs +++ b/curves/src/bls12_377/fq12.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_fields::{field, Fp12, Fp12Parameters}; +use snarkvm_fields::{Fp12, Fp12Parameters, field}; use snarkvm_utilities::biginteger::BigInteger384 as BigInteger; use crate::bls12_377::{Fq, Fq2, Fq6Parameters}; diff --git a/curves/src/bls12_377/fq2.rs b/curves/src/bls12_377/fq2.rs index fbaffb2c7e..d939091e0d 100644 --- a/curves/src/bls12_377/fq2.rs +++ b/curves/src/bls12_377/fq2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use serde::{Deserialize, Serialize}; -use snarkvm_fields::{field, Field, Fp2, Fp2Parameters}; +use snarkvm_fields::{Field, Fp2, Fp2Parameters, field}; use snarkvm_utilities::biginteger::BigInteger384 as BigInteger; use crate::bls12_377::Fq; diff --git a/curves/src/bls12_377/fq6.rs b/curves/src/bls12_377/fq6.rs index 841c81dabc..464e5d1e96 100644 --- a/curves/src/bls12_377/fq6.rs +++ b/curves/src/bls12_377/fq6.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use snarkvm_fields::{ + Fp2Parameters, field, fp6_3over2::{Fp6, Fp6Parameters}, - Fp2Parameters, }; use snarkvm_utilities::biginteger::BigInteger384; diff --git a/curves/src/bls12_377/fr.rs b/curves/src/bls12_377/fr.rs index 67de1ab1ad..a3a654e12d 100644 --- a/curves/src/bls12_377/fr.rs +++ b/curves/src/bls12_377/fr.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/bls12_377/g1.rs b/curves/src/bls12_377/g1.rs index 34f6379dcc..f7c23bdfd5 100644 --- a/curves/src/bls12_377/g1.rs +++ b/curves/src/bls12_377/g1.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,19 +13,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_fields::{field, Field, One, PrimeField, Zero}; +use snarkvm_fields::{Field, One, PrimeField, Zero, field}; use snarkvm_utilities::{ - biginteger::{BigInteger256, BigInteger384}, BigInteger, BitIteratorBE, + biginteger::{BigInteger256, BigInteger384}, }; use crate::{ + AffineCurve, + ProjectiveCurve, bls12_377::{Fq, Fr}, templates::bls12::Bls12Parameters, traits::{ModelParameters, ShortWeierstrassParameters}, - AffineCurve, - ProjectiveCurve, }; use std::ops::Neg; diff --git a/curves/src/bls12_377/g2.rs b/curves/src/bls12_377/g2.rs index 06b130e62e..ff2f1a8d9f 100644 --- a/curves/src/bls12_377/g2.rs +++ b/curves/src/bls12_377/g2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,18 +13,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm_fields::{field, Field, PrimeField, Zero}; +use snarkvm_fields::{Field, PrimeField, Zero, field}; use snarkvm_utilities::{ - biginteger::{BigInteger256, BigInteger384}, BigInteger, BitIteratorBE, + biginteger::{BigInteger256, BigInteger384}, }; use crate::{ - bls12_377::{g1::Bls12_377G1Parameters, Fq, Fq2, Fr}, - traits::{ModelParameters, ShortWeierstrassParameters}, AffineCurve, ProjectiveCurve, + bls12_377::{Fq, Fq2, Fr, g1::Bls12_377G1Parameters}, + traits::{ModelParameters, ShortWeierstrassParameters}, }; use std::ops::Neg; diff --git a/curves/src/bls12_377/mod.rs b/curves/src/bls12_377/mod.rs index 934990ad56..2667c9a3bc 100644 --- a/curves/src/bls12_377/mod.rs +++ b/curves/src/bls12_377/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![cfg_attr(nightly, doc = include_str!("../../documentation/the_aleo_curves/02_bls12-377.md"))] +#![doc = include_str!("../../documentation/the_aleo_curves/02_bls12-377.md")] pub mod fr; #[doc(inline)] diff --git a/curves/src/bls12_377/parameters.rs b/curves/src/bls12_377/parameters.rs index f731fc22d0..dd3f489142 100644 --- a/curves/src/bls12_377/parameters.rs +++ b/curves/src/bls12_377/parameters.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,13 +15,13 @@ use crate::{ bls12_377::{ - g1::Bls12_377G1Parameters, - g2::Bls12_377G2Parameters, Fq, - Fq12, - Fq12Parameters, Fq2Parameters, Fq6Parameters, + Fq12, + Fq12Parameters, + g1::Bls12_377G1Parameters, + g2::Bls12_377G2Parameters, }, templates::bls12::{ Bls12, diff --git a/curves/src/bls12_377/tests.rs b/curves/src/bls12_377/tests.rs index d68364c213..9c63aa4044 100644 --- a/curves/src/bls12_377/tests.rs +++ b/curves/src/bls12_377/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,15 +16,13 @@ #![allow(unused_imports)] use crate::{ bls12_377::{ - g1::Bls12_377G1Parameters, - g2::Bls12_377G2Parameters, Bls12_377, Fq, - Fq12, Fq2, Fq2Parameters, Fq6, Fq6Parameters, + Fq12, FqParameters, Fr, FrParameters, @@ -31,9 +30,15 @@ use crate::{ G1Projective, G2Affine, G2Projective, + g1::Bls12_377G1Parameters, + g2::Bls12_377G2Parameters, }, templates::{short_weierstrass_jacobian::tests::sw_tests, twisted_edwards_extended::tests::edwards_test}, traits::{ + AffineCurve, + PairingEngine, + ProjectiveCurve, + ShortWeierstrassParameters, tests_field::{ bench_sqrt, field_serialization_test, @@ -45,14 +50,9 @@ use crate::{ }, tests_group::*, tests_projective::curve_tests, - AffineCurve, - PairingEngine, - ProjectiveCurve, - ShortWeierstrassParameters, }, }; use snarkvm_fields::{ - fp6_3over2::Fp6Parameters, FftField, FftParameters, Field, @@ -63,11 +63,12 @@ use snarkvm_fields::{ PrimeField, SquareRootField, Zero, + fp6_3over2::Fp6Parameters, }; use snarkvm_utilities::{ + BitIteratorBE, biginteger::{BigInteger, BigInteger256, BigInteger384}, rand::{TestRng, Uniform}, - BitIteratorBE, }; use rand::Rng; diff --git a/curves/src/edwards_bls12/fq.rs b/curves/src/edwards_bls12/fq.rs index 279b0795e4..665579ceae 100644 --- a/curves/src/edwards_bls12/fq.rs +++ b/curves/src/edwards_bls12/fq.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/edwards_bls12/fr.rs b/curves/src/edwards_bls12/fr.rs index 0ed9d8e233..b40307e9f8 100644 --- a/curves/src/edwards_bls12/fr.rs +++ b/curves/src/edwards_bls12/fr.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/edwards_bls12/mod.rs b/curves/src/edwards_bls12/mod.rs index c51efebd49..7ba8acc6c6 100644 --- a/curves/src/edwards_bls12/mod.rs +++ b/curves/src/edwards_bls12/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![cfg_attr(nightly, doc = include_str!("../../documentation/the_aleo_curves/01_edwards_bls12.md"))] +#![doc = include_str!("../../documentation/the_aleo_curves/01_edwards_bls12.md")] pub mod fq; #[doc(inline)] diff --git a/curves/src/edwards_bls12/parameters.rs b/curves/src/edwards_bls12/parameters.rs index 138e3e1252..c03024dfaa 100644 --- a/curves/src/edwards_bls12/parameters.rs +++ b/curves/src/edwards_bls12/parameters.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -103,7 +104,7 @@ impl FromStr for EdwardsAffine { return Err(GroupError::InvalidString); } let mut point = Vec::new(); - for substr in s.split(|c| c == '(' || c == ')' || c == ',' || c == ' ') { + for substr in s.split(['(', ')', ',', ' ']) { if !substr.is_empty() { point.push(Fq::from_str(substr)?); } diff --git a/curves/src/edwards_bls12/tests.rs b/curves/src/edwards_bls12/tests.rs index 6b33288f36..9e77d4da40 100644 --- a/curves/src/edwards_bls12/tests.rs +++ b/curves/src/edwards_bls12/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,20 +17,20 @@ use crate::{ edwards_bls12::*, templates::twisted_edwards_extended::tests::{edwards_test, montgomery_conversion_test}, traits::{ - tests_field::{field_serialization_test, field_test, primefield_test}, - tests_group::*, - tests_projective::curve_tests, AffineCurve, MontgomeryParameters, ProjectiveCurve, TwistedEdwardsParameters, + tests_field::{field_serialization_test, field_test, primefield_test}, + tests_group::*, + tests_projective::curve_tests, }, }; use snarkvm_fields::{Field, LegendreSymbol, One, SquareRootField, Zero}; use snarkvm_utilities::{ + ToBytes, rand::{TestRng, Uniform}, to_bytes_le, - ToBytes, }; use rand::Rng; diff --git a/curves/src/errors.rs b/curves/src/errors.rs index 748fa6657a..50c126d687 100644 --- a/curves/src/errors.rs +++ b/curves/src/errors.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/lib.rs b/curves/src/lib.rs index 659ef01c31..d78de0a46a 100644 --- a/curves/src/lib.rs +++ b/curves/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/bls12/bls12.rs b/curves/src/templates/bls12/bls12.rs index 71a57c22e9..d275040ec2 100644 --- a/curves/src/templates/bls12/bls12.rs +++ b/curves/src/templates/bls12/bls12.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,6 +14,7 @@ // limitations under the License. use crate::{ + AffineCurve, templates::{ bls12::{ g1::{G1Affine, G1Prepared, G1Projective}, @@ -21,19 +23,18 @@ use crate::{ short_weierstrass_jacobian, }, traits::{ModelParameters, PairingCurve, PairingEngine, ShortWeierstrassParameters}, - AffineCurve, }; use snarkvm_fields::{ - fp6_3over2::Fp6Parameters, Field, - Fp12, - Fp12Parameters, Fp2, Fp2Parameters, + Fp12, + Fp12Parameters, One, PrimeField, SquareRootField, Zero, + fp6_3over2::Fp6Parameters, }; use snarkvm_utilities::bititerator::BitIteratorBE; diff --git a/curves/src/templates/bls12/g1.rs b/curves/src/templates/bls12/g1.rs index ca7c7b40f4..fdea8e7445 100644 --- a/curves/src/templates/bls12/g1.rs +++ b/curves/src/templates/bls12/g1.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ use crate::{ traits::AffineCurve, }; use snarkvm_fields::Zero; -use snarkvm_utilities::{serialize::*, FromBytes, ToBytes}; +use snarkvm_utilities::{FromBytes, ToBytes, serialize::*}; use std::io::{Read, Result as IoResult, Write}; diff --git a/curves/src/templates/bls12/g2.rs b/curves/src/templates/bls12/g2.rs index 5c27d12909..1cb3c4e54d 100644 --- a/curves/src/templates/bls12/g2.rs +++ b/curves/src/templates/bls12/g2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,7 +21,7 @@ use crate::{ traits::{AffineCurve, ShortWeierstrassParameters}, }; use snarkvm_fields::{Field, Fp2, One, Zero}; -use snarkvm_utilities::{bititerator::BitIteratorBE, serialize::*, ToBytes}; +use snarkvm_utilities::{ToBytes, bititerator::BitIteratorBE, serialize::*}; use std::io::{Result as IoResult, Write}; diff --git a/curves/src/templates/bls12/mod.rs b/curves/src/templates/bls12/mod.rs index c5f0ae8885..84d5343d63 100644 --- a/curves/src/templates/bls12/mod.rs +++ b/curves/src/templates/bls12/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/macros.rs b/curves/src/templates/macros.rs index 2447aa03ae..7d0e08bd25 100644 --- a/curves/src/templates/macros.rs +++ b/curves/src/templates/macros.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/mod.rs b/curves/src/templates/mod.rs index 22d0ef5e6c..4a43044eec 100644 --- a/curves/src/templates/mod.rs +++ b/curves/src/templates/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/short_weierstrass_jacobian/affine.rs b/curves/src/templates/short_weierstrass_jacobian/affine.rs index d5cbe730f5..b339bae637 100644 --- a/curves/src/templates/short_weierstrass_jacobian/affine.rs +++ b/curves/src/templates/short_weierstrass_jacobian/affine.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,12 +20,12 @@ use crate::{ }; use snarkvm_fields::{Field, One, SquareRootField, Zero}; use snarkvm_utilities::{ + FromBytes, + ToBytes, bititerator::BitIteratorBE, io::{Error, ErrorKind, Read, Result as IoResult, Write}, rand::Uniform, serialize::*, - FromBytes, - ToBytes, }; use core::{ @@ -32,8 +33,8 @@ use core::{ ops::{Mul, Neg}, }; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use serde::{Deserialize, Serialize}; diff --git a/curves/src/templates/short_weierstrass_jacobian/mod.rs b/curves/src/templates/short_weierstrass_jacobian/mod.rs index 8edbcabf67..6516ecbb3b 100644 --- a/curves/src/templates/short_weierstrass_jacobian/mod.rs +++ b/curves/src/templates/short_weierstrass_jacobian/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/short_weierstrass_jacobian/projective.rs b/curves/src/templates/short_weierstrass_jacobian/projective.rs index c45d4ec2d3..3b0f5b34fb 100644 --- a/curves/src/templates/short_weierstrass_jacobian/projective.rs +++ b/curves/src/templates/short_weierstrass_jacobian/projective.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,8 +17,8 @@ use crate::{ templates::short_weierstrass_jacobian::Affine, traits::{AffineCurve, ProjectiveCurve, ShortWeierstrassParameters as Parameters}, }; -use snarkvm_fields::{impl_add_sub_from_field_ref, Field, One, Zero}; -use snarkvm_utilities::{cfg_iter_mut, rand::Uniform, serialize::*, FromBytes, ToBytes}; +use snarkvm_fields::{Field, One, Zero, impl_add_sub_from_field_ref}; +use snarkvm_utilities::{FromBytes, ToBytes, cfg_iter_mut, rand::Uniform, serialize::*}; use core::{ fmt::{Display, Formatter, Result as FmtResult}, @@ -25,8 +26,8 @@ use core::{ ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; #[cfg(not(feature = "serial"))] use rayon::prelude::*; diff --git a/curves/src/templates/short_weierstrass_jacobian/tests.rs b/curves/src/templates/short_weierstrass_jacobian/tests.rs index b8f94bbd23..74b473183e 100644 --- a/curves/src/templates/short_weierstrass_jacobian/tests.rs +++ b/curves/src/templates/short_weierstrass_jacobian/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,12 +17,12 @@ use super::{Affine, Projective}; use crate::{AffineCurve, ProjectiveCurve, ShortWeierstrassParameters}; use snarkvm_fields::Zero; use snarkvm_utilities::{ - io::Cursor, - rand::Uniform, - serialize::{CanonicalDeserialize, CanonicalSerialize}, Compress, TestRng, Validate, + io::Cursor, + rand::Uniform, + serialize::{CanonicalDeserialize, CanonicalSerialize}, }; pub const ITERATIONS: usize = 10; diff --git a/curves/src/templates/to_field_vec.rs b/curves/src/templates/to_field_vec.rs index 758422de87..c5a8ea18a1 100644 --- a/curves/src/templates/to_field_vec.rs +++ b/curves/src/templates/to_field_vec.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/twisted_edwards_extended/affine.rs b/curves/src/templates/twisted_edwards_extended/affine.rs index d850729e4b..a6712a3303 100644 --- a/curves/src/templates/twisted_edwards_extended/affine.rs +++ b/curves/src/templates/twisted_edwards_extended/affine.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,12 +20,12 @@ use crate::{ }; use snarkvm_fields::{Field, One, PrimeField, SquareRootField, Zero}; use snarkvm_utilities::{ + FromBytes, + ToBytes, bititerator::BitIteratorBE, io::{Read, Result as IoResult, Write}, rand::Uniform, serialize::*, - FromBytes, - ToBytes, }; use core::{ @@ -32,8 +33,8 @@ use core::{ ops::{Mul, Neg}, }; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use serde::{Deserialize, Serialize}; diff --git a/curves/src/templates/twisted_edwards_extended/mod.rs b/curves/src/templates/twisted_edwards_extended/mod.rs index 8edbcabf67..6516ecbb3b 100644 --- a/curves/src/templates/twisted_edwards_extended/mod.rs +++ b/curves/src/templates/twisted_edwards_extended/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/templates/twisted_edwards_extended/projective.rs b/curves/src/templates/twisted_edwards_extended/projective.rs index 5db7a6830c..0cdc2f7d3c 100644 --- a/curves/src/templates/twisted_edwards_extended/projective.rs +++ b/curves/src/templates/twisted_edwards_extended/projective.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,8 +17,8 @@ use crate::{ templates::twisted_edwards_extended::Affine, traits::{AffineCurve, ProjectiveCurve, TwistedEdwardsParameters as Parameters}, }; -use snarkvm_fields::{impl_add_sub_from_field_ref, Field, One, PrimeField, Zero}; -use snarkvm_utilities::{bititerator::BitIteratorBE, rand::Uniform, serialize::*, FromBytes, ToBytes}; +use snarkvm_fields::{Field, One, PrimeField, Zero, impl_add_sub_from_field_ref}; +use snarkvm_utilities::{FromBytes, ToBytes, bititerator::BitIteratorBE, rand::Uniform, serialize::*}; use core::{ fmt::{Display, Formatter, Result as FmtResult}, @@ -25,8 +26,8 @@ use core::{ ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use std::io::{Read, Result as IoResult, Write}; diff --git a/curves/src/templates/twisted_edwards_extended/tests.rs b/curves/src/templates/twisted_edwards_extended/tests.rs index e1ccbded0d..0412c2595a 100644 --- a/curves/src/templates/twisted_edwards_extended/tests.rs +++ b/curves/src/templates/twisted_edwards_extended/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,14 +16,14 @@ use super::{Affine, Projective}; use snarkvm_utilities::{ - io::Cursor, - rand::Uniform, - serialize::{CanonicalDeserialize, CanonicalSerialize}, - to_bytes_le, Compress, TestRng, ToBytes, Validate, + io::Cursor, + rand::Uniform, + serialize::{CanonicalDeserialize, CanonicalSerialize}, + to_bytes_le, }; use crate::traits::{AffineCurve, MontgomeryParameters, ProjectiveCurve, TwistedEdwardsParameters}; diff --git a/curves/src/traits/group.rs b/curves/src/traits/group.rs index 47f8bdcc69..c7ca15a80e 100644 --- a/curves/src/traits/group.rs +++ b/curves/src/traits/group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{templates::short_weierstrass_jacobian, PairingEngine}; +use crate::{PairingEngine, templates::short_weierstrass_jacobian}; use snarkvm_fields::{Field, PrimeField, SquareRootField, Zero}; -use snarkvm_utilities::{rand::Uniform, serialize::*, FromBytes, ToBytes}; +use snarkvm_utilities::{FromBytes, ToBytes, rand::Uniform, serialize::*}; use core::{ fmt::{Debug, Display}, @@ -22,7 +23,7 @@ use core::{ iter, ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; /// Projective representation of an elliptic curve point guaranteed to be in the prime order subgroup. pub trait ProjectiveCurve: diff --git a/curves/src/traits/mod.rs b/curves/src/traits/mod.rs index dad95a76ad..5d9d49b4f3 100644 --- a/curves/src/traits/mod.rs +++ b/curves/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/traits/pairing_engine.rs b/curves/src/traits/pairing_engine.rs index d422580f58..0a8d62ca97 100644 --- a/curves/src/traits/pairing_engine.rs +++ b/curves/src/traits/pairing_engine.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/traits/tests_field.rs b/curves/src/traits/tests_field.rs index d1d5ac9b09..76137b31af 100644 --- a/curves/src/traits/tests_field.rs +++ b/curves/src/traits/tests_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,12 +14,12 @@ // limitations under the License. use snarkvm_fields::{ - traits::{FftParameters, FieldParameters}, FftField, Field, LegendreSymbol, PrimeField, SquareRootField, + traits::{FftParameters, FieldParameters}, }; use snarkvm_utilities::{ io::Cursor, diff --git a/curves/src/traits/tests_group.rs b/curves/src/traits/tests_group.rs index 2530a7b474..271a16faeb 100644 --- a/curves/src/traits/tests_group.rs +++ b/curves/src/traits/tests_group.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/curves/src/traits/tests_projective.rs b/curves/src/traits/tests_projective.rs index b48d55d9a3..be7a206c8e 100644 --- a/curves/src/traits/tests_projective.rs +++ b/curves/src/traits/tests_projective.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/Cargo.toml b/fields/Cargo.toml index df9474d09e..53bca86512 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-fields" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Fields for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -30,7 +30,7 @@ harness = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.aleo-std] diff --git a/fields/benches/fields.rs b/fields/benches/fields.rs index f58e4f6a64..81af5be729 100644 --- a/fields/benches/fields.rs +++ b/fields/benches/fields.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/errors/constraint_field.rs b/fields/src/errors/constraint_field.rs index 49273d3c3c..d7de1ffaed 100644 --- a/fields/src/errors/constraint_field.rs +++ b/fields/src/errors/constraint_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/errors/field.rs b/fields/src/errors/field.rs index 382158bede..9f8f3e3847 100644 --- a/fields/src/errors/field.rs +++ b/fields/src/errors/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/errors/mod.rs b/fields/src/errors/mod.rs index b946147a53..6a14889b41 100644 --- a/fields/src/errors/mod.rs +++ b/fields/src/errors/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/fp12_2over3over2.rs b/fields/src/fp12_2over3over2.rs index e7da3be7cd..f890ae6c1b 100644 --- a/fields/src/fp12_2over3over2.rs +++ b/fields/src/fp12_2over3over2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{fp6_3over2::*, Field, Fp2, Fp2Parameters, One, Zero}; -use snarkvm_utilities::{bititerator::BitIteratorBE, rand::Uniform, serialize::*, FromBytes, ToBits, ToBytes}; +use crate::{Field, Fp2, Fp2Parameters, One, Zero, fp6_3over2::*}; +use snarkvm_utilities::{FromBytes, ToBits, ToBytes, bititerator::BitIteratorBE, rand::Uniform, serialize::*}; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use serde::{Deserialize, Serialize}; use std::{ diff --git a/fields/src/fp2.rs b/fields/src/fp2.rs index 528e5c3be7..72a260b85b 100644 --- a/fields/src/fp2.rs +++ b/fields/src/fp2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,16 +15,16 @@ use crate::{Field, LegendreSymbol, One, PrimeField, SquareRootField, Zero}; use snarkvm_utilities::{ - rand::Uniform, - serialize::{SerializationError, *}, FromBytes, ToBits, ToBytes, + rand::Uniform, + serialize::{SerializationError, *}, }; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use serde::{Deserialize, Serialize}; use std::{ diff --git a/fields/src/fp6_3over2.rs b/fields/src/fp6_3over2.rs index 5699630195..d7ba904c76 100644 --- a/fields/src/fp6_3over2.rs +++ b/fields/src/fp6_3over2.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,16 +15,16 @@ use crate::{Field, Fp2, Fp2Parameters, One, Zero}; use snarkvm_utilities::{ - rand::Uniform, - serialize::{SerializationError, *}, FromBytes, ToBits, ToBytes, + rand::Uniform, + serialize::{SerializationError, *}, }; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use serde::{Deserialize, Serialize}; use std::{ diff --git a/fields/src/fp_256.rs b/fields/src/fp_256.rs index 80f69a635b..7d6cc1495d 100644 --- a/fields/src/fp_256.rs +++ b/fields/src/fp_256.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,8 +14,6 @@ // limitations under the License. use crate::{ - impl_add_sub_from_field_ref, - impl_mul_div_from_field_ref, FftField, Field, FieldError, @@ -26,13 +25,15 @@ use crate::{ PrimeField, SquareRootField, Zero, + impl_add_sub_from_field_ref, + impl_mul_div_from_field_ref, }; use snarkvm_utilities::{ - biginteger::{arithmetic as fa, BigInteger as _BigInteger, BigInteger256 as BigInteger}, - serialize::CanonicalDeserialize, FromBytes, ToBits, ToBytes, + biginteger::{BigInteger as _BigInteger, BigInteger256 as BigInteger, arithmetic as fa}, + serialize::CanonicalDeserialize, }; use std::{ diff --git a/fields/src/fp_384.rs b/fields/src/fp_384.rs index 1e60a18c2f..d1ff2ee895 100644 --- a/fields/src/fp_384.rs +++ b/fields/src/fp_384.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,8 +14,6 @@ // limitations under the License. use crate::{ - impl_add_sub_from_field_ref, - impl_mul_div_from_field_ref, FftField, Field, FieldError, @@ -26,13 +25,15 @@ use crate::{ PrimeField, SquareRootField, Zero, + impl_add_sub_from_field_ref, + impl_mul_div_from_field_ref, }; use snarkvm_utilities::{ - biginteger::{arithmetic as fa, BigInteger as _BigInteger, BigInteger384 as BigInteger}, - serialize::CanonicalDeserialize, FromBytes, ToBits, ToBytes, + biginteger::{BigInteger as _BigInteger, BigInteger384 as BigInteger, arithmetic as fa}, + serialize::CanonicalDeserialize, }; use std::{ diff --git a/fields/src/legendre.rs b/fields/src/legendre.rs index 9992fe7144..81fc0fd0cf 100644 --- a/fields/src/legendre.rs +++ b/fields/src/legendre.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/lib.rs b/fields/src/lib.rs index 52b1ac0c3d..c21d4f764b 100644 --- a/fields/src/lib.rs +++ b/fields/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -49,10 +50,10 @@ pub mod traits; pub use traits::*; use snarkvm_utilities::{ - biginteger::*, - serialize::{CanonicalDeserialize, CanonicalDeserializeWithFlags, CanonicalSerialize, CanonicalSerializeWithFlags}, FromBytes, ToBytes, + biginteger::*, + serialize::{CanonicalDeserialize, CanonicalDeserializeWithFlags, CanonicalSerialize, CanonicalSerializeWithFlags}, }; impl_field_to_biginteger!(Fp256, BigInteger256, Fp256Parameters); diff --git a/fields/src/macros.rs b/fields/src/macros.rs index 493745348a..3b09e90f89 100644 --- a/fields/src/macros.rs +++ b/fields/src/macros.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -44,7 +45,7 @@ macro_rules! impl_primefield_standard_sample { loop { let mut tmp = $field(rng.sample(rand::distributions::Standard), PhantomData); // Mask away the unused bits at the beginning. - tmp.0.as_mut().last_mut().map(|val| *val &= std::u64::MAX >> P::REPR_SHAVE_BITS); + tmp.0.as_mut().last_mut().map(|val| *val &= u64::MAX >> P::REPR_SHAVE_BITS); if tmp.is_valid() { return tmp; @@ -192,7 +193,7 @@ macro_rules! impl_primefield_serializer { mut writer: W, flags: F, ) -> Result<(), snarkvm_utilities::serialize::SerializationError> { - use snarkvm_utilities::serialize::{number_of_bits_and_bytes, SerializationError}; + use snarkvm_utilities::serialize::{SerializationError, number_of_bits_and_bytes}; // All reasonable `Flags` should be less than 8 bits in size // (256 values are enough for anyone!) if F::BIT_SIZE > 8 { diff --git a/fields/src/to_field_vec.rs b/fields/src/to_field_vec.rs index e790fb47ea..d8e65138e7 100644 --- a/fields/src/to_field_vec.rs +++ b/fields/src/to_field_vec.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/fft_field.rs b/fields/src/traits/fft_field.rs index 6dad3522e3..17aa8a98c6 100644 --- a/fields/src/traits/fft_field.rs +++ b/fields/src/traits/fft_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/fft_parameters.rs b/fields/src/traits/fft_parameters.rs index 9e52aafa80..875af189c4 100644 --- a/fields/src/traits/fft_parameters.rs +++ b/fields/src/traits/fft_parameters.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/field.rs b/fields/src/traits/field.rs index cdad6ed9db..fe3309e162 100644 --- a/fields/src/traits/field.rs +++ b/fields/src/traits/field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,6 +15,9 @@ use crate::{One, PrimeField, Zero}; use snarkvm_utilities::{ + FromBytes, + ToBits, + ToBytes, bititerator::BitIteratorBE, rand::Uniform, serialize::{ @@ -24,9 +28,6 @@ use snarkvm_utilities::{ EmptyFlags, Flags, }, - FromBytes, - ToBits, - ToBytes, }; use std::{ diff --git a/fields/src/traits/field_parameters.rs b/fields/src/traits/field_parameters.rs index ba0c4a186a..d91a8f5d3b 100644 --- a/fields/src/traits/field_parameters.rs +++ b/fields/src/traits/field_parameters.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/mod.rs b/fields/src/traits/mod.rs index a07b63a013..631e03fdc6 100644 --- a/fields/src/traits/mod.rs +++ b/fields/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/poseidon_default.rs b/fields/src/traits/poseidon_default.rs index a4d63dc405..0c5d3dd582 100644 --- a/fields/src/traits/poseidon_default.rs +++ b/fields/src/traits/poseidon_default.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,11 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{serial_batch_inversion_and_mul, PoseidonGrainLFSR, PrimeField}; +use crate::{PoseidonGrainLFSR, PrimeField, serial_batch_inversion_and_mul}; use aleo_std::{end_timer, start_timer}; use itertools::Itertools; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; /// Parameters and RNG used #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/fields/src/traits/poseidon_grain_lfsr.rs b/fields/src/traits/poseidon_grain_lfsr.rs index bcefe30fa6..e090096453 100644 --- a/fields/src/traits/poseidon_grain_lfsr.rs +++ b/fields/src/traits/poseidon_grain_lfsr.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,9 +16,9 @@ #![allow(dead_code)] use crate::{FieldParameters, PrimeField}; -use snarkvm_utilities::{vec::Vec, FromBits}; +use snarkvm_utilities::{FromBits, vec::Vec}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; pub struct PoseidonGrainLFSR { pub field_size_in_bits: u64, diff --git a/fields/src/traits/prime_field.rs b/fields/src/traits/prime_field.rs index 35f5614148..d9ba38949f 100644 --- a/fields/src/traits/prime_field.rs +++ b/fields/src/traits/prime_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/square_root_field.rs b/fields/src/traits/square_root_field.rs index a3d0e98520..2dfa0e3adb 100644 --- a/fields/src/traits/square_root_field.rs +++ b/fields/src/traits/square_root_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/to_constraint_field.rs b/fields/src/traits/to_constraint_field.rs index dbd6012f8a..6a07a95d86 100644 --- a/fields/src/traits/to_constraint_field.rs +++ b/fields/src/traits/to_constraint_field.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/fields/src/traits/zero.rs b/fields/src/traits/zero.rs index 666898d56d..5ccf5e3254 100644 --- a/fields/src/traits/zero.rs +++ b/fields/src/traits/zero.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index 709a32abe0..c2eca6484a 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A node ledger for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -62,54 +62,54 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "./authority" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "./block" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "./committee" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-narwhal] package = "snarkvm-ledger-narwhal" path = "./narwhal" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-puzzle] package = "snarkvm-ledger-puzzle" path = "puzzle" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "./query" -version = "=0.16.19" +version = "=1.0.0" features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "./store" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-test-helpers] package = "snarkvm-ledger-test-helpers" path = "./test-helpers" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.synthesizer] package = "snarkvm-synthesizer" path = "../synthesizer" -version = "=0.16.19" +version = "=1.0.0" [dependencies.aleo-std] version = "0.1.24" @@ -156,3 +156,9 @@ path = "./test-helpers" [dev-dependencies.serde_json] version = "1.0" features = [ "preserve_order" ] + +[dev-dependencies.snarkvm-circuit] +path = "../circuit" + +[dev-dependencies.snarkvm-utilities] +path = "../utilities" diff --git a/ledger/authority/Cargo.toml b/ledger/authority/Cargo.toml index bf1ce00d77..45fd41b818 100644 --- a/ledger/authority/Cargo.toml +++ b/ledger/authority/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-authority" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Data structures for a block authority in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-subdag/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.19" +version = "=1.0.0" [dependencies.anyhow] version = "1" diff --git a/ledger/authority/src/bytes.rs b/ledger/authority/src/bytes.rs index 1d710be1c6..3935971bed 100644 --- a/ledger/authority/src/bytes.rs +++ b/ledger/authority/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/authority/src/lib.rs b/ledger/authority/src/lib.rs index 5d6c8e5736..526be0cfc8 100644 --- a/ledger/authority/src/lib.rs +++ b/ledger/authority/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,10 +24,6 @@ use console::{ account::{Address, PrivateKey, Signature}, network::Network, prelude::{ - de, - error, - fmt, - ser, Debug, Deserialize, DeserializeExt, @@ -45,6 +42,10 @@ use console::{ ToBytes, ToBytesSerializer, Write, + de, + error, + fmt, + ser, }, types::Field, }; diff --git a/ledger/authority/src/serialize.rs b/ledger/authority/src/serialize.rs index ba87f9aac5..72208f60c6 100644 --- a/ledger/authority/src/serialize.rs +++ b/ledger/authority/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/authority/src/string.rs b/ledger/authority/src/string.rs index 922c80025d..5e132d1e69 100644 --- a/ledger/authority/src/string.rs +++ b/ledger/authority/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/benches/block.rs b/ledger/benches/block.rs index 710c96661f..81b8a7f98f 100644 --- a/ledger/benches/block.rs +++ b/ledger/benches/block.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/benches/bonded_mapping.rs b/ledger/benches/bonded_mapping.rs index 19a5aaa208..15dcc5d82c 100644 --- a/ledger/benches/bonded_mapping.rs +++ b/ledger/benches/bonded_mapping.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/benches/transaction.rs b/ledger/benches/transaction.rs index 7e6e23a544..933b0918c0 100644 --- a/ledger/benches/transaction.rs +++ b/ledger/benches/transaction.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,8 +24,8 @@ use console::{ program::{Plaintext, Record, Value}, }; use ledger_block::Transition; -use ledger_store::{helpers::memory::ConsensusMemory, ConsensusStore}; -use synthesizer::{program::Program, VM}; +use ledger_store::{ConsensusStore, helpers::memory::ConsensusMemory}; +use synthesizer::{VM, program::Program}; use criterion::Criterion; use indexmap::IndexMap; diff --git a/ledger/block/Cargo.toml b/ledger/block/Cargo.toml index de289f8bd7..4429ab54e8 100644 --- a/ledger/block/Cargo.toml +++ b/ledger/block/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-block" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A block for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -39,47 +39,52 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../ledger/committee" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../narwhal/batch-header" -version = "=0.16.19" +version = "=1.0.0" + +[dependencies.ledger-narwhal-data] +package = "snarkvm-ledger-narwhal-data" +path = "../narwhal/data" +version = "=1.0.0" [dependencies.ledger-narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../narwhal/transmission-id" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-puzzle] package = "snarkvm-ledger-puzzle" path = "../puzzle" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.19" +version = "=1.0.0" [dependencies.indexmap] version = "2.0" diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index 9a33f1f2d2..bd258803b5 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -32,7 +33,7 @@ impl FromBytes for Block { // Read the header. let header = FromBytes::read_le(&mut reader)?; - // Write the authority. + // Read the authority. let authority = FromBytes::read_le(&mut reader)?; // Read the number of ratifications. diff --git a/ledger/block/src/genesis.rs b/ledger/block/src/genesis.rs index 1370598a08..1aa096e986 100644 --- a/ledger/block/src/genesis.rs +++ b/ledger/block/src/genesis.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/bytes.rs b/ledger/block/src/header/bytes.rs index a906e6a4ab..37f3d55b32 100644 --- a/ledger/block/src/header/bytes.rs +++ b/ledger/block/src/header/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/genesis.rs b/ledger/block/src/header/genesis.rs index 5d653b4671..ab351a0fe0 100644 --- a/ledger/block/src/header/genesis.rs +++ b/ledger/block/src/header/genesis.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/merkle.rs b/ledger/block/src/header/merkle.rs index 0c8f1c1ac1..98360dd934 100644 --- a/ledger/block/src/header/merkle.rs +++ b/ledger/block/src/header/merkle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/bytes.rs b/ledger/block/src/header/metadata/bytes.rs index f458935906..0276bc6269 100644 --- a/ledger/block/src/header/metadata/bytes.rs +++ b/ledger/block/src/header/metadata/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/genesis.rs b/ledger/block/src/header/metadata/genesis.rs index dc34250c0c..63de6bcb11 100644 --- a/ledger/block/src/header/metadata/genesis.rs +++ b/ledger/block/src/header/metadata/genesis.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/mod.rs b/ledger/block/src/header/metadata/mod.rs index 9bb7e2dcab..568e7e0d9d 100644 --- a/ledger/block/src/header/metadata/mod.rs +++ b/ledger/block/src/header/metadata/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/serialize.rs b/ledger/block/src/header/metadata/serialize.rs index a756c2e55b..1be1042d5b 100644 --- a/ledger/block/src/header/metadata/serialize.rs +++ b/ledger/block/src/header/metadata/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/string.rs b/ledger/block/src/header/metadata/string.rs index 34f236f35e..5e890f2595 100644 --- a/ledger/block/src/header/metadata/string.rs +++ b/ledger/block/src/header/metadata/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/to_bits.rs b/ledger/block/src/header/metadata/to_bits.rs index ac89e5627a..82c9add277 100644 --- a/ledger/block/src/header/metadata/to_bits.rs +++ b/ledger/block/src/header/metadata/to_bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/to_hash.rs b/ledger/block/src/header/metadata/to_hash.rs index 03e8664937..01da9e2bb8 100644 --- a/ledger/block/src/header/metadata/to_hash.rs +++ b/ledger/block/src/header/metadata/to_hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/metadata/verify.rs b/ledger/block/src/header/metadata/verify.rs index aeff171c68..6ab2bb1ea7 100644 --- a/ledger/block/src/header/metadata/verify.rs +++ b/ledger/block/src/header/metadata/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/mod.rs b/ledger/block/src/header/mod.rs index 2f963090d3..27ba50e113 100644 --- a/ledger/block/src/header/mod.rs +++ b/ledger/block/src/header/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,7 +26,7 @@ mod verify; use crate::{Ratifications, Transactions}; use console::{ network::prelude::*, - program::{HeaderLeaf, HeaderPath, HeaderTree, HEADER_DEPTH}, + program::{HEADER_DEPTH, HeaderLeaf, HeaderPath, HeaderTree}, types::Field, }; use synthesizer_program::FinalizeOperation; diff --git a/ledger/block/src/header/serialize.rs b/ledger/block/src/header/serialize.rs index 1736ff909b..4ab53983ce 100644 --- a/ledger/block/src/header/serialize.rs +++ b/ledger/block/src/header/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/string.rs b/ledger/block/src/header/string.rs index 8c53380bf0..be6866bc59 100644 --- a/ledger/block/src/header/string.rs +++ b/ledger/block/src/header/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/header/verify.rs b/ledger/block/src/header/verify.rs index 2ecef3bd5e..3f51e3b521 100644 --- a/ledger/block/src/header/verify.rs +++ b/ledger/block/src/header/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/helpers/mod.rs b/ledger/block/src/helpers/mod.rs index 397d30577d..75c589b32b 100644 --- a/ledger/block/src/helpers/mod.rs +++ b/ledger/block/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/helpers/target.rs b/ledger/block/src/helpers/target.rs index 63e0512ecd..86c2507bd6 100644 --- a/ledger/block/src/helpers/target.rs +++ b/ledger/block/src/helpers/target.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use console::prelude::{ensure, Network, Result}; +use console::prelude::{Network, Result, ensure}; /// A safety bound (sanity-check) for the coinbase reward. pub const MAX_COINBASE_REWARD: u64 = 190_258_739; // Coinbase reward at block 1. @@ -301,7 +302,7 @@ pub fn to_next_targets( #[cfg(test)] mod tests { use super::*; - use console::network::{prelude::*, MainnetV0}; + use console::network::{MainnetV0, prelude::*}; type CurrentNetwork = MainnetV0; diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index e8b86bb420..7b5bc28e45 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -55,6 +56,7 @@ use console::{ }; use ledger_authority::Authority; use ledger_committee::Committee; +use ledger_narwhal_data::Data; use ledger_narwhal_subdag::Subdag; use ledger_narwhal_transmission_id::TransmissionID; use ledger_puzzle::{PuzzleSolutions, Solution, SolutionID}; @@ -603,7 +605,7 @@ pub mod test_helpers { use super::*; use console::account::{Address, PrivateKey}; use ledger_query::Query; - use ledger_store::{helpers::memory::BlockMemory, BlockStore}; + use ledger_store::{BlockStore, helpers::memory::BlockMemory}; use synthesizer_process::Process; use once_cell::sync::OnceCell; diff --git a/ledger/block/src/ratifications/bytes.rs b/ledger/block/src/ratifications/bytes.rs index aa8d6f4a9a..2e121f6466 100644 --- a/ledger/block/src/ratifications/bytes.rs +++ b/ledger/block/src/ratifications/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratifications/merkle.rs b/ledger/block/src/ratifications/merkle.rs index 6d229abed2..90a28215aa 100644 --- a/ledger/block/src/ratifications/merkle.rs +++ b/ledger/block/src/ratifications/merkle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratifications/mod.rs b/ledger/block/src/ratifications/mod.rs index 4e6778e26e..4c6a16138c 100644 --- a/ledger/block/src/ratifications/mod.rs +++ b/ledger/block/src/ratifications/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ mod string; use crate::Ratify; use console::{ network::prelude::*, - program::{RatificationsPath, RatificationsTree, RATIFICATIONS_DEPTH}, + program::{RATIFICATIONS_DEPTH, RatificationsPath, RatificationsTree}, types::Field, }; diff --git a/ledger/block/src/ratifications/serialize.rs b/ledger/block/src/ratifications/serialize.rs index 7322772076..7bd964a49b 100644 --- a/ledger/block/src/ratifications/serialize.rs +++ b/ledger/block/src/ratifications/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratifications/string.rs b/ledger/block/src/ratifications/string.rs index 9a31010535..c0446de485 100644 --- a/ledger/block/src/ratifications/string.rs +++ b/ledger/block/src/ratifications/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratify/bytes.rs b/ledger/block/src/ratify/bytes.rs index 0b763a57eb..cd06493881 100644 --- a/ledger/block/src/ratify/bytes.rs +++ b/ledger/block/src/ratify/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratify/mod.rs b/ledger/block/src/ratify/mod.rs index dfc4b9e8ee..a963580598 100644 --- a/ledger/block/src/ratify/mod.rs +++ b/ledger/block/src/ratify/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratify/serialize.rs b/ledger/block/src/ratify/serialize.rs index 3bb89fe5f2..0bbe4b5e52 100644 --- a/ledger/block/src/ratify/serialize.rs +++ b/ledger/block/src/ratify/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/ratify/string.rs b/ledger/block/src/ratify/string.rs index 6872ff77be..fd135dd476 100644 --- a/ledger/block/src/ratify/string.rs +++ b/ledger/block/src/ratify/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index e485a1a43e..73fd9d3951 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/solutions/bytes.rs b/ledger/block/src/solutions/bytes.rs index 17dd27d088..bd1cdcdb14 100644 --- a/ledger/block/src/solutions/bytes.rs +++ b/ledger/block/src/solutions/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/solutions/merkle.rs b/ledger/block/src/solutions/merkle.rs index 7b655dd759..bc445e6517 100644 --- a/ledger/block/src/solutions/merkle.rs +++ b/ledger/block/src/solutions/merkle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/solutions/mod.rs b/ledger/block/src/solutions/mod.rs index 9934e4e1b6..cdd2c1a93e 100644 --- a/ledger/block/src/solutions/mod.rs +++ b/ledger/block/src/solutions/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/solutions/serialize.rs b/ledger/block/src/solutions/serialize.rs index 09aa2667b5..456057e452 100644 --- a/ledger/block/src/solutions/serialize.rs +++ b/ledger/block/src/solutions/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/solutions/string.rs b/ledger/block/src/solutions/string.rs index b4dfe9b954..54c23fe77e 100644 --- a/ledger/block/src/solutions/string.rs +++ b/ledger/block/src/solutions/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/string.rs b/ledger/block/src/string.rs index 53b3fe8d66..5eacc8db1f 100644 --- a/ledger/block/src/string.rs +++ b/ledger/block/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/bytes.rs b/ledger/block/src/transaction/bytes.rs index 299c27be99..18cdbad312 100644 --- a/ledger/block/src/transaction/bytes.rs +++ b/ledger/block/src/transaction/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/deployment/bytes.rs b/ledger/block/src/transaction/deployment/bytes.rs index e8e97757a6..f0f2700a4e 100644 --- a/ledger/block/src/transaction/deployment/bytes.rs +++ b/ledger/block/src/transaction/deployment/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/deployment/mod.rs b/ledger/block/src/transaction/deployment/mod.rs index b8e915ee2f..42c6182f6f 100644 --- a/ledger/block/src/transaction/deployment/mod.rs +++ b/ledger/block/src/transaction/deployment/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/deployment/serialize.rs b/ledger/block/src/transaction/deployment/serialize.rs index 88af802fc9..02480533da 100644 --- a/ledger/block/src/transaction/deployment/serialize.rs +++ b/ledger/block/src/transaction/deployment/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/deployment/string.rs b/ledger/block/src/transaction/deployment/string.rs index dbf9cdda56..9cade1f6b0 100644 --- a/ledger/block/src/transaction/deployment/string.rs +++ b/ledger/block/src/transaction/deployment/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/execution/bytes.rs b/ledger/block/src/transaction/execution/bytes.rs index c10a8c8fda..26269d68cc 100644 --- a/ledger/block/src/transaction/execution/bytes.rs +++ b/ledger/block/src/transaction/execution/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/execution/mod.rs b/ledger/block/src/transaction/execution/mod.rs index 7bd7d34ef2..36139105c5 100644 --- a/ledger/block/src/transaction/execution/mod.rs +++ b/ledger/block/src/transaction/execution/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/execution/serialize.rs b/ledger/block/src/transaction/execution/serialize.rs index b432dd8e72..467dcb6f33 100644 --- a/ledger/block/src/transaction/execution/serialize.rs +++ b/ledger/block/src/transaction/execution/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/execution/string.rs b/ledger/block/src/transaction/execution/string.rs index 08dfd0524b..ae47ab1dbd 100644 --- a/ledger/block/src/transaction/execution/string.rs +++ b/ledger/block/src/transaction/execution/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/fee/bytes.rs b/ledger/block/src/transaction/fee/bytes.rs index 1f156f622f..6a8d391f4a 100644 --- a/ledger/block/src/transaction/fee/bytes.rs +++ b/ledger/block/src/transaction/fee/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/fee/mod.rs b/ledger/block/src/transaction/fee/mod.rs index da76ef96e7..eaa2a07f8a 100644 --- a/ledger/block/src/transaction/fee/mod.rs +++ b/ledger/block/src/transaction/fee/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -202,7 +203,7 @@ pub mod test_helpers { use super::*; use console::types::Field; use ledger_query::Query; - use ledger_store::{helpers::memory::BlockMemory, BlockStore}; + use ledger_store::{BlockStore, helpers::memory::BlockMemory}; use synthesizer_process::Process; use once_cell::sync::OnceCell; diff --git a/ledger/block/src/transaction/fee/serialize.rs b/ledger/block/src/transaction/fee/serialize.rs index b73ec5e037..8d8c2a9b6f 100644 --- a/ledger/block/src/transaction/fee/serialize.rs +++ b/ledger/block/src/transaction/fee/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/fee/string.rs b/ledger/block/src/transaction/fee/string.rs index 3b6ea42a0c..12f9449be1 100644 --- a/ledger/block/src/transaction/fee/string.rs +++ b/ledger/block/src/transaction/fee/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/merkle.rs b/ledger/block/src/transaction/merkle.rs index eca22c3b68..d6e5d4fa56 100644 --- a/ledger/block/src/transaction/merkle.rs +++ b/ledger/block/src/transaction/merkle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/mod.rs b/ledger/block/src/transaction/mod.rs index 3115d7a866..61e49e6afe 100644 --- a/ledger/block/src/transaction/mod.rs +++ b/ledger/block/src/transaction/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -29,7 +30,7 @@ mod string; use crate::Transition; use console::{ network::prelude::*, - program::{Ciphertext, ProgramOwner, Record, TransactionLeaf, TransactionPath, TransactionTree, TRANSACTION_DEPTH}, + program::{Ciphertext, ProgramOwner, Record, TRANSACTION_DEPTH, TransactionLeaf, TransactionPath, TransactionTree}, types::{Field, Group, U64}, }; diff --git a/ledger/block/src/transaction/serialize.rs b/ledger/block/src/transaction/serialize.rs index 33830ee625..78d763dd0d 100644 --- a/ledger/block/src/transaction/serialize.rs +++ b/ledger/block/src/transaction/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transaction/string.rs b/ledger/block/src/transaction/string.rs index 82336d1385..f68837f03e 100644 --- a/ledger/block/src/transaction/string.rs +++ b/ledger/block/src/transaction/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/bytes.rs b/ledger/block/src/transactions/bytes.rs index d76e8625ba..9e9a41900c 100644 --- a/ledger/block/src/transactions/bytes.rs +++ b/ledger/block/src/transactions/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/confirmed/bytes.rs b/ledger/block/src/transactions/confirmed/bytes.rs index 16f929215c..81813e292a 100644 --- a/ledger/block/src/transactions/confirmed/bytes.rs +++ b/ledger/block/src/transactions/confirmed/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/confirmed/mod.rs b/ledger/block/src/transactions/confirmed/mod.rs index f859ad8947..9593e2ace5 100644 --- a/ledger/block/src/transactions/confirmed/mod.rs +++ b/ledger/block/src/transactions/confirmed/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ mod bytes; mod serialize; mod string; -use crate::{rejected::Rejected, Transaction}; +use crate::{Transaction, rejected::Rejected}; use console::{network::prelude::*, program::FINALIZE_ID_DEPTH, types::Field}; use synthesizer_program::FinalizeOperation; diff --git a/ledger/block/src/transactions/confirmed/serialize.rs b/ledger/block/src/transactions/confirmed/serialize.rs index 7b7925fd52..67d62f610d 100644 --- a/ledger/block/src/transactions/confirmed/serialize.rs +++ b/ledger/block/src/transactions/confirmed/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/confirmed/string.rs b/ledger/block/src/transactions/confirmed/string.rs index 6d361bb82e..1b40c9e454 100644 --- a/ledger/block/src/transactions/confirmed/string.rs +++ b/ledger/block/src/transactions/confirmed/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index 74c4fd9006..f5a3e99b96 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 90bd1ec721..39628f15bb 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -28,13 +29,13 @@ use console::{ network::prelude::*, program::{ Ciphertext, + FINALIZE_ID_DEPTH, + FINALIZE_OPERATIONS_DEPTH, ProgramOwner, Record, + TRANSACTIONS_DEPTH, TransactionsPath, TransactionsTree, - FINALIZE_ID_DEPTH, - FINALIZE_OPERATIONS_DEPTH, - TRANSACTIONS_DEPTH, }, types::{Field, Group, U64}, }; diff --git a/ledger/block/src/transactions/rejected/bytes.rs b/ledger/block/src/transactions/rejected/bytes.rs index c5cff5fe43..7746e8a9c7 100644 --- a/ledger/block/src/transactions/rejected/bytes.rs +++ b/ledger/block/src/transactions/rejected/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/rejected/mod.rs b/ledger/block/src/transactions/rejected/mod.rs index 6ce9886201..655ee40f67 100644 --- a/ledger/block/src/transactions/rejected/mod.rs +++ b/ledger/block/src/transactions/rejected/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/rejected/serialize.rs b/ledger/block/src/transactions/rejected/serialize.rs index a1998371e6..1cfc25de41 100644 --- a/ledger/block/src/transactions/rejected/serialize.rs +++ b/ledger/block/src/transactions/rejected/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/rejected/string.rs b/ledger/block/src/transactions/rejected/string.rs index e15f66b6cb..2d8e03e888 100644 --- a/ledger/block/src/transactions/rejected/string.rs +++ b/ledger/block/src/transactions/rejected/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/serialize.rs b/ledger/block/src/transactions/serialize.rs index a1e5d3b92e..81fd339431 100644 --- a/ledger/block/src/transactions/serialize.rs +++ b/ledger/block/src/transactions/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transactions/string.rs b/ledger/block/src/transactions/string.rs index 29fcdbc894..9ab1dba03a 100644 --- a/ledger/block/src/transactions/string.rs +++ b/ledger/block/src/transactions/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/bytes.rs b/ledger/block/src/transition/bytes.rs index 3654b7de17..7c54ad5924 100644 --- a/ledger/block/src/transition/bytes.rs +++ b/ledger/block/src/transition/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/input/bytes.rs b/ledger/block/src/transition/input/bytes.rs index faceae3a05..eb00e313ad 100644 --- a/ledger/block/src/transition/input/bytes.rs +++ b/ledger/block/src/transition/input/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/input/mod.rs b/ledger/block/src/transition/input/mod.rs index c49beb2c11..bafa4ed603 100644 --- a/ledger/block/src/transition/input/mod.rs +++ b/ledger/block/src/transition/input/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/input/serialize.rs b/ledger/block/src/transition/input/serialize.rs index 3a959b7c40..8aff3c4cbe 100644 --- a/ledger/block/src/transition/input/serialize.rs +++ b/ledger/block/src/transition/input/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/input/string.rs b/ledger/block/src/transition/input/string.rs index c6a510414c..d4a5815752 100644 --- a/ledger/block/src/transition/input/string.rs +++ b/ledger/block/src/transition/input/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/merkle.rs b/ledger/block/src/transition/merkle.rs index 4874a675e0..78c3546a99 100644 --- a/ledger/block/src/transition/merkle.rs +++ b/ledger/block/src/transition/merkle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/mod.rs b/ledger/block/src/transition/mod.rs index be9e15fd5d..c72e61b650 100644 --- a/ledger/block/src/transition/mod.rs +++ b/ledger/block/src/transition/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -26,7 +27,6 @@ mod string; use console::{ network::prelude::*, program::{ - compute_function_id, Ciphertext, Identifier, InputID, @@ -36,12 +36,13 @@ use console::{ Register, Request, Response, + TRANSITION_DEPTH, TransitionLeaf, TransitionPath, TransitionTree, Value, ValueType, - TRANSITION_DEPTH, + compute_function_id, }, types::{Field, Group}, }; diff --git a/ledger/block/src/transition/output/bytes.rs b/ledger/block/src/transition/output/bytes.rs index 867b6600d6..9e21b40756 100644 --- a/ledger/block/src/transition/output/bytes.rs +++ b/ledger/block/src/transition/output/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/output/mod.rs b/ledger/block/src/transition/output/mod.rs index 84a7b5c594..bbe80539c9 100644 --- a/ledger/block/src/transition/output/mod.rs +++ b/ledger/block/src/transition/output/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/output/serialize.rs b/ledger/block/src/transition/output/serialize.rs index 47041735a0..8931715aaf 100644 --- a/ledger/block/src/transition/output/serialize.rs +++ b/ledger/block/src/transition/output/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/output/string.rs b/ledger/block/src/transition/output/string.rs index 460bac5e2a..77bc39ccab 100644 --- a/ledger/block/src/transition/output/string.rs +++ b/ledger/block/src/transition/output/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/serialize.rs b/ledger/block/src/transition/serialize.rs index 619615a321..fa5742a14a 100644 --- a/ledger/block/src/transition/serialize.rs +++ b/ledger/block/src/transition/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/transition/string.rs b/ledger/block/src/transition/string.rs index 1b896c8e35..5d7624e759 100644 --- a/ledger/block/src/transition/string.rs +++ b/ledger/block/src/transition/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 6a7b49d286..d7d4cf6cbd 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -173,6 +174,15 @@ impl Block { subdag.anchor_round(), previous_round ); + // Ensure that the rounds in the subdag are sequential. + if previous_round != 0 { + for round in previous_round..=subdag.anchor_round() { + ensure!( + subdag.contains_key(&round), + "Subdag is missing round {round} in block {expected_height}", + ); + } + } // Output the subdag anchor round. subdag.anchor_round() } @@ -539,14 +549,15 @@ impl Block { ) -> Result<(Vec>, Vec)> { // Prepare an iterator over the solution IDs. let mut solutions = solutions.as_ref().map(|s| s.deref()).into_iter().flatten().peekable(); - // Prepare an iterator over the unconfirmed transaction IDs. - let unconfirmed_transaction_ids = cfg_iter!(transactions) - .map(|confirmed| confirmed.to_unconfirmed_transaction_id()) + // Prepare an iterator over the unconfirmed transactions. + let unconfirmed_transactions = cfg_iter!(transactions) + .map(|confirmed| confirmed.to_unconfirmed_transaction()) .collect::>>()?; - let mut unconfirmed_transaction_ids = unconfirmed_transaction_ids.iter().peekable(); + let mut unconfirmed_transactions = unconfirmed_transactions.iter().peekable(); - // Initialize a set of already seen transmission IDs. - let mut seen_transmission_ids = HashSet::new(); + // Initialize a set of already seen transaction and solution IDs. + let mut seen_transaction_ids = HashSet::new(); + let mut seen_solution_ids = HashSet::new(); // Initialize a set of aborted or already-existing solution IDs. let mut aborted_or_existing_solution_ids = HashSet::new(); @@ -555,17 +566,31 @@ impl Block { // Iterate over the transmission IDs. for transmission_id in subdag.transmission_ids() { - // If the transmission ID has already been seen, then continue. - if !seen_transmission_ids.insert(transmission_id) { - continue; + // If the transaction or solution ID has already been seen, then continue. + // Note: This is done instead of checking `TransmissionID` directly, because we need to + // ensure that each transaction or solution ID is unique. The `TransmissionID` is guaranteed + // to be unique, however the transaction/solution ID may not be due to malleability concerns. + match transmission_id { + TransmissionID::Ratification => {} + TransmissionID::Solution(solution_id, _) => { + if !seen_solution_ids.insert(solution_id) { + continue; + } + } + TransmissionID::Transaction(transaction_id, _) => { + if !seen_transaction_ids.insert(transaction_id) { + continue; + } + } } // Process the transmission ID. match transmission_id { TransmissionID::Ratification => {} - TransmissionID::Solution(solution_id) => { + TransmissionID::Solution(solution_id, _checksum) => { match solutions.peek() { // Check the next solution matches the expected solution ID. + // We don't check against the checksum, because check_solution_mut might mutate the solution. Some((_, solution)) if solution.id() == *solution_id => { // Increment the solution iterator. solutions.next(); @@ -578,12 +603,17 @@ impl Block { } } } - TransmissionID::Transaction(transaction_id) => { - match unconfirmed_transaction_ids.peek() { + TransmissionID::Transaction(transaction_id, checksum) => { + match unconfirmed_transactions.peek() { // Check the next transaction matches the expected transaction. - Some(expected_id) if transaction_id == *expected_id => { - // Increment the unconfirmed transaction ID iterator. - unconfirmed_transaction_ids.next(); + Some(transaction) + if transaction.id() == *transaction_id + && Data::>::Buffer(transaction.to_bytes_le()?.into()) + .to_checksum::()? + == *checksum => + { + // Increment the unconfirmed transaction iterator. + unconfirmed_transactions.next(); } // Otherwise, add the transaction ID to the aborted or existing list. _ => { @@ -599,7 +629,7 @@ impl Block { // Ensure there are no more solutions in the block. ensure!(solutions.next().is_none(), "There exists more solutions than expected."); // Ensure there are no more transactions in the block. - ensure!(unconfirmed_transaction_ids.next().is_none(), "There exists more transactions than expected."); + ensure!(unconfirmed_transactions.next().is_none(), "There exists more transactions than expected."); // Ensure the aborted solution IDs match. for aborted_solution_id in aborted_solution_ids { diff --git a/ledger/committee/Cargo.toml b/ledger/committee/Cargo.toml index 00a8d55338..d59a7d17cd 100644 --- a/ledger/committee/Cargo.toml +++ b/ledger/committee/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-committee" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A committee for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -34,11 +34,12 @@ test-helpers = [ "prop-tests", "rand_distr" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../narwhal/batch-header" +version = "=1.0.0" [dependencies.indexmap] version = "2.0" @@ -47,7 +48,7 @@ features = [ "serde", "rayon" ] [dependencies.metrics] package = "snarkvm-metrics" path = "../../metrics" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.serde_json] diff --git a/ledger/committee/src/bytes.rs b/ledger/committee/src/bytes.rs index 54aeebe9e6..85b3a4cd70 100644 --- a/ledger/committee/src/bytes.rs +++ b/ledger/committee/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 84ba82780e..206968fc33 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -169,14 +170,15 @@ impl Committee { self.total_stake().saturating_add(2).saturating_div(3) } - /// Returns the amount of stake required to reach a quorum threshold `(2f + 1)`. + /// Returns the amount of stake required to reach a quorum threshold `(N - f)`. pub fn quorum_threshold(&self) -> u64 { // Assuming `N = 3f + 1 + k`, where `0 <= k < 3`, - // then `(2N + 3) / 3 = 2f + 1 + (2k + 2)/3 = 2f + 1 + k = N - f`. + // then `2N/3 + 1 = 2f + 1 + (2k + 2)/3 = 2f + 1 + k = N - f`. + // In the line above, `/` means integer division. self.total_stake().saturating_mul(2).saturating_div(3).saturating_add(1) } - /// Returns the total amount of stake in the committee `(3f + 1)`. + /// Returns the total amount of stake in the committee. pub const fn total_stake(&self) -> u64 { self.total_stake } diff --git a/ledger/committee/src/prop_tests.rs b/ledger/committee/src/prop_tests.rs index 293c26a0ff..7377165ec8 100644 --- a/ledger/committee/src/prop_tests.rs +++ b/ledger/committee/src/prop_tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,8 +19,8 @@ use console::account::PrivateKey; use anyhow::Result; use proptest::{ - collection::{hash_set, SizeRange}, - prelude::{any, Arbitrary, BoxedStrategy, Just, Strategy}, + collection::{SizeRange, hash_set}, + prelude::{Arbitrary, BoxedStrategy, Just, Strategy, any}, sample::size_range, }; use rand::SeedableRng; @@ -186,7 +187,7 @@ fn committee_members(input: CommitteeContext) { } let quorum_threshold = committee.quorum_threshold(); let availability_threshold = committee.availability_threshold(); - // (2f + 1) + (f + 1) - 1 = 3f + 1 = N + // (N - f) + (f + 1) - 1 = N assert_eq!(quorum_threshold + availability_threshold - 1, total_stake); } diff --git a/ledger/committee/src/serialize.rs b/ledger/committee/src/serialize.rs index 3964cf7597..3a8f72cdd5 100644 --- a/ledger/committee/src/serialize.rs +++ b/ledger/committee/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/committee/src/string.rs b/ledger/committee/src/string.rs index cb0572d65a..f11ceb796d 100644 --- a/ledger/committee/src/string.rs +++ b/ledger/committee/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/committee/src/to_id.rs b/ledger/committee/src/to_id.rs index e5bfffa63b..92ab7f0dc8 100644 --- a/ledger/committee/src/to_id.rs +++ b/ledger/committee/src/to_id.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/Cargo.toml b/ledger/narwhal/Cargo.toml index f1b5238232..c90e20183f 100644 --- a/ledger/narwhal/Cargo.toml +++ b/ledger/narwhal/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Data structures for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -64,37 +64,37 @@ transmission-id = [ "narwhal-transmission-id" ] [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "./batch-certificate" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "./batch-header" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "./data" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "./subdag" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.narwhal-transmission] package = "snarkvm-ledger-narwhal-transmission" path = "./transmission" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "./transmission-id" -version = "=0.16.19" +version = "=1.0.0" optional = true [dev-dependencies.snarkvm-ledger-narwhal] diff --git a/ledger/narwhal/batch-certificate/Cargo.toml b/ledger/narwhal/batch-certificate/Cargo.toml index 63d18a6237..1554439139 100644 --- a/ledger/narwhal/batch-certificate/Cargo.toml +++ b/ledger/narwhal/batch-certificate/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,17 +32,17 @@ test-helpers = [ "narwhal-batch-header/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.19" +version = "=1.0.0" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/batch-certificate/src/bytes.rs b/ledger/narwhal/batch-certificate/src/bytes.rs index e661d366d4..49179d5858 100644 --- a/ledger/narwhal/batch-certificate/src/bytes.rs +++ b/ledger/narwhal/batch-certificate/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index a99166c383..30a0c434a9 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-certificate/src/serialize.rs b/ledger/narwhal/batch-certificate/src/serialize.rs index 776101bf07..d6c1b0e82d 100644 --- a/ledger/narwhal/batch-certificate/src/serialize.rs +++ b/ledger/narwhal/batch-certificate/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-certificate/src/string.rs b/ledger/narwhal/batch-certificate/src/string.rs index d94f243ff4..97340d7d29 100644 --- a/ledger/narwhal/batch-certificate/src/string.rs +++ b/ledger/narwhal/batch-certificate/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-header/Cargo.toml b/ledger/narwhal/batch-header/Cargo.toml index 56037b9b45..c4a0f7a31e 100644 --- a/ledger/narwhal/batch-header/Cargo.toml +++ b/ledger/narwhal/batch-header/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A batch header for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-transmission-id/test-helpers", "time" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.19" +version = "=1.0.0" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/batch-header/src/bytes.rs b/ledger/narwhal/batch-header/src/bytes.rs index 7d01157e42..75961f37c1 100644 --- a/ledger/narwhal/batch-header/src/bytes.rs +++ b/ledger/narwhal/batch-header/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 03f99aa712..2fa80edf65 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-header/src/serialize.rs b/ledger/narwhal/batch-header/src/serialize.rs index ec9dbf2629..7b9e150479 100644 --- a/ledger/narwhal/batch-header/src/serialize.rs +++ b/ledger/narwhal/batch-header/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-header/src/string.rs b/ledger/narwhal/batch-header/src/string.rs index a5f7bb1e2d..35cf77cb22 100644 --- a/ledger/narwhal/batch-header/src/string.rs +++ b/ledger/narwhal/batch-header/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/batch-header/src/to_id.rs b/ledger/narwhal/batch-header/src/to_id.rs index c783d2e4ff..3d9347063b 100644 --- a/ledger/narwhal/batch-header/src/to_id.rs +++ b/ledger/narwhal/batch-header/src/to_id.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/data/Cargo.toml b/ledger/narwhal/data/Cargo.toml index a8172b12d9..76b210b028 100644 --- a/ledger/narwhal/data/Cargo.toml +++ b/ledger/narwhal/data/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal-data" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -29,7 +29,7 @@ async = [ "tokio" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.bytes] version = "1" @@ -42,3 +42,11 @@ features = [ "preserve_order" ] optional = true version = "1" features = [ "rt" ] + +[dev-dependencies.ledger-block] +package = "snarkvm-ledger-block" +path = "../../../ledger/block" + +[dev-dependencies.ledger-test-helpers] +package = "snarkvm-ledger-test-helpers" +path = "../../../ledger/test-helpers" diff --git a/ledger/narwhal/data/src/lib.rs b/ledger/narwhal/data/src/lib.rs index 18997c95a6..f45a782f25 100644 --- a/ledger/narwhal/data/src/lib.rs +++ b/ledger/narwhal/data/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -35,6 +36,20 @@ pub enum Data { } impl Data { + pub fn to_checksum(&self) -> Result { + // Convert to bits. + let preimage = match self { + Self::Object(object) => object.to_bytes_le()?.to_bits_le(), + Self::Buffer(bytes) => bytes.deref().to_bits_le(), + }; + // Hash the preimage bits. + let hash = N::hash_sha3_256(&preimage)?; + // Select the number of bits needed to parse the checksum. + let num_bits = usize::try_from(N::TransmissionChecksum::BITS).map_err(error)?; + // Return the checksum. + N::TransmissionChecksum::from_bits_le(&hash[0..num_bits]) + } + pub fn into> + From + FromBytes + ToBytes + Send + 'static>(self) -> Data { match self { Self::Object(x) => Data::Object(x.into()), @@ -223,3 +238,39 @@ impl<'de, T: FromBytes + ToBytes + DeserializeOwned + Send + 'static> Deserializ } } } + +#[cfg(test)] +mod tests { + use super::*; + use console::network::MainnetV0; + use ledger_block::Transaction; + + #[test] + fn test_to_checksum() { + let rng = &mut TestRng::default(); + + // Sample transactions + let transactions = [ + ledger_test_helpers::sample_deployment_transaction(true, rng), + ledger_test_helpers::sample_deployment_transaction(false, rng), + ledger_test_helpers::sample_execution_transaction_with_fee(true, rng), + ledger_test_helpers::sample_execution_transaction_with_fee(false, rng), + ledger_test_helpers::sample_fee_private_transaction(rng), + ledger_test_helpers::sample_fee_public_transaction(rng), + ]; + + for transaction in transactions.into_iter() { + // Convert the transaction to a Data buffer. + let data_bytes: Data> = Data::Buffer(transaction.to_bytes_le().unwrap().into()); + // Convert the transaction to a data object. + let data = Data::Object(transaction); + + // Compute the checksums. + let checksum_1 = data_bytes.to_checksum::().unwrap(); + let checksum_2 = data.to_checksum::().unwrap(); + + // Ensure the checksums are equal. + assert_eq!(checksum_1, checksum_2); + } + } +} diff --git a/ledger/narwhal/src/lib.rs b/ledger/narwhal/src/lib.rs index 0596ee799c..ec54ad513b 100644 --- a/ledger/narwhal/src/lib.rs +++ b/ledger/narwhal/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index f91a199478..3b6801f76c 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A subdag for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,27 +32,27 @@ test-helpers = [ "narwhal-batch-certificate/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../batch-certificate" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../committee" -version = "=0.16.19" +version = "=1.0.0" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.19" +version = "=1.0.0" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/subdag/src/bytes.rs b/ledger/narwhal/subdag/src/bytes.rs index 5b7aef35a9..986931e8f4 100644 --- a/ledger/narwhal/subdag/src/bytes.rs +++ b/ledger/narwhal/subdag/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index 3e50e6b60b..d5f1efc5c6 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -230,7 +231,7 @@ pub mod test_helpers { use super::*; use console::{network::MainnetV0, prelude::TestRng}; - use indexmap::{indexset, IndexSet}; + use indexmap::{IndexSet, indexset}; type CurrentNetwork = MainnetV0; diff --git a/ledger/narwhal/subdag/src/serialize.rs b/ledger/narwhal/subdag/src/serialize.rs index f02389871e..336b173879 100644 --- a/ledger/narwhal/subdag/src/serialize.rs +++ b/ledger/narwhal/subdag/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/subdag/src/string.rs b/ledger/narwhal/subdag/src/string.rs index 101046abe9..49f69c7305 100644 --- a/ledger/narwhal/subdag/src/string.rs +++ b/ledger/narwhal/subdag/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/transmission-id/Cargo.toml b/ledger/narwhal/transmission-id/Cargo.toml index abe68bf1ed..1d0a5153bb 100644 --- a/ledger/narwhal/transmission-id/Cargo.toml +++ b/ledger/narwhal/transmission-id/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A transmission ID for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,12 +32,12 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-puzzle] package = "snarkvm-ledger-puzzle" path = "../../puzzle" -version = "=0.16.19" +version = "=1.0.0" [dev-dependencies.bincode] version = "1.3" diff --git a/ledger/narwhal/transmission-id/src/bytes.rs b/ledger/narwhal/transmission-id/src/bytes.rs index a8a49a3d7b..d3a02055d5 100644 --- a/ledger/narwhal/transmission-id/src/bytes.rs +++ b/ledger/narwhal/transmission-id/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,8 +23,8 @@ impl FromBytes for TransmissionID { // Match the variant. match variant { 0 => Ok(Self::Ratification), - 1 => Ok(Self::Solution(FromBytes::read_le(&mut reader)?)), - 2 => Ok(Self::Transaction(FromBytes::read_le(&mut reader)?)), + 1 => Ok(Self::Solution(FromBytes::read_le(&mut reader)?, FromBytes::read_le(&mut reader)?)), + 2 => Ok(Self::Transaction(FromBytes::read_le(&mut reader)?, FromBytes::read_le(&mut reader)?)), 3.. => Err(error("Invalid worker transmission ID variant")), } } @@ -35,13 +36,15 @@ impl ToBytes for TransmissionID { // Write the transmission. match self { Self::Ratification => 0u8.write_le(&mut writer), - Self::Solution(id) => { + Self::Solution(id, checksum) => { 1u8.write_le(&mut writer)?; - id.write_le(&mut writer) + id.write_le(&mut writer)?; + checksum.write_le(&mut writer) } - Self::Transaction(id) => { + Self::Transaction(id, checksum) => { 2u8.write_le(&mut writer)?; - id.write_le(&mut writer) + id.write_le(&mut writer)?; + checksum.write_le(&mut writer) } } } diff --git a/ledger/narwhal/transmission-id/src/lib.rs b/ledger/narwhal/transmission-id/src/lib.rs index 7ba75ba2a1..6f333834ba 100644 --- a/ledger/narwhal/transmission-id/src/lib.rs +++ b/ledger/narwhal/transmission-id/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -20,29 +21,29 @@ mod serialize; mod string; use console::{network::TRANSACTION_PREFIX, prelude::*}; -use ledger_puzzle::{SolutionID, SOLUTION_ID_PREFIX}; +use ledger_puzzle::{SOLUTION_ID_PREFIX, SolutionID}; #[derive(Copy, Clone, PartialEq, Eq, Hash)] pub enum TransmissionID { /// A ratification. Ratification, /// A solution. - Solution(SolutionID), + Solution(SolutionID, N::TransmissionChecksum), /// A transaction. - Transaction(N::TransactionID), + Transaction(N::TransactionID, N::TransmissionChecksum), } -impl From> for TransmissionID { - /// Converts the solution ID into a transmission ID. - fn from(solution_id: SolutionID) -> Self { - Self::Solution(solution_id) +impl From<(SolutionID, N::TransmissionChecksum)> for TransmissionID { + /// Converts the solution ID and checksum into a transmission ID. + fn from((solution_id, checksum): (SolutionID, N::TransmissionChecksum)) -> Self { + Self::Solution(solution_id, checksum) } } -impl From<&N::TransactionID> for TransmissionID { - /// Converts the transaction ID into a transmission ID. - fn from(transaction_id: &N::TransactionID) -> Self { - Self::Transaction(*transaction_id) +impl From<(&N::TransactionID, &N::TransmissionChecksum)> for TransmissionID { + /// Converts the transaction ID and checksum into a transmission ID. + fn from((transaction_id, checksum): (&N::TransactionID, &N::TransmissionChecksum)) -> Self { + Self::Transaction(*transaction_id, *checksum) } } @@ -50,7 +51,7 @@ impl TransmissionID { /// Returns the solution ID if the transmission is a solution. pub fn solution(&self) -> Option> { match self { - Self::Solution(solution_id) => Some(*solution_id), + Self::Solution(solution_id, _) => Some(*solution_id), _ => None, } } @@ -58,10 +59,19 @@ impl TransmissionID { /// Returns the transaction ID if the transmission is a transaction. pub fn transaction(&self) -> Option { match self { - Self::Transaction(transaction_id) => Some(*transaction_id), + Self::Transaction(transaction_id, _) => Some(*transaction_id), _ => None, } } + + /// Returns the checksum if the transmission is a solution or a transaction. + pub fn checksum(&self) -> Option { + match self { + Self::Ratification => None, + Self::Solution(_, checksum) => Some(*checksum), + Self::Transaction(_, checksum) => Some(*checksum), + } + } } #[cfg(any(test, feature = "test-helpers"))] @@ -81,11 +91,17 @@ pub mod test_helpers { let mut sample = Vec::with_capacity(10); // Append sample solution IDs. for _ in 0..5 { - sample.push(TransmissionID::Solution(SolutionID::from(rng.gen::()))); + sample.push(TransmissionID::Solution( + SolutionID::from(rng.gen::()), + ::TransmissionChecksum::from(rng.gen::()), + )); } // Append sample transaction IDs. for _ in 0..5 { - let id = TransmissionID::Transaction(::TransactionID::from(Field::rand(rng))); + let id = TransmissionID::Transaction( + ::TransactionID::from(Field::rand(rng)), + ::TransmissionChecksum::from(rng.gen::()), + ); sample.push(id); } // Return the sample vector. diff --git a/ledger/narwhal/transmission-id/src/serialize.rs b/ledger/narwhal/transmission-id/src/serialize.rs index 9d5247cea1..d01905fbff 100644 --- a/ledger/narwhal/transmission-id/src/serialize.rs +++ b/ledger/narwhal/transmission-id/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/transmission-id/src/string.rs b/ledger/narwhal/transmission-id/src/string.rs index 817c878236..8b874a47c1 100644 --- a/ledger/narwhal/transmission-id/src/string.rs +++ b/ledger/narwhal/transmission-id/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,11 +20,20 @@ impl FromStr for TransmissionID { /// Initializes the transmission ID from a string. fn from_str(input: &str) -> Result { - if input.starts_with(SOLUTION_ID_PREFIX) { - Ok(Self::Solution(SolutionID::from_str(input)?)) - } else if input.starts_with(TRANSACTION_PREFIX) { + // Split the id and checksum. + let (id, checksum) = input.split_once('.').ok_or_else(|| anyhow!("Invalid transmission ID: {input}"))?; + // Parse the string. + if id.starts_with(SOLUTION_ID_PREFIX) { + Ok(Self::Solution( + SolutionID::from_str(id)?, + N::TransmissionChecksum::from_str(checksum) + .map_err(|_| anyhow!("Failed to parse checksum: {checksum}"))?, + )) + } else if id.starts_with(TRANSACTION_PREFIX) { Ok(Self::Transaction( - N::TransactionID::from_str(input).map_err(|_| anyhow!("Failed to parse transaction ID: {input}"))?, + N::TransactionID::from_str(id).map_err(|_| anyhow!("Failed to parse transaction ID: {id}"))?, + N::TransmissionChecksum::from_str(checksum) + .map_err(|_| anyhow!("Failed to parse checksum: {checksum}"))?, )) } else { bail!("Invalid transmission ID: {input}") @@ -43,8 +53,8 @@ impl Display for TransmissionID { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { Self::Ratification => write!(f, "ratification"), - Self::Solution(id) => write!(f, "{}", id), - Self::Transaction(id) => write!(f, "{}", id), + Self::Solution(id, checksum) => write!(f, "{}.{}", id, checksum), + Self::Transaction(id, checksum) => write!(f, "{}.{}", id, checksum), } } } diff --git a/ledger/narwhal/transmission/Cargo.toml b/ledger/narwhal/transmission/Cargo.toml index 44b3bb5705..4ac74caa5e 100644 --- a/ledger/narwhal/transmission/Cargo.toml +++ b/ledger/narwhal/transmission/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A transmission for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,22 +32,22 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../block" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "../data" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-puzzle] package = "snarkvm-ledger-puzzle" path = "../../puzzle" -version = "=0.16.19" +version = "=1.0.0" [dependencies.bytes] version = "1" diff --git a/ledger/narwhal/transmission/src/bytes.rs b/ledger/narwhal/transmission/src/bytes.rs index 7d06ef6077..fc0d946eb6 100644 --- a/ledger/narwhal/transmission/src/bytes.rs +++ b/ledger/narwhal/transmission/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/transmission/src/lib.rs b/ledger/narwhal/transmission/src/lib.rs index 44d2eb83ca..07fdc25278 100644 --- a/ledger/narwhal/transmission/src/lib.rs +++ b/ledger/narwhal/transmission/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -64,6 +65,17 @@ impl From>> for Transmission { } } +impl Transmission { + /// Returns the checksum of the transmission. + pub fn to_checksum(&self) -> Result> { + match self { + Self::Ratification => Ok(None), + Self::Solution(solution) => solution.to_checksum::().map(Some), + Self::Transaction(transaction) => transaction.to_checksum::().map(Some), + } + } +} + #[cfg(any(test, feature = "test-helpers"))] pub mod test_helpers { use super::*; diff --git a/ledger/narwhal/transmission/src/serialize.rs b/ledger/narwhal/transmission/src/serialize.rs index 45b6f5a36e..e986992592 100644 --- a/ledger/narwhal/transmission/src/serialize.rs +++ b/ledger/narwhal/transmission/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/narwhal/transmission/src/string.rs b/ledger/narwhal/transmission/src/string.rs index f1a93b89ff..6502889bbd 100644 --- a/ledger/narwhal/transmission/src/string.rs +++ b/ledger/narwhal/transmission/src/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/Cargo.toml b/ledger/puzzle/Cargo.toml index 453cf8d8ed..17acb70d26 100644 --- a/ledger/puzzle/Cargo.toml +++ b/ledger/puzzle/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-puzzle" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Puzzle for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -32,25 +32,19 @@ required-features = [ "setup" ] [features] default = [ "indexmap/rayon", "rayon" ] cuda = [ "snarkvm-algorithms/cuda" ] -serial = [ - "console/serial", - "snarkvm-algorithms/serial", -] +serial = [ "console/serial", "snarkvm-algorithms/serial" ] setup = [ ] timer = [ "aleo-std/timer" ] -wasm = [ - "console/wasm", - "snarkvm-algorithms/wasm", -] +wasm = [ "console/wasm", "snarkvm-algorithms/wasm" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.aleo-std] version = "0.1.24" @@ -102,4 +96,3 @@ version = "0.8" [dev-dependencies.snarkvm-ledger-puzzle-epoch] path = "epoch" -version = "=0.16.19" diff --git a/ledger/puzzle/benches/puzzle.rs b/ledger/puzzle/benches/puzzle.rs index 2e30433bc3..6018d894ce 100644 --- a/ledger/puzzle/benches/puzzle.rs +++ b/ledger/puzzle/benches/puzzle.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,7 +26,7 @@ use snarkvm_ledger_puzzle::{Puzzle, PuzzleSolutions}; use snarkvm_ledger_puzzle_epoch::MerklePuzzle; use criterion::Criterion; -use rand::{self, thread_rng, CryptoRng, RngCore}; +use rand::{self, CryptoRng, RngCore, thread_rng}; fn sample_address_and_counter(rng: &mut (impl CryptoRng + RngCore)) -> (Address, u64) { let private_key = PrivateKey::new(rng).unwrap(); diff --git a/ledger/puzzle/epoch/Cargo.toml b/ledger/puzzle/epoch/Cargo.toml index f34a44da35..90b5e47961 100644 --- a/ledger/puzzle/epoch/Cargo.toml +++ b/ledger/puzzle/epoch/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-puzzle-epoch" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Epoch puzzle for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -25,10 +25,7 @@ edition = "2021" [features] default = [ "synthesis", "rayon" ] -serial = [ - "console/serial", - "snarkvm-ledger-puzzle/serial", -] +serial = [ "console/serial", "snarkvm-ledger-puzzle/serial" ] merkle = [ ] synthesis = [ "aleo-std", @@ -44,26 +41,26 @@ wasm = [ "console/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../../circuit" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-ledger-puzzle] path = "../." -version = "=0.16.19" +version = "=1.0.0" [dependencies.snarkvm-synthesizer-process] path = "../../../synthesizer/process" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-synthesizer-program] path = "../../../synthesizer/program" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.aleo-std] diff --git a/ledger/puzzle/epoch/src/lib.rs b/ledger/puzzle/epoch/src/lib.rs index 0018125b20..8328514422 100644 --- a/ledger/puzzle/epoch/src/lib.rs +++ b/ledger/puzzle/epoch/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/merkle/mod.rs b/ledger/puzzle/epoch/src/merkle/mod.rs index 5e24980ff0..9161e7e452 100644 --- a/ledger/puzzle/epoch/src/merkle/mod.rs +++ b/ledger/puzzle/epoch/src/merkle/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use console::{ network::Network, - prelude::{cfg_into_iter, FromBytes, ToBits as TBits, ToBytes, Uniform}, + prelude::{FromBytes, ToBits as TBits, ToBytes, Uniform, cfg_into_iter}, types::Field, }; use snarkvm_ledger_puzzle::PuzzleTrait; diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/destination.rs b/ledger/puzzle/epoch/src/synthesis/helpers/destination.rs index a8287b908f..b9be02f2e9 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/destination.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/destination.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/instruction_set.rs b/ledger/puzzle/epoch/src/synthesis/helpers/instruction_set.rs index e119310397..81f7bf27ab 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/instruction_set.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/instruction_set.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use crate::synthesis::helpers::{PuzzleDestination, PuzzleInstructionType, Puzzle use console::{ prelude::Zero, program::{Field, Literal, LiteralType, Network}, - types::{I128, I16, I32, I64, I8, U128, U16, U32, U64, U8}, + types::{I8, I16, I32, I64, I128, U8, U16, U32, U64, U128}, }; type Instruction = PuzzleInstructionType; diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/instruction_type.rs b/ledger/puzzle/epoch/src/synthesis/helpers/instruction_type.rs index 4584d4dc50..7eeb59d0fe 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/instruction_type.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/instruction_type.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/mod.rs b/ledger/puzzle/epoch/src/synthesis/helpers/mod.rs index e3c03b03c8..b63ce3d79a 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/mod.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -39,7 +40,7 @@ use snarkvm_synthesizer_program::Instruction; use anyhow::Result; use indexmap::IndexSet; -use rand::{prelude::*, SeedableRng}; +use rand::{SeedableRng, prelude::*}; use rand_chacha::ChaChaRng; use std::{collections::HashMap, str::FromStr}; diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/operand.rs b/ledger/puzzle/epoch/src/synthesis/helpers/operand.rs index 3605cedb40..9e81033969 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/operand.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/operand.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/register.rs b/ledger/puzzle/epoch/src/synthesis/helpers/register.rs index 32112e49f1..7767e03327 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/register.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/register.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/synthesis/helpers/register_table.rs b/ledger/puzzle/epoch/src/synthesis/helpers/register_table.rs index b998a8fe79..bbf87ba585 100644 --- a/ledger/puzzle/epoch/src/synthesis/helpers/register_table.rs +++ b/ledger/puzzle/epoch/src/synthesis/helpers/register_table.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,8 +15,8 @@ use crate::synthesis::helpers::{LiteralType, PuzzleRegister}; -use anyhow::{anyhow, bail, Result}; -use indexmap::{indexmap, indexset, IndexMap, IndexSet}; +use anyhow::{Result, anyhow, bail}; +use indexmap::{IndexMap, IndexSet, indexmap, indexset}; /// A register table is used to track the registers for each literal type. /// diff --git a/ledger/puzzle/epoch/src/synthesis/mod.rs b/ledger/puzzle/epoch/src/synthesis/mod.rs index c61675d558..1441baea82 100644 --- a/ledger/puzzle/epoch/src/synthesis/mod.rs +++ b/ledger/puzzle/epoch/src/synthesis/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,7 +23,7 @@ use circuit::Aleo; use console::network::Network; use snarkvm_ledger_puzzle::PuzzleTrait; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use core::{marker::PhantomData, num::NonZeroUsize}; use lru::LruCache; use parking_lot::RwLock; diff --git a/ledger/puzzle/epoch/src/synthesis/program/construct_inputs.rs b/ledger/puzzle/epoch/src/synthesis/program/construct_inputs.rs index 9a7c5f681b..6b91504808 100644 --- a/ledger/puzzle/epoch/src/synthesis/program/construct_inputs.rs +++ b/ledger/puzzle/epoch/src/synthesis/program/construct_inputs.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/synthesis/program/mod.rs b/ledger/puzzle/epoch/src/synthesis/program/mod.rs index 89d993db80..d1a1ac2298 100644 --- a/ledger/puzzle/epoch/src/synthesis/program/mod.rs +++ b/ledger/puzzle/epoch/src/synthesis/program/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ mod to_leaves; mod to_r1cs; use crate::synthesis::helpers::*; -use circuit::{environment::R1CS, Mode}; +use circuit::{Mode, environment::R1CS}; use console::{ account::PrivateKey, network::Network, @@ -28,7 +29,7 @@ use snarkvm_synthesizer_process::{CallStack, Process, Registers, Stack, StackPro use snarkvm_synthesizer_program::{Instruction, Program, RegistersStoreCircuit, StackProgram}; use aleo_std::prelude::{finish, lap, timer}; -use anyhow::{anyhow, bail, ensure, Result}; +use anyhow::{Result, anyhow, bail, ensure}; use rand::Rng; use rand_chacha::ChaChaRng; use std::{ diff --git a/ledger/puzzle/epoch/src/synthesis/program/to_leaves.rs b/ledger/puzzle/epoch/src/synthesis/program/to_leaves.rs index 7502180f01..fc246d6930 100644 --- a/ledger/puzzle/epoch/src/synthesis/program/to_leaves.rs +++ b/ledger/puzzle/epoch/src/synthesis/program/to_leaves.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/epoch/src/synthesis/program/to_r1cs.rs b/ledger/puzzle/epoch/src/synthesis/program/to_r1cs.rs index a7575b57d0..533f3fc982 100644 --- a/ledger/puzzle/epoch/src/synthesis/program/to_r1cs.rs +++ b/ledger/puzzle/epoch/src/synthesis/program/to_r1cs.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -64,8 +65,11 @@ impl EpochProgram { bail!("Failed to execute instruction ({instruction}): {error}"); } - #[cfg(feature = "debug")] + #[cfg(debug_assertions)] { + use circuit::Eject; + use snarkvm_synthesizer_program::RegistersLoadCircuit; + use colored::Colorize; let is_satisfied = A::is_satisfied(); @@ -75,7 +79,6 @@ impl EpochProgram { ); if !is_satisfied { for operand in instruction.operands() { - use synthesizer_program::RegistersLoadCircuit; let value = registers.load_circuit(&self.stack, operand)?; println!(" {operand} = {}", value.eject_value()); } diff --git a/ledger/puzzle/src/lib.rs b/ledger/puzzle/src/lib.rs index b0c50ddc94..b52eaae061 100644 --- a/ledger/puzzle/src/lib.rs +++ b/ledger/puzzle/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -33,6 +34,9 @@ use console::{ algorithms::Sha3_256, collections::kary_merkle_tree::KaryMerkleTree, prelude::{ + FromBits, + Network, + Result, anyhow, bail, cfg_into_iter, @@ -41,9 +45,6 @@ use console::{ cfg_values, ensure, has_duplicates, - FromBits, - Network, - Result, }, types::U64, }; @@ -172,7 +173,7 @@ impl Puzzle { // Ensure that the proof target matches the expected proof target. ensure!( solution.target() == *proof_target, - "The proof target does not match the expected proof target" + "The proof target does not match the cached proof target" ); targets[i] = *proof_target } @@ -195,7 +196,7 @@ impl Puzzle { // Ensure that the proof target matches the expected proof target. ensure!( solution.target() == proof_target, - "The proof target does not match the expected proof target" + "The proof target does not match the computed proof target" ); // Insert the proof target into the cache. self.proof_target_cache.write().put(*solution_id, proof_target); @@ -266,6 +267,34 @@ impl Puzzle { Ok(()) } + /// ATTENTION: This function will update the target if the solution target is different from the calculated one. + /// Returns `Ok(())` if the solution is valid. + pub fn check_solution_mut( + &self, + solution: &mut Solution, + expected_epoch_hash: N::BlockHash, + expected_proof_target: u64, + ) -> Result<()> { + // Ensure the epoch hash matches. + if solution.epoch_hash() != expected_epoch_hash { + bail!( + "Solution does not match the expected epoch hash (found '{}', expected '{expected_epoch_hash}')", + solution.epoch_hash() + ) + } + // Calculate the proof target of the solution. + let proof_target = self.get_proof_target_unchecked(solution)?; + + // Set the target with the newly calculated proof target value. + solution.target = proof_target; + + // Ensure the solution is greater than or equal to the expected proof target. + if proof_target < expected_proof_target { + bail!("Solution does not meet the proof target requirement ({proof_target} < {expected_proof_target})") + } + Ok(()) + } + /// Returns `Ok(())` if the solutions are valid. pub fn check_solutions( &self, diff --git a/ledger/puzzle/src/partial_solution/bytes.rs b/ledger/puzzle/src/partial_solution/bytes.rs index 5434a25fc4..b2eece6c5b 100644 --- a/ledger/puzzle/src/partial_solution/bytes.rs +++ b/ledger/puzzle/src/partial_solution/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -26,7 +27,7 @@ impl FromBytes for PartialSolution { } impl ToBytes for PartialSolution { - /// Writes the parital solution to the buffer. + /// Writes the partial solution to the buffer. fn write_le(&self, mut writer: W) -> IoResult<()> { self.epoch_hash.write_le(&mut writer)?; self.address.write_le(&mut writer)?; diff --git a/ledger/puzzle/src/partial_solution/mod.rs b/ledger/puzzle/src/partial_solution/mod.rs index 37ceb38a54..dbd77d8b53 100644 --- a/ledger/puzzle/src/partial_solution/mod.rs +++ b/ledger/puzzle/src/partial_solution/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/partial_solution/serialize.rs b/ledger/puzzle/src/partial_solution/serialize.rs index 944b056d7c..e982e73d01 100644 --- a/ledger/puzzle/src/partial_solution/serialize.rs +++ b/ledger/puzzle/src/partial_solution/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/partial_solution/string.rs b/ledger/puzzle/src/partial_solution/string.rs index d75703341b..0486609ecf 100644 --- a/ledger/puzzle/src/partial_solution/string.rs +++ b/ledger/puzzle/src/partial_solution/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution/bytes.rs b/ledger/puzzle/src/solution/bytes.rs index 66d0ed9c61..064a43cb53 100644 --- a/ledger/puzzle/src/solution/bytes.rs +++ b/ledger/puzzle/src/solution/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution/mod.rs b/ledger/puzzle/src/solution/mod.rs index e163d4d733..c3fd5e238c 100644 --- a/ledger/puzzle/src/solution/mod.rs +++ b/ledger/puzzle/src/solution/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,7 +26,7 @@ pub struct Solution { /// The partial solution. partial_solution: PartialSolution, /// The solution target. - target: u64, + pub(super) target: u64, } impl Solution { diff --git a/ledger/puzzle/src/solution/serialize.rs b/ledger/puzzle/src/solution/serialize.rs index 3678b71407..33b6ec74f6 100644 --- a/ledger/puzzle/src/solution/serialize.rs +++ b/ledger/puzzle/src/solution/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution/string.rs b/ledger/puzzle/src/solution/string.rs index 79cb9ddfef..15fcff05c6 100644 --- a/ledger/puzzle/src/solution/string.rs +++ b/ledger/puzzle/src/solution/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution_id/bytes.rs b/ledger/puzzle/src/solution_id/bytes.rs index 34edbb8521..06badeebac 100644 --- a/ledger/puzzle/src/solution_id/bytes.rs +++ b/ledger/puzzle/src/solution_id/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution_id/mod.rs b/ledger/puzzle/src/solution_id/mod.rs index 433f4b992d..f5d50fc55e 100644 --- a/ledger/puzzle/src/solution_id/mod.rs +++ b/ledger/puzzle/src/solution_id/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution_id/serialize.rs b/ledger/puzzle/src/solution_id/serialize.rs index b2f26abcf0..204a0a7a90 100644 --- a/ledger/puzzle/src/solution_id/serialize.rs +++ b/ledger/puzzle/src/solution_id/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solution_id/string.rs b/ledger/puzzle/src/solution_id/string.rs index 760b5dfc73..42d04f5961 100644 --- a/ledger/puzzle/src/solution_id/string.rs +++ b/ledger/puzzle/src/solution_id/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -78,7 +79,7 @@ mod tests { // Check the string representation. let candidate = format!("{expected}"); assert_eq!(expected, SolutionID::from_str(&candidate)?); - assert_eq!(SOLUTION_ID_PREFIX, candidate.to_string().split('1').next().unwrap()); + assert_eq!(SOLUTION_ID_PREFIX, candidate.split('1').next().unwrap()); } Ok(()) } diff --git a/ledger/puzzle/src/solutions/bytes.rs b/ledger/puzzle/src/solutions/bytes.rs index 4716c471ec..78339477f6 100644 --- a/ledger/puzzle/src/solutions/bytes.rs +++ b/ledger/puzzle/src/solutions/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solutions/mod.rs b/ledger/puzzle/src/solutions/mod.rs index 6d618283ef..2a305a3f6a 100644 --- a/ledger/puzzle/src/solutions/mod.rs +++ b/ledger/puzzle/src/solutions/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solutions/serialize.rs b/ledger/puzzle/src/solutions/serialize.rs index b85d144611..4127fab479 100644 --- a/ledger/puzzle/src/solutions/serialize.rs +++ b/ledger/puzzle/src/solutions/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/puzzle/src/solutions/string.rs b/ledger/puzzle/src/solutions/string.rs index 7de56f52a2..b8bee3ca28 100644 --- a/ledger/puzzle/src/solutions/string.rs +++ b/ledger/puzzle/src/solutions/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/query/Cargo.toml b/ledger/query/Cargo.toml index 979555c7e4..de6fce2c4d 100644 --- a/ledger/query/Cargo.toml +++ b/ledger/query/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-query" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A query for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -34,18 +34,18 @@ query = [ "ledger-store", "synthesizer-program", "ureq" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.async-trait] diff --git a/ledger/query/src/lib.rs b/ledger/query/src/lib.rs index 652275a377..f9776ce657 100644 --- a/ledger/query/src/lib.rs +++ b/ledger/query/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/query/src/query.rs b/ledger/query/src/query.rs index c5d0ac524d..f7da44b447 100644 --- a/ledger/query/src/query.rs +++ b/ledger/query/src/query.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/query/src/traits.rs b/ledger/query/src/traits.rs index cdef8937b7..72b8c56868 100644 --- a/ledger/query/src/traits.rs +++ b/ledger/query/src/traits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index 74529a693f..a5bcc2f68d 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -127,8 +128,8 @@ pub fn split_candidate_solutions( verification_fn: F, ) -> (Vec, Vec) where - T: Sized, - F: Fn(&T) -> bool, + T: Sized + Copy, + F: Fn(&mut T) -> bool, { // Separate the candidate solutions into valid and aborted solutions. let mut valid_candidate_solutions = Vec::with_capacity(max_solutions); @@ -147,32 +148,35 @@ where } // Split off a chunk of the candidate solutions. - let candidates_chunk = if candidate_solutions.len() > chunk_size { + let mut candidates_chunk = if candidate_solutions.len() > chunk_size { candidate_solutions.split_off(candidate_solutions.len() - chunk_size) } else { std::mem::take(&mut candidate_solutions) }; // Verify the solutions in the chunk. - let verification_results: Vec<_> = candidates_chunk - .into_iter() - .rev() - .map(|solution| { - let verified = verification_fn(&solution); - (solution, verified) - }) - .collect(); + let verification_results = candidates_chunk.iter_mut().rev().map(|solution| { + let verified = verification_fn(solution); + (solution, verified) + }); // Process the results of the verification. for (solution, is_valid) in verification_results.into_iter() { if is_valid && valid_candidate_solutions.len() < max_solutions { - valid_candidate_solutions.push(solution); + valid_candidate_solutions.push(*solution); } else { - aborted_candidate_solutions.push(solution); + aborted_candidate_solutions.push(*solution); } } } + // The `aborted_candidate_solutions` can contain both verified and unverified solutions. + // When `check_solution_mut` is used as `verification_fn`, these aborted solutions + // may include both mutated and un-mutated variants. This occurs because the verification + // check is skipped once the `max_solutions` limit is reached. + // + // This approach is SAFE because currently, only the `solutionID` of aborted solutions is stored. + // However, if full aborted solutions need to be stored in the future, this logic will need to be revisited. (valid_candidate_solutions, aborted_candidate_solutions) } @@ -201,7 +205,7 @@ impl> Ledger { // Separate the candidate solutions into valid and aborted solutions. let (valid_candidate_solutions, aborted_candidate_solutions) = split_candidate_solutions(candidate_solutions, N::MAX_SOLUTIONS, |solution| { - self.puzzle().check_solution(solution, latest_epoch_hash, latest_proof_target).is_ok() + self.puzzle().check_solution_mut(solution, latest_epoch_hash, latest_proof_target).is_ok() }); // Check if there are any valid solutions. diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index 77752b478f..4c0a97a6ea 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -117,6 +118,9 @@ impl> Ledger { ratified_finalize_operations, )?; + // Determine if the block subdag is correctly constructed and is not a combination of multiple subdags. + self.check_block_subdag_atomicity(block)?; + // Ensure that each existing solution ID from the block exists in the ledger. for existing_solution_id in expected_existing_solution_ids { if !self.contains_solution_id(&existing_solution_id)? { @@ -133,4 +137,66 @@ impl> Ledger { Ok(()) } + + /// Checks that the block subdag can not be split into multiple valid subdags. + fn check_block_subdag_atomicity(&self, block: &Block) -> Result<()> { + // Returns `true` if there is a path from the previous certificate to the current certificate. + fn is_linked( + subdag: &Subdag, + previous_certificate: &BatchCertificate, + current_certificate: &BatchCertificate, + ) -> Result { + // Initialize the list containing the traversal. + let mut traversal = vec![current_certificate]; + // Iterate over the rounds from the current certificate to the previous certificate. + for round in (previous_certificate.round()..current_certificate.round()).rev() { + // Retrieve all of the certificates for this past round. + let certificates = subdag.get(&round).ok_or(anyhow!("No certificates found for round {round}"))?; + // Filter the certificates to only include those that are in the traversal. + traversal = certificates + .into_iter() + .filter(|p| traversal.iter().any(|c| c.previous_certificate_ids().contains(&p.id()))) + .collect(); + } + Ok(traversal.contains(&previous_certificate)) + } + + // Check if the block has a subdag. + let subdag = match block.authority() { + Authority::Quorum(subdag) => subdag, + _ => return Ok(()), + }; + + // Iterate over the rounds to find possible leader certificates. + for round in (self.latest_round().saturating_add(2)..=subdag.anchor_round().saturating_sub(2)).rev().step_by(2) + { + // Retrieve the previous committee lookback. + let previous_committee_lookback = self + .get_committee_lookback_for_round(round)? + .ok_or_else(|| anyhow!("No committee lookback found for round {round}"))?; + + // Compute the leader for the commit round. + let computed_leader = previous_committee_lookback + .get_leader(round) + .map_err(|e| anyhow!("Failed to compute leader for round {round}: {e}"))?; + + // Retrieve the previous leader certificates. + let previous_certificate = match subdag.get(&round).and_then(|certificates| { + certificates.iter().find(|certificate| certificate.author() == computed_leader) + }) { + Some(cert) => cert, + None => continue, + }; + + // Determine if there is a path between the previous certificate and the subdag's leader certificate. + if is_linked(subdag, previous_certificate, subdag.leader_certificate())? { + bail!( + "The previous certificate should not be linked to the current certificate in block {}", + block.height() + ); + } + } + + Ok(()) + } } diff --git a/ledger/src/check_transaction_basic.rs b/ledger/src/check_transaction_basic.rs index 8d0110cac5..d578a6704f 100644 --- a/ledger/src/check_transaction_basic.rs +++ b/ledger/src/check_transaction_basic.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/src/contains.rs b/ledger/src/contains.rs index 5f75b826bb..7f5243a46c 100644 --- a/ledger/src/contains.rs +++ b/ledger/src/contains.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -44,8 +45,8 @@ impl> Ledger { pub fn contains_transmission(&self, transmission_id: &TransmissionID) -> Result { match transmission_id { TransmissionID::Ratification => Ok(false), - TransmissionID::Solution(solution_id) => self.contains_solution_id(solution_id), - TransmissionID::Transaction(transaction_id) => self.contains_transaction_id(transaction_id), + TransmissionID::Solution(solution_id, _) => self.contains_solution_id(solution_id), + TransmissionID::Transaction(transaction_id, _) => self.contains_transaction_id(transaction_id), } } diff --git a/ledger/src/find.rs b/ledger/src/find.rs index 8b6cff547b..d24c0858e9 100644 --- a/ledger/src/find.rs +++ b/ledger/src/find.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/src/get.rs b/ledger/src/get.rs index a92d52d142..162dd2c247 100644 --- a/ledger/src/get.rs +++ b/ledger/src/get.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,6 +26,22 @@ impl> Ledger { self.vm.finalize_store().committee_store().get_committee_for_round(round) } + /// Returns the committee lookback for the given round. + pub fn get_committee_lookback_for_round(&self, round: u64) -> Result>> { + // Get the round number for the previous committee. Note, we subtract 2 from odd rounds, + // because committees are updated in even rounds. + let previous_round = match round % 2 == 0 { + true => round.saturating_sub(1), + false => round.saturating_sub(2), + }; + + // Get the committee lookback round. + let committee_lookback_round = previous_round.saturating_sub(Committee::::COMMITTEE_LOOKBACK_RANGE); + + // Retrieve the committee for the committee lookback round. + self.get_committee_for_round(committee_lookback_round) + } + /// Returns the state root that contains the given `block height`. pub fn get_state_root(&self, block_height: u32) -> Result> { self.vm.block_store().get_state_root(block_height) diff --git a/ledger/src/helpers/bft.rs b/ledger/src/helpers/bft.rs index 3d786d6e9e..29c73ca6fb 100644 --- a/ledger/src/helpers/bft.rs +++ b/ledger/src/helpers/bft.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ use ledger_block::{Ratify, Transaction}; use ledger_narwhal::{Transmission, TransmissionID}; use ledger_puzzle::Solution; -use anyhow::{bail, ensure, Result}; +use anyhow::{Result, bail, ensure}; use std::collections::HashSet; /// Takes in an iterator of transmissions and returns a tuple of ratifications, solutions, and transactions. @@ -46,7 +47,9 @@ pub fn decouple_transmissions( // Deserialize and store the transmission. match (transmission_id, transmission) { (TransmissionID::Ratification, Transmission::Ratification) => (), - (TransmissionID::Solution(commitment), Transmission::Solution(solution)) => { + (TransmissionID::Solution(commitment, checksum), Transmission::Solution(solution)) => { + // Ensure the transmission checksum corresponds to the solution. + ensure!(checksum == solution.to_checksum::()?, "Mismatching transmission checksum (solution)"); // Deserialize the solution. let solution = solution.deserialize_blocking()?; // Ensure the transmission ID corresponds to the solution. @@ -54,7 +57,9 @@ pub fn decouple_transmissions( // Insert the solution into the list. solutions.push(solution); } - (TransmissionID::Transaction(transaction_id), Transmission::Transaction(transaction)) => { + (TransmissionID::Transaction(transaction_id, checksum), Transmission::Transaction(transaction)) => { + // Ensure the transmission checksum corresponds to the transaction. + ensure!(checksum == transaction.to_checksum::()?, "Mismatching transmission checksum (transaction)"); // Deserialize the transaction. let transaction = transaction.deserialize_blocking()?; // Ensure the transmission ID corresponds to the transaction. diff --git a/ledger/src/helpers/mod.rs b/ledger/src/helpers/mod.rs index 2b00c4b28c..98b4db6024 100644 --- a/ledger/src/helpers/mod.rs +++ b/ledger/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/src/helpers/supply.rs b/ledger/src/helpers/supply.rs index b534846805..6770bbb25b 100644 --- a/ledger/src/helpers/supply.rs +++ b/ledger/src/helpers/supply.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,7 +16,7 @@ use console::network::Network; use ledger_block::Transactions; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; /// Returns the next total supply in microcredits, given the starting total supply and newly-confirmed transactions. pub fn update_total_supply( diff --git a/ledger/src/iterators.rs b/ledger/src/iterators.rs index 11e461cee7..fce64fb998 100644 --- a/ledger/src/iterators.rs +++ b/ledger/src/iterators.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index 957d45e783..4d7465c744 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -63,8 +64,8 @@ use synthesizer::{ }; use aleo_std::{ - prelude::{finish, lap, timer}, StorageMode, + prelude::{finish, lap, timer}, }; use anyhow::Result; use core::ops::Range; @@ -126,7 +127,7 @@ impl> Ledger { const NUM_BLOCKS: usize = 10; // Retrieve the latest height. let latest_height = ledger.current_block.read().height(); - debug_assert_eq!(latest_height, *ledger.vm.block_store().heights().max().unwrap(), "Mismatch in latest height"); + debug_assert_eq!(latest_height, ledger.vm.block_store().max_height().unwrap(), "Mismatch in latest height"); // Sample random block heights. let block_heights: Vec = (0..=latest_height).choose_multiple(&mut OsRng, (latest_height as usize).min(NUM_BLOCKS)); @@ -169,7 +170,7 @@ impl> Ledger { }; // If the block store is empty, initialize the genesis block. - if ledger.vm.block_store().heights().max().is_none() { + if ledger.vm.block_store().max_height().is_none() { // Add the genesis block. ledger.advance_to_next_block(&genesis_block)?; } @@ -177,7 +178,7 @@ impl> Ledger { // Retrieve the latest height. let latest_height = - *ledger.vm.block_store().heights().max().ok_or_else(|| anyhow!("Failed to load blocks from the ledger"))?; + ledger.vm.block_store().max_height().ok_or_else(|| anyhow!("Failed to load blocks from the ledger"))?; // Fetch the latest block. let block = ledger .get_block(latest_height) @@ -391,9 +392,11 @@ pub(crate) mod test_helpers { }; use ledger_block::Block; use ledger_store::ConsensusStore; + use snarkvm_circuit::network::AleoV0; use synthesizer::vm::VM; pub(crate) type CurrentNetwork = MainnetV0; + pub(crate) type CurrentAleo = AleoV0; #[cfg(not(feature = "rocks"))] pub(crate) type CurrentLedger = diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 22f6046c1e..cc5989c0e5 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,31 +14,167 @@ // limitations under the License. use crate::{ - advance::split_candidate_solutions, - test_helpers::{CurrentLedger, CurrentNetwork}, Ledger, RecordsFilter, + advance::split_candidate_solutions, + test_helpers::{CurrentAleo, CurrentLedger, CurrentNetwork}, }; use aleo_std::StorageMode; use console::{ account::{Address, PrivateKey}, - network::{prelude::*, MainnetV0}, + network::{MainnetV0, prelude::*}, program::{Entry, Identifier, Literal, Plaintext, ProgramID, Value}, types::U16, }; -use ledger_block::{ConfirmedTransaction, Execution, Ratify, Rejected, Transaction}; +use ledger_authority::Authority; +use ledger_block::{Block, ConfirmedTransaction, Execution, Ratify, Rejected, Transaction}; use ledger_committee::{Committee, MIN_VALIDATOR_STAKE}; -use ledger_store::{helpers::memory::ConsensusMemory, ConsensusStore}; -use synthesizer::{program::Program, vm::VM, Stack}; +use ledger_narwhal::{BatchCertificate, BatchHeader, Data, Subdag, Transmission, TransmissionID}; +use ledger_store::{ConsensusStore, helpers::memory::ConsensusMemory}; +use snarkvm_utilities::try_vm_runtime; +use synthesizer::{Stack, program::Program, vm::VM}; -use indexmap::IndexMap; +use indexmap::{IndexMap, IndexSet}; use rand::seq::SliceRandom; +use std::collections::{BTreeMap, HashMap}; +use time::OffsetDateTime; /// Initializes a sample VM. fn sample_vm() -> VM> { VM::from(ConsensusStore::>::open(None).unwrap()).unwrap() } +/// Extract the transmissions from a block. +fn extract_transmissions( + block: &Block, +) -> IndexMap, Transmission> { + let mut transmissions = IndexMap::new(); + for tx in block.transactions().iter() { + let checksum = Data::Object(tx.transaction().clone()).to_checksum::().unwrap(); + transmissions.insert(TransmissionID::from((&tx.id(), &checksum)), tx.transaction().clone().into()); + } + if let Some(coinbase_solution) = block.solutions().as_ref() { + for (_, solution) in coinbase_solution.iter() { + let checksum = Data::Object(*solution).to_checksum::().unwrap(); + transmissions.insert(TransmissionID::from((solution.id(), checksum)), (*solution).into()); + } + } + transmissions +} + +/// Construct `num_blocks` quorum blocks given a set of validator private keys and the genesis block. +fn construct_quorum_blocks( + private_keys: Vec>, + genesis: Block, + num_blocks: u64, + rng: &mut TestRng, +) -> Vec> { + // Initialize the ledger with the genesis block. + let ledger = + Ledger::>::load(genesis.clone(), StorageMode::Production) + .unwrap(); + + // Initialize the round parameters. + assert!(num_blocks > 0); + assert!(num_blocks < 25); + let rounds_per_commit = 2; + let final_round = num_blocks.saturating_mul(rounds_per_commit); + + // Sample rounds of batch certificates starting at the genesis round from a static set of 4 authors. + let (round_to_certificates_map, committee) = { + let committee = ledger.latest_committee().unwrap(); + let mut round_to_certificates_map: HashMap>> = HashMap::new(); + let mut previous_certificates: IndexSet> = IndexSet::with_capacity(4); + + // Create certificates for each round. + for round in 1..=final_round { + let mut current_certificates = IndexSet::new(); + let previous_certificate_ids = + if round <= 1 { IndexSet::new() } else { previous_certificates.iter().map(|c| c.id()).collect() }; + + for (i, private_key_1) in private_keys.iter().enumerate() { + let batch_header = BatchHeader::new( + private_key_1, + round, + OffsetDateTime::now_utc().unix_timestamp(), + committee.id(), + Default::default(), + previous_certificate_ids.clone(), + rng, + ) + .unwrap(); + // Add signatures for the batch headers. This creates a fully connected DAG. + let signatures = private_keys + .iter() + .enumerate() + .filter(|&(j, _)| i != j) + .map(|(_, private_key_2)| private_key_2.sign(&[batch_header.batch_id()], rng).unwrap()) + .collect(); + current_certificates.insert(BatchCertificate::from(batch_header, signatures).unwrap()); + } + + round_to_certificates_map.insert(round, current_certificates.clone()); + previous_certificates = current_certificates; + } + (round_to_certificates_map, committee) + }; + + // Helper function to create a quorum block. + fn create_next_quorum_block( + ledger: &Ledger>, + round: u64, + leader_certificate: &BatchCertificate, + previous_leader_certificate: Option<&BatchCertificate>, + round_to_certificates_map: &HashMap>>, + rng: &mut TestRng, + ) -> Block { + // Construct the subdag for the block. + let mut subdag_map = BTreeMap::new(); + // Add the leader certificate. + subdag_map.insert(round, [leader_certificate.clone()].into()); + // Add the certificates of the previous round. + subdag_map.insert(round - 1, round_to_certificates_map.get(&(round - 1)).unwrap().clone()); + // Add the certificates from the previous leader round, excluding the previous leader certificate. + // This assumes the number of rounds per commit is 2. + if let Some(prev_leader_cert) = previous_leader_certificate { + let mut previous_leader_round_certificates = + round_to_certificates_map.get(&(round - 2)).cloned().unwrap_or_default(); + previous_leader_round_certificates.shift_remove(prev_leader_cert); + subdag_map.insert(round - 2, previous_leader_round_certificates); + } + // Construct the block. + let subdag = Subdag::from(subdag_map).unwrap(); + let block = ledger.prepare_advance_to_next_quorum_block(subdag, Default::default(), rng).unwrap(); + ledger.check_next_block(&block, rng).unwrap(); + block + } + + // Track the blocks that are created. + let mut blocks = Vec::new(); + let mut previous_leader_certificate: Option<&BatchCertificate> = None; + + // Construct the blocks. + for block_height in 1..=num_blocks { + let round = block_height.saturating_mul(rounds_per_commit); + let leader = committee.get_leader(round).unwrap(); + let leader_certificate = + round_to_certificates_map.get(&round).unwrap().iter().find(|c| c.author() == leader).unwrap(); + let block = create_next_quorum_block( + &ledger, + round, + leader_certificate, + previous_leader_certificate, + &round_to_certificates_map, + rng, + ); + ledger.advance_to_next_block(&block).unwrap(); + previous_leader_certificate = Some(leader_certificate); + blocks.push(block); + } + + blocks +} + #[test] fn test_load() { let rng = &mut TestRng::default(); @@ -1774,7 +1911,7 @@ fn test_split_candidate_solutions() { let candidate_solutions: Vec = rng.sample_iter(Standard).take(num_candidates).collect(); let (_accepted, _aborted) = - split_candidate_solutions(candidate_solutions, max_solutions, |candidate| candidate % 2 == 0); + split_candidate_solutions(candidate_solutions, max_solutions, |candidate| *candidate % 2 == 0); } } @@ -2346,11 +2483,105 @@ finalize is_id: ledger.advance_to_next_block(&block_3).unwrap(); } +#[test] +fn test_deployment_with_cast_from_field_to_scalar() { + // Initialize an RNG. + let rng = &mut TestRng::default(); + + const ITERATIONS: usize = 10; + + // Construct a program that casts a field to a scalar. + let program = Program::::from_str( + r" +program test_cast_field_to_scalar.aleo; +function foo: + input r0 as field.public; + cast r0 into r1 as scalar;", + ) + .unwrap(); + + // Constructs a program that has a struct with a field that is cast to a scalar. + let program_2 = Program::::from_str( + r" +program test_cast_f_to_s_struct.aleo; + +struct message: + first as scalar; + +function foo: + input r0 as field.public; + cast r0 into r1 as scalar; + cast r1 into r2 as message;", + ) + .unwrap(); + + // Constructs a program that has an array of scalars cast from fields. + let program_3 = Program::::from_str( + r" +program test_cast_f_to_s_array.aleo; + +function foo: + input r0 as field.public; + cast r0 into r1 as scalar; + cast r1 r1 r1 r1 into r2 as [scalar; 4u32];", + ) + .unwrap(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, .. } = crate::test_helpers::sample_test_env(rng); + + // Create a helper method to deploy the programs. + let deploy_program = |program: &Program, rng: &mut TestRng| { + let mut attempts = 0; + loop { + if attempts >= ITERATIONS { + panic!("Failed to craft deployment after {ITERATIONS} attempts"); + } + match try_vm_runtime!(|| ledger.vm().deploy(&private_key, program, None, 0, None, rng)) { + Ok(result) => break result.unwrap(), + Err(_) => attempts += 1, + } + } + }; + + // Deploy the programs. Keep attempting to create a deployment until it is successful. + let deployment_tx = deploy_program(&program, rng); + let deployment_tx_2 = deploy_program(&program_2, rng); + let deployment_tx_3 = deploy_program(&program_3, rng); + + // Verify the deployment under different RNGs to ensure the deployment is valid. + for _ in 0..ITERATIONS { + let process = ledger.vm().process().clone(); + // Create a helper method to verify the deployments. + let verify_deployment = |deployment_tx: &Transaction, rng: &mut TestRng| { + let expected_result = match try_vm_runtime!(|| ledger.vm().check_transaction(deployment_tx, None, rng)) { + Ok(result) => result.is_ok(), + Err(_) => false, + }; + let deployment = deployment_tx.deployment().unwrap().clone(); + for _ in 0..ITERATIONS { + let result = + match try_vm_runtime!(|| process.read().verify_deployment::(&deployment, rng)) { + Ok(result) => result.is_ok(), + Err(_) => false, + }; + assert_eq!(result, expected_result); + } + }; + + // Verify the deployments. + verify_deployment(&deployment_tx, rng); + verify_deployment(&deployment_tx_2, rng); + verify_deployment(&deployment_tx_3, rng); + } +} + // These tests require the proof targets to be low enough to be able to generate **valid** solutions. // This requires the 'test' feature to be enabled for the `console` dependency. #[cfg(feature = "test")] mod valid_solutions { use super::*; + use ledger_puzzle::Solution; use rand::prelude::SliceRandom; use std::collections::HashSet; @@ -2668,4 +2899,246 @@ mod valid_solutions { candidate_solutions.iter().skip(CurrentNetwork::MAX_SOLUTIONS).map(|s| s.id()).collect::>(); assert_eq!(block_aborted_solution_ids, expected_aborted_solutions, "Aborted solutions do not match"); } + + #[test] + fn test_malicious_solution() { + // Initialize an RNG. + let rng = &mut TestRng::default(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, address, .. } = + crate::test_helpers::sample_test_env(rng); + + // Retrieve the puzzle parameters. + let puzzle = ledger.puzzle(); + let latest_epoch_hash = ledger.latest_epoch_hash().unwrap(); + let minimum_proof_target = ledger.latest_proof_target(); + + // Initialize a valid solution object. + let mut valid_solution = None; + while valid_solution.is_none() { + let solution = puzzle.prove(latest_epoch_hash, address, rng.gen(), None).unwrap(); + if puzzle.get_proof_target(&solution).unwrap() >= minimum_proof_target { + valid_solution = Some(solution); + } + } + // Unwrap the valid solution. + let valid_solution = valid_solution.unwrap(); + + // Construct a malicious solution with a different target. + let different_target = valid_solution.target().wrapping_sub(1); + let malicious_solution = Solution::new(*valid_solution.partial_solution(), different_target); + + assert_eq!( + valid_solution.id(), + malicious_solution.id(), + "The malicious solution should have the same ID as the valid solution" + ); + assert_ne!( + valid_solution.target(), + malicious_solution.target(), + "The malicious solution should have a different target than the valid solution" + ); + + // Create a valid transaction for the block. + let inputs = [Value::from_str(&format!("{address}")).unwrap(), Value::from_str("10u64").unwrap()]; + let transfer_transaction = ledger + .vm + .execute(&private_key, ("credits.aleo", "transfer_public"), inputs.iter(), None, 0, None, rng) + .unwrap(); + + // Check that the block creation fixes the malformed solution. + let expected_solution_id = valid_solution.id(); + let expected_solution = valid_solution; + let mut check_block = |candidate_solutions: Vec>| { + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block( + &private_key, + vec![], + candidate_solutions.clone(), + vec![transfer_transaction.clone()], + rng, + ) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Check that the block's solutions are well-formed. + assert_eq!(block.solutions().len(), 1); + assert_eq!(block.aborted_solution_ids().len(), 0); + + // Fetch the solution from the block. + let (solution_id, solution) = block.solutions().as_ref().unwrap().first().unwrap(); + assert_eq!(*solution_id, expected_solution_id, "Check that the block has the correct solution ID"); + assert_eq!(*solution, expected_solution, "Check that the block has the correct solution"); + }; + + // Case 1: The malicious solution is included in the block construction. + let candidate_solutions = vec![malicious_solution]; + check_block(candidate_solutions); + + // Case 2: The valid solution is included in the block construction. + let candidate_solutions = vec![valid_solution]; + check_block(candidate_solutions); + } + + #[test] + fn test_solution_with_insufficient_target() { + // Initialize an RNG. + let rng = &mut TestRng::default(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, address, .. } = + crate::test_helpers::sample_test_env(rng); + + // Retrieve the puzzle parameters. + let puzzle = ledger.puzzle(); + let latest_epoch_hash = ledger.latest_epoch_hash().unwrap(); + let minimum_proof_target = ledger.latest_proof_target(); + + // Initialize a valid solution object. + let mut invalid_solution = None; + while invalid_solution.is_none() { + let solution = puzzle.prove(latest_epoch_hash, address, rng.gen(), None).unwrap(); + if puzzle.get_proof_target(&solution).unwrap() < minimum_proof_target { + invalid_solution = Some(solution); + } + } + // Unwrap the invalid solution. + let invalid_solution = invalid_solution.unwrap(); + + // Create a valid transaction for the block. + let inputs = [Value::from_str(&format!("{address}")).unwrap(), Value::from_str("10u64").unwrap()]; + let transfer_transaction = ledger + .vm + .execute(&private_key, ("credits.aleo", "transfer_public"), inputs.iter(), None, 0, None, rng) + .unwrap(); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block( + &private_key, + vec![], + vec![invalid_solution], + vec![transfer_transaction], + rng, + ) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the deployment block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Check that the block's solutions are well-formed. + assert_eq!(block.solutions().len(), 0); + assert_eq!(block.aborted_solution_ids().len(), 1); + + // Check that the aborted solution is correct. + let block_aborted_solution_id = block.aborted_solution_ids().first().unwrap(); + assert_eq!(*block_aborted_solution_id, invalid_solution.id(), "Aborted solutions do not match"); + } +} + +#[test] +fn test_forged_block_subdags() { + let rng = &mut TestRng::default(); + + // Sample the genesis private key. + let private_key = PrivateKey::::new(rng).unwrap(); + // Initialize the store. + let store = ConsensusStore::<_, ConsensusMemory<_>>::open(None).unwrap(); + // Create a genesis block with a seeded RNG to reproduce the same genesis private keys. + let seed: u64 = rng.gen(); + let genesis_rng = &mut TestRng::from_seed(seed); + let genesis = VM::from(store).unwrap().genesis_beacon(&private_key, genesis_rng).unwrap(); + + // Extract the private keys from the genesis committee by using the same RNG to sample private keys. + let genesis_rng = &mut TestRng::from_seed(seed); + let private_keys = [ + private_key, + PrivateKey::new(genesis_rng).unwrap(), + PrivateKey::new(genesis_rng).unwrap(), + PrivateKey::new(genesis_rng).unwrap(), + ]; + + // Construct 3 quorum blocks. + let mut quorum_blocks = construct_quorum_blocks(private_keys.to_vec(), genesis.clone(), 3, rng); + + // Extract the individual blocks. + let block_1 = quorum_blocks.remove(0); + let block_2 = quorum_blocks.remove(0); + let block_3 = quorum_blocks.remove(0); + + // Construct the ledger. + let ledger = + Ledger::>::load(genesis, StorageMode::Production).unwrap(); + ledger.advance_to_next_block(&block_1).unwrap(); + ledger.check_next_block(&block_2, rng).unwrap(); + + //////////////////////////////////////////////////////////////////////////// + // Attack 1: Forge block 2' with the subdag of block 3. + //////////////////////////////////////////////////////////////////////////// + { + let block_3_subdag = + if let Authority::Quorum(subdag) = block_3.authority() { subdag } else { unreachable!("") }; + + // Fetch the transmissions. + let transmissions = extract_transmissions(&block_3); + + // Forge the block. + let forged_block_2 = ledger + .prepare_advance_to_next_quorum_block(block_3_subdag.clone(), transmissions, &mut rand::thread_rng()) + .unwrap(); + + assert_ne!(forged_block_2, block_2); + + // Attempt to verify the forged block. + assert!(ledger.check_next_block(&forged_block_2, &mut rand::thread_rng()).is_err()); + } + + //////////////////////////////////////////////////////////////////////////// + // Attack 2: Forge block 2' with the combined subdag of block 2 and 3. + //////////////////////////////////////////////////////////////////////////// + { + // Fetch the subdags. + let block_2_subdag = + if let Authority::Quorum(subdag) = block_2.authority() { subdag } else { unreachable!("") }; + let block_3_subdag = + if let Authority::Quorum(subdag) = block_3.authority() { subdag } else { unreachable!("") }; + + // Combined the subdags. + let mut combined_subdag = block_2_subdag.deref().clone(); + for (round, certificates) in block_3_subdag.iter() { + combined_subdag + .entry(*round) + .and_modify(|c| c.extend(certificates.clone())) + .or_insert(certificates.clone()); + } + + // Fetch the transmissions. + let block_2_transmissions = extract_transmissions(&block_2); + let block_3_transmissions = extract_transmissions(&block_3); + + // Combine the transmissions. + let mut combined_transmissions = block_2_transmissions; + combined_transmissions.extend(block_3_transmissions); + + // Forge the block. + let forged_block_2_from_both_subdags = ledger + .prepare_advance_to_next_quorum_block( + Subdag::from(combined_subdag).unwrap(), + combined_transmissions, + &mut rand::thread_rng(), + ) + .unwrap(); + + assert_ne!(forged_block_2_from_both_subdags, block_1); + + // Attempt to verify the forged block. + assert!(ledger.check_next_block(&forged_block_2_from_both_subdags, &mut rand::thread_rng()).is_err()); + } } diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index 898f21fa7a..6e2bc81d8e 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-store" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A data store for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -42,42 +42,42 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../committee" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../narwhal/batch-certificate" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-puzzle] package = "snarkvm-ledger-puzzle" path = "../puzzle" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.19" +version = "=1.0.0" [dependencies.aleo-std-storage] version = "0.1.7" diff --git a/ledger/store/src/block/confirmed_tx_type/bytes.rs b/ledger/store/src/block/confirmed_tx_type/bytes.rs index 445c6e1312..beba8a7d92 100644 --- a/ledger/store/src/block/confirmed_tx_type/bytes.rs +++ b/ledger/store/src/block/confirmed_tx_type/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/block/confirmed_tx_type/mod.rs b/ledger/store/src/block/confirmed_tx_type/mod.rs index 58845a40b4..2eb71a707d 100644 --- a/ledger/store/src/block/confirmed_tx_type/mod.rs +++ b/ledger/store/src/block/confirmed_tx_type/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/block/confirmed_tx_type/serialize.rs b/ledger/store/src/block/confirmed_tx_type/serialize.rs index fdfd704b99..1e29e74732 100644 --- a/ledger/store/src/block/confirmed_tx_type/serialize.rs +++ b/ledger/store/src/block/confirmed_tx_type/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/block/confirmed_tx_type/string.rs b/ledger/store/src/block/confirmed_tx_type/string.rs index ac282e36de..d00c2f3f25 100644 --- a/ledger/store/src/block/confirmed_tx_type/string.rs +++ b/ledger/store/src/block/confirmed_tx_type/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 745ff1d805..88ed88b169 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,14 +17,14 @@ pub mod confirmed_tx_type; pub use confirmed_tx_type::*; use crate::{ - atomic_batch_scope, - cow_to_cloned, - cow_to_copied, - helpers::{Map, MapRead}, TransactionStorage, TransactionStore, TransitionStorage, TransitionStore, + atomic_batch_scope, + cow_to_cloned, + cow_to_copied, + helpers::{Map, MapRead}, }; use console::{ network::prelude::*, @@ -487,16 +488,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { }; // Retrieve the aborted solution IDs. - let aborted_solution_ids = match self.get_block_aborted_solution_ids(block_hash)? { - Some(solution_ids) => solution_ids, - None => Vec::new(), - }; + let aborted_solution_ids = (self.get_block_aborted_solution_ids(block_hash)?).unwrap_or_default(); // Retrieve the aborted transaction IDs. - let aborted_transaction_ids = match self.get_block_aborted_transaction_ids(block_hash)? { - Some(transaction_ids) => transaction_ids, - None => Vec::new(), - }; + let aborted_transaction_ids = (self.get_block_aborted_transaction_ids(block_hash)?).unwrap_or_default(); // Retrieve the rejected transaction IDs, and the deployment or execution ID. let rejected_transaction_ids_and_deployment_or_execution_id = match self.get_block_transactions(block_hash)? { @@ -1014,11 +1009,13 @@ impl> BlockStore { // Compute the block tree. let tree = { - // Prepare an iterator over the block heights. - let mut heights_hashes = storage.id_map().iter_confirmed().collect::>(); - heights_hashes.sort_unstable_by(|(h1, _), (h2, _)| h1.cmp(h2)); - // Prepare the leaves of the block tree. - let hashes = cfg_into_iter!(heights_hashes).map(|(_, hash)| hash.to_bits_le()).collect::>>(); + // Prepare an iterator over the block heights and prepare the leaves of the block tree. + let hashes = storage + .id_map() + .iter_confirmed() + .sorted_unstable_by(|(h1, _), (h2, _)| h1.cmp(h2)) + .map(|(_, hash)| hash.to_bits_le()) + .collect::>>(); // Construct the block tree. Arc::new(RwLock::new(N::merkle_tree_bhp(&hashes)?)) }; @@ -1068,10 +1065,8 @@ impl> BlockStore { let mut tree = self.tree.write(); // Determine the block heights to remove. - let heights = match self.storage.id_map().keys_confirmed().max() { - Some(height) => { - // Determine the end block height to remove. - let end_height = cow_to_copied!(height); + let heights = match self.max_height() { + Some(end_height) => { // Determine the start block height to remove. let start_height = end_height .checked_sub(n - 1) @@ -1353,6 +1348,11 @@ impl> BlockStore { self.storage.id_map().keys_confirmed() } + /// Returns the height of the latest block in the storage. + pub fn max_height(&self) -> Option { + self.storage.id_map().len_confirmed().checked_sub(1)?.try_into().ok() + } + /// Returns an iterator over the block hashes, for all blocks in `self`. pub fn hashes(&self) -> impl '_ + Iterator> { self.storage.reverse_id_map().keys_confirmed() diff --git a/ledger/store/src/consensus/mod.rs b/ledger/store/src/consensus/mod.rs index d4672f7414..4f46f46fb8 100644 --- a/ledger/store/src/consensus/mod.rs +++ b/ledger/store/src/consensus/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/memory/block.rs b/ledger/store/src/helpers/memory/block.rs index 1562087b6c..04ee35c308 100644 --- a/ledger/store/src/helpers/memory/block.rs +++ b/ledger/store/src/helpers/memory/block.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,11 +14,11 @@ // limitations under the License. use crate::{ - helpers::memory::{MemoryMap, TransactionMemory, TransitionMemory}, BlockStorage, ConfirmedTxType, TransactionStore, TransitionStore, + helpers::memory::{MemoryMap, TransactionMemory, TransitionMemory}, }; use console::{prelude::*, types::Field}; use ledger_authority::Authority; diff --git a/ledger/store/src/helpers/memory/consensus.rs b/ledger/store/src/helpers/memory/consensus.rs index d5adf20141..b29a1cad6e 100644 --- a/ledger/store/src/helpers/memory/consensus.rs +++ b/ledger/store/src/helpers/memory/consensus.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - helpers::memory::{BlockMemory, FinalizeMemory, TransactionMemory, TransitionMemory}, BlockStore, ConsensusStorage, FinalizeStore, + helpers::memory::{BlockMemory, FinalizeMemory, TransactionMemory, TransitionMemory}, }; use console::prelude::*; diff --git a/ledger/store/src/helpers/memory/internal/map.rs b/ledger/store/src/helpers/memory/internal/map.rs index f43a56e315..e932b7a416 100644 --- a/ledger/store/src/helpers/memory/internal/map.rs +++ b/ledger/store/src/helpers/memory/internal/map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,10 +23,10 @@ use core::{borrow::Borrow, hash::Hash}; use parking_lot::{Mutex, RwLock}; use std::{ borrow::Cow, - collections::{btree_map, BTreeMap}, + collections::{BTreeMap, btree_map}, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, }; @@ -383,7 +384,7 @@ impl< #[cfg(test)] mod tests { use super::*; - use crate::{atomic_batch_scope, atomic_finalize, FinalizeMode}; + use crate::{FinalizeMode, atomic_batch_scope, atomic_finalize}; use console::{account::Address, network::MainnetV0}; type CurrentNetwork = MainnetV0; diff --git a/ledger/store/src/helpers/memory/internal/mod.rs b/ledger/store/src/helpers/memory/internal/mod.rs index dea20c2ef0..db111021e7 100644 --- a/ledger/store/src/helpers/memory/internal/mod.rs +++ b/ledger/store/src/helpers/memory/internal/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/memory/internal/nested_map.rs b/ledger/store/src/helpers/memory/internal/nested_map.rs index 11d265ce21..1133e7a42f 100644 --- a/ledger/store/src/helpers/memory/internal/nested_map.rs +++ b/ledger/store/src/helpers/memory/internal/nested_map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,10 +22,10 @@ use core::hash::Hash; use parking_lot::{Mutex, RwLock}; use std::{ borrow::Cow, - collections::{btree_map, BTreeMap, BTreeSet}, + collections::{BTreeMap, BTreeSet, btree_map}, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, }; @@ -590,7 +591,7 @@ fn to_map_key(m: &[u8], k: &[u8]) -> Vec { #[cfg(test)] mod tests { use super::*; - use crate::{atomic_batch_scope, atomic_finalize, FinalizeMode}; + use crate::{FinalizeMode, atomic_batch_scope, atomic_finalize}; use console::{account::Address, network::MainnetV0}; type CurrentNetwork = MainnetV0; diff --git a/ledger/store/src/helpers/memory/mod.rs b/ledger/store/src/helpers/memory/mod.rs index 6a41a4ffd6..d7c6e4a6c1 100644 --- a/ledger/store/src/helpers/memory/mod.rs +++ b/ledger/store/src/helpers/memory/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/memory/program.rs b/ledger/store/src/helpers/memory/program.rs index 04675cff7d..b48edf62c0 100644 --- a/ledger/store/src/helpers/memory/program.rs +++ b/ledger/store/src/helpers/memory/program.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,10 +16,10 @@ #![allow(clippy::type_complexity)] use crate::{ - helpers::memory::{MemoryMap, NestedMemoryMap}, CommitteeStorage, CommitteeStore, FinalizeStorage, + helpers::memory::{MemoryMap, NestedMemoryMap}, }; use console::{ prelude::*, diff --git a/ledger/store/src/helpers/memory/transaction.rs b/ledger/store/src/helpers/memory/transaction.rs index 66b7b14867..31dc8ac3d3 100644 --- a/ledger/store/src/helpers/memory/transaction.rs +++ b/ledger/store/src/helpers/memory/transaction.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,6 @@ // limitations under the License. use crate::{ - helpers::memory::{MemoryMap, TransitionMemory}, DeploymentStorage, DeploymentStore, ExecutionStorage, @@ -23,6 +23,7 @@ use crate::{ TransactionStorage, TransactionType, TransitionStore, + helpers::memory::{MemoryMap, TransitionMemory}, }; use console::{ prelude::*, diff --git a/ledger/store/src/helpers/memory/transition.rs b/ledger/store/src/helpers/memory/transition.rs index ee5e90b1c4..1b1b56be27 100644 --- a/ledger/store/src/helpers/memory/transition.rs +++ b/ledger/store/src/helpers/memory/transition.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{helpers::memory::MemoryMap, InputStorage, InputStore, OutputStorage, OutputStore, TransitionStorage}; +use crate::{InputStorage, InputStore, OutputStorage, OutputStore, TransitionStorage, helpers::memory::MemoryMap}; use console::{ prelude::*, program::{Ciphertext, Future, Identifier, Plaintext, ProgramID, Record}, diff --git a/ledger/store/src/helpers/mod.rs b/ledger/store/src/helpers/mod.rs index deb8926700..746d5b48e6 100644 --- a/ledger/store/src/helpers/mod.rs +++ b/ledger/store/src/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/rocksdb/block.rs b/ledger/store/src/helpers/rocksdb/block.rs index 498e8eebf6..97a86cc3d1 100644 --- a/ledger/store/src/helpers/rocksdb/block.rs +++ b/ledger/store/src/helpers/rocksdb/block.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,17 +14,17 @@ // limitations under the License. use crate::{ + BlockStorage, + ConfirmedTxType, + TransactionStore, + TransitionStore, helpers::rocksdb::{ - internal::{self, DataMap, Database}, BlockMap, MapID, TransactionDB, TransitionDB, + internal::{self, DataMap, Database}, }, - BlockStorage, - ConfirmedTxType, - TransactionStore, - TransitionStore, }; use console::{prelude::*, types::Field}; use ledger_authority::Authority; diff --git a/ledger/store/src/helpers/rocksdb/consensus.rs b/ledger/store/src/helpers/rocksdb/consensus.rs index 3735a31e67..0ff5df0aff 100644 --- a/ledger/store/src/helpers/rocksdb/consensus.rs +++ b/ledger/store/src/helpers/rocksdb/consensus.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - helpers::rocksdb::{BlockDB, FinalizeDB, TransactionDB, TransitionDB}, BlockStore, ConsensusStorage, FinalizeStore, + helpers::rocksdb::{BlockDB, FinalizeDB, TransactionDB, TransitionDB}, }; use console::prelude::*; diff --git a/ledger/store/src/helpers/rocksdb/internal/id.rs b/ledger/store/src/helpers/rocksdb/internal/id.rs index 4f745e89cb..b01dc7b99c 100644 --- a/ledger/store/src/helpers/rocksdb/internal/id.rs +++ b/ledger/store/src/helpers/rocksdb/internal/id.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/rocksdb/internal/map.rs b/ledger/store/src/helpers/rocksdb/internal/map.rs index df5daf9cc4..c4c6c0a02b 100644 --- a/ledger/store/src/helpers/rocksdb/internal/map.rs +++ b/ledger/store/src/helpers/rocksdb/internal/map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -554,10 +555,10 @@ impl fmt::Debu mod tests { use super::*; use crate::{ + FinalizeMode, atomic_batch_scope, atomic_finalize, - helpers::rocksdb::{internal::tests::temp_dir, MapID, TestMap}, - FinalizeMode, + helpers::rocksdb::{MapID, TestMap, internal::tests::temp_dir}, }; use console::{ account::{Address, FromStr}, diff --git a/ledger/store/src/helpers/rocksdb/internal/mod.rs b/ledger/store/src/helpers/rocksdb/internal/mod.rs index a30b06d71b..a5c5d3c7e4 100644 --- a/ledger/store/src/helpers/rocksdb/internal/mod.rs +++ b/ledger/store/src/helpers/rocksdb/internal/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -25,18 +26,18 @@ pub use nested_map::*; mod tests; use aleo_std_storage::StorageMode; -use anyhow::{bail, ensure, Result}; +use anyhow::{Result, bail, ensure}; use once_cell::sync::OnceCell; use parking_lot::Mutex; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; use std::{ borrow::Borrow, marker::PhantomData, mem, ops::Deref, sync::{ - atomic::{AtomicBool, AtomicUsize, Ordering}, Arc, + atomic::{AtomicBool, AtomicUsize, Ordering}, }, }; @@ -140,6 +141,7 @@ impl Database for RocksDB { options.increase_parallelism(2); options.set_max_background_jobs(4); options.create_if_missing(true); + options.set_max_open_files(8192); Arc::new(rocksdb::DB::open(&options, primary)?) }; diff --git a/ledger/store/src/helpers/rocksdb/internal/nested_map.rs b/ledger/store/src/helpers/rocksdb/internal/nested_map.rs index 036845fe37..245b50d913 100644 --- a/ledger/store/src/helpers/rocksdb/internal/nested_map.rs +++ b/ledger/store/src/helpers/rocksdb/internal/nested_map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use super::*; use crate::helpers::{NestedMap, NestedMapRead}; -use console::prelude::{anyhow, cfg_into_iter, FromBytes}; +use console::prelude::{FromBytes, anyhow, cfg_into_iter}; use core::{fmt, fmt::Debug, hash::Hash, mem}; use std::{borrow::Cow, sync::atomic::Ordering}; @@ -761,13 +762,13 @@ impl<'a, V: 'a + Clone + PartialEq + Eq + Serialize + DeserializeOwned> Iterator mod tests { use super::*; use crate::{ + FinalizeMode, atomic_batch_scope, atomic_finalize, helpers::{ - rocksdb::{internal::tests::temp_dir, MapID, TestMap}, + rocksdb::{MapID, TestMap, internal::tests::temp_dir}, traits::Map, }, - FinalizeMode, }; use console::{ account::{Address, FromStr}, diff --git a/ledger/store/src/helpers/rocksdb/internal/tests.rs b/ledger/store/src/helpers/rocksdb/internal/tests.rs index 2b59a232fc..cbae47a770 100644 --- a/ledger/store/src/helpers/rocksdb/internal/tests.rs +++ b/ledger/store/src/helpers/rocksdb/internal/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::helpers::{ - rocksdb::{MapID, RocksDB, TestMap as TestMapID}, Map, MapRead, + rocksdb::{MapID, RocksDB, TestMap as TestMapID}, }; use console::{ network::{MainnetV0, Network}, diff --git a/ledger/store/src/helpers/rocksdb/mod.rs b/ledger/store/src/helpers/rocksdb/mod.rs index 6a41a4ffd6..d7c6e4a6c1 100644 --- a/ledger/store/src/helpers/rocksdb/mod.rs +++ b/ledger/store/src/helpers/rocksdb/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/rocksdb/program.rs b/ledger/store/src/helpers/rocksdb/program.rs index 88b6481c18..d57a6fb286 100644 --- a/ledger/store/src/helpers/rocksdb/program.rs +++ b/ledger/store/src/helpers/rocksdb/program.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,10 +16,10 @@ #![allow(clippy::type_complexity)] use crate::{ - helpers::rocksdb::{self, CommitteeMap, DataMap, Database, MapID, NestedDataMap, ProgramMap}, CommitteeStorage, CommitteeStore, FinalizeStorage, + helpers::rocksdb::{self, CommitteeMap, DataMap, Database, MapID, NestedDataMap, ProgramMap}, }; use console::{ prelude::*, diff --git a/ledger/store/src/helpers/rocksdb/transaction.rs b/ledger/store/src/helpers/rocksdb/transaction.rs index 2cac1c9c2c..fbb026a5c9 100644 --- a/ledger/store/src/helpers/rocksdb/transaction.rs +++ b/ledger/store/src/helpers/rocksdb/transaction.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,6 +14,15 @@ // limitations under the License. use crate::{ + DeploymentStorage, + DeploymentStore, + ExecutionStorage, + ExecutionStore, + FeeStorage, + FeeStore, + TransactionStorage, + TransactionType, + TransitionStore, helpers::rocksdb::{ self, DataMap, @@ -24,15 +34,6 @@ use crate::{ TransactionMap, TransitionDB, }, - DeploymentStorage, - DeploymentStore, - ExecutionStorage, - ExecutionStore, - FeeStorage, - FeeStore, - TransactionStorage, - TransactionType, - TransitionStore, }; use console::{ prelude::*, diff --git a/ledger/store/src/helpers/rocksdb/transition.rs b/ledger/store/src/helpers/rocksdb/transition.rs index 44ee06c33e..0b6e801c71 100644 --- a/ledger/store/src/helpers/rocksdb/transition.rs +++ b/ledger/store/src/helpers/rocksdb/transition.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,12 +14,12 @@ // limitations under the License. use crate::{ - helpers::rocksdb::{self, DataMap, Database, MapID, TransitionInputMap, TransitionMap, TransitionOutputMap}, InputStorage, InputStore, OutputStorage, OutputStore, TransitionStorage, + helpers::rocksdb::{self, DataMap, Database, MapID, TransitionInputMap, TransitionMap, TransitionOutputMap}, }; use console::{ prelude::*, diff --git a/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_are_batched.rs b/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_are_batched.rs index e27b9a532b..22cc8a22ee 100644 --- a/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_are_batched.rs +++ b/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_are_batched.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_can_be_aborted.rs b/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_can_be_aborted.rs index e238fdfee6..248444dfbc 100644 --- a/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_can_be_aborted.rs +++ b/ledger/store/src/helpers/test_helpers/map/check_atomic_writes_can_be_aborted.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/map/check_contains_key.rs b/ledger/store/src/helpers/test_helpers/map/check_contains_key.rs index cde5881d98..4e6ed265a0 100644 --- a/ledger/store/src/helpers/test_helpers/map/check_contains_key.rs +++ b/ledger/store/src/helpers/test_helpers/map/check_contains_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/map/check_insert_and_get_speculative.rs b/ledger/store/src/helpers/test_helpers/map/check_insert_and_get_speculative.rs index b10aa93afe..e071baee88 100644 --- a/ledger/store/src/helpers/test_helpers/map/check_insert_and_get_speculative.rs +++ b/ledger/store/src/helpers/test_helpers/map/check_insert_and_get_speculative.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/map/check_iterators_match.rs b/ledger/store/src/helpers/test_helpers/map/check_iterators_match.rs index 386c1e36d7..a51db1515a 100644 --- a/ledger/store/src/helpers/test_helpers/map/check_iterators_match.rs +++ b/ledger/store/src/helpers/test_helpers/map/check_iterators_match.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/map/check_remove_and_get_speculative.rs b/ledger/store/src/helpers/test_helpers/map/check_remove_and_get_speculative.rs index e686abe226..3b452c598d 100644 --- a/ledger/store/src/helpers/test_helpers/map/check_remove_and_get_speculative.rs +++ b/ledger/store/src/helpers/test_helpers/map/check_remove_and_get_speculative.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/map/mod.rs b/ledger/store/src/helpers/test_helpers/map/mod.rs index 94bf296e4f..64da072d78 100644 --- a/ledger/store/src/helpers/test_helpers/map/mod.rs +++ b/ledger/store/src/helpers/test_helpers/map/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/mod.rs b/ledger/store/src/helpers/test_helpers/mod.rs index 3a94764b25..e0411c9a9c 100644 --- a/ledger/store/src/helpers/test_helpers/mod.rs +++ b/ledger/store/src/helpers/test_helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_are_batched.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_are_batched.rs index 694575e3f6..e27185d008 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_are_batched.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_are_batched.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_can_be_aborted.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_can_be_aborted.rs index c2182d129c..bc733f30a5 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_can_be_aborted.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_atomic_writes_can_be_aborted.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_contains_key.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_contains_key.rs index b7c4f79596..1625be7bda 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_contains_key.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_contains_key.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_get_map.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_get_map.rs index a57f6819f0..5cc3ad889b 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_get_map.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_get_map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_insert_and_get_value_speculative.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_insert_and_get_value_speculative.rs index c2689e6cd1..78fd100ed9 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_insert_and_get_value_speculative.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_insert_and_get_value_speculative.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_iterators_match.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_iterators_match.rs index 19ba023e0b..5fbd2ae3be 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_iterators_match.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_iterators_match.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/check_remove_and_get_value_speculative.rs b/ledger/store/src/helpers/test_helpers/nested_map/check_remove_and_get_value_speculative.rs index 8889c828ca..ea814aba1f 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/check_remove_and_get_value_speculative.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/check_remove_and_get_value_speculative.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/test_helpers/nested_map/mod.rs b/ledger/store/src/helpers/test_helpers/nested_map/mod.rs index b39f1a4c30..a8e833fd38 100644 --- a/ledger/store/src/helpers/test_helpers/nested_map/mod.rs +++ b/ledger/store/src/helpers/test_helpers/nested_map/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/traits/map.rs b/ledger/store/src/helpers/traits/map.rs index b0eef6a4ac..15dc60babd 100644 --- a/ledger/store/src/helpers/traits/map.rs +++ b/ledger/store/src/helpers/traits/map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/traits/mod.rs b/ledger/store/src/helpers/traits/mod.rs index dea20c2ef0..db111021e7 100644 --- a/ledger/store/src/helpers/traits/mod.rs +++ b/ledger/store/src/helpers/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/helpers/traits/nested_map.rs b/ledger/store/src/helpers/traits/nested_map.rs index 263dffc551..3052694bbc 100644 --- a/ledger/store/src/helpers/traits/nested_map.rs +++ b/ledger/store/src/helpers/traits/nested_map.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/lib.rs b/ledger/store/src/lib.rs index 9d50462adc..6eb10f7b69 100644 --- a/ledger/store/src/lib.rs +++ b/ledger/store/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -52,7 +53,7 @@ macro_rules! cow_to_cloned { }; } -use console::prelude::{bail, Result}; +use console::prelude::{Result, bail}; #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum FinalizeMode { diff --git a/ledger/store/src/program/committee.rs b/ledger/store/src/program/committee.rs index 3e7d70dc78..a3261e99d1 100644 --- a/ledger/store/src/program/committee.rs +++ b/ledger/store/src/program/committee.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index 4cad599083..f0662a6feb 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/program/mod.rs b/ledger/store/src/program/mod.rs index 435debde8b..3da9877418 100644 --- a/ledger/store/src/program/mod.rs +++ b/ledger/store/src/program/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/transaction/deployment.rs b/ledger/store/src/transaction/deployment.rs index 91860a6ba7..a0c3d685a7 100644 --- a/ledger/store/src/transaction/deployment.rs +++ b/ledger/store/src/transaction/deployment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,12 +14,12 @@ // limitations under the License. use crate::{ + FeeStorage, + FeeStore, atomic_batch_scope, cow_to_cloned, cow_to_copied, helpers::{Map, MapRead}, - FeeStorage, - FeeStore, }; use console::{ network::prelude::*, @@ -671,7 +672,7 @@ impl> DeploymentStore { #[cfg(test)] mod tests { use super::*; - use crate::{helpers::memory::DeploymentMemory, TransitionStore}; + use crate::{TransitionStore, helpers::memory::DeploymentMemory}; #[test] fn test_insert_get_remove() { diff --git a/ledger/store/src/transaction/execution.rs b/ledger/store/src/transaction/execution.rs index 1ebfaa9d95..089372b788 100644 --- a/ledger/store/src/transaction/execution.rs +++ b/ledger/store/src/transaction/execution.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,13 +14,13 @@ // limitations under the License. use crate::{ + FeeStorage, + FeeStore, + TransitionStore, atomic_batch_scope, cow_to_cloned, cow_to_copied, helpers::{Map, MapRead}, - FeeStorage, - FeeStore, - TransitionStore, }; use console::network::prelude::*; use ledger_block::{Execution, Transaction, Transition}; @@ -392,7 +393,7 @@ impl> ExecutionStore { #[cfg(test)] mod tests { use super::*; - use crate::{helpers::memory::ExecutionMemory, TransitionStore}; + use crate::{TransitionStore, helpers::memory::ExecutionMemory}; type CurrentNetwork = console::network::MainnetV0; diff --git a/ledger/store/src/transaction/fee.rs b/ledger/store/src/transaction/fee.rs index f821afaea8..a757d73981 100644 --- a/ledger/store/src/transaction/fee.rs +++ b/ledger/store/src/transaction/fee.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,12 +14,12 @@ // limitations under the License. use crate::{ + TransitionStorage, + TransitionStore, atomic_batch_scope, cow_to_cloned, cow_to_copied, helpers::{Map, MapRead}, - TransitionStorage, - TransitionStore, }; use console::network::prelude::*; use ledger_block::Fee; diff --git a/ledger/store/src/transaction/mod.rs b/ledger/store/src/transaction/mod.rs index 7d62c529b1..1bb6966e1d 100644 --- a/ledger/store/src/transaction/mod.rs +++ b/ledger/store/src/transaction/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -22,11 +23,11 @@ mod fee; pub use fee::*; use crate::{ + TransitionStorage, + TransitionStore, atomic_batch_scope, cow_to_copied, helpers::{Map, MapRead}, - TransitionStorage, - TransitionStore, }; use console::{ network::prelude::*, diff --git a/ledger/store/src/transition/input.rs b/ledger/store/src/transition/input.rs index 33ba49dc71..8889d344a4 100644 --- a/ledger/store/src/transition/input.rs +++ b/ledger/store/src/transition/input.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/transition/mod.rs b/ledger/store/src/transition/mod.rs index e813caa01b..bb0eff8629 100644 --- a/ledger/store/src/transition/mod.rs +++ b/ledger/store/src/transition/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/store/src/transition/output.rs b/ledger/store/src/transition/output.rs index 01acfa41cb..30d53bcc4b 100644 --- a/ledger/store/src/transition/output.rs +++ b/ledger/store/src/transition/output.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/ledger/test-helpers/Cargo.toml b/ledger/test-helpers/Cargo.toml index eba63ce2ee..d0ac094931 100644 --- a/ledger/test-helpers/Cargo.toml +++ b/ledger/test-helpers/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-ledger-test-helpers" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Test helpers for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -19,39 +19,39 @@ edition = "2021" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../query" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "../../synthesizer/process" -version = "=0.16.19" +version = "=1.0.0" [dependencies.once_cell] version = "1.18" diff --git a/ledger/test-helpers/src/lib.rs b/ledger/test-helpers/src/lib.rs index 80cf06bb9c..7d789c6fdd 100644 --- a/ledger/test-helpers/src/lib.rs +++ b/ledger/test-helpers/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -34,7 +35,7 @@ use ledger_block::{ Transition, }; use ledger_query::Query; -use ledger_store::{helpers::memory::BlockMemory, BlockStore}; +use ledger_store::{BlockStore, helpers::memory::BlockMemory}; use synthesizer_process::Process; use synthesizer_program::Program; diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 457d43f039..c40cc74c5d 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-metrics" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Metrics for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", diff --git a/metrics/src/lib.rs b/metrics/src/lib.rs index 202bc9e244..3d8f42ed16 100644 --- a/metrics/src/lib.rs +++ b/metrics/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index a7ea78546e..0cdb6fc265 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-parameters" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Parameters for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -31,12 +31,12 @@ wasm = [ "encoding", "js-sys", "web-sys" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.aleo-std] version = "0.1.24" diff --git a/parameters/examples/inclusion.rs b/parameters/examples/inclusion.rs index 83c0f116bc..dc241cbd95 100644 --- a/parameters/examples/inclusion.rs +++ b/parameters/examples/inclusion.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,12 +22,12 @@ use snarkvm_console::{ program::{Plaintext, Record, StatePath}, types::Field, }; -use snarkvm_ledger_store::{helpers::memory::ConsensusMemory, ConsensusStore}; -use snarkvm_synthesizer::{process::InclusionAssignment, snark::UniversalSRS, VM}; +use snarkvm_ledger_store::{ConsensusStore, helpers::memory::ConsensusMemory}; +use snarkvm_synthesizer::{VM, process::InclusionAssignment, snark::UniversalSRS}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use rand::thread_rng; -use serde_json::{json, Value}; +use serde_json::{Value, json}; use std::{ fs::File, io::{BufWriter, Write}, diff --git a/parameters/examples/setup.rs b/parameters/examples/setup.rs index e324c9b0c3..323581081a 100644 --- a/parameters/examples/setup.rs +++ b/parameters/examples/setup.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,11 +15,11 @@ use snarkvm_algorithms::crypto_hash::sha256::sha256; use snarkvm_circuit::Aleo; -use snarkvm_console::network::{prelude::ToBytes, CanaryV0, MainnetV0, Network, TestnetV0}; +use snarkvm_console::network::{CanaryV0, MainnetV0, Network, TestnetV0, prelude::ToBytes}; use snarkvm_synthesizer::{Process, Program}; use anyhow::Result; -use serde_json::{json, Value}; +use serde_json::{Value, json}; use std::{ fs, fs::File, diff --git a/parameters/src/canary/genesis.rs b/parameters/src/canary/genesis.rs index 08a0d0299f..50030e48db 100644 --- a/parameters/src/canary/genesis.rs +++ b/parameters/src/canary/genesis.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -27,6 +28,6 @@ mod tests { #[test] fn test_genesis_block() { let bytes = GenesisBytes::load_bytes(); - assert_eq!(20083, bytes.len() as u64, "Update me if serialization has changed"); + assert_eq!(19241, bytes.len() as u64, "Update me if serialization has changed"); } } diff --git a/parameters/src/canary/mod.rs b/parameters/src/canary/mod.rs index 003f04ada7..9a35444aa0 100644 --- a/parameters/src/canary/mod.rs +++ b/parameters/src/canary/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/src/canary/resources/block.genesis b/parameters/src/canary/resources/block.genesis index 74a775b9c7..e271fd884e 100644 Binary files a/parameters/src/canary/resources/block.genesis and b/parameters/src/canary/resources/block.genesis differ diff --git a/parameters/src/canary/resources/genesis_delegations.json b/parameters/src/canary/resources/genesis_delegations.json new file mode 100644 index 0000000000..8810baeadd --- /dev/null +++ b/parameters/src/canary/resources/genesis_delegations.json @@ -0,0 +1,21 @@ +{ + "aleo1anfdhn0hr934qh0kw5lk7a43ulj3tpe50ax5hgwnf8h8k5tv7cgqxtg8dq": ["aleo10calatc7mgmaplmd7kg55jqswmjmy9zl4de9qmxvq9c4c632zuqsnm0nad", "aleo1anfw4m9t84d06ql6x7g7xsev9u9xgnpegx607j54mwxskj3ahgpqx62xg5", 30000000000000], + "aleo1anfdjlvutswne298kqgdrq57m4axmw4u6j0qcttv0l5vtanfkczq60ksht": ["aleo180jksy0d30lzwpjejmy8ug8jsn8e8nu9as05cmh2rgf8se6jeyqsammtys", "aleo1anfwgpyk20huq2jljen4raj2l6j344ccuvp0vnwv8wyv2ktvayrq5mwn7m", 20000000000000], + "aleo1anfdugp3vz0aw3yu5j8c3m92g4n3u7ktdl4fp4sa8edv5k9h3ygspu2ktu": ["aleo1ca07qvzu4ystav8y65dxrur0hlzxcl8aj7h49zvzx48ag0kmlcqqnaergh", "aleo1anfw2jx7ll6reykpn4x2kkry3s0qlvrz4rz9mkgtjn5248yuvc9qkmer05", 20000000000000], + "aleo1anfdenyche8deevqhyuk2s8a55g4x3yn5xtf9k3wth99nt80ygqqlxymad": ["aleo1u4hq6gemptr297g30yjhpl42zz6z24u99qclls9n0jynw443kqpq893z08", "aleo1anfwfn87pdpztp9pdmqgh5hpqycuc0gtka27rt0deqjv33n9hqpqz9ehfj", 150000000000000], + "aleo1anfd6m679q4kf8ars2e87xfjz3f7ezvr59lpahynuxux0symsqpq95wgap": ["aleo1e4l5tmdps84rle0lu048rk5x83deld4w0q09qzsdcc2a4h8evc9qm8ydch", "aleo1anfw6t0man4sllvn3xjfwu4wt80xwt2eu67ayfhg8h5z6ezwlsqqtd9fwl", 20000000000000], + "aleo1anfd9pwgf9czrvhtxwpg2u0gqpvajaam8fc6xfrpqqasvuvtjcxqf36rxw": ["aleo1lqvdmn0jc8nfj5veakrhnyyxegv3u7f4rlgg6hessvfunlev9cfqmyka37", "aleo1anfw6drxwrr4puuu7wsf7vzvjfjrwml4cps9ww8xxwptwy7u6yqqvj0e6t", 20000000000000], + "aleo1anfdkfd6r5u6g05fds62d4474dqhsmjdkr0tuxsheznatqv895qqfdkj04": ["aleo1cal2xtpm30ypt5078kfttu3epeuhac3mmv8ndkewchq3tlatmczs3qxnlv", "aleo1anfw0uqseujaqvqllq24pr7em547ekt5exmr4uhah9mwfz7xxqqsl0thxd", 20000000000000], + "aleo1anfd2awgqsmy2ut3pfxj8rcm3szjl7xsm6j6r2shz7hu69hgyurqrsthkz": ["aleo1l7avejc23yv6e8nx4udjwz89dw6mg95dzsp936hf77yuhnjywv9syl0ywc", "aleo1anfwps4q9y4ywvv294y79xf30tnfvpt224n92wg79rtlvm3epvxsc3vyr0", 20000000000000], + "aleo1anfds8fhnswgj2mjaem063le2w7x307mgn2xj7wckssvd40csu8qd6ptcc": ["aleo1z838c4zukt8qpwndz3gnjd374skg6zucd8q6pz30r3v2gcuh4q8qvdf8p9", "aleo1anfwgntsh7x667gvscw02m94gv7d2f92dd45whr9l4ghgr60qy9saltswj", 30000000000000], + "aleo1anfdyfvq9gh49dr2ctr38473q32ne3pga8p7y4wzqvegtmasrgfqrejqeh": ["aleo128vwxfvffrw2kfhg472z7sa0erg54zutxjqexvfa9t9qlrgcuy9qtdem0x", "aleo1anfw0rd60fl8crky5cjut4n7tz9wkv2hltvfmx7p8ksh7va4muyq20cr4y", 20000000000000], + "aleo1anfdv7v0z2dj84tz53jxeke4zsm8usla4s5pm37fprr5cyfkrc8sn02j9y": ["aleo1psngnx6kt4y20zewd50x2zw6lfdehwzdarn2vazw346ur4hhjqrqhrz2qv", "aleo1anfwdmy4ldcm4dr7vw00kcsgxh64p44520nuve74h8a8a7edlqyqglkpwk", 150000000000000], + "aleo1anfdylfnpf06fjdskmmrg9tks49jdpmuhvykkq4lkreqycsy6gxqra3ucy": ["aleo1wksvl4eswnhj0wgzn8vutqk8p2svml7jzx5w85fxce5w46jhncxsdee9df", "aleo1anfwju3fme8srle6wruzpxw9zkx6vcn3unl55hj4sw8pawnqaq9sl09pe9", 150000000000000], + "aleo1anfd4qdndn3we5huql9d68azx59hl33jqts8jvnm68qs6s96k58sre7vf4": ["aleo1t8dng2slj2rjhgmf8r7kklk0gwnpcgy85kn079ltgmmjwnedvvrqdkku32", "aleo1anfwtsvr9l4zhhk6e360yw7jd867utmh3xe4f2v2qje4wwzeggyqr60x0h", 150000000000000], + "aleo1anfd9de8nfttnsw2tyma89vl6hudf2dgss696ys79qlp57u4jqqqfpynuq": ["aleo1anfvmly4uldmvdu7435f78n5qt7eprvttru85rqcn9tfc4j28cqqmxeu7s", "aleo1anfw2ku5gk9zxh8ltke7tck0telugnpuyvahrpkq6xeek4cjzsps5ryeas", 150000000000000], + "aleo1q60cnaukr2fgx9dcnjwz3ka4uj3svk6d7pgalqfln690yjwykszsu7j5eq": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo13yjkljfnaq5996geg5xz8rctqdcfv6j0hkxxam9rp6z2wr3jkgxqt0t8l8", 25000000000000], + "aleo1ag7jp4cwyvmdhpfxc5cdcygue2f602erjlhhvq3wky9evt4tjs9qrrhaxk": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo10thxce29gedea3fa7z8rkkcqjzhgpe8c8sa6s0lzqmq9pkkdl58qtphg5t", 25000000000000], + "aleo1x46fux6zu2u6evg0j3xtu26nt9ska6v3cf3a4cfyy4u0ldzaxyxstcz60s": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1gy3khx6e5pzzn47juv83878jdckw6zl8p50hjns07awun7myhyzq96xgkr", 25000000000000], + "aleo1e8rj993j028m0csjmwjlyt6tuemd892ghnwsp0h8lryy2l3cnvrs8rt96n": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1l8dq0c9er0hwc6sgk5awgqhp0agq8tvspy8qxm6a3yehn37v6qqqdwdcac", 25000000000000], + "aleo1r8a9gsd03kqd7nl4d64a6xrvwvcfquef9r7cv46m074qk2nuksps8ns77y": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1cek9kjj77432njfthtmxg04ymrf6eyjdw9zeqa7fn0kc7zywa5psdwdptf", 25000000000000] +} \ No newline at end of file diff --git a/parameters/src/canary/resources/genesis_public_balances.json b/parameters/src/canary/resources/genesis_public_balances.json new file mode 100644 index 0000000000..2e1c997cf7 --- /dev/null +++ b/parameters/src/canary/resources/genesis_public_balances.json @@ -0,0 +1,38 @@ +{ + "aleo1anfxjkwvf4cnpdrx4ukqdrgwjcfkplgtg7eftzq3ktz89duv5czqrpxtgy": 167000000000000, + "aleo1anfxl5cy59amxgyks9y6kr7xwh9yrh4d4sm4472sw8eqnj4x5czqzrmmdy": 135000000000000, + "aleo1anfxkkrn9lyj82jceaugh4662kn0mf0vpje85l7ds69zm7atfcysvsv4ez": 122995290000000, + "aleo1pzuc98fpz8xrvdjtx9umtcdu720v5zt2u79h49e39tqc3qhgayzqnn47js": 100000000, + "aleo1wqtpfauqtpp7f3m00muh9nsx7k38lm9acqey3279vqdvsscc7c8slm0nad": 100000000, + "aleo10ez0l4589luwgk4d6wexr7j80ng6ty4h5g4uue9p5cdet0prcyps54egw7": 100000000, + "aleo15zvde6z6z6kwhjrljz5p2v2e34aeqytuugylht42f4fwgzkwty8s8c22au": 100000000, + "aleo1dmysvldxgm4t74ncwyzmzd9p6f22df9hlu6s4tzx2t78kgwgh59qxvdraw": 100000000, + "aleo1ptzknxyc9zm6wxqv4p8dnj92kgxr6fgew4mkdcc2p54xrjrjryfqtr8pe5": 100000000, + "aleo18jdhm4a0927c7c4jagzznldapuqxceuzel9rkwlzvr5cwk6mecxqpensa9": 100000000, + "aleo19g99vj20nq6d6v33kvnaw5dfjakdhdmu2a7swyaxe5q654l8pyqqy397g6": 100000000, + "aleo147vv6vxe97l6v6ur0re0prpy4d2yhsn959fha0fwtec2vp300cfq98c08q": 100000000, + "aleo1gdh9cs48uswy8uc8kyd3nmgqtf9mzu4ucl4pkrg7fyc6syr9rq9qtgkccm": 100000000, + "aleo16r36k8t7fhc72uhkdsx3aj4uy0dk7s87szc6wcgexlxpc4hl8gys0dem0x": 100000000, + "aleo16gecle3925np3hq6c9xg5e0slvhjysy73fpwax2d4ezhgqax9yqswayf6r": 100000000, + "aleo1ql6v479rs938zwq8slf7ktrzryln869mrxeqxpt8hnlr9fulk5pq7492tt": 100000000, + "aleo13hg7km34zaxgffec9jsdgvmfh9wsh9zchymd8tnawf35qcm0tc9sw472yk": 100000000, + "aleo13yjkljfnaq5996geg5xz8rctqdcfv6j0hkxxam9rp6z2wr3jkgxqt0t8l8": 100000000, + "aleo10thxce29gedea3fa7z8rkkcqjzhgpe8c8sa6s0lzqmq9pkkdl58qtphg5t": 100000000, + "aleo1gy3khx6e5pzzn47juv83878jdckw6zl8p50hjns07awun7myhyzq96xgkr": 100000000, + "aleo1l8dq0c9er0hwc6sgk5awgqhp0agq8tvspy8qxm6a3yehn37v6qqqdwdcac": 100000000, + "aleo1cek9kjj77432njfthtmxg04ymrf6eyjdw9zeqa7fn0kc7zywa5psdwdptf": 100000000, + "aleo1anfw4m9t84d06ql6x7g7xsev9u9xgnpegx607j54mwxskj3ahgpqx62xg5": 100000000, + "aleo1anfwgpyk20huq2jljen4raj2l6j344ccuvp0vnwv8wyv2ktvayrq5mwn7m": 100000000, + "aleo1anfw2jx7ll6reykpn4x2kkry3s0qlvrz4rz9mkgtjn5248yuvc9qkmer05": 100000000, + "aleo1anfwfn87pdpztp9pdmqgh5hpqycuc0gtka27rt0deqjv33n9hqpqz9ehfj": 100000000, + "aleo1anfw6t0man4sllvn3xjfwu4wt80xwt2eu67ayfhg8h5z6ezwlsqqtd9fwl": 100000000, + "aleo1anfw6drxwrr4puuu7wsf7vzvjfjrwml4cps9ww8xxwptwy7u6yqqvj0e6t": 100000000, + "aleo1anfw0uqseujaqvqllq24pr7em547ekt5exmr4uhah9mwfz7xxqqsl0thxd": 100000000, + "aleo1anfwps4q9y4ywvv294y79xf30tnfvpt224n92wg79rtlvm3epvxsc3vyr0": 100000000, + "aleo1anfwgntsh7x667gvscw02m94gv7d2f92dd45whr9l4ghgr60qy9saltswj": 100000000, + "aleo1anfw0rd60fl8crky5cjut4n7tz9wkv2hltvfmx7p8ksh7va4muyq20cr4y": 100000000, + "aleo1anfwdmy4ldcm4dr7vw00kcsgxh64p44520nuve74h8a8a7edlqyqglkpwk": 100000000, + "aleo1anfwju3fme8srle6wruzpxw9zkx6vcn3unl55hj4sw8pawnqaq9sl09pe9": 100000000, + "aleo1anfwtsvr9l4zhhk6e360yw7jd867utmh3xe4f2v2qje4wwzeggyqr60x0h": 100000000, + "aleo1anfgedfl9phdyrzz3r88hrxkevk36wnegjdkzrfz276fj85shsps8u0zyx": 10000000 +} \ No newline at end of file diff --git a/parameters/src/canary/resources/genesis_validators.json b/parameters/src/canary/resources/genesis_validators.json new file mode 100644 index 0000000000..6032a8595a --- /dev/null +++ b/parameters/src/canary/resources/genesis_validators.json @@ -0,0 +1,17 @@ +{ + "aleo10calatc7mgmaplmd7kg55jqswmjmy9zl4de9qmxvq9c4c632zuqsnm0nad": ["aleo1wqtpfauqtpp7f3m00muh9nsx7k38lm9acqey3279vqdvsscc7c8slm0nad", 100000000, true, 10], + "aleo180jksy0d30lzwpjejmy8ug8jsn8e8nu9as05cmh2rgf8se6jeyqsammtys": ["aleo10ez0l4589luwgk4d6wexr7j80ng6ty4h5g4uue9p5cdet0prcyps54egw7", 100000000, true, 10], + "aleo1ca07qvzu4ystav8y65dxrur0hlzxcl8aj7h49zvzx48ag0kmlcqqnaergh": ["aleo15zvde6z6z6kwhjrljz5p2v2e34aeqytuugylht42f4fwgzkwty8s8c22au", 100000000, true, 10], + "aleo1u4hq6gemptr297g30yjhpl42zz6z24u99qclls9n0jynw443kqpq893z08": ["aleo1dmysvldxgm4t74ncwyzmzd9p6f22df9hlu6s4tzx2t78kgwgh59qxvdraw", 100000000, true, 10], + "aleo1e4l5tmdps84rle0lu048rk5x83deld4w0q09qzsdcc2a4h8evc9qm8ydch": ["aleo1ptzknxyc9zm6wxqv4p8dnj92kgxr6fgew4mkdcc2p54xrjrjryfqtr8pe5", 100000000, true, 10], + "aleo1lqvdmn0jc8nfj5veakrhnyyxegv3u7f4rlgg6hessvfunlev9cfqmyka37": ["aleo18jdhm4a0927c7c4jagzznldapuqxceuzel9rkwlzvr5cwk6mecxqpensa9", 100000000, true, 10], + "aleo1cal2xtpm30ypt5078kfttu3epeuhac3mmv8ndkewchq3tlatmczs3qxnlv": ["aleo19g99vj20nq6d6v33kvnaw5dfjakdhdmu2a7swyaxe5q654l8pyqqy397g6", 100000000, true, 10], + "aleo1l7avejc23yv6e8nx4udjwz89dw6mg95dzsp936hf77yuhnjywv9syl0ywc": ["aleo147vv6vxe97l6v6ur0re0prpy4d2yhsn959fha0fwtec2vp300cfq98c08q", 100000000, true, 10], + "aleo1z838c4zukt8qpwndz3gnjd374skg6zucd8q6pz30r3v2gcuh4q8qvdf8p9": ["aleo1gdh9cs48uswy8uc8kyd3nmgqtf9mzu4ucl4pkrg7fyc6syr9rq9qtgkccm", 100000000, true, 10], + "aleo128vwxfvffrw2kfhg472z7sa0erg54zutxjqexvfa9t9qlrgcuy9qtdem0x": ["aleo16r36k8t7fhc72uhkdsx3aj4uy0dk7s87szc6wcgexlxpc4hl8gys0dem0x", 100000000, true, 10], + "aleo1psngnx6kt4y20zewd50x2zw6lfdehwzdarn2vazw346ur4hhjqrqhrz2qv": ["aleo16gecle3925np3hq6c9xg5e0slvhjysy73fpwax2d4ezhgqax9yqswayf6r", 100000000, true, 10], + "aleo1wksvl4eswnhj0wgzn8vutqk8p2svml7jzx5w85fxce5w46jhncxsdee9df": ["aleo1ql6v479rs938zwq8slf7ktrzryln869mrxeqxpt8hnlr9fulk5pq7492tt", 100000000, true, 10], + "aleo1t8dng2slj2rjhgmf8r7kklk0gwnpcgy85kn079ltgmmjwnedvvrqdkku32": ["aleo13hg7km34zaxgffec9jsdgvmfh9wsh9zchymd8tnawf35qcm0tc9sw472yk", 100000000, true, 10], + "aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364": ["aleo1pzuc98fpz8xrvdjtx9umtcdu720v5zt2u79h49e39tqc3qhgayzqnn47js", 100000000, true, 0], + "aleo1anfvmly4uldmvdu7435f78n5qt7eprvttru85rqcn9tfc4j28cqqmxeu7s": ["aleo1anfw2ku5gk9zxh8ltke7tck0telugnpuyvahrpkq6xeek4cjzsps5ryeas", 100000000, true, 100] +} \ No newline at end of file diff --git a/parameters/src/errors/mod.rs b/parameters/src/errors/mod.rs index 930294ae30..598d38e40d 100644 --- a/parameters/src/errors/mod.rs +++ b/parameters/src/errors/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/src/errors/parameter.rs b/parameters/src/errors/parameter.rs index 6643f2c8ca..3584bbeae2 100644 --- a/parameters/src/errors/parameter.rs +++ b/parameters/src/errors/parameter.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/src/lib.rs b/parameters/src/lib.rs index 02ed021cf3..959e12987c 100644 --- a/parameters/src/lib.rs +++ b/parameters/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/src/macros.rs b/parameters/src/macros.rs index 7a2455d677..14ec141d40 100644 --- a/parameters/src/macros.rs +++ b/parameters/src/macros.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/src/mainnet/genesis.rs b/parameters/src/mainnet/genesis.rs index 08a0d0299f..a178a1a42f 100644 --- a/parameters/src/mainnet/genesis.rs +++ b/parameters/src/mainnet/genesis.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -27,6 +28,6 @@ mod tests { #[test] fn test_genesis_block() { let bytes = GenesisBytes::load_bytes(); - assert_eq!(20083, bytes.len() as u64, "Update me if serialization has changed"); + assert_eq!(31083, bytes.len() as u64, "Update me if serialization has changed"); } } diff --git a/parameters/src/mainnet/mod.rs b/parameters/src/mainnet/mod.rs index d4d37db702..029e0922f5 100644 --- a/parameters/src/mainnet/mod.rs +++ b/parameters/src/mainnet/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -28,9 +29,6 @@ const REMOTE_URL: &str = "https://parameters.aleo.org/mainnet"; impl_local!(Degree15, "resources/", "powers-of-beta-15", "usrs"); #[cfg(feature = "wasm")] impl_remote!(Degree15, REMOTE_URL, "resources/", "powers-of-beta-15", "usrs"); -#[cfg(not(feature = "wasm"))] -impl_local!(Degree16, "resources/", "powers-of-beta-16", "usrs"); -#[cfg(feature = "wasm")] impl_remote!(Degree16, REMOTE_URL, "resources/", "powers-of-beta-16", "usrs"); impl_remote!(Degree17, REMOTE_URL, "resources/", "powers-of-beta-17", "usrs"); impl_remote!(Degree18, REMOTE_URL, "resources/", "powers-of-beta-18", "usrs"); @@ -171,6 +169,17 @@ mod tests { use wasm_bindgen_test::*; wasm_bindgen_test_configure!(run_in_browser); + #[ignore] + #[test] + fn test_load_bytes_mini() { + Degree16::load_bytes().expect("Failed to load degree 16"); + BondPublicVerifier::load_bytes().expect("Failed to load bond_public verifier"); + FeePublicProver::load_bytes().expect("Failed to load fee_public prover"); + FeePublicVerifier::load_bytes().expect("Failed to load fee_public verifier"); + InclusionProver::load_bytes().expect("Failed to load inclusion prover"); + InclusionVerifier::load_bytes().expect("Failed to load inclusion verifier"); + } + #[wasm_bindgen_test] fn test_load_bytes() { Degree16::load_bytes().expect("Failed to load degree 16"); diff --git a/parameters/src/mainnet/powers.rs b/parameters/src/mainnet/powers.rs index 577c8dc01d..c12245f07c 100644 --- a/parameters/src/mainnet/powers.rs +++ b/parameters/src/mainnet/powers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -27,7 +28,7 @@ use snarkvm_utilities::{ Write, }; -use anyhow::{anyhow, bail, ensure, Result}; +use anyhow::{Result, anyhow, bail, ensure}; use parking_lot::RwLock; use std::{collections::BTreeMap, ops::Range, sync::Arc}; diff --git a/parameters/src/mainnet/resources/block.genesis b/parameters/src/mainnet/resources/block.genesis index 5ef9829adb..9af822fdc8 100644 Binary files a/parameters/src/mainnet/resources/block.genesis and b/parameters/src/mainnet/resources/block.genesis differ diff --git a/parameters/src/mainnet/resources/bond_validator.prover b/parameters/src/mainnet/resources/bond_validator.prover deleted file mode 100644 index 14bebd9746..0000000000 Binary files a/parameters/src/mainnet/resources/bond_validator.prover and /dev/null differ diff --git a/parameters/src/mainnet/resources/genesis_delegations.json b/parameters/src/mainnet/resources/genesis_delegations.json new file mode 100644 index 0000000000..3b26598733 --- /dev/null +++ b/parameters/src/mainnet/resources/genesis_delegations.json @@ -0,0 +1,467 @@ +{ + "aleo1m6qdhgcgej0f898nmm99kc42qd2edtx8yz7p9tk09d8gzffsp59qz5rvn8": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1m6qdhgcgej0f898nmm99kc42qd2edtx8yz7p9tk09d8gzffsp59qz5rvn8", + 460000000000 + ], + "aleo15ekkuj8vw3jr7y587w2y23ywd0fycqz0p2el8s9d28n8uem0uvxq49esed": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo15ekkuj8vw3jr7y587w2y23ywd0fycqz0p2el8s9d28n8uem0uvxq49esed", + 137136000000 + ], + "aleo1w7xxm56sckhy60umt2vt0qddt0uepm48zuulfrrcrsvxmpghdypsuuzhyz": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1w7xxm56sckhy60umt2vt0qddt0uepm48zuulfrrcrsvxmpghdypsuuzhyz", + 100000000000 + ], + "aleo1yur28awsesnzxhusd59k4sh5e0j3ykrsjr2y3p8keua5wmrt8s8qp0w6k3": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1yur28awsesnzxhusd59k4sh5e0j3ykrsjr2y3p8keua5wmrt8s8qp0w6k3", + 1400000000000 + ], + "aleo1h0yhs9gv3y6at6h9jrxlgxtxz4zadtz8a890s36ef85dkgujpvxsaw6lpq": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo1h0yhs9gv3y6at6h9jrxlgxtxz4zadtz8a890s36ef85dkgujpvxsaw6lpq", + 3000000000000 + ], + "aleo1h8htd9wycst5fygy7l3llk0gperlfnxczvvquylqrnewm3gyhgqsu9ad9c": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1h8htd9wycst5fygy7l3llk0gperlfnxczvvquylqrnewm3gyhgqsu9ad9c", + 577500000000 + ], + "aleo16hlmhhacvz60amg4fvderydgh7j7204ehl2zxha5al45k6lu35ysw7f7j6": [ + "aleo1n6c5ugxk6tp09vkrjegcpcprssdfcf7283agcdtt8gu9qex2c5xs9c28ay", + "aleo16hlmhhacvz60amg4fvderydgh7j7204ehl2zxha5al45k6lu35ysw7f7j6", + 14064200000000 + ], + "aleo1lxzg8el3yjfx6umsea5aawyy4l335yjvusrkgtu7lzyrf72w55qq70wrxr": [ + "aleo1n6c5ugxk6tp09vkrjegcpcprssdfcf7283agcdtt8gu9qex2c5xs9c28ay", + "aleo1lxzg8el3yjfx6umsea5aawyy4l335yjvusrkgtu7lzyrf72w55qq70wrxr", + 14064200000000 + ], + "aleo10vhwhc0jwrzqfjlu8htpas8jdaazsgzwve93yqdzx08kgsk9mv8qjc28e7": [ + "aleo1n6c5ugxk6tp09vkrjegcpcprssdfcf7283agcdtt8gu9qex2c5xs9c28ay", + "aleo10vhwhc0jwrzqfjlu8htpas8jdaazsgzwve93yqdzx08kgsk9mv8qjc28e7", + 100000000000000 + ], + "aleo18ry8mc3ms8psrn67uw52tfsrp9z9ex6ackpw2s4khsqkee9xfsrsj7d7st": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo18ry8mc3ms8psrn67uw52tfsrp9z9ex6ackpw2s4khsqkee9xfsrsj7d7st", + 998679000000 + ], + "aleo1a73ftefplhp6wtfn6fm6337cs3rc3y5gcyeeazwtpgsunj4w4vqqkrunrx": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1a73ftefplhp6wtfn6fm6337cs3rc3y5gcyeeazwtpgsunj4w4vqqkrunrx", + 14382827000000 + ], + "aleo1pl393a8m6ft9k59shx43lsqwxuf5mzr5w3shqkrrz8kn2fzj0cqq4n4pl4": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1pl393a8m6ft9k59shx43lsqwxuf5mzr5w3shqkrrz8kn2fzj0cqq4n4pl4", + 13743589000000 + ], + "aleo1zf6mf9slaeg8u2th885tm6a3mdfw6kkv4u7wyuzl7tzmy2x49v8sp6a6yc": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1zf6mf9slaeg8u2th885tm6a3mdfw6kkv4u7wyuzl7tzmy2x49v8sp6a6yc", + 13679666000000 + ], + "aleo1ygnmyaryeylyu387fydh6stz8rhjf4jldl68ney76dj0krq8lq9qy2vw52": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1ygnmyaryeylyu387fydh6stz8rhjf4jldl68ney76dj0krq8lq9qy2vw52", + 13168277000000 + ], + "aleo19v3kdvxeqvl3k6dea8mvkkkgg0rfu4umy0eup5hp5eu52ly6vggq9g6wkk": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo19v3kdvxeqvl3k6dea8mvkkkgg0rfu4umy0eup5hp5eu52ly6vggq9g6wkk", + 13104353000000 + ], + "aleo1fxpy4s8trl05v0nxjk5e9plj075txuhjymcnws2s9kfmtf3v4qrs8ydgew": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1fxpy4s8trl05v0nxjk5e9plj075txuhjymcnws2s9kfmtf3v4qrs8ydgew", + 12465116000000 + ], + "aleo18ruf9e6wcjgkd66ncxtgtqupn73xvcumuakpa568d307heh0gurs28ksvf": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo18ruf9e6wcjgkd66ncxtgtqupn73xvcumuakpa568d307heh0gurs28ksvf", + 12401192000000 + ], + "aleo16xc9d7lyu5sawrkt0nnweeqy7fq6ythy822dp60gkweumru6ggyqpkhk5f": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo16xc9d7lyu5sawrkt0nnweeqy7fq6ythy822dp60gkweumru6ggyqpkhk5f", + 11889802000000 + ], + "aleo1sghf70z3ppmvs2j6pqah5wkxsz2ny0rtcgeq7eyyagh7gztm8c9sttywpy": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1sghf70z3ppmvs2j6pqah5wkxsz2ny0rtcgeq7eyyagh7gztm8c9sttywpy", + 11825878000000 + ], + "aleo1u5y6nhfl7ez47kerpu0rqam4jxc93nhpng29nmt3gmcmvfattgzsnrrh29": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1u5y6nhfl7ez47kerpu0rqam4jxc93nhpng29nmt3gmcmvfattgzsnrrh29", + 11186642000000 + ], + "aleo1866k0fpa8ncsfwhsl49smxztxrvhwr0n4kx4ep9p5596ulz9wcqqzmas60": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1866k0fpa8ncsfwhsl49smxztxrvhwr0n4kx4ep9p5596ulz9wcqqzmas60", + 2811069000000 + ], + "aleo1d25g09mvypl76sadtfhgcpdm3vnnffrallft8g3uu07p03ju5grqglxdkl": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1d25g09mvypl76sadtfhgcpdm3vnnffrallft8g3uu07p03ju5grqglxdkl", + 2683292000000 + ], + "aleo198z79wdr3rxtmlw3c7qud2hx7luug6a39wg5awzevq3208p0cq8sxeshl4": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo198z79wdr3rxtmlw3c7qud2hx7luug6a39wg5awzevq3208p0cq8sxeshl4", + 2555517000000 + ], + "aleo1lfsxyrpcfcuzw6839jcuw2csta68uuuedvu4nj0rj07l0fd3ks9qrpxatx": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1lfsxyrpcfcuzw6839jcuw2csta68uuuedvu4nj0rj07l0fd3ks9qrpxatx", + 2427741000000 + ], + "aleo1hwj60wec8c4ml8wh53kjz5ejwc02e0gyrccs2wsuen6cxe54gvxskmycfn": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1hwj60wec8c4ml8wh53kjz5ejwc02e0gyrccs2wsuen6cxe54gvxskmycfn", + 2299965000000 + ], + "aleo1kftx8hkw0kz88cxp3nwuqmrrxy42xncxvaxk6pt8vl2ftehddcgsenlkse": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1kftx8hkw0kz88cxp3nwuqmrrxy42xncxvaxk6pt8vl2ftehddcgsenlkse", + 249671000000 + ], + "aleo137l47p4t8zt68da9lc89tg3dcq56g6yn708txnr2c3flckra8vqq4spc8e": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo137l47p4t8zt68da9lc89tg3dcq56g6yn708txnr2c3flckra8vqq4spc8e", + 7031250000000 + ], + "aleo1m25x36qt5x27v2qptlypj8ky3puf8nl0vvtfazx5e4zlf6qkwuzsgrz80s": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1m25x36qt5x27v2qptlypj8ky3puf8nl0vvtfazx5e4zlf6qkwuzsgrz80s", + 149802000000 + ], + "aleo19x0cjqghg0thspr3ddzza2ved2ewqnfmtcudm2s595uu5lpjsy8sycv3x7": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo19x0cjqghg0thspr3ddzza2ved2ewqnfmtcudm2s595uu5lpjsy8sycv3x7", + 249671000000 + ], + "aleo1ptsfk0nt96qa5tpr0uun4tesaywhf8gu4vjq2pxnw4cxev764vgs8eu7xl": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo1ptsfk0nt96qa5tpr0uun4tesaywhf8gu4vjq2pxnw4cxev764vgs8eu7xl", + 998683000000 + ], + "aleo1r3y7p79la2gv50y09f6zem9nme7ue5my03px79f7m00sfk4klcqsyvacqt": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1r3y7p79la2gv50y09f6zem9nme7ue5my03px79f7m00sfk4klcqsyvacqt", + 2496708000000 + ], + "aleo1t72uc4md9q8clf2g2a5sa7e68ulztqtkusd0sle7y53qzy8nnsqqq6ddkn": [ + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t", + "aleo1t72uc4md9q8clf2g2a5sa7e68ulztqtkusd0sle7y53qzy8nnsqqq6ddkn", + 4993416000000 + ], + "aleo1277fs8zmx602nrk5ywjc2ntcxgq9pk0yga6hyq079xmtn8etz5rs9rky5m": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1277fs8zmx602nrk5ywjc2ntcxgq9pk0yga6hyq079xmtn8etz5rs9rky5m", + 140625000000 + ], + "aleo1qd6e3scnppeu323x8n3k59v9pgw098e5nvgj8e6q9dv5apzufvqshyfre7": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1qd6e3scnppeu323x8n3k59v9pgw098e5nvgj8e6q9dv5apzufvqshyfre7", + 140625000000 + ], + "aleo1qy4qufq03wcph05fdf5aj09ez67vcmmlrzqf0zza352qwaq43gyqt3wdf6": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1qy4qufq03wcph05fdf5aj09ez67vcmmlrzqf0zza352qwaq43gyqt3wdf6", + 140625000000 + ], + "aleo1r50sqzn9areyc94t2ec4myy5t5x59pk5qwaxay6l29t0maq9m5xs9995ru": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1r50sqzn9areyc94t2ec4myy5t5x59pk5qwaxay6l29t0maq9m5xs9995ru", + 140625000000 + ], + "aleo1y46cysmnq9fevcs68qm0enp7u3fqmufjaakatjkfz47afp5n9cpq3xxgrx": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1y46cysmnq9fevcs68qm0enp7u3fqmufjaakatjkfz47afp5n9cpq3xxgrx", + 140625000000 + ], + "aleo1jly336exw8e64jtd4qqfhp6wc7wyxs58yyn9pw8l2tqz4ejm0vzszq0cgu": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1jly336exw8e64jtd4qqfhp6wc7wyxs58yyn9pw8l2tqz4ejm0vzszq0cgu", + 1171875000000 + ], + "aleo124mepz78ln5fl4awr8kaagyka6deyvr6pa0r9cfkk2jtwrqk5vfqttzypj": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo124mepz78ln5fl4awr8kaagyka6deyvr6pa0r9cfkk2jtwrqk5vfqttzypj", + 1171875000000 + ], + "aleo133vg3mmqths45lw7q8knfx04zeuvgrafy3lf59kl6k3nee2arsqqswlnfk": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo133vg3mmqths45lw7q8knfx04zeuvgrafy3lf59kl6k3nee2arsqqswlnfk", + 2343750000000 + ], + "aleo1f7clvaznwnceh2hx30akl0660pm9lk3p4j84j0p95ajk2w7zgc8s8gmau3": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1f7clvaznwnceh2hx30akl0660pm9lk3p4j84j0p95ajk2w7zgc8s8gmau3", + 2343750000000 + ], + "aleo1kldd35w0tcu82e202ksy9s83a8fznwer4z5datw7fxknd6jtusyqm3j7uk": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1kldd35w0tcu82e202ksy9s83a8fznwer4z5datw7fxknd6jtusyqm3j7uk", + 2343750000000 + ], + "aleo1t8j28tpac402nx0dpr4fjqaghxn766kvnde00hzkffzkvh0cycfqt5zxha": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1t8j28tpac402nx0dpr4fjqaghxn766kvnde00hzkffzkvh0cycfqt5zxha", + 2343750000000 + ], + "aleo1uzl5szknaq05z5s2y86058kxs5kme5ermmaeghutsfw9eta54uxqsn34tw": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1uzl5szknaq05z5s2y86058kxs5kme5ermmaeghutsfw9eta54uxqsn34tw", + 2343750000000 + ], + "aleo17d6q3kj8laxwr374hhu64hma4punap9n7gs7c5n54qljqar4sszsfqlk9y": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo17d6q3kj8laxwr374hhu64hma4punap9n7gs7c5n54qljqar4sszsfqlk9y", + 17578125000000 + ], + "aleo17vzf9r3drx4uu9876pr4mquewec4w6esc2l7cqfmvjhr4sj63uyqfhdfj6": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo17vzf9r3drx4uu9876pr4mquewec4w6esc2l7cqfmvjhr4sj63uyqfhdfj6", + 17578125000000 + ], + "aleo1w8gqamthnnht4eql06tjdpa0d4al79d4gpkdlqcevk7ud6hy9yrqcg6yhx": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo1w8gqamthnnht4eql06tjdpa0d4al79d4gpkdlqcevk7ud6hy9yrqcg6yhx", + 17578125000000 + ], + "aleo1yqer6549yt6033kxy65w6mgg3p006a6dkgh835rgltd46sgsesqs8cpnd0": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo1yqer6549yt6033kxy65w6mgg3p006a6dkgh835rgltd46sgsesqs8cpnd0", + 17578125000000 + ], + "aleo1yfy6rxj0mkv8mm0vnl48mk7lnlm4cgnlwvgwsyp3uxm7eya23gzsjvwue8": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1yfy6rxj0mkv8mm0vnl48mk7lnlm4cgnlwvgwsyp3uxm7eya23gzsjvwue8", + 4687500000000 + ], + "aleo16jndj42zwa2c4u3dlfewl2sw9s9pyy5s5ylya4sj8xe30jz345qqvzy7s3": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo16jndj42zwa2c4u3dlfewl2sw9s9pyy5s5ylya4sj8xe30jz345qqvzy7s3", + 46875000000000 + ], + "aleo1v66szkdedglappxhay6fe73nplh74dtxffupsx56h037rp4t5cps5e68re": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1v66szkdedglappxhay6fe73nplh74dtxffupsx56h037rp4t5cps5e68re", + 12351639000000 + ], + "aleo1xvyd220wmgq60xwtfn45pfszduwrupqf0ueuudtyu0zc9zhg3qys7g59g2": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1xvyd220wmgq60xwtfn45pfszduwrupqf0ueuudtyu0zc9zhg3qys7g59g2", + 3940000000000 + ], + "aleo1sk34qecfpx4u8tv5l39adw5hm2sfft83m6zdca3nmxjkzxptfuqs6j067a": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1sk34qecfpx4u8tv5l39adw5hm2sfft83m6zdca3nmxjkzxptfuqs6j067a", + 10341794000000 + ], + "aleo12hyw67830mgx7gw8mhh5myk7267xmtemvf9h9w7nwdgwl3kepcyqwzczwq": [ + "aleo1wu56llc4eaw08t63944fx7r69f9syneh30zjaykzna8z2wekl5rqem0nad", + "aleo12hyw67830mgx7gw8mhh5myk7267xmtemvf9h9w7nwdgwl3kepcyqwzczwq", + 15000000000000 + ], + "aleo19enxmhjpxejaa2zdt3k27g07nzksucsh0cyjx20dp5ve9ngxqyrs32lccl": [ + "aleo1wu56llc4eaw08t63944fx7r69f9syneh30zjaykzna8z2wekl5rqem0nad", + "aleo19enxmhjpxejaa2zdt3k27g07nzksucsh0cyjx20dp5ve9ngxqyrs32lccl", + 15000000000000 + ], + "aleo1yjtfucvv2s9aszgxd49sw330knunaua3ummz802dazmnz9w7gcxqq4p08a": [ + "aleo1af5kqnf4xt8tm8wdj4hwawq08tr583x0rhyrwcnf8y0jaedw4upswaefgw", + "aleo1yjtfucvv2s9aszgxd49sw330knunaua3ummz802dazmnz9w7gcxqq4p08a", + 20000000000000 + ], + "aleo10jmw3scav45qszlr79tsstwualnltwpu57gk0l7d4wz7xuq0c58swpm0a8": [ + "aleo1dsrv0z6wu9mgzl5l7wh62rwmrd4yt3zva7n4ayhvg02luvtqkqgq5tw209", + "aleo10jmw3scav45qszlr79tsstwualnltwpu57gk0l7d4wz7xuq0c58swpm0a8", + 20000000000000 + ], + "aleo167ync87ysjr9qdmpc8n4mvh8hfe7xlv95gua7eknkqka5y6v9qqskhujn7": [ + "aleo1q3gtqtd03fs7chhjdr8c4hf8vkwt96pf3vw28uytsdrnwt4hrs9sg7c62j", + "aleo167ync87ysjr9qdmpc8n4mvh8hfe7xlv95gua7eknkqka5y6v9qqskhujn7", + 10000000000000 + ], + "aleo1glulvw24c9u62qq50dtl37mursp0mgz8jhru45xz4rxn6054xv8sx3q9yp": [ + "aleo1q3gtqtd03fs7chhjdr8c4hf8vkwt96pf3vw28uytsdrnwt4hrs9sg7c62j", + "aleo1glulvw24c9u62qq50dtl37mursp0mgz8jhru45xz4rxn6054xv8sx3q9yp", + 10000000000000 + ], + "aleo1px3ace30tu6v90n0f47ythpqkdt84dh4c2qn4vjz2wyq2c5a7s8q3y67fd": [ + "aleo18xwgkgzwvzpw6yz8cdhrvrv6ztpd26zll46kd4kfcd79c9x90grsah3jug", + "aleo1px3ace30tu6v90n0f47ythpqkdt84dh4c2qn4vjz2wyq2c5a7s8q3y67fd", + 20000000000000 + ], + "aleo1ec50yxa676p6ymzd5qv7m9zmeh2cdwh48ws8pquw8zjyn6eu95gqhfa8xl": [ + "aleo1d37xxnms3sq5qxcnnh3dtvzr35xemjzas4jcytjr8uvymfetnu9salav5n", + "aleo1ec50yxa676p6ymzd5qv7m9zmeh2cdwh48ws8pquw8zjyn6eu95gqhfa8xl", + 20000000000000 + ], + "aleo17gq4vh96zp72jffqde6urc7ccvarz7p7yg8un7mpcjfjhlampqgsgzp4we": [ + "aleo1q3vx8pet0h7739hx5xlekfxh9kus6qdlxhx9qdkxhh9rnva8q5gsskve3t", + "aleo17gq4vh96zp72jffqde6urc7ccvarz7p7yg8un7mpcjfjhlampqgsgzp4we", + 20000000000000 + ], + "aleo1ur7lkcxdx6nwm8l8uq77tfy8ufxhcfu3sk9xxl7vrf05k9xyhgpqqxm9rs": [ + "aleo19t9f8nla683mzeaz5q2gv5u90zkx9v6azwvya7fswgfkfddaucxqxr0scu", + "aleo1ur7lkcxdx6nwm8l8uq77tfy8ufxhcfu3sk9xxl7vrf05k9xyhgpqqxm9rs", + 15000000000000 + ], + "aleo1xaafkw5szspu59rzy2nnnc6thhy8skrvgyhfqeh9vtzk3dafcsqq8dhssp": [ + "aleo19t9f8nla683mzeaz5q2gv5u90zkx9v6azwvya7fswgfkfddaucxqxr0scu", + "aleo1xaafkw5szspu59rzy2nnnc6thhy8skrvgyhfqeh9vtzk3dafcsqq8dhssp", + 15000000000000 + ], + "aleo1tsp2n8crlnk4zq70k466pe33jkd9ff4845ct473zjg8ec4ndtqpq8cq6xd": [ + "aleo12tf856xd9we5ay090zkep0s3q5e8srzwqr37ds0ppvv5kkzad5fqvwndmx", + "aleo1tsp2n8crlnk4zq70k466pe33jkd9ff4845ct473zjg8ec4ndtqpq8cq6xd", + 10000000000000 + ], + "aleo1yeeaxjtlevc8pq24emxuazrgngaxx8m3hqtgx4d9nevw3c72eyyqtwekc6": [ + "aleo12tf856xd9we5ay090zkep0s3q5e8srzwqr37ds0ppvv5kkzad5fqvwndmx", + "aleo1yeeaxjtlevc8pq24emxuazrgngaxx8m3hqtgx4d9nevw3c72eyyqtwekc6", + 10000000000000 + ], + "aleo1vsee8e9277wt2cz9k7tuz3dlnrt8xcflx5vxhwcwq3ctucveaqqqgmy8nc": [ + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t", + "aleo1vsee8e9277wt2cz9k7tuz3dlnrt8xcflx5vxhwcwq3ctucveaqqqgmy8nc", + 20000000000000 + ], + "aleo1u7ze7cn030ddhcpk58kgh99u9vdwjg2zrda93tatd23sjmvh7ugsfjgp6y": [ + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t", + "aleo1u7ze7cn030ddhcpk58kgh99u9vdwjg2zrda93tatd23sjmvh7ugsfjgp6y", + 20000000000000 + ], + "aleo1qhgarp578ev29ta877f6y79nj3m3upyzf49t4qqfrkan467lyuqqcu802c": [ + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t", + "aleo1qhgarp578ev29ta877f6y79nj3m3upyzf49t4qqfrkan467lyuqqcu802c", + 20000000000000 + ], + "aleo1zuh5kdysktqr4g0a9z3py2npdqe4hd0v4rk4vzy6xvrzserpmsrqu8677r": [ + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t", + "aleo1zuh5kdysktqr4g0a9z3py2npdqe4hd0v4rk4vzy6xvrzserpmsrqu8677r", + 20000000000000 + ], + "aleo1fveelav4mze9568cdyktjjgakylng62h3us9cvrnjkfmfy62rszs8czanu": [ + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t", + "aleo1fveelav4mze9568cdyktjjgakylng62h3us9cvrnjkfmfy62rszs8czanu", + 10000000000000 + ], + "aleo13eq882hjvr3elj7us305l0ft9zpxq2ltl7kh9apjtya4rywmhygsltaumx": [ + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t", + "aleo13eq882hjvr3elj7us305l0ft9zpxq2ltl7kh9apjtya4rywmhygsltaumx", + 10000000000000 + ], + "aleo10ta8rju94rme6nsu65pwvtylk0e3z9mrtnx2l0z5r8ykccra6c8symuw5f": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo10ta8rju94rme6nsu65pwvtylk0e3z9mrtnx2l0z5r8ykccra6c8symuw5f", + 10784163000000 + ], + "aleo13m4rqnnt07wps6ceqskk93mnq2hjysyw996gx597utcchkvm6ups84uqw7": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo13m4rqnnt07wps6ceqskk93mnq2hjysyw996gx597utcchkvm6ups84uqw7", + 10784163000000 + ], + "aleo1wsjk67j9djsg7utwr429umz2lrqwg6u94tu0sazf9k59yp0hyczszvw8n8": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1wsjk67j9djsg7utwr429umz2lrqwg6u94tu0sazf9k59yp0hyczszvw8n8", + 10784163000000 + ], + "aleo1pclpavgqrlh6pnn47zvg4qzemntzme7ghcn48jckqsqdxm8zavpqn0px6w": [ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls", + "aleo1pclpavgqrlh6pnn47zvg4qzemntzme7ghcn48jckqsqdxm8zavpqn0px6w", + 10784163000000 + ], + "aleo155hljz7d52mym5j7qrgkkkwmkeyruaerp94c25wyh3kqxvutasysvw66s4": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo155hljz7d52mym5j7qrgkkkwmkeyruaerp94c25wyh3kqxvutasysvw66s4", + 10784163000000 + ], + "aleo1xlta2uzdg6xuxx2gm2msadqnnqhzumdf748nmeu7e3u5jnu32cxsgtnz0h": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo1xlta2uzdg6xuxx2gm2msadqnnqhzumdf748nmeu7e3u5jnu32cxsgtnz0h", + 10784163000000 + ], + "aleo1q4k7lknx22kwteh5fs5kekgqt2k9z285h3snnsa80csrznml358qf36nen": [ + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs", + "aleo1q4k7lknx22kwteh5fs5kekgqt2k9z285h3snnsa80csrznml358qf36nen", + 10784163000000 + ], + "aleo16aw5kz3caf3rm5h3fwmh7xna999ge3evmuta3djze89t64q26srswdar4r": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo16aw5kz3caf3rm5h3fwmh7xna999ge3evmuta3djze89t64q26srswdar4r", + 10784163000000 + ], + "aleo1823a9jru5q2rappstljx5srs6ukd2l4e9akajezafmf7v6ykuy9qn7elzc": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo1823a9jru5q2rappstljx5srs6ukd2l4e9akajezafmf7v6ykuy9qn7elzc", + 10784163000000 + ], + "aleo19y87xmlm45sqga59wns5952nfycplrw0u0l75ylmk4w6vam59uqq0wewpz": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo19y87xmlm45sqga59wns5952nfycplrw0u0l75ylmk4w6vam59uqq0wewpz", + 10784163000000 + ], + "aleo1ecwf0cjxemlv7uw6j08tepqnwr4f8eczcr9vmkvvks5wj5wcfygq220akt": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo1ecwf0cjxemlv7uw6j08tepqnwr4f8eczcr9vmkvvks5wj5wcfygq220akt", + 10784163000000 + ], + "aleo1h67mr9cd345zft7qyu2c352h09ukuaspa6l646cya2ssaje96qxqrjfhfm": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo1h67mr9cd345zft7qyu2c352h09ukuaspa6l646cya2ssaje96qxqrjfhfm", + 10784163000000 + ], + "aleo1ma7nk8e85f0usgwt6vtm02779zw67gh329h2e0jdzcpsyhwhvgpsm4m8s6": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo1ma7nk8e85f0usgwt6vtm02779zw67gh329h2e0jdzcpsyhwhvgpsm4m8s6", + 10784163000000 + ], + "aleo1n6snqf78c23c44vnynhkc7umujut7rwhnvznmukp2txta0fpzsfqpjfxje": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo1n6snqf78c23c44vnynhkc7umujut7rwhnvznmukp2txta0fpzsfqpjfxje", + 10784163000000 + ], + "aleo1rdraw65s8xpm6gzupumdpyr63nxsg0evnuwt7fdal0apcan57yrs39ms28": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1rdraw65s8xpm6gzupumdpyr63nxsg0evnuwt7fdal0apcan57yrs39ms28", + 10784163000000 + ], + "aleo1s3g5nmwd349mf8csu305av9xgq36a5vrkcjw79lg836zf8pvm58se4942q": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1s3g5nmwd349mf8csu305av9xgq36a5vrkcjw79lg836zf8pvm58se4942q", + 10784163000000 + ], + "aleo1swhwd4gjkmkfnsusul502l68mp0v3972qep8klr5sxqf6d65dy9qftvtyy": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1swhwd4gjkmkfnsusul502l68mp0v3972qep8klr5sxqf6d65dy9qftvtyy", + 10784163000000 + ], + "aleo1uyhkz5q6e0px3csltv0rdlv4n4yzmrft5cgvx8e2mc8au8eu0ygsxea3cc": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1uyhkz5q6e0px3csltv0rdlv4n4yzmrft5cgvx8e2mc8au8eu0ygsxea3cc", + 10784163000000 + ], + "aleo1w6jkccdy07mvp2ncuw92hcf6qww80lcw4df9khrth8kqtv22xgzquv4rsj": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1w6jkccdy07mvp2ncuw92hcf6qww80lcw4df9khrth8kqtv22xgzquv4rsj", + 10784163000000 + ], + "aleo1wdyzn9wcadwyjn9fz5mqrnm0gcwxef7xzuycz874r8d2t54r8spscq8n0z": [ + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52", + "aleo1wdyzn9wcadwyjn9fz5mqrnm0gcwxef7xzuycz874r8d2t54r8spscq8n0z", + 10784163000000 + ], + "aleo15wpy0ptmfp3asg9pmlwce3w65g5e4mkxr4yn3jglmekef23ktsfq8l979q": [ + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln", + "aleo15wpy0ptmfp3asg9pmlwce3w65g5e4mkxr4yn3jglmekef23ktsfq8l979q", + 10000000000 + ] +} \ No newline at end of file diff --git a/parameters/src/mainnet/resources/genesis_public_balances.json b/parameters/src/mainnet/resources/genesis_public_balances.json new file mode 100644 index 0000000000..dec6c32e59 --- /dev/null +++ b/parameters/src/mainnet/resources/genesis_public_balances.json @@ -0,0 +1,138 @@ +{ + "aleo133y0hmcvcrtc8h8sarg2q8u2wd80y832as33yjvwt24gnrpawcgqv35f73": 323340000000, + "aleo1lsqkt6hv23sgtc0dm85asmu94gtsg9nwh3fsfx0jfvaveaw9hcgqjvjlgh": 100000000000, + "aleo1xhj70rqqrge2ma8s9enhxxafzc7ca4fmy7xw8v3txt8fusjt0yzqy0jrhl": 58750000000, + "aleo1r4u8nkxqfrauq8wt50ft86c8jrvrz3rsvwdljpmwkmsrwzg7gupst4g2q0": 35624626000000, + "aleo1nevs44gr0g5dqw6hv9auvn9sd4xxwt5fhhmg6apkdkx8zxvymqpsagk9hr": 2343261000000, + "aleo10vcxw744ptk6p4mfhdq6aunz54k0metd8ynvn9k35uf8dmvktgysx2656e": 577500000000, + "aleo1zv2m0y6rl5z729vf2gnt04rlnfp8qwzvm2tas9cgfr3z29p5mugqchjqqy": 228593000000, + "aleo16zwv878wskhamf43jt7mvexqv3efl7dpx0s94xts7f7kg24v9g8q4hwj70": 1180000000000, + "aleo1r2tgdetqyn62ydr322adr7v8x7n0n0xm22u3hwnjez52wh7x7vqq6dekek": 75000000000, + "aleo1grh73zs6enlz697vr5r67mvdrj780y9qf26sq8p47xu9z0du2urqulwp3s": 70000000000, + "aleo1jljdp9jch23pm0p7f5ndhdyx2er3ff7epnly60hq76uwureu5u9sr3faaa": 70000000000, + "aleo14egtjeerasckcjz5e2h5pmudehz2feckudf4qus8kf0dyu79fyxq8x800g": 60000000000, + "aleo1rdc9gkf92ahqaahas4efcny0f9edqthuaqycjm2cj7xq2u69aqzs8xh0qm": 48360571000000, + "aleo1fgc5ku80v7eyjkm9579pyx976ew25my0d6n2rtxklc72266plggqfl3ndr": 25000000000000, + "aleo1dx2war20thpyem2nmj3nzeupn03vpau07nka7kjcl0em7f40cuxqfrl3zg": 25000000000000, + "aleo1lh07t92lssveqtc8zrn6dse67cfxt7a5tlhscwpscr96phk3lcpq0fk8j9": 25000000000000, + "aleo1zd8lqxk7mlcmwm6crrae4vcpw4ydqff0knw77ap2zrlvutq3ecrqf3gdup": 25000000000000, + "aleo1jfsw7fwd8njh8zlum8uvp7xrmw5tha3tvwlr9wrftk72msss8s9s0z6uqx": 1000000000000, + "aleo1juqqx2zpt7297ksdqkswjqgsw3xaxhmpgqlwntk2gzlzcd2dd5zsgedkkv": 6102240000000, + "aleo1y0f7nkk2gn4fpd876pl54dmgatz0luz6w38h26la5lhhxt4jzyfqe5tgsc": 6102240000000, + "aleo1l7w0qyzftwqxvydz0tjxv2nfd0wpp2ncq35mecg97f37taawr5xssdhz6m": 3514891000000, + "aleo14t63us2r8jr9dyld6psd5g93npz3wantf4a9x27chfzdfkassqyqy08myt": 3514891000000, + "aleo1p2jus7cukq7tgt5ta7r3t0vm6g28nwg8jf22t56q05sg7q00purq5pecms": 2643857000000, + "aleo1fnpz5r0rkzggtyhyla749aafnqxms70lyrz2puqc24p3sdkllgxqda8urv": 1562174000000, + "aleo1j84267aflalhler05yxw5j45sxzv87zlyzv2e6f58jmfl262zyqqnl7662": 640735000000, + "aleo18ek3r92ufc84je97rd4rkwh04vqc7ucvg4sha52m49keph8uryzsqtkt40": 517635000000, + "aleo1d0dv0xfr327ydwe0hwrwemt94h89v0msa67htq0fseufmf92yvrs6pykmk": 117636000000, + "aleo1vevurpd8pp8djvemwvdxg8wmy4lj64zwwj5ju5q36djkxterrurstqxydm": 100000000000, + "aleo19ef6ew7y4nx2pflquqnrv9c3dgzfn52akjd9uj2mnrpmmklzns8sc4fwhj": 97636000000, + "aleo10egca5endeu6dkewyjppfzfmrs69udfk99akrq8rgfk2wjmr5qpqt6lzg3": 81363000000, + "aleo1j6u4k6ey3fys26hgtscee3jgmf2luf967nglx028c69mlc9y7vyqz5802x": 78804000000, + "aleo1w39rxmemeuj0gcfq2nxrfjvt2zz940nsf6gmudcnv4mdx2m9vggsmanvyf": 69158000000, + "aleo1uj24ty3q74sffxn9uufesxhg3md4uw0em4055aztdwd9pfpxlsxqddfrhp": 69158000000, + "aleo144rrzh2g6v2mkkn0talsfehf038cmkphxxgjt032z60n3qkk5c9quyaakj": 63646000000, + "aleo19c3tc2cz4hkunnyfw25g7z29tthax9jr7lhwn6mh7dl00pcdpgrshhnz8x": 54920000000, + "aleo1yp8m4wq7ak6wm5zj47le7544hexczzsapg6gfmha8vns6d2mccgslv6hzz": 50000000000, + "aleo1fl5g8y9rdkxmk7rgnw9c6st9vhgek7fgaky8enp3adx53sfezq9q29nt4t": 50000000000, + "aleo1sqj54qjahcuwuesjs7dk25gt8zah8hwtl8n8eh94hnzslde9j5zsn90lty": 48818000000, + "aleo1n09623m4z39wudrd9rpn96jns64t292umwccrg0uxqf0rfyr7crq0hcltu": 45000000000, + "aleo1p4qk93g2wrmvrg7ax59eqgueg3x66cyfl80n0kw66t3l048nryysq0devq": 42715000000, + "aleo199z6wl2rnh242f89gylzegt3adnktsjqzelvmxzfea80lx6z4ypqte97gt": 38647000000, + "aleo1v5yzrwdhfsyx70sfdw020fzu9glu33629dcj7ymnwcfk3lu95q8sjxl3kw": 30000000000, + "aleo189004ka24e4j3226nred9nleupcctytmvvgydnnv05az5lwz4yrq9yyxpx": 30000000000, + "aleo17u0x9xd7wp9zypp6vtcs9jrhhj8ae8rrc2yzh4xr0qgkan27rugs3a3e3k": 30000000000, + "aleo1388tzd4uzasjgcdrkt2e3tu4c4chgyuhvjc9f29dju7ccz5jdgxqgkykfw": 26443000000, + "aleo1atzmysxdmywln7s875qdeu4h0anpclrvffrsgw4rmvdwnkd5mvys0ghv3l": 12187000000, + "aleo1amj7rm5gl5d053a6mfl9zzae3dflclwg9cy86l9gr9xepplj7gps5suwqc": 12187000000, + "aleo1d67hf3qa35xxjxf3sl4wdh900rv4r58lzsreqmlrt8flrk5rfc8svllhmk": 9750000000, + "aleo197ndkeg2ve52m83kuljhwm9qmp9nld2nq72dw490hrtgjvd9ss8qx85drr": 4875000000, + "aleo18ry8mc3ms8psrn67uw52tfsrp9z9ex6ackpw2s4khsqkee9xfsrsj7d7st": 4000000, + "aleo1a73ftefplhp6wtfn6fm6337cs3rc3y5gcyeeazwtpgsunj4w4vqqkrunrx": 5000000, + "aleo1pl393a8m6ft9k59shx43lsqwxuf5mzr5w3shqkrrz8kn2fzj0cqq4n4pl4": 5000000, + "aleo1zf6mf9slaeg8u2th885tm6a3mdfw6kkv4u7wyuzl7tzmy2x49v8sp6a6yc": 5000000, + "aleo1ygnmyaryeylyu387fydh6stz8rhjf4jldl68ney76dj0krq8lq9qy2vw52": 5000000, + "aleo19v3kdvxeqvl3k6dea8mvkkkgg0rfu4umy0eup5hp5eu52ly6vggq9g6wkk": 5000000, + "aleo1fxpy4s8trl05v0nxjk5e9plj075txuhjymcnws2s9kfmtf3v4qrs8ydgew": 5000000, + "aleo18ruf9e6wcjgkd66ncxtgtqupn73xvcumuakpa568d307heh0gurs28ksvf": 5000000, + "aleo16xc9d7lyu5sawrkt0nnweeqy7fq6ythy822dp60gkweumru6ggyqpkhk5f": 5000000, + "aleo1sghf70z3ppmvs2j6pqah5wkxsz2ny0rtcgeq7eyyagh7gztm8c9sttywpy": 5000000, + "aleo1u5y6nhfl7ez47kerpu0rqam4jxc93nhpng29nmt3gmcmvfattgzsnrrh29": 5000000, + "aleo1866k0fpa8ncsfwhsl49smxztxrvhwr0n4kx4ep9p5596ulz9wcqqzmas60": 5000000, + "aleo1d25g09mvypl76sadtfhgcpdm3vnnffrallft8g3uu07p03ju5grqglxdkl": 5000000, + "aleo198z79wdr3rxtmlw3c7qud2hx7luug6a39wg5awzevq3208p0cq8sxeshl4": 5000000, + "aleo1lfsxyrpcfcuzw6839jcuw2csta68uuuedvu4nj0rj07l0fd3ks9qrpxatx": 5000000, + "aleo1hwj60wec8c4ml8wh53kjz5ejwc02e0gyrccs2wsuen6cxe54gvxskmycfn": 5000000, + "aleo14ajlf9segep8rgspe8ruqg0eyvssqrjevzlafy74x647sedm0cxs5gp509": 7989466000000, + "aleo18ct0pg4607uy89lfkw4m7fgw2guwy7p56rrgs67avp99q2zc25rq9zmvu4": 13762990000000, + "aleo1tet9q8h2gg63j4yxrldsa67y5kdugv87q4dc4je5nvku0c3vugrqzfyjgm": 11500000000000, + "aleo1y563rzw0amux87ucuh9gugjv6tlmaxm2ge7l33fkt0lre0k3zvqqxc7fhu": 15300000000000, + "aleo15dmq34aqvh4wnd5dve6q4g35pfd47hpz6hsfgxfmmdqfqyl9vcrsqqd27p": 12800000000000, + "aleo1rv3e3pldrsvajh8wt7lmdgegr68pmzh56sphn5h8zhyjuvh7mcpsgpfv5t": 11400000000000, + "aleo1p7sa3uqdwcxkz4ah05rpwaklqlh68z5w5jnfjw9la89vpmspdsysug9j4g": 12400000000000, + "aleo1jcs4qfrth590e8p7mpq97zsv0nje3c3ku5xnjk8we62qks69av9qdrtlg6": 12500000000000, + "aleo1p8t3sge7glx99hr4nk7x09jfurnlxmu4turnurjv39r2fxqydqys06ku6e": 17300000000000, + "aleo1pnu2xmx5xjsfq6up4mgejasvasf7l93aykkqarejzhd9n99pd5yskkfzw0": 17500000000000, + "aleo16yh4un57d8cs6gxavdp4h93clz0gs9xwcmjyglvczm9earjy9qrqezv22c": 12300000000000, + "aleo1tq34lq20vezx25amwm5kg7dxtjyets574cx099fx22hsfqawncrqmclvur": 19800000000000, + "aleo1qglgcl4elyrhayl8xzzvutxrqhyu7zv8zxhtluzprzkmrmgw0spq7ecf84": 11800000000000, + "aleo1gz67w2dw73p0csm6xrswl9yfz865an56exhec5x5ucgplj85rq9sxdjlxk": 11400000000000, + "aleo1z26qdnklknxyesvk74e23ef00y8pt0szy9j0vz7fa32knx46fsqsg5euq7": 7989467000000, + "aleo14aknju3kv8phldntax7v2gea7zz03j7w8ve0e04e9yur5l5kqc8sczrjg9": 7989466000000, + "aleo1t38e6jr5atvgwydngy9pu3qak4qr2ygvwthkutngqzvuk4rk2u8sd46pdj": 7989466000000, + "aleo1tl043gmmth70sdvzr8xk55lpgqv7q6raa7nq37tuwqer8jmdevpqc2papu": 7916667000000, + "aleo1nrkg28vduc9ckhf8nt0kww60p25zeuutj5tj6w49smd4mehsaurq590m4r": 1750000000000, + "aleo1zyrw7m47kc0atxwrtpwg08v0mqr393nfz9es2ehag0rnuxfvrvqsfd5e7u": 1750000000000, + "aleo15jvycc8yaasuau6jv4gfjdnfv2frm3c2t5h6z3c0hu2sm5qj85gq79emsx": 778750000000, + "aleo1nre9xv8kyuunztqjsjztha522pss63e80285ccd7x26g84rm8u8scrvhdp": 610544000000, + "aleo1xgdy3hln7uk402hquqs0updr607fq7eeyktdw2sc0ez4jqlfnvyqj272e2": 661700000000, + "aleo1zvrqzksewrpz4zcc3utveskm3fu8s7r3m2gf64d8dy30amsh5ursppdpa6": 600000000000, + "aleo145e9z8ln7lswnmljynflg42n37ey68xf905hjz9a78y6dtry5vxseu9jc0": 315272000000, + "aleo1nje4x5lwmnfynuvclxxqqaljda83y6w5hj0drgqpwh3ueszdzcfqg8egda": 266803000000, + "aleo13cra8uq8l5uwvzfedpq7mj75hc3fw6ff9s5kan6pxl5ljx0j5vrqsp3lu3": 807830000000, + "aleo1ty4xmu9kpl6vkxq3g4u9yv0w7d200cylkp4gkwfqp6xl64y82gyqcpklmn": 436386000000, + "aleo1f6n9kfwwqu5j5x7tq9y4hdd7pk9rjkfvlv4qwpm6vzvdx7ushv8q7quk86": 193125000000, + "aleo19dzp3cqnr5ll32upth830fs5grd9ru5ehkql8vpenh3sarcy9sfqsnjhaw": 150833000000, + "aleo1dfgdw2ayc7uzhfnu60s89ay84v4hxpj5uk80u7jjp6hdqzu9esxqmzru0a": 110000000000, + "aleo123pwwjq79uzrclwg4lc93e9w5v0sz4gmncuqnt76l20dyxscdcqquvurjd": 93125000000, + "aleo1fau627e9009ef3j0dxnpj5kmks7kdnt0ljyz0pl43w2gyfz4vqxs5ace3m": 93125000000, + "aleo1qmf6nlhcn27vdrttf8rsfegv4l6hp4wceqjppmplu056qsce7u9sunmrgf": 200000000000, + "aleo1ptl6tjq6r7afu7vp0qt9azrzmdukw502590jtk49htv658cuhv9sh9hhkj": 360000000000, + "aleo1sf9hdt4nfkmtgnhq3cak2jhhxxgz2yw2esnj3j534e9y9wzwxvqsh6q5cf": 64583000000, + "aleo1f0gumcfg6acx2vwhl4r655fhxrxtz9fr46tnr68wf2ryv2tqlc9qunwjka": 135000000000, + "aleo134sjx6mrrqxsxvj3gwsvdk5g458xn9v9d47lwp46kfc0fvxjlsrs9jtutr": 30000000000, + "aleo174wuzssxqul4qv6fu607e9yplmzu4449nwuc8m6zqlfzqc0u4qpq5mvj8w": 30000000000, + "aleo1gzgfmwdumvvqq67m7x0xgxj4mem0ftaxjtw76l3qxa5m4v9axsysuylulf": 29750000000, + "aleo10vhsexf0hx46kkm5p5s7hud42l4z5lt3fna3khxxxkjzwuzklvpqfapqnu": 85000000000, + "aleo1mtxd2xwymchujaumzmms7jxp8u29gjqkalyggxfjcfyzvzmcv5pszpsq9h": 50000000000, + "aleo1jz48svzjm670m83v8ru08l5eanapxx9f9r93t5xx7jpr399jdvgs6ckd4w": 3000000000000, + "aleo1sdwqg3072zm4twn76n2xe8c5exxfg9qd3lq0mwh929h93whju5gqy2050w": 200000000000, + "aleo1tj5daaewxezjgaly9r2zmkj5ryf5c5yuxewzx6tk2nuaks9v2sfqvw32gy": 5000000000, + "aleo157fuufe54qgz0samll3lekq2hqhc9aahfrddkyfny28dzmeg4crs4q7mgh": 600000000000, + "aleo105qxh7mynwks2vqfpn27a6caqwpj0mk5jg2c95e8tstn79awcqzsuhgr9h": 66667000000, + "aleo1njctsewqjx9e29260kkqf2alyd0rnak38tf230c59hcjckq7gcqqrxlznv": 59324424000000, + "aleo1j2xkasy3pawvet7n0jr3wnhfcchw6dqnheewx83gt7g8ynj6zugqcgl4tm": 7903750000000, + "aleo12wc902nfw60ky7srgtagc072aewpkh83wr84vh5568wtrm7xxcyqe0l0gk": 10000000000000, + "aleo1h9c0frgllm2fmtfkfe9wd6lusfkuw44prekc220cr2hdzfxzfq8qzrzmfn": 3000000000000, + "aleo1ykzj6ukmxxxvd3xe5j9j8vtfdmruyte3a6rvxpwu798dyqvm2qgqk4fwtp": 2500000000, + "aleo18l9m0u4ndxe9w8fyjw67y6ae7ydmkegjhfeqx2clkw8dq3963sgq0yntqd": 10000000, + "aleo1ss8jsght7ey2ul3wjsrccf2m2dguzakz03a5fszzznt32zzefszqxqnj0k": 10000000, + "aleo1st8x7ng74nde3x753u5y9c4cvgcpcp668ndcagucvuqltp3tgv9shqltkn": 10000000, + "aleo10yvuu6svtfskgxnxuznh86gksewl743jkfxw3yshcaxyuqgpcq9qesevgw": 10000000, + "aleo1lxs2fe32fv084gavgeq8yh3h4f8778c3vskcn5dd8a0mqde365zs7m0nad": 10000000, + "aleo18rxfnwymru2j3prsuk070u4atf2zdnk3yp99x6s948a2q0ldsuyscu9t42": 10000000, + "aleo1dzwkf82y93q54gj6kaydexexkde8kp84mx0qhj4es6arqcjxkuxsd0dsrv": 10000000, + "aleo1k3w8l8kmwjxcs5rsnnqp9p2z65s68ltk6kn559fw7per4mzgzvxsmsp8rz": 10000000, + "aleo13kxtmlp3u37m9np4zf465rapd2h8gxhxv5wmp8q852hxhnnfac8s9769tn": 10000000, + "aleo1mj07es0ar580s9sdqk036jzpxxaewpuwylw53hyvjtlj4vaknvxsmm0ux2": 10000000, + "aleo1g5wrxvgyvckgtuceg36eg6pf024x3p6nex05lcefz0h6576rmgrs22dr4w": 10000000, + "aleo1xx0fqugtrm0kv872dj5ujhyx3kjfrdtz5vj23hmq4p9cqwtvfs8se6ct93": 10000000, + "aleo1t0tjdmwfz89s6d50xrzapp8f6aks5pqm0lf46xvz2y200s9rasps9g0scu": 10000000, + "aleo1mjql67fre85nu92mjyf6024ua2zwg60l7udwtn27qdnlsx2qxvzq08vdmx": 260010000000, + "aleo1celn0jtuurc5s2k2v697e3nuuf3nrlhaymrmwljqqkhnlnt3kvpqdz62dd": 10000000, + "aleo1xzspdh569aajes9gm6w9pt535zdtj9tc3npf3245gasl76t03ypqu63k38": 10000000, + "aleo15jklh2w7964apw5cpqax4hddadpy9tx5n9lz8879twcajazdwspqjds0jr": 50000000, + "aleo1uc970xpa7w98enygh3lc5s6twvad9fmm8j3yvdyjxxfll0wfeqrs0lwcjz": 5000000, + "aleo176kj4y74n3ls24erc848e8wf3kf3vhwh6yp64qcuw93z469payqs38anfg": 10000000 +} \ No newline at end of file diff --git a/parameters/src/mainnet/resources/genesis_validators.json b/parameters/src/mainnet/resources/genesis_validators.json new file mode 100644 index 0000000000..d83c52603c --- /dev/null +++ b/parameters/src/mainnet/resources/genesis_validators.json @@ -0,0 +1,98 @@ +{ + "aleo1vfukg8ky2mhfprw63s0k0hl4vvd8573s6fkn8cv9y0ca6q27eq8qwdnxls": [ + "aleo18l9m0u4ndxe9w8fyjw67y6ae7ydmkegjhfeqx2clkw8dq3963sgq0yntqd", + 100000000, + true, + 10 + ], + "aleo1hdtsgk52nsualvrt4t676m9sydp6zllwe0mr4w5mzknxj3rkzs8slhszhs": [ + "aleo1ss8jsght7ey2ul3wjsrccf2m2dguzakz03a5fszzznt32zzefszqxqnj0k", + 100000000, + true, + 10 + ], + "aleo1m5vc6da037erge36scdmefk0dcnrjk9tu04zyedfvxunwcwd3vxqtcy7ln": [ + "aleo1st8x7ng74nde3x753u5y9c4cvgcpcp668ndcagucvuqltp3tgv9shqltkn", + 100000000, + true, + 10 + ], + "aleo1qc46ca98xxjy34v37ge75yydyt36mgatqup7zrjra6gp9huatsqsjv6p52": [ + "aleo10yvuu6svtfskgxnxuznh86gksewl743jkfxw3yshcaxyuqgpcq9qesevgw", + 100000000, + true, + 10 + ], + "aleo1wu56llc4eaw08t63944fx7r69f9syneh30zjaykzna8z2wekl5rqem0nad": [ + "aleo1lxs2fe32fv084gavgeq8yh3h4f8778c3vskcn5dd8a0mqde365zs7m0nad", + 100000000, + true, + 10 + ], + "aleo1af5kqnf4xt8tm8wdj4hwawq08tr583x0rhyrwcnf8y0jaedw4upswaefgw": [ + "aleo18rxfnwymru2j3prsuk070u4atf2zdnk3yp99x6s948a2q0ldsuyscu9t42", + 100000000, + true, + 10 + ], + "aleo1dsrv0z6wu9mgzl5l7wh62rwmrd4yt3zva7n4ayhvg02luvtqkqgq5tw209": [ + "aleo1dzwkf82y93q54gj6kaydexexkde8kp84mx0qhj4es6arqcjxkuxsd0dsrv", + 100000000, + true, + 10 + ], + "aleo107mzqjf3w2mw70wz0uy9r3u95y4s7af27jzxdyemz3sf9ase7v9ss6nr8t": [ + "aleo1k3w8l8kmwjxcs5rsnnqp9p2z65s68ltk6kn559fw7per4mzgzvxsmsp8rz", + 100000000, + true, + 20 + ], + "aleo1q3gtqtd03fs7chhjdr8c4hf8vkwt96pf3vw28uytsdrnwt4hrs9sg7c62j": [ + "aleo13kxtmlp3u37m9np4zf465rapd2h8gxhxv5wmp8q852hxhnnfac8s9769tn", + 100000000, + true, + 10 + ], + "aleo18xwgkgzwvzpw6yz8cdhrvrv6ztpd26zll46kd4kfcd79c9x90grsah3jug": [ + "aleo1mj07es0ar580s9sdqk036jzpxxaewpuwylw53hyvjtlj4vaknvxsmm0ux2", + 100000000, + true, + 10 + ], + "aleo1d37xxnms3sq5qxcnnh3dtvzr35xemjzas4jcytjr8uvymfetnu9salav5n": [ + "aleo1g5wrxvgyvckgtuceg36eg6pf024x3p6nex05lcefz0h6576rmgrs22dr4w", + 100000000, + true, + 10 + ], + "aleo1q3vx8pet0h7739hx5xlekfxh9kus6qdlxhx9qdkxhh9rnva8q5gsskve3t": [ + "aleo1xx0fqugtrm0kv872dj5ujhyx3kjfrdtz5vj23hmq4p9cqwtvfs8se6ct93", + 100000000, + true, + 10 + ], + "aleo19t9f8nla683mzeaz5q2gv5u90zkx9v6azwvya7fswgfkfddaucxqxr0scu": [ + "aleo1t0tjdmwfz89s6d50xrzapp8f6aks5pqm0lf46xvz2y200s9rasps9g0scu", + 100000000, + true, + 10 + ], + "aleo12tf856xd9we5ay090zkep0s3q5e8srzwqr37ds0ppvv5kkzad5fqvwndmx": [ + "aleo1mjql67fre85nu92mjyf6024ua2zwg60l7udwtn27qdnlsx2qxvzq08vdmx", + 100000000, + true, + 10 + ], + "aleo1n6c5ugxk6tp09vkrjegcpcprssdfcf7283agcdtt8gu9qex2c5xs9c28ay": [ + "aleo1celn0jtuurc5s2k2v697e3nuuf3nrlhaymrmwljqqkhnlnt3kvpqdz62dd", + 100000000, + true, + 0 + ], + "aleo1anfvarnm27e2s5j6mzx3kzakx5eryc69re96x6grzkm9nkapkgpq4vyy5t": [ + "aleo1xzspdh569aajes9gm6w9pt535zdtj9tc3npf3245gasl76t03ypqu63k38", + 100000000, + true, + 100 + ] +} \ No newline at end of file diff --git a/parameters/src/mainnet/resources/powers-of-beta-16.usrs b/parameters/src/mainnet/resources/powers-of-beta-16.usrs deleted file mode 100644 index eb015eb960..0000000000 Binary files a/parameters/src/mainnet/resources/powers-of-beta-16.usrs and /dev/null differ diff --git a/parameters/src/testnet/genesis.rs b/parameters/src/testnet/genesis.rs index 08a0d0299f..68ba304a83 100644 --- a/parameters/src/testnet/genesis.rs +++ b/parameters/src/testnet/genesis.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -27,6 +28,6 @@ mod tests { #[test] fn test_genesis_block() { let bytes = GenesisBytes::load_bytes(); - assert_eq!(20083, bytes.len() as u64, "Update me if serialization has changed"); + assert_eq!(20929, bytes.len() as u64, "Update me if serialization has changed"); } } diff --git a/parameters/src/testnet/mod.rs b/parameters/src/testnet/mod.rs index 948bdff16b..84f3c76531 100644 --- a/parameters/src/testnet/mod.rs +++ b/parameters/src/testnet/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/parameters/src/testnet/resources/block.genesis b/parameters/src/testnet/resources/block.genesis index 8fa9ad161e..8566c73f14 100644 Binary files a/parameters/src/testnet/resources/block.genesis and b/parameters/src/testnet/resources/block.genesis differ diff --git a/parameters/src/testnet/resources/genesis_delegations.json b/parameters/src/testnet/resources/genesis_delegations.json new file mode 100644 index 0000000000..4bf2807f90 --- /dev/null +++ b/parameters/src/testnet/resources/genesis_delegations.json @@ -0,0 +1,23 @@ +{ + "aleo1anfdyecj5fss40m7jh7t7g5rsncyqcd9ys74dssc62p0fldq8v9qlyaelk": ["aleo1vcyhz3cwu45js0sndl8hf7zzfg0slg20x8wjsv2r9q3havgzgupqxm0nad", "aleo1anfwa8pvsztk6plad3a3pp3vy6aevf7vm0pvfhwxrat6wl2q4qps22ff8r", 30000000000000], + "aleo1anfdn92msrk78sm8ckuylx036vteg9m349wvdlr7jp0qpc9p8qzqpgcvgf": ["aleo1ekqgrpvru7demjrp92sxkdr2cqetr8qrkkcmmvkr8kqem9r5t59qwa780g", "aleo1anfwnv3ke0sm0h4yumnvmjyge7c5e440t5hp2jwy3spd87dtdqzqdp3nsx", 20000000000000], + "aleo1anfd3kl7t8jnvft75ka9lr2xgtvyljhgfjj4jxtm44hs6xl575rsgp7whd": ["aleo1fpee4gzwuehvxh3gknygf4n3g76tqwsgxu4mxn7rsgfe8rklmsxqlu68e2", "aleo1anfw9k8x9kxu5zxuf9u6z9prhh8e50lg79nty4g82cj58x38mvqq9feerh", 20000000000000], + "aleo1anfdtnukn9h9eev5nky63ddkkdf6uqnlxc0tl05lcpzenp78jgys2du699": ["aleo1u4hqhsukjqkm6q02kc5cjm470srwt77x9yt0fa2j263wtqzrevyqmdccy3", "aleo1anfw0agea55ym2kde9vmpwemz7jpunyvlg0u74x3ew0rqs3rnuqs89gpyd", 150000000000000], + "aleo1anfd65qdrnnszpkq3vdgrk0ckemlryfhq5s9cpyjyxfs9ra49c8quaqnld": ["aleo1zdzzxfrhgzlhh89vqpf4384ewqs0g32wqzvdeltzlynq25hkju8s38953f", "aleo1anfwukg3njd76zlx2x4jxg07fdgj4jnq9hq7vjwvpx9400jlsygss8kpyv", 20000000000000], + "aleo1anfdmczmdpazr4x4a5d7avqjuamn538vjkl2u8purhz7x0744crsn6leh6": ["aleo1uhd3qew7kgs8zmcm2w23xk7j4fjrf448zdjjslcngl9h3u3rs5zsltfmez", "aleo1anfw340j4x3vyypqprwxuzzcxjaka4x250nskf0p50km4dzhwg9sfpgqms", 20000000000000], + "aleo1anfdlp0r63vl8nl360t585meda0rh7zwq26nce5ztzlevcnyuugsjlutyd": ["aleo1dxf42pkgv5fcsnanhw2h4lvzcaxxcfwajtsghvqljugnpwfc5vxq0ulav5", "aleo1anfwlxd3lsdp9uuvt2z85q572ffjr8yln8x0r5ns2czp266pqgys8tr724", 20000000000000], + "aleo1anfd7qwlrhzvl9natecefcjdgmkrfcffu3r02jsd3y2ac62spyqsneyrap": ["aleo1l7avejc23yv6e8nx4udjwz89dw6mg95dzsp936hf77yuhnjywv9syl0ywc", "aleo1anfwwfur5mdngretzlfqw8tusj03dgzmxfutl00t3953s4993crqjmwj5l", 20000000000000], + "aleo1anfd04w4ea4daw4nc8mpzjerr3he86k3rh8w7eajtyw89k2lvg8s3g2ufm": ["aleo19dpf763gtj9h34wwk9a45ccfmd07r2kckqu7y9av3d5lly0asygss2scur", "aleo1anfw8l6yz3j4all3gu0afh46dyr6as78ue60uw655uwq4jl37qys5gmjpl", 30000000000000], + "aleo1anfdz0d8urvhdxdnjr0cdt5wuzuqvyplf0vu998l6xmkxgf705yqkxaxfn": ["aleo105eppvclpq20dv0282yft3m2njn9j4znrz087uj3r92gcpttagpsedem0x", "aleo1anfwpfzgk2gly3fn8zdw62nw3uj7adr6ly40z8rlhjc2fhfphy9q7evvpz", 20000000000000], + "aleo1anfdek5g46da7stdmyflgzn9vlpjszt9gj9ayr993fx666x37uqq55x3j4": ["aleo17mp7lz72e7zhvzyj8u2szrts2r98vz37sd6z9w500s99aaq4sq8s34vgv9", "aleo1anfw8t4mael397wmy0x3w2kukey85394vu5vhfhtvals0ga6yspq8sk2w9", 150000000000000], + "aleo1anfd83alxygns6rnrjn2d73zrmr26f8ml2rvmqvvtl065rlqts8q4sajqs": ["aleo17m3l8a4hmf3wypzkf5lsausfdwq9etzyujd0vmqh35ledn2sgvqqzqkqal", "aleo1anfwzpgythyrtxzhj7xs22mhsq6nz7440ws66hcfmz5xeaw8s58q20a5uc", 150000000000000], + "aleo1anfd6854hl76d4046p82246glxgyjy9klkgcjwpcmue65auntvxshuc5ck": ["aleo1czp8gure8caqnpqgxsacc2kv2zhggz4ujp065wwfa76qwxggrups6ap3jg", "aleo1anfw2fyyy3dl55n5kmus65spw5mle47xqjdeldtxx9ppsjs83vpsd4fpjh", 150000000000000], + "aleo1anfda0mfnvd4yrkjxym3epqg2q3cpl9nche59qwedc6ptpcjpy9qq8arzf": ["aleo1anfvuep47h0r9q349gu76d8twga8w98p0z2ggrktupcj450d5g8q7w3e2p", "aleo1anfwl4af93p67jva5k2r506yx2lw7jr0t9tltpgh8vullmry8c8q3sp7yu", 150000000000000], + "aleo17avqttd2jmxq3wrcmds2tc4ypcp2f85d29dqmqsmqlzr42c8vcrscpch26": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1pstqsdc3wazvcmj2dcxdarw63c84zkefqqv57669a37p8wt3nsrq2fcm0l", 25000000000000], + "aleo109kemfaxa7flf89jup6qrnkn6ml6t9zsp7ynegss45kywqh6fcrq0z0qst": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1gdhhvtpdqg8qsargayxfaj3s4tl482lster3e9rt384jxnszrsfqnhvpye", 25000000000000], + "aleo1y0vd8pxz5d2l67u8hflvs3vh2zvv7wcsxj2paxfdmr2tqftkhczq8rpq3q": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1gnrgczjq80wkrezsxux9qeve2r68q36kt8y20ndyldwg25tzfurqps2f06", 25000000000000], + "aleo1aem42tpjdgy4j5h9m2938mrewg67r2t7chzzlk0mkstwymtl3gzq6uf2lw": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo12m6n25wl29fcrwnkc0sd75guguwtsrs48lknunpdkrcmpcdw4v8svkrfne", 25000000000000], + "aleo1qcxl6uzsex7es556gcpxsr3fzm9sh3j9r0xqzxqjkvl6wmaa459qze2x6w": ["aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364", "aleo1u3nmst8zqh20xg7t8u8nd4zuc5z4uehnrj7yx05dun4salwru5gqrf75sq", 25000000000000], + "aleo1ep4pya77hjjlutqu80g6ezdcplztvykj5xzd5v730z3muc2qf5zqak3qkx": ["aleo17mp7lz72e7zhvzyj8u2szrts2r98vz37sd6z9w500s99aaq4sq8s34vgv9", "aleo1ep4pya77hjjlutqu80g6ezdcplztvykj5xzd5v730z3muc2qf5zqak3qkx", 10000000000], + "aleo130kkf4meuvznrn3g69tqhxyvrllneys0vmh3dtn4p9hp5ntn2vqqjfgp5p": ["aleo17m3l8a4hmf3wypzkf5lsausfdwq9etzyujd0vmqh35ledn2sgvqqzqkqal", "aleo130kkf4meuvznrn3g69tqhxyvrllneys0vmh3dtn4p9hp5ntn2vqqjfgp5p", 20000000000] +} \ No newline at end of file diff --git a/parameters/src/testnet/resources/genesis_public_balances.json b/parameters/src/testnet/resources/genesis_public_balances.json new file mode 100644 index 0000000000..945bf1916a --- /dev/null +++ b/parameters/src/testnet/resources/genesis_public_balances.json @@ -0,0 +1,75 @@ +{ + "aleo1anfx9xxgsvjpg6gqjnm7m3eyycthz3y0k0h5659suhejws3td5rq28r6fd": 167000000000000, + "aleo1anfx7d2986jmrxs37ldqrz3nlus7u3grrluluhulrvj883d3ps8s9r7q9u": 135000000000000, + "aleo1anfxe06adre90ppk9seh2zr8jqe7f5atlsppqcnq6dga35t4dy8qd3u4hr": 74888497000000, + "aleo1anfwl4af93p67jva5k2r506yx2lw7jr0t9tltpgh8vullmry8c8q3sp7yu": 100000000, + "aleo1vxwv3alrx660hyxxefjvwm3psd9f20r9qz0xe7qfp0dtr86pus8qxm0nad": 100000000, + "aleo1gajgumpgqhh8wvntew2rp0dpux8eh6cv7930yp3w9evz2vg65qqqfl00z0": 100000000, + "aleo18knt96enlk6zhfr8kx2vr0hatnwwsej8q2u8tpmzxxdfvyu9cg9sju2a8l": 100000000, + "aleo1kuefcn9ae7k8qfp932ehkjjdlh0jc8dpsknh9vksr7xncunsj5yqmsdraw": 100000000, + "aleo1vkwsehmedq883434ggtrc35rpr6p3fuqcemsz8l9qn98pdfryursdxhk29": 100000000, + "aleo1h67qa2avqcla9el22ul6qkyl57xmq3tsmk937umx52klemj5zcfq92xm0x": 100000000, + "aleo19g99vj20nq6d6v33kvnaw5dfjakdhdmu2a7swyaxe5q654l8pyqqy397g6": 100000000, + "aleo147vv6vxe97l6v6ur0re0prpy4d2yhsn959fha0fwtec2vp300cfq98c08q": 100000000, + "aleo1ywykurcvjfqy5a9untn0gjayz3smp4x2ft62sn38u7f6x225aurqh3scur": 100000000, + "aleo1f6lgcvfah830dq24r9dmhdhyu9ajt8kkxcdxpnl6jwk3z0k83ygq5dem0x": 100000000, + "aleo1hz8gju8jvxycdw8m826s88aszwws4lpew5v2wd8x7k77zl3vxgrstal05v": 100000000, + "aleo1glzpk8x34kl0c3ucerj3dfzeu74g4mqfp3tp60uc9fwyl7y9wyzsqxswjs": 100000000, + "aleo1mrckw3x7ye4yhw6hspyyj87rd0dngwuhww7u6lqjrw29260t4qfqcjy5mf": 100000000, + "aleo1pstqsdc3wazvcmj2dcxdarw63c84zkefqqv57669a37p8wt3nsrq2fcm0l": 100000000, + "aleo1gdhhvtpdqg8qsargayxfaj3s4tl482lster3e9rt384jxnszrsfqnhvpye": 100000000, + "aleo1gnrgczjq80wkrezsxux9qeve2r68q36kt8y20ndyldwg25tzfurqps2f06": 100000000, + "aleo12m6n25wl29fcrwnkc0sd75guguwtsrs48lknunpdkrcmpcdw4v8svkrfne": 100000000, + "aleo1u3nmst8zqh20xg7t8u8nd4zuc5z4uehnrj7yx05dun4salwru5gqrf75sq": 100000000, + "aleo1anfwa8pvsztk6plad3a3pp3vy6aevf7vm0pvfhwxrat6wl2q4qps22ff8r": 100000000, + "aleo1anfwnv3ke0sm0h4yumnvmjyge7c5e440t5hp2jwy3spd87dtdqzqdp3nsx": 100000000, + "aleo1anfw9k8x9kxu5zxuf9u6z9prhh8e50lg79nty4g82cj58x38mvqq9feerh": 100000000, + "aleo1anfw0agea55ym2kde9vmpwemz7jpunyvlg0u74x3ew0rqs3rnuqs89gpyd": 100000000, + "aleo1anfwukg3njd76zlx2x4jxg07fdgj4jnq9hq7vjwvpx9400jlsygss8kpyv": 100000000, + "aleo1anfw340j4x3vyypqprwxuzzcxjaka4x250nskf0p50km4dzhwg9sfpgqms": 100000000, + "aleo1anfwlxd3lsdp9uuvt2z85q572ffjr8yln8x0r5ns2czp266pqgys8tr724": 100000000, + "aleo1anfwwfur5mdngretzlfqw8tusj03dgzmxfutl00t3953s4993crqjmwj5l": 100000000, + "aleo1anfw8l6yz3j4all3gu0afh46dyr6as78ue60uw655uwq4jl37qys5gmjpl": 100000000, + "aleo1anfwpfzgk2gly3fn8zdw62nw3uj7adr6ly40z8rlhjc2fhfphy9q7evvpz": 100000000, + "aleo1anfw8t4mael397wmy0x3w2kukey85394vu5vhfhtvals0ga6yspq8sk2w9": 100000000, + "aleo1anfwzpgythyrtxzhj7xs22mhsq6nz7440ws66hcfmz5xeaw8s58q20a5uc": 100000000, + "aleo1anfw2fyyy3dl55n5kmus65spw5mle47xqjdeldtxx9ppsjs83vpsd4fpjh": 100000000, + "aleo1susaqk8fup7z2w6uff8djfdrr0dp27r70jp8a3s8edfc966e2ggs066frm": 10000000, + "aleo183jdycqrs0aj88r467jejf7g28nuque2gc35yujnztsawryawspq70lajp": 2000000000, + "aleo1v9fgx2f4thvwpdkxy2fxmqsep8hdrh2t34eahx095g8wwp5h25psrz365c": 1000000000, + "aleo1n2tkexkg5av4vhc72kldmf7j8jnku9tnu38ee7gx6avj8yuhpqzqczylvk": 50000000000, + "aleo1ep4pya77hjjlutqu80g6ezdcplztvykj5xzd5v730z3muc2qf5zqak3qkx": 100000000, + "aleo130kkf4meuvznrn3g69tqhxyvrllneys0vmh3dtn4p9hp5ntn2vqqjfgp5p": 100000000, + "aleo13kkl4as4ukc56p7yv2hnxhh8ske3flnkly6lu33hn8j3pvnlrgyqynks2p": 12351639000000, + "aleo1scle92gyxa8llt85g7nqrjtjvfpshxg5gfk2wnrfe0xdjsmpuygq0puzx7": 7916667000000, + "aleo1szf38fgd9y5060ehlh4qcfz92ep9qqnfvjlffx8wz9pv6qaj7vxs8jtdct": 12091794000000, + "aleo1eddeq40v8zh6gamjxq3tdt57dce2kc4yh8jykfdvz9tuqxkaa59s8dvx8m": 3877500000000, + "aleo164nw8gxszevyp804l3vh4lg2y7ktcn4ky0nzxsj7fn53sauwhyyqv6sxfw": 1812500000000, + "aleo1497953lt4r3ukh7zwg2xvl8xrfw9d9ae67vyu48js37aaqx59qxs8yket6": 778750000000, + "aleo14zpcgdf8t3zfqlxteqmmsw5e45vk6j3arlh6lwmjha329k7q7s9q6697r0": 610544000000, + "aleo1xj9rymlaedxdm0hyllaacnlcllj33j330k20vvxur3t4l0ud5ypsr8lcwm": 661700000000, + "aleo1njxwejjs89plp9g09euyv7dj93hndzjklkdrvsha88qnvuxkx5ys4s7rnm": 600000000000, + "aleo15nytfjn839zyya5efdhlutvla5j3mns4s2n44wahs63ql62j058sptuy4s": 315272000000, + "aleo16xhz496vugkptnjr92a9kgu8ffrlxxgda8smn4secnqlq3l9dvzsye4lc7": 266803000000, + "aleo1sukeek2srpa9garykfjtx5my68eenhwu55tfdhh0zqe9qlk05y9qexmgas": 807830000000, + "aleo15dlgj63t88r2c5eh5uch8m7ccl083rxxupa5jskuh6mxh63pfsrspudg29": 436386000000, + "aleo1j2k8ygmuql6fc0z4x9zzpsv6j4esa3tq6adgffrkzsf34garp5xsgs6g6j": 193125000000, + "aleo1le90msflp97t8rj9jkd2e56wempp4frtp7xyzzv0ulcg676kzuysnusqg9": 150833000000, + "aleo1283fl0rcewv7gh745zv7fzdn9usjayql7eurkshvsf709wkevugqnpr6pu": 110000000000, + "aleo14dhggffhjxggznhy2kktclw3pdeu669h5pgx58a6yp4u33gpac8qjufuxu": 93125000000, + "aleo1anmccvfxn2gmtju2s7mu96tpwvg6laj4kdfudtyye6suqd8ecqqqn8mc9l": 93125000000, + "aleo1ju2s9hej92nx5ugu7dn0xrvwcnpd0h6u4k2rfkvvrh05u59ruyxq6qyfxf": 200000000000, + "aleo1fdshagcdgrw4gt3mn8c2mquuvkvtkv878xkypz6t9ly3p5cues8qwqcqzr": 360000000000, + "aleo17ct5zfa8y9lf0v0euvu9y40s3w6nja4mhqyqcx2gfvk9ykx9kugqjl72w4": 64583000000, + "aleo1ck3ptgls640fj8uvcw6xscp35l4luzramf9njps036f2xvu0aqxq8f5xpw": 135000000000, + "aleo1xf3gw4rw6yrc2mq3a6d4efjzqv0lum6tj58dj7qegrl0q7vzfyyq26m4sw": 30000000000, + "aleo1623wl27e3564spz4a3qusg57yyfzjstrv36ceklqu56r6lq7sqqsjnjwsn": 30000000000, + "aleo1h9rlvd3fgcn5mc8we6qqazdjfnhqmp2nfvcfgpkkg2k6m52fdvrqperxxz": 29750000000, + "aleo1sps4zsqt57ftmh8c8s204hhhp4f9c39ueeyjukc4rsshzpsklvys298y86": 85000000000, + "aleo1gylwdcdl2cpln3y03wrsmsxczg6esusm6hly3svyvsusurn7nc8qcdlqy2": 50000000000, + "aleo1hlc2477tvp3msak49jww9rhh96clw8z628987dqjrnpvheesfuxq0cmghl": 3000000000000, + "aleo1uasll0afwe5xrn4lkfrqfv40rk66k5vaevvmwkaq5j5awedpzg8qu85a6n": 200000000000, + "aleo1vnkmlgjctu2wemm4uv0vwp4h4keqk3jdjtu7f4tfyzt84l78tuzqlsy9q4": 5000000000, + "aleo1y3ukjtcklkfyamfgvmkrlj856jdvlxt5ymajy2mg07rcnm5r3yzqen9frx": 600000000000, + "aleo139nt5wqsnrg524s3scr09yz0u6gx7vf4fp8uvn2x0d5cl6k4durs2t29sf": 66667000000 +} \ No newline at end of file diff --git a/parameters/src/testnet/resources/genesis_validators.json b/parameters/src/testnet/resources/genesis_validators.json new file mode 100644 index 0000000000..df0787d920 --- /dev/null +++ b/parameters/src/testnet/resources/genesis_validators.json @@ -0,0 +1,17 @@ +{ + "aleo1vcyhz3cwu45js0sndl8hf7zzfg0slg20x8wjsv2r9q3havgzgupqxm0nad": ["aleo1vxwv3alrx660hyxxefjvwm3psd9f20r9qz0xe7qfp0dtr86pus8qxm0nad", 100000000, true, 10], + "aleo1ekqgrpvru7demjrp92sxkdr2cqetr8qrkkcmmvkr8kqem9r5t59qwa780g": ["aleo1gajgumpgqhh8wvntew2rp0dpux8eh6cv7930yp3w9evz2vg65qqqfl00z0", 100000000, true, 10], + "aleo1fpee4gzwuehvxh3gknygf4n3g76tqwsgxu4mxn7rsgfe8rklmsxqlu68e2": ["aleo18knt96enlk6zhfr8kx2vr0hatnwwsej8q2u8tpmzxxdfvyu9cg9sju2a8l", 100000000, true, 10], + "aleo1u4hqhsukjqkm6q02kc5cjm470srwt77x9yt0fa2j263wtqzrevyqmdccy3": ["aleo1kuefcn9ae7k8qfp932ehkjjdlh0jc8dpsknh9vksr7xncunsj5yqmsdraw", 100000000, true, 10], + "aleo1zdzzxfrhgzlhh89vqpf4384ewqs0g32wqzvdeltzlynq25hkju8s38953f": ["aleo1vkwsehmedq883434ggtrc35rpr6p3fuqcemsz8l9qn98pdfryursdxhk29", 100000000, true, 10], + "aleo1uhd3qew7kgs8zmcm2w23xk7j4fjrf448zdjjslcngl9h3u3rs5zsltfmez": ["aleo1h67qa2avqcla9el22ul6qkyl57xmq3tsmk937umx52klemj5zcfq92xm0x", 100000000, true, 10], + "aleo1dxf42pkgv5fcsnanhw2h4lvzcaxxcfwajtsghvqljugnpwfc5vxq0ulav5": ["aleo19g99vj20nq6d6v33kvnaw5dfjakdhdmu2a7swyaxe5q654l8pyqqy397g6", 100000000, true, 10], + "aleo1l7avejc23yv6e8nx4udjwz89dw6mg95dzsp936hf77yuhnjywv9syl0ywc": ["aleo147vv6vxe97l6v6ur0re0prpy4d2yhsn959fha0fwtec2vp300cfq98c08q", 100000000, true, 10], + "aleo19dpf763gtj9h34wwk9a45ccfmd07r2kckqu7y9av3d5lly0asygss2scur": ["aleo1ywykurcvjfqy5a9untn0gjayz3smp4x2ft62sn38u7f6x225aurqh3scur", 100000000, true, 10], + "aleo105eppvclpq20dv0282yft3m2njn9j4znrz087uj3r92gcpttagpsedem0x": ["aleo1f6lgcvfah830dq24r9dmhdhyu9ajt8kkxcdxpnl6jwk3z0k83ygq5dem0x", 100000000, true, 10], + "aleo17mp7lz72e7zhvzyj8u2szrts2r98vz37sd6z9w500s99aaq4sq8s34vgv9": ["aleo1hz8gju8jvxycdw8m826s88aszwws4lpew5v2wd8x7k77zl3vxgrstal05v", 100000000, true, 10], + "aleo17m3l8a4hmf3wypzkf5lsausfdwq9etzyujd0vmqh35ledn2sgvqqzqkqal": ["aleo1glzpk8x34kl0c3ucerj3dfzeu74g4mqfp3tp60uc9fwyl7y9wyzsqxswjs", 100000000, true, 10], + "aleo1czp8gure8caqnpqgxsacc2kv2zhggz4ujp065wwfa76qwxggrups6ap3jg": ["aleo1mrckw3x7ye4yhw6hspyyj87rd0dngwuhww7u6lqjrw29260t4qfqcjy5mf", 100000000, true, 10], + "aleo1l2a3lakq9pz9w9hyre7rk9zmk64wzr62z0q26wglr8tmf8w5cyqqxtt364": ["aleo1pzuc98fpz8xrvdjtx9umtcdu720v5zt2u79h49e39tqc3qhgayzqnn47js", 100000000, true, 0], + "aleo1anfvuep47h0r9q349gu76d8twga8w98p0z2ggrktupcj450d5g8q7w3e2p": ["aleo1anfwx4rryfndsd22kdt6fr7uvm9ldqh2jhfurlqn6rpa5v0n7yzs6pt5qz", 100000000, true, 100] +} \ No newline at end of file diff --git a/rust-toolchain b/rust-toolchain index 32a6ce3c71..dbd41264aa 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.76.0 +1.81.0 diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index d63e004d7d..8ce6d33350 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-synthesizer" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Synthesizer for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -69,73 +69,78 @@ harness = false [dependencies.algorithms] package = "snarkvm-algorithms" path = "../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.circuit] package = "snarkvm-circuit" path = "../circuit" -version = "=0.16.19" +version = "=1.0.0" [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../ledger/block" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../ledger/committee" -version = "=0.16.19" +version = "=1.0.0" + +[dependencies.ledger-narwhal-data] +package = "snarkvm-ledger-narwhal-data" +path = "../ledger/narwhal/data" +version = "=1.0.0" [dependencies.ledger-puzzle] package = "snarkvm-ledger-puzzle" path = "../ledger/puzzle" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-puzzle-epoch] package = "snarkvm-ledger-puzzle-epoch" path = "../ledger/puzzle/epoch" -version = "=0.16.19" +version = "=1.0.0" features = [ "synthesis" ] [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../ledger/query" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../ledger/store" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "./process" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "./program" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "./snark" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.utilities] package = "snarkvm-utilities" path = "../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.aleo-std] version = "0.1.24" diff --git a/synthesizer/benches/kary_merkle_tree.rs b/synthesizer/benches/kary_merkle_tree.rs index 3b41f8a460..612709b21a 100644 --- a/synthesizer/benches/kary_merkle_tree.rs +++ b/synthesizer/benches/kary_merkle_tree.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -15,13 +16,13 @@ #[macro_use] extern crate criterion; -use circuit::{collections::kary_merkle_tree::*, AleoV0, Eject, Environment, Inject, Mode}; +use circuit::{AleoV0, Eject, Environment, Inject, Mode, collections::kary_merkle_tree::*}; use console::{ algorithms::Sha3_256, collections::kary_merkle_tree::KaryMerkleTree, network::{ - prelude::{TestRng, ToBits, Uniform}, MainnetV0, + prelude::{TestRng, ToBits, Uniform}, }, types::Field, }; diff --git a/synthesizer/process/Cargo.toml b/synthesizer/process/Cargo.toml index 294a43b9bd..bc73c68f54 100644 --- a/synthesizer/process/Cargo.toml +++ b/synthesizer/process/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-synthesizer-process" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "A process for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -53,45 +53,45 @@ harness = false [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "network", "program", "types" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../ledger/block" -version = "=0.16.19" +version = "=1.0.0" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../../ledger/query" -version = "=0.16.19" +version = "=1.0.0" default-features = false [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../../ledger/store" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.19" +version = "=1.0.0" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.19" +version = "=1.0.0" [dependencies.utilities] package = "snarkvm-utilities" path = "../../utilities" -version = "=0.16.19" +version = "=1.0.0" [dependencies.aleo-std] version = "0.1.24" @@ -113,6 +113,9 @@ version = "0.12" [dependencies.rand] version = "0.8" +[dependencies.rand_chacha] +version = "0.3" + [dependencies.rayon] version = "1" optional = true diff --git a/synthesizer/process/benches/stack_operations.rs b/synthesizer/process/benches/stack_operations.rs index f1241d5cfd..353eb569e7 100644 --- a/synthesizer/process/benches/stack_operations.rs +++ b/synthesizer/process/benches/stack_operations.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -26,7 +27,7 @@ use synthesizer_program::{Program, StackProgram}; use circuit::prelude::bail; use console::{network::Network, prelude::SizeInDataBits}; use criterion::{BatchSize, Criterion}; -use rand::{distributions::Alphanumeric, Rng}; +use rand::{Rng, distributions::Alphanumeric}; use std::str::FromStr; use utilities::TestRng; diff --git a/synthesizer/process/src/authorize.rs b/synthesizer/process/src/authorize.rs index da526e7b5b..6f26ae982a 100644 --- a/synthesizer/process/src/authorize.rs +++ b/synthesizer/process/src/authorize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/cost.rs b/synthesizer/process/src/cost.rs index 61dabb7bbe..9be8228648 100644 --- a/synthesizer/process/src/cost.rs +++ b/synthesizer/process/src/cost.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/deploy.rs b/synthesizer/process/src/deploy.rs index b876a37f0e..88ddb829fd 100644 --- a/synthesizer/process/src/deploy.rs +++ b/synthesizer/process/src/deploy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/evaluate.rs b/synthesizer/process/src/evaluate.rs index 53ba6000d8..f30c6be866 100644 --- a/synthesizer/process/src/evaluate.rs +++ b/synthesizer/process/src/evaluate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/execute.rs b/synthesizer/process/src/execute.rs index 5340eb402c..ebc4cd7694 100644 --- a/synthesizer/process/src/execute.rs +++ b/synthesizer/process/src/execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/finalize.rs b/synthesizer/process/src/finalize.rs index 5b420ac064..6606d2d152 100644 --- a/synthesizer/process/src/finalize.rs +++ b/synthesizer/process/src/finalize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -449,8 +450,8 @@ mod tests { use crate::tests::test_execute::{sample_fee, sample_finalize_state}; use console::prelude::TestRng; use ledger_store::{ - helpers::memory::{BlockMemory, FinalizeMemory}, BlockStore, + helpers::memory::{BlockMemory, FinalizeMemory}, }; type CurrentNetwork = console::network::MainnetV0; diff --git a/synthesizer/process/src/lib.rs b/synthesizer/process/src/lib.rs index 1230e96d9b..65bfede98e 100644 --- a/synthesizer/process/src/lib.rs +++ b/synthesizer/process/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -45,11 +46,11 @@ mod tests; use console::{ account::PrivateKey, network::prelude::*, - program::{compute_function_id, Identifier, Literal, Locator, Plaintext, ProgramID, Record, Response, Value}, + program::{Identifier, Literal, Locator, Plaintext, ProgramID, Record, Response, Value, compute_function_id}, types::{Field, U16, U64}, }; use ledger_block::{Deployment, Execution, Fee, Input, Transition}; -use ledger_store::{atomic_batch_scope, FinalizeStorage, FinalizeStore}; +use ledger_store::{FinalizeStorage, FinalizeStore, atomic_batch_scope}; use synthesizer_program::{ Branch, Closure, @@ -288,13 +289,13 @@ impl Process { } } -#[cfg(any(test, feature = "test"))] +#[cfg(test)] pub mod test_helpers { use super::*; use console::{account::PrivateKey, network::MainnetV0, program::Identifier}; use ledger_block::Transition; use ledger_query::Query; - use ledger_store::{helpers::memory::BlockMemory, BlockStore}; + use ledger_store::{BlockStore, helpers::memory::BlockMemory}; use synthesizer_program::Program; use once_cell::sync::OnceCell; diff --git a/synthesizer/process/src/stack/authorization/bytes.rs b/synthesizer/process/src/stack/authorization/bytes.rs index d9caf4dfea..a8b7154919 100644 --- a/synthesizer/process/src/stack/authorization/bytes.rs +++ b/synthesizer/process/src/stack/authorization/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/authorization/mod.rs b/synthesizer/process/src/stack/authorization/mod.rs index 62d5bb513a..b7aa4b9669 100644 --- a/synthesizer/process/src/stack/authorization/mod.rs +++ b/synthesizer/process/src/stack/authorization/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/authorization/serialize.rs b/synthesizer/process/src/stack/authorization/serialize.rs index a2544427ed..04134381f2 100644 --- a/synthesizer/process/src/stack/authorization/serialize.rs +++ b/synthesizer/process/src/stack/authorization/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/authorization/string.rs b/synthesizer/process/src/stack/authorization/string.rs index 9e85b03ca8..5e2b8fc514 100644 --- a/synthesizer/process/src/stack/authorization/string.rs +++ b/synthesizer/process/src/stack/authorization/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/authorize.rs b/synthesizer/process/src/stack/authorize.rs index 6e740bd50f..1e9c55403e 100644 --- a/synthesizer/process/src/stack/authorize.rs +++ b/synthesizer/process/src/stack/authorize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 60c2650540..d5f1a805c9 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{stack::Address, CallStack, Registers, RegistersCall, StackEvaluate, StackExecute}; +use crate::{CallStack, Registers, RegistersCall, StackEvaluate, StackExecute, stack::Address}; use aleo_std::prelude::{finish, lap, timer}; use console::{ account::Field, diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 431cf2acb2..19de63e11b 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use super::*; -use rand::{rngs::StdRng, SeedableRng}; +use rand::{SeedableRng, rngs::StdRng}; impl Stack { /// Deploys the given program ID, if it does not exist. @@ -93,6 +94,12 @@ impl Stack { "The number of functions in the program does not match the number of verifying keys" ); + // Create a seeded rng to use for input value and sub-stack generation. + // This is needed to ensure that the verification results of deployments are consistent across all parties, + // because currently there is a possible flakiness due to overflows in Field to Scalar casting. + let seed = u64::from_bytes_le(&deployment.to_deployment_id()?.to_bytes_le()?[0..8])?; + let mut seeded_rng = rand_chacha::ChaChaRng::seed_from_u64(seed); + // Iterate through the program functions and construct the callstacks and corresponding assignments. for (function, (_, (verifying_key, _))) in deployment.program().functions().values().zip_eq(deployment.verifying_keys()) @@ -111,9 +118,9 @@ impl Stack { // Retrieve the external stack. let stack = self.get_external_stack(locator.program_id())?; // Sample the input. - stack.sample_value(&burner_address, &ValueType::Record(*locator.resource()), rng) + stack.sample_value(&burner_address, &ValueType::Record(*locator.resource()), &mut seeded_rng) } - _ => self.sample_value(&burner_address, input_type, rng), + _ => self.sample_value(&burner_address, input_type, &mut seeded_rng), }) .collect::>>()?; lap!(timer, "Sample the inputs"); @@ -154,7 +161,7 @@ impl Stack { } // Verify the certificates. - let rngs = (0..call_stacks.len()).map(|_| StdRng::from_seed(rng.gen())).collect::>(); + let rngs = (0..call_stacks.len()).map(|_| StdRng::from_seed(seeded_rng.gen())).collect::>(); cfg_into_iter!(call_stacks).zip_eq(deployment.verifying_keys()).zip_eq(rngs).try_for_each( |(((function_name, call_stack, assignments), (_, (verifying_key, certificate))), mut rng)| { // Synthesize the circuit. diff --git a/synthesizer/process/src/stack/evaluate.rs b/synthesizer/process/src/stack/evaluate.rs index 078a33931d..507743b54f 100644 --- a/synthesizer/process/src/stack/evaluate.rs +++ b/synthesizer/process/src/stack/evaluate.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 521619599e..f0e18ef114 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -429,9 +430,7 @@ impl StackExecute for Stack { let assignment = A::eject_assignment_and_reset(); // If the circuit is in `Synthesize` or `Execute` mode, synthesize the circuit key, if it does not exist. - if matches!(registers.call_stack(), CallStack::Synthesize(..)) - || matches!(registers.call_stack(), CallStack::Execute(..)) - { + if matches!(registers.call_stack(), CallStack::Synthesize(..) | CallStack::Execute(..)) { // If the proving key does not exist, then synthesize it. if !self.contains_proving_key(function.name()) { // Add the circuit key to the mapping. diff --git a/synthesizer/process/src/stack/finalize_registers/load.rs b/synthesizer/process/src/stack/finalize_registers/load.rs index ff161c845e..ad6f800f45 100644 --- a/synthesizer/process/src/stack/finalize_registers/load.rs +++ b/synthesizer/process/src/stack/finalize_registers/load.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/finalize_registers/mod.rs b/synthesizer/process/src/stack/finalize_registers/mod.rs index 0758ef6723..ccc02fd42d 100644 --- a/synthesizer/process/src/stack/finalize_registers/mod.rs +++ b/synthesizer/process/src/stack/finalize_registers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/finalize_registers/store.rs b/synthesizer/process/src/stack/finalize_registers/store.rs index e2eefcc7f2..4af3f55821 100644 --- a/synthesizer/process/src/stack/finalize_registers/store.rs +++ b/synthesizer/process/src/stack/finalize_registers/store.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/finalize_types/initialize.rs b/synthesizer/process/src/stack/finalize_types/initialize.rs index 5331baacdc..dfb9ad2dc1 100644 --- a/synthesizer/process/src/stack/finalize_types/initialize.rs +++ b/synthesizer/process/src/stack/finalize_types/initialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/finalize_types/matches.rs b/synthesizer/process/src/stack/finalize_types/matches.rs index aa04ace2be..0c18d430ac 100644 --- a/synthesizer/process/src/stack/finalize_types/matches.rs +++ b/synthesizer/process/src/stack/finalize_types/matches.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/finalize_types/mod.rs b/synthesizer/process/src/stack/finalize_types/mod.rs index 717e3aa496..d2563f4a71 100644 --- a/synthesizer/process/src/stack/finalize_types/mod.rs +++ b/synthesizer/process/src/stack/finalize_types/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -44,6 +45,7 @@ use synthesizer_program::{ GetOrUse, Instruction, InstructionTrait, + MAX_ADDITIONAL_SEEDS, Opcode, Operand, Program, @@ -52,7 +54,6 @@ use synthesizer_program::{ Set, StackMatches, StackProgram, - MAX_ADDITIONAL_SEEDS, }; use indexmap::IndexMap; diff --git a/synthesizer/process/src/stack/helpers/initialize.rs b/synthesizer/process/src/stack/helpers/initialize.rs index ea1c35f370..ea1d368ec0 100644 --- a/synthesizer/process/src/stack/helpers/initialize.rs +++ b/synthesizer/process/src/stack/helpers/initialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/helpers/matches.rs b/synthesizer/process/src/stack/helpers/matches.rs index 4ed9a81de7..d1aa51322e 100644 --- a/synthesizer/process/src/stack/helpers/matches.rs +++ b/synthesizer/process/src/stack/helpers/matches.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/helpers/mod.rs b/synthesizer/process/src/stack/helpers/mod.rs index 2b0884a4df..b5988c77b1 100644 --- a/synthesizer/process/src/stack/helpers/mod.rs +++ b/synthesizer/process/src/stack/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/helpers/sample.rs b/synthesizer/process/src/stack/helpers/sample.rs index ed9eaaf9d0..b5c9ff2994 100644 --- a/synthesizer/process/src/stack/helpers/sample.rs +++ b/synthesizer/process/src/stack/helpers/sample.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/helpers/synthesize.rs b/synthesizer/process/src/stack/helpers/synthesize.rs index 72d7d7bc24..3f007fc0af 100644 --- a/synthesizer/process/src/stack/helpers/synthesize.rs +++ b/synthesizer/process/src/stack/helpers/synthesize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 070b1391dd..5b3e627424 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -36,7 +37,7 @@ mod evaluate; mod execute; mod helpers; -use crate::{cost_in_microcredits, traits::*, CallMetrics, Process, Trace}; +use crate::{CallMetrics, Process, Trace, cost_in_microcredits, traits::*}; use console::{ account::{Address, PrivateKey}, network::prelude::*, @@ -64,7 +65,7 @@ use console::{ types::{Field, Group}, }; use ledger_block::{Deployment, Transition}; -use synthesizer_program::{traits::*, CallOperator, Closure, Function, Instruction, Operand, Program}; +use synthesizer_program::{CallOperator, Closure, Function, Instruction, Operand, Program, traits::*}; use synthesizer_snark::{Certificate, ProvingKey, UniversalSRS, VerifyingKey}; use aleo_std::prelude::{finish, lap, timer}; diff --git a/synthesizer/process/src/stack/register_types/initialize.rs b/synthesizer/process/src/stack/register_types/initialize.rs index f35a89f8e5..3714852a3a 100644 --- a/synthesizer/process/src/stack/register_types/initialize.rs +++ b/synthesizer/process/src/stack/register_types/initialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/register_types/matches.rs b/synthesizer/process/src/stack/register_types/matches.rs index 6c6a9bc94d..0f18c91713 100644 --- a/synthesizer/process/src/stack/register_types/matches.rs +++ b/synthesizer/process/src/stack/register_types/matches.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/register_types/mod.rs b/synthesizer/process/src/stack/register_types/mod.rs index 94479b895c..16d7e5e59d 100644 --- a/synthesizer/process/src/stack/register_types/mod.rs +++ b/synthesizer/process/src/stack/register_types/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/registers/call.rs b/synthesizer/process/src/stack/registers/call.rs index 185c64e408..08931035f3 100644 --- a/synthesizer/process/src/stack/registers/call.rs +++ b/synthesizer/process/src/stack/registers/call.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/registers/caller.rs b/synthesizer/process/src/stack/registers/caller.rs index 3839138afe..28f9816f8a 100644 --- a/synthesizer/process/src/stack/registers/caller.rs +++ b/synthesizer/process/src/stack/registers/caller.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/registers/load.rs b/synthesizer/process/src/stack/registers/load.rs index e9b43762cc..80cdb3c268 100644 --- a/synthesizer/process/src/stack/registers/load.rs +++ b/synthesizer/process/src/stack/registers/load.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/registers/mod.rs b/synthesizer/process/src/stack/registers/mod.rs index 225a194d31..5e1e0d249c 100644 --- a/synthesizer/process/src/stack/registers/mod.rs +++ b/synthesizer/process/src/stack/registers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/stack/registers/store.rs b/synthesizer/process/src/stack/registers/store.rs index 96f3718c61..3728c3c5fe 100644 --- a/synthesizer/process/src/stack/registers/store.rs +++ b/synthesizer/process/src/stack/registers/store.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/tests/mod.rs b/synthesizer/process/src/tests/mod.rs index 0a1d4bbafb..342a746f9b 100644 --- a/synthesizer/process/src/tests/mod.rs +++ b/synthesizer/process/src/tests/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index f62fa8767a..9de634854f 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,19 +17,19 @@ use crate::Process; use circuit::network::AleoV0; use console::{ account::{Address, PrivateKey}, - network::{prelude::*, MainnetV0}, + network::{MainnetV0, prelude::*}, program::{Identifier, Literal, Plaintext, ProgramID, Value}, types::U64, }; use ledger_committee::{MIN_DELEGATOR_STAKE, MIN_VALIDATOR_SELF_STAKE, MIN_VALIDATOR_STAKE}; use ledger_query::Query; use ledger_store::{ - atomic_finalize, - helpers::memory::{BlockMemory, FinalizeMemory}, BlockStore, FinalizeMode, FinalizeStorage, FinalizeStore, + atomic_finalize, + helpers::memory::{BlockMemory, FinalizeMemory}, }; use synthesizer_program::{FinalizeGlobalState, FinalizeStoreTrait, Program}; @@ -1692,7 +1693,7 @@ fn test_bond_validator_fails_if_unbonding_state() { ); assert!(rebonding_result.is_err()); - // Ensure the error wasn't due to insufficent balance + // Ensure the error wasn't due to insufficient balance let validator_balance = account_balance(&store, validator_address).unwrap(); assert!(validator_balance > MIN_VALIDATOR_STAKE); diff --git a/synthesizer/process/src/tests/test_execute.rs b/synthesizer/process/src/tests/test_execute.rs index cf2dcfd122..3af7055726 100644 --- a/synthesizer/process/src/tests/test_execute.rs +++ b/synthesizer/process/src/tests/test_execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,27 +14,27 @@ // limitations under the License. use crate::{ - traits::{StackEvaluate, StackExecute}, CallStack, Process, Stack, Trace, + traits::{StackEvaluate, StackExecute}, }; -use circuit::{network::AleoV0, Aleo}; +use circuit::{Aleo, network::AleoV0}; use console::{ account::{Address, PrivateKey, ViewKey}, - network::{prelude::*, MainnetV0}, + network::{MainnetV0, prelude::*}, program::{Identifier, Literal, Plaintext, ProgramID, Record, Value}, types::{Field, U64}, }; use ledger_block::{Fee, Transaction}; use ledger_query::Query; use ledger_store::{ - helpers::memory::{BlockMemory, FinalizeMemory}, BlockStorage, BlockStore, FinalizeStorage, FinalizeStore, + helpers::memory::{BlockMemory, FinalizeMemory}, }; use synthesizer_program::{FinalizeGlobalState, FinalizeStoreTrait, Program, StackProgram}; use synthesizer_snark::UniversalSRS; diff --git a/synthesizer/process/src/trace/call_metrics/mod.rs b/synthesizer/process/src/trace/call_metrics/mod.rs index d45fec6d94..69d7bb26ec 100644 --- a/synthesizer/process/src/trace/call_metrics/mod.rs +++ b/synthesizer/process/src/trace/call_metrics/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/trace/inclusion/mod.rs b/synthesizer/process/src/trace/inclusion/mod.rs index b61b9d0f77..0517a29460 100644 --- a/synthesizer/process/src/trace/inclusion/mod.rs +++ b/synthesizer/process/src/trace/inclusion/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,7 +20,7 @@ use crate::Stack; use console::{ network::prelude::*, - program::{InputID, StatePath, TransactionLeaf, TransitionLeaf, TransitionPath, TRANSACTION_DEPTH}, + program::{InputID, StatePath, TRANSACTION_DEPTH, TransactionLeaf, TransitionLeaf, TransitionPath}, types::{Field, Group}, }; use ledger_block::{Input, Output, Transaction, Transition}; diff --git a/synthesizer/process/src/trace/inclusion/prepare.rs b/synthesizer/process/src/trace/inclusion/prepare.rs index cdde9be46f..9fefd076a8 100644 --- a/synthesizer/process/src/trace/inclusion/prepare.rs +++ b/synthesizer/process/src/trace/inclusion/prepare.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/trace/mod.rs b/synthesizer/process/src/trace/mod.rs index 757a5d7404..8a994d79c7 100644 --- a/synthesizer/process/src/trace/mod.rs +++ b/synthesizer/process/src/trace/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/traits/mod.rs b/synthesizer/process/src/traits/mod.rs index d0b6856a8f..7d7eeddd4d 100644 --- a/synthesizer/process/src/traits/mod.rs +++ b/synthesizer/process/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/verify_deployment.rs b/synthesizer/process/src/verify_deployment.rs index f499fdebcc..3aca6313ab 100644 --- a/synthesizer/process/src/verify_deployment.rs +++ b/synthesizer/process/src/verify_deployment.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/process/src/verify_execution.rs b/synthesizer/process/src/verify_execution.rs index 7684a5099f..bc993a3e55 100644 --- a/synthesizer/process/src/verify_execution.rs +++ b/synthesizer/process/src/verify_execution.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -91,6 +92,7 @@ impl Process { // Ensure each output is valid. let num_inputs = transition.inputs().len(); + let num_outputs = transition.outputs().len(); if transition .outputs() .iter() @@ -106,6 +108,10 @@ impl Process { // Retrieve the function from the stack. let function = stack.get_function(transition.function_name())?; + // Ensure the number of inputs and outputs match the expected number in the function. + ensure!(function.inputs().len() == num_inputs, "The number of transition inputs is incorrect"); + ensure!(function.outputs().len() == num_outputs, "The number of transition outputs is incorrect"); + // Retrieve the parent program ID. // Note: The last transition in the execution does not have a parent, by definition. let parent = reverse_call_graph.get(transition.id()).and_then(|tid| execution.get_program_id(tid)); diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index 71b92dafc5..e9ec997a6b 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -164,7 +165,7 @@ impl Process { } lap!(timer, "Verify the inputs"); - // Ensure there are is one output. + // Ensure there is one output. ensure!( fee.outputs().len() == 1, "The number of outputs in the fee transition should be 1, found {}", diff --git a/synthesizer/program/Cargo.toml b/synthesizer/program/Cargo.toml index 9c1515671c..52c119291e 100644 --- a/synthesizer/program/Cargo.toml +++ b/synthesizer/program/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-synthesizer-program" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Program for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -31,12 +31,12 @@ wasm = [ "console/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.19" +version = "=1.0.0" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "account", "network", "program", "types" ] diff --git a/synthesizer/program/benches/instruction.rs b/synthesizer/program/benches/instruction.rs index fcf76c4e44..b2c4d887d5 100644 --- a/synthesizer/program/benches/instruction.rs +++ b/synthesizer/program/benches/instruction.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/bytes.rs b/synthesizer/program/src/bytes.rs index 555df50c64..ed4b83e846 100644 --- a/synthesizer/program/src/bytes.rs +++ b/synthesizer/program/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/bytes.rs b/synthesizer/program/src/closure/bytes.rs index da3b8d7264..a5c5d1483c 100644 --- a/synthesizer/program/src/closure/bytes.rs +++ b/synthesizer/program/src/closure/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/input/bytes.rs b/synthesizer/program/src/closure/input/bytes.rs index f11c4458db..2780202916 100644 --- a/synthesizer/program/src/closure/input/bytes.rs +++ b/synthesizer/program/src/closure/input/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/input/mod.rs b/synthesizer/program/src/closure/input/mod.rs index 927a089ed2..fc6958032e 100644 --- a/synthesizer/program/src/closure/input/mod.rs +++ b/synthesizer/program/src/closure/input/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/input/parse.rs b/synthesizer/program/src/closure/input/parse.rs index c233d74d8c..015ff8edae 100644 --- a/synthesizer/program/src/closure/input/parse.rs +++ b/synthesizer/program/src/closure/input/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/mod.rs b/synthesizer/program/src/closure/mod.rs index be54fddb4a..79ba179b13 100644 --- a/synthesizer/program/src/closure/mod.rs +++ b/synthesizer/program/src/closure/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/output/bytes.rs b/synthesizer/program/src/closure/output/bytes.rs index 466dfd5dc7..2d7c41c9cb 100644 --- a/synthesizer/program/src/closure/output/bytes.rs +++ b/synthesizer/program/src/closure/output/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/output/mod.rs b/synthesizer/program/src/closure/output/mod.rs index 2a07177a1b..2d9500a8dd 100644 --- a/synthesizer/program/src/closure/output/mod.rs +++ b/synthesizer/program/src/closure/output/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/output/parse.rs b/synthesizer/program/src/closure/output/parse.rs index bf2f4290cd..f0ce324cc5 100644 --- a/synthesizer/program/src/closure/output/parse.rs +++ b/synthesizer/program/src/closure/output/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/closure/parse.rs b/synthesizer/program/src/closure/parse.rs index 9560dfc924..1854b7b145 100644 --- a/synthesizer/program/src/closure/parse.rs +++ b/synthesizer/program/src/closure/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/finalize/bytes.rs b/synthesizer/program/src/finalize/bytes.rs index 21b4e250f8..7ba723b775 100644 --- a/synthesizer/program/src/finalize/bytes.rs +++ b/synthesizer/program/src/finalize/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/finalize/input/bytes.rs b/synthesizer/program/src/finalize/input/bytes.rs index 1eaf8b5dfd..06ef0e3270 100644 --- a/synthesizer/program/src/finalize/input/bytes.rs +++ b/synthesizer/program/src/finalize/input/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/finalize/input/mod.rs b/synthesizer/program/src/finalize/input/mod.rs index 1081768a45..030ea03c24 100644 --- a/synthesizer/program/src/finalize/input/mod.rs +++ b/synthesizer/program/src/finalize/input/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/finalize/input/parse.rs b/synthesizer/program/src/finalize/input/parse.rs index 7cbe05e80d..0b1b0ac864 100644 --- a/synthesizer/program/src/finalize/input/parse.rs +++ b/synthesizer/program/src/finalize/input/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/finalize/mod.rs b/synthesizer/program/src/finalize/mod.rs index d376e4554a..4c472b2f66 100644 --- a/synthesizer/program/src/finalize/mod.rs +++ b/synthesizer/program/src/finalize/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/finalize/parse.rs b/synthesizer/program/src/finalize/parse.rs index 79ca7ac9c5..2aeb0faee7 100644 --- a/synthesizer/program/src/finalize/parse.rs +++ b/synthesizer/program/src/finalize/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/bytes.rs b/synthesizer/program/src/function/bytes.rs index 50dbe7fb18..57ac395eb3 100644 --- a/synthesizer/program/src/function/bytes.rs +++ b/synthesizer/program/src/function/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/input/bytes.rs b/synthesizer/program/src/function/input/bytes.rs index 331fcdf1ec..b4c3995bcd 100644 --- a/synthesizer/program/src/function/input/bytes.rs +++ b/synthesizer/program/src/function/input/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/input/mod.rs b/synthesizer/program/src/function/input/mod.rs index 8e6887826e..f5b1f24c77 100644 --- a/synthesizer/program/src/function/input/mod.rs +++ b/synthesizer/program/src/function/input/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/input/parse.rs b/synthesizer/program/src/function/input/parse.rs index 31a8cb50e4..b90430e9a5 100644 --- a/synthesizer/program/src/function/input/parse.rs +++ b/synthesizer/program/src/function/input/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/mod.rs b/synthesizer/program/src/function/mod.rs index 24674e9777..cb1a9b6eef 100644 --- a/synthesizer/program/src/function/mod.rs +++ b/synthesizer/program/src/function/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/output/bytes.rs b/synthesizer/program/src/function/output/bytes.rs index a73eeeb333..32d01a4fa7 100644 --- a/synthesizer/program/src/function/output/bytes.rs +++ b/synthesizer/program/src/function/output/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/output/mod.rs b/synthesizer/program/src/function/output/mod.rs index 1b5fb50581..902a1d0cdc 100644 --- a/synthesizer/program/src/function/output/mod.rs +++ b/synthesizer/program/src/function/output/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/output/parse.rs b/synthesizer/program/src/function/output/parse.rs index b157beb175..394c85dcd9 100644 --- a/synthesizer/program/src/function/output/parse.rs +++ b/synthesizer/program/src/function/output/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/function/parse.rs b/synthesizer/program/src/function/parse.rs index 48258a3e0b..1a83ca8dcf 100644 --- a/synthesizer/program/src/function/parse.rs +++ b/synthesizer/program/src/function/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/import/bytes.rs b/synthesizer/program/src/import/bytes.rs index 6aea062cfd..c36eba061e 100644 --- a/synthesizer/program/src/import/bytes.rs +++ b/synthesizer/program/src/import/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/import/mod.rs b/synthesizer/program/src/import/mod.rs index 3ff0f41250..e4288f3f0b 100644 --- a/synthesizer/program/src/import/mod.rs +++ b/synthesizer/program/src/import/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/import/parse.rs b/synthesizer/program/src/import/parse.rs index ad53f31e7c..1681fb91c5 100644 --- a/synthesizer/program/src/import/parse.rs +++ b/synthesizer/program/src/import/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/lib.rs b/synthesizer/program/src/lib.rs index 6058ffa3ca..5adf88f0e1 100644 --- a/synthesizer/program/src/lib.rs +++ b/synthesizer/program/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -48,19 +49,6 @@ mod serialize; use console::{ network::prelude::{ - alt, - anyhow, - bail, - de, - ensure, - error, - fmt, - many0, - many1, - map, - map_res, - tag, - take, Debug, Deserialize, Deserializer, @@ -83,6 +71,19 @@ use console::{ ToBytesSerializer, TypeName, Write, + alt, + anyhow, + bail, + de, + ensure, + error, + fmt, + many0, + many1, + map, + map_res, + tag, + take, }, program::{Identifier, PlaintextType, ProgramID, RecordType, StructType}, }; @@ -265,7 +266,7 @@ impl, Command: CommandTrait> Pro /// Returns the function with the given name. pub fn get_function(&self, name: &Identifier) -> Result> { - self.get_function_ref(name).map(|function| function.clone()) + self.get_function_ref(name).cloned() } /// Returns a reference to the function with the given name. diff --git a/synthesizer/program/src/logic/command/await_.rs b/synthesizer/program/src/logic/command/await_.rs index 5fc745c11e..a0e2edebbe 100644 --- a/synthesizer/program/src/logic/command/await_.rs +++ b/synthesizer/program/src/logic/command/await_.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/command/branch.rs b/synthesizer/program/src/logic/command/branch.rs index 7efc86c665..ff2a1f3ea8 100644 --- a/synthesizer/program/src/logic/command/branch.rs +++ b/synthesizer/program/src/logic/command/branch.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/command/contains.rs b/synthesizer/program/src/logic/command/contains.rs index fca79405d2..375f56bdde 100644 --- a/synthesizer/program/src/logic/command/contains.rs +++ b/synthesizer/program/src/logic/command/contains.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - traits::{FinalizeStoreTrait, RegistersLoad, RegistersStore, StackMatches, StackProgram}, CallOperator, Opcode, Operand, + traits::{FinalizeStoreTrait, RegistersLoad, RegistersStore, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/command/get.rs b/synthesizer/program/src/logic/command/get.rs index 2526ed7e70..9bcf7c2dce 100644 --- a/synthesizer/program/src/logic/command/get.rs +++ b/synthesizer/program/src/logic/command/get.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - traits::{FinalizeStoreTrait, RegistersLoad, RegistersStore, StackMatches, StackProgram}, CallOperator, Opcode, Operand, + traits::{FinalizeStoreTrait, RegistersLoad, RegistersStore, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/command/get_or_use.rs b/synthesizer/program/src/logic/command/get_or_use.rs index 940694b24d..fea8d94fc9 100644 --- a/synthesizer/program/src/logic/command/get_or_use.rs +++ b/synthesizer/program/src/logic/command/get_or_use.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - traits::{FinalizeStoreTrait, RegistersLoad, RegistersStore, StackMatches, StackProgram}, CallOperator, Opcode, Operand, + traits::{FinalizeStoreTrait, RegistersLoad, RegistersStore, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/command/mod.rs b/synthesizer/program/src/logic/command/mod.rs index 187683c640..e31408db76 100644 --- a/synthesizer/program/src/logic/command/mod.rs +++ b/synthesizer/program/src/logic/command/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -40,6 +41,10 @@ mod set; pub use set::*; use crate::{ + CastType, + FinalizeOperation, + FinalizeRegistersState, + Instruction, traits::{ CommandTrait, FinalizeStoreTrait, @@ -49,10 +54,6 @@ use crate::{ StackMatches, StackProgram, }, - CastType, - FinalizeOperation, - FinalizeRegistersState, - Instruction, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/command/position.rs b/synthesizer/program/src/logic/command/position.rs index a8b738954c..7e26484e08 100644 --- a/synthesizer/program/src/logic/command/position.rs +++ b/synthesizer/program/src/logic/command/position.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/command/rand_chacha.rs b/synthesizer/program/src/logic/command/rand_chacha.rs index caf7ce6eab..44aa938c97 100644 --- a/synthesizer/program/src/logic/command/rand_chacha.rs +++ b/synthesizer/program/src/logic/command/rand_chacha.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,15 +14,15 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersStore, StackMatches, StackProgram}, FinalizeRegistersState, Opcode, Operand, + traits::{RegistersLoad, RegistersStore, StackMatches, StackProgram}, }; use console::{ network::prelude::*, program::{Literal, LiteralType, Plaintext, Register, Value}, - types::{Address, Boolean, Field, Group, Scalar, I128, I16, I32, I64, I8, U128, U16, U32, U64, U8}, + types::{Address, Boolean, Field, Group, I8, I16, I32, I64, I128, Scalar, U8, U16, U32, U64, U128}, }; use rand::SeedableRng; diff --git a/synthesizer/program/src/logic/command/remove.rs b/synthesizer/program/src/logic/command/remove.rs index 134a278c81..185a26048d 100644 --- a/synthesizer/program/src/logic/command/remove.rs +++ b/synthesizer/program/src/logic/command/remove.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - traits::{FinalizeStoreTrait, RegistersLoad, StackMatches, StackProgram}, FinalizeOperation, Opcode, Operand, + traits::{FinalizeStoreTrait, RegistersLoad, StackMatches, StackProgram}, }; use console::{network::prelude::*, program::Identifier}; diff --git a/synthesizer/program/src/logic/command/set.rs b/synthesizer/program/src/logic/command/set.rs index 9b687f5e90..68c5b9e96e 100644 --- a/synthesizer/program/src/logic/command/set.rs +++ b/synthesizer/program/src/logic/command/set.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - traits::{FinalizeStoreTrait, RegistersLoad, StackMatches, StackProgram}, FinalizeOperation, Opcode, Operand, + traits::{FinalizeStoreTrait, RegistersLoad, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/finalize_global_state/mod.rs b/synthesizer/program/src/logic/finalize_global_state/mod.rs index 7bded83d09..20fe845a09 100644 --- a/synthesizer/program/src/logic/finalize_global_state/mod.rs +++ b/synthesizer/program/src/logic/finalize_global_state/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/finalize_operation/bits.rs b/synthesizer/program/src/logic/finalize_operation/bits.rs index 16d17b9c21..7613f5711b 100644 --- a/synthesizer/program/src/logic/finalize_operation/bits.rs +++ b/synthesizer/program/src/logic/finalize_operation/bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/finalize_operation/bytes.rs b/synthesizer/program/src/logic/finalize_operation/bytes.rs index 0477bbb597..85ec3b17cb 100644 --- a/synthesizer/program/src/logic/finalize_operation/bytes.rs +++ b/synthesizer/program/src/logic/finalize_operation/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/finalize_operation/mod.rs b/synthesizer/program/src/logic/finalize_operation/mod.rs index f5130bb8aa..5e4c2c2fd4 100644 --- a/synthesizer/program/src/logic/finalize_operation/mod.rs +++ b/synthesizer/program/src/logic/finalize_operation/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/finalize_operation/serialize.rs b/synthesizer/program/src/logic/finalize_operation/serialize.rs index 7eb28bb103..18aff66762 100644 --- a/synthesizer/program/src/logic/finalize_operation/serialize.rs +++ b/synthesizer/program/src/logic/finalize_operation/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/finalize_operation/string.rs b/synthesizer/program/src/logic/finalize_operation/string.rs index 47a7051a54..080c151c37 100644 --- a/synthesizer/program/src/logic/finalize_operation/string.rs +++ b/synthesizer/program/src/logic/finalize_operation/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/instruction/bytes.rs b/synthesizer/program/src/logic/instruction/bytes.rs index 61fede6a78..04ba7f90e8 100644 --- a/synthesizer/program/src/logic/instruction/bytes.rs +++ b/synthesizer/program/src/logic/instruction/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -64,6 +65,8 @@ impl ToBytes for Instruction { let index = Instruction::::OPCODES.iter().position(|&opcode| $variant::::opcode() == opcode).unwrap(); // Serialize the instruction. + // Note that this cast is safe as the number of instructions is less than `u16::MAX`. + #[allow(clippy::cast_possible_truncation)] u16::write_le(&(index as u16),&mut $writer)?; instruction.write_le(&mut $writer)?; }),+ diff --git a/synthesizer/program/src/logic/instruction/mod.rs b/synthesizer/program/src/logic/instruction/mod.rs index 91c09fae9e..22b516e662 100644 --- a/synthesizer/program/src/logic/instruction/mod.rs +++ b/synthesizer/program/src/logic/instruction/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -38,13 +39,6 @@ use crate::traits::{ use console::{ network::Network, prelude::{ - alt, - bail, - ensure, - error, - fmt, - map, - tag, Debug, Display, Error, @@ -59,6 +53,13 @@ use console::{ Sanitizer, ToBytes, Write, + alt, + bail, + ensure, + error, + fmt, + map, + tag, }, program::{Register, RegisterType}, }; @@ -468,6 +469,7 @@ mod tests { #[test] fn test_opcodes() { // Sanity check the number of instructions is unchanged. + // Note that the number of opcodes **MUST NOT** exceed u16::MAX. assert_eq!( 68, Instruction::::OPCODES.len(), diff --git a/synthesizer/program/src/logic/instruction/opcode/mod.rs b/synthesizer/program/src/logic/instruction/opcode/mod.rs index da08374972..d24ad6afae 100644 --- a/synthesizer/program/src/logic/instruction/opcode/mod.rs +++ b/synthesizer/program/src/logic/instruction/opcode/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/instruction/operand/bytes.rs b/synthesizer/program/src/logic/instruction/operand/bytes.rs index 8e88c72fad..050cc63c9e 100644 --- a/synthesizer/program/src/logic/instruction/operand/bytes.rs +++ b/synthesizer/program/src/logic/instruction/operand/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/instruction/operand/mod.rs b/synthesizer/program/src/logic/instruction/operand/mod.rs index 29110a1618..2e05f39376 100644 --- a/synthesizer/program/src/logic/instruction/operand/mod.rs +++ b/synthesizer/program/src/logic/instruction/operand/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/instruction/operand/parse.rs b/synthesizer/program/src/logic/instruction/operand/parse.rs index cf6c76f37b..4a0c415714 100644 --- a/synthesizer/program/src/logic/instruction/operand/parse.rs +++ b/synthesizer/program/src/logic/instruction/operand/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/instruction/operation/assert.rs b/synthesizer/program/src/logic/instruction/operation/assert.rs index 769eaa789e..57b05b1a5c 100644 --- a/synthesizer/program/src/logic/instruction/operation/assert.rs +++ b/synthesizer/program/src/logic/instruction/operation/assert.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, StackMatches, StackProgram}, Opcode, Operand, + traits::{RegistersLoad, RegistersLoadCircuit, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/async_.rs b/synthesizer/program/src/logic/instruction/operation/async_.rs index 35fa6b07ec..b151dd7313 100644 --- a/synthesizer/program/src/logic/instruction/operation/async_.rs +++ b/synthesizer/program/src/logic/instruction/operation/async_.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,13 +14,13 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, StackMatches, StackProgram}, Opcode, Operand, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, Result, + traits::{RegistersLoad, StackMatches, StackProgram}, }; use circuit::{Inject, Mode}; diff --git a/synthesizer/program/src/logic/instruction/operation/call.rs b/synthesizer/program/src/logic/instruction/operation/call.rs index 627e0b32ac..b5cbaf8d51 100644 --- a/synthesizer/program/src/logic/instruction/operation/call.rs +++ b/synthesizer/program/src/logic/instruction/operation/call.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, StackMatches, StackProgram}, Opcode, Operand, + traits::{RegistersLoad, RegistersLoadCircuit, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/cast.rs b/synthesizer/program/src/logic/instruction/operation/cast.rs index 87c45a3a80..fb24f67c2b 100644 --- a/synthesizer/program/src/logic/instruction/operation/cast.rs +++ b/synthesizer/program/src/logic/instruction/operation/cast.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,6 +14,8 @@ // limitations under the License. use crate::{ + Opcode, + Operand, traits::{ RegistersLoad, RegistersLoadCircuit, @@ -23,8 +26,6 @@ use crate::{ StackMatches, StackProgram, }, - Opcode, - Operand, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/commit.rs b/synthesizer/program/src/logic/instruction/operation/commit.rs index 35904c2a94..df86369984 100644 --- a/synthesizer/program/src/logic/instruction/operation/commit.rs +++ b/synthesizer/program/src/logic/instruction/operation/commit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, Opcode, Operand, + traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/hash.rs b/synthesizer/program/src/logic/instruction/operation/hash.rs index 21acdd04ab..7a7ef228f2 100644 --- a/synthesizer/program/src/logic/instruction/operation/hash.rs +++ b/synthesizer/program/src/logic/instruction/operation/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, Opcode, Operand, + traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/is.rs b/synthesizer/program/src/logic/instruction/operation/is.rs index 21ee23905a..7a5aaa8243 100644 --- a/synthesizer/program/src/logic/instruction/operation/is.rs +++ b/synthesizer/program/src/logic/instruction/operation/is.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, Opcode, Operand, + traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/literals.rs b/synthesizer/program/src/logic/instruction/operation/literals.rs index 9201e58ebe..c2b2c630dc 100644 --- a/synthesizer/program/src/logic/instruction/operation/literals.rs +++ b/synthesizer/program/src/logic/instruction/operation/literals.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, Opcode, Operand, Operation, + traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, }; use console::{ network::prelude::*, diff --git a/synthesizer/program/src/logic/instruction/operation/macros.rs b/synthesizer/program/src/logic/instruction/operation/macros.rs index 46ced3ebbe..eeed6eef7d 100644 --- a/synthesizer/program/src/logic/instruction/operation/macros.rs +++ b/synthesizer/program/src/logic/instruction/operation/macros.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -774,7 +775,8 @@ mod tests { } // These indicators are later used in the for-loops below. is_shift_operator |= true; - shift_exceeds_bitwidth |= ((*b as u32) >= $input_a::::size_in_bits() as u32); + let input_a_size_in_bits = u32::try_from($input_a::::size_in_bits()).expect("Input size in bits exceeded u32::MAX"); + shift_exceeds_bitwidth |= ((*b as u32) >= input_a_size_in_bits); }; ("ensure divide by zero halts") => { should_succeed &= (*b) != *$input_b::::zero(); diff --git a/synthesizer/program/src/logic/instruction/operation/mod.rs b/synthesizer/program/src/logic/instruction/operation/mod.rs index 1f00110cc3..a86a0e6ebb 100644 --- a/synthesizer/program/src/logic/instruction/operation/mod.rs +++ b/synthesizer/program/src/logic/instruction/operation/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/instruction/operation/sign_verify.rs b/synthesizer/program/src/logic/instruction/operation/sign_verify.rs index 34b1e3feec..2b9c829b7d 100644 --- a/synthesizer/program/src/logic/instruction/operation/sign_verify.rs +++ b/synthesizer/program/src/logic/instruction/operation/sign_verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,9 +14,9 @@ // limitations under the License. use crate::{ - traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, Opcode, Operand, + traits::{RegistersLoad, RegistersLoadCircuit, RegistersStore, RegistersStoreCircuit, StackMatches, StackProgram}, }; use circuit::prelude::ToFields as CircuitToFields; use console::{ diff --git a/synthesizer/program/src/logic/instruction/parse.rs b/synthesizer/program/src/logic/instruction/parse.rs index 0212d13166..f701b20d04 100644 --- a/synthesizer/program/src/logic/instruction/parse.rs +++ b/synthesizer/program/src/logic/instruction/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/logic/mod.rs b/synthesizer/program/src/logic/mod.rs index 26ba868d5e..811fef97a3 100644 --- a/synthesizer/program/src/logic/mod.rs +++ b/synthesizer/program/src/logic/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/bytes.rs b/synthesizer/program/src/mapping/bytes.rs index 9f38c621b4..e7497c9fcd 100644 --- a/synthesizer/program/src/mapping/bytes.rs +++ b/synthesizer/program/src/mapping/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/key/bytes.rs b/synthesizer/program/src/mapping/key/bytes.rs index 244ca10357..0f3c4324ab 100644 --- a/synthesizer/program/src/mapping/key/bytes.rs +++ b/synthesizer/program/src/mapping/key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/key/mod.rs b/synthesizer/program/src/mapping/key/mod.rs index ed1f4005fd..7a89e69e48 100644 --- a/synthesizer/program/src/mapping/key/mod.rs +++ b/synthesizer/program/src/mapping/key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/key/parse.rs b/synthesizer/program/src/mapping/key/parse.rs index 5438873b93..af2b57d5c2 100644 --- a/synthesizer/program/src/mapping/key/parse.rs +++ b/synthesizer/program/src/mapping/key/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/mod.rs b/synthesizer/program/src/mapping/mod.rs index b7b6238626..1dfa0ebda6 100644 --- a/synthesizer/program/src/mapping/mod.rs +++ b/synthesizer/program/src/mapping/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/parse.rs b/synthesizer/program/src/mapping/parse.rs index 4f25ed546c..090ca5a074 100644 --- a/synthesizer/program/src/mapping/parse.rs +++ b/synthesizer/program/src/mapping/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/value/bytes.rs b/synthesizer/program/src/mapping/value/bytes.rs index 54355ac7f0..0412fb93ed 100644 --- a/synthesizer/program/src/mapping/value/bytes.rs +++ b/synthesizer/program/src/mapping/value/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/value/mod.rs b/synthesizer/program/src/mapping/value/mod.rs index b62104c6b8..15a3057747 100644 --- a/synthesizer/program/src/mapping/value/mod.rs +++ b/synthesizer/program/src/mapping/value/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/mapping/value/parse.rs b/synthesizer/program/src/mapping/value/parse.rs index 787aed922b..dd945ee973 100644 --- a/synthesizer/program/src/mapping/value/parse.rs +++ b/synthesizer/program/src/mapping/value/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/parse.rs b/synthesizer/program/src/parse.rs index 40929f4341..fbb70228ac 100644 --- a/synthesizer/program/src/parse.rs +++ b/synthesizer/program/src/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index fb370ef290..4e1b606f43 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/serialize.rs b/synthesizer/program/src/serialize.rs index 764c74965c..bfd64d05e0 100644 --- a/synthesizer/program/src/serialize.rs +++ b/synthesizer/program/src/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/traits/command.rs b/synthesizer/program/src/traits/command.rs index 8a50676db4..65469ba2a7 100644 --- a/synthesizer/program/src/traits/command.rs +++ b/synthesizer/program/src/traits/command.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/traits/finalize_store.rs b/synthesizer/program/src/traits/finalize_store.rs index e7496df456..17f2a4eb97 100644 --- a/synthesizer/program/src/traits/finalize_store.rs +++ b/synthesizer/program/src/traits/finalize_store.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/traits/instruction.rs b/synthesizer/program/src/traits/instruction.rs index e65e96694c..d600ee201c 100644 --- a/synthesizer/program/src/traits/instruction.rs +++ b/synthesizer/program/src/traits/instruction.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/traits/mod.rs b/synthesizer/program/src/traits/mod.rs index 2e112e8535..122ad6b5f0 100644 --- a/synthesizer/program/src/traits/mod.rs +++ b/synthesizer/program/src/traits/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index 214ea1eee6..459a064b39 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,7 +19,7 @@ use crate::{FinalizeGlobalState, Function, Operand, Program}; use console::{ account::Group, network::Network, - prelude::{bail, Result}, + prelude::{Result, bail}, program::{ Future, Identifier, diff --git a/synthesizer/program/tests/helpers/macros.rs b/synthesizer/program/tests/helpers/macros.rs index 48f6333fc3..7656195b4a 100644 --- a/synthesizer/program/tests/helpers/macros.rs +++ b/synthesizer/program/tests/helpers/macros.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/tests/helpers/mod.rs b/synthesizer/program/tests/helpers/mod.rs index 13354d9c07..6afa4164cc 100644 --- a/synthesizer/program/tests/helpers/mod.rs +++ b/synthesizer/program/tests/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/tests/helpers/sample.rs b/synthesizer/program/tests/helpers/sample.rs index 066e6c8b60..4f6395125b 100644 --- a/synthesizer/program/tests/helpers/sample.rs +++ b/synthesizer/program/tests/helpers/sample.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,8 +20,8 @@ use console::{ program::{Identifier, Literal, Plaintext, Register, Value}, }; use snarkvm_synthesizer_program::{ - traits::{RegistersStore, RegistersStoreCircuit}, FinalizeGlobalState, + traits::{RegistersStore, RegistersStoreCircuit}, }; use synthesizer_process::{Authorization, CallStack, FinalizeRegisters, Registers, Stack, StackProgramTypes}; diff --git a/synthesizer/program/tests/instruction/assert.rs b/synthesizer/program/tests/instruction/assert.rs index e35b8ac3f1..6c06918b23 100644 --- a/synthesizer/program/tests/instruction/assert.rs +++ b/synthesizer/program/tests/instruction/assert.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/tests/instruction/commit.rs b/synthesizer/program/tests/instruction/commit.rs index de594e80ac..c22f362f11 100644 --- a/synthesizer/program/tests/instruction/commit.rs +++ b/synthesizer/program/tests/instruction/commit.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,13 +24,13 @@ use console::{ program::{Identifier, Literal, LiteralType, Plaintext, Register, Value}, }; use snarkvm_synthesizer_program::{ - CommitBHP1024, CommitBHP256, CommitBHP512, CommitBHP768, + CommitBHP1024, CommitInstruction, - CommitPED128, CommitPED64, + CommitPED128, Opcode, Operand, Program, diff --git a/synthesizer/program/tests/instruction/hash.rs b/synthesizer/program/tests/instruction/hash.rs index eb55772311..106474e978 100644 --- a/synthesizer/program/tests/instruction/hash.rs +++ b/synthesizer/program/tests/instruction/hash.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -23,16 +24,16 @@ use console::{ program::{Identifier, Literal, LiteralType, Plaintext, PlaintextType, Register, Value}, }; use snarkvm_synthesizer_program::{ - HashBHP1024, HashBHP256, HashBHP512, HashBHP768, + HashBHP1024, HashInstruction, HashKeccak256, HashKeccak384, HashKeccak512, - HashPED128, HashPED64, + HashPED128, HashPSD2, HashPSD4, HashPSD8, diff --git a/synthesizer/program/tests/instruction/is.rs b/synthesizer/program/tests/instruction/is.rs index c281085d6c..1d58f84cdd 100644 --- a/synthesizer/program/tests/instruction/is.rs +++ b/synthesizer/program/tests/instruction/is.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/tests/instruction/mod.rs b/synthesizer/program/tests/instruction/mod.rs index 715fdb7c64..777ba1fffc 100644 --- a/synthesizer/program/tests/instruction/mod.rs +++ b/synthesizer/program/tests/instruction/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/program/tests/lib.rs b/synthesizer/program/tests/lib.rs index dc13bcd7b4..646af98135 100644 --- a/synthesizer/program/tests/lib.rs +++ b/synthesizer/program/tests/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/Cargo.toml b/synthesizer/snark/Cargo.toml index 1d63ac19fb..701e7dfc1e 100644 --- a/synthesizer/snark/Cargo.toml +++ b/synthesizer/snark/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-synthesizer-snark" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "SNARK wrappers for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -33,18 +33,18 @@ wasm = [ "console/wasm", "snarkvm-algorithms/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.19" +version = "=1.0.0" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "network" ] [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.19" +version = "=1.0.0" [dependencies.bincode] version = "1" diff --git a/synthesizer/snark/src/certificate/bytes.rs b/synthesizer/snark/src/certificate/bytes.rs index df0ebfecef..fb5270d5b2 100644 --- a/synthesizer/snark/src/certificate/bytes.rs +++ b/synthesizer/snark/src/certificate/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/certificate/mod.rs b/synthesizer/snark/src/certificate/mod.rs index 0e16febfd9..adbc4ca00c 100644 --- a/synthesizer/snark/src/certificate/mod.rs +++ b/synthesizer/snark/src/certificate/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -67,6 +68,7 @@ impl Certificate { let fiat_shamir = N::varuna_fs_parameters(); // Verify the certificate. + #[allow(clippy::manual_unwrap_or_default)] match Varuna::::verify_vk(universal_verifier, fiat_shamir, assignment, verifying_key, self) { Ok(is_valid) => { #[cfg(feature = "aleo-cli")] diff --git a/synthesizer/snark/src/certificate/parse.rs b/synthesizer/snark/src/certificate/parse.rs index cc22051156..0bb7ee9f95 100644 --- a/synthesizer/snark/src/certificate/parse.rs +++ b/synthesizer/snark/src/certificate/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/certificate/serialize.rs b/synthesizer/snark/src/certificate/serialize.rs index 3b74b8e7ca..893cba2427 100644 --- a/synthesizer/snark/src/certificate/serialize.rs +++ b/synthesizer/snark/src/certificate/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/lib.rs b/synthesizer/snark/src/lib.rs index 458d684ce7..4abcb2b580 100644 --- a/synthesizer/snark/src/lib.rs +++ b/synthesizer/snark/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ #![warn(clippy::cast_possible_truncation)] #![cfg_attr(not(feature = "aleo-cli"), allow(unused_variables))] -use console::network::{prelude::*, FiatShamir}; +use console::network::{FiatShamir, prelude::*}; use snarkvm_algorithms::{snark::varuna, traits::SNARK}; use once_cell::sync::OnceCell; @@ -165,7 +166,7 @@ mod test { fn test_varuna_verify_public_input_size() { /// Creates a simple circuit: a * b. fn create_assignment() -> circuit::Assignment<::Field> { - use circuit::{environment::Mode, types::Field, Inject}; + use circuit::{Inject, environment::Mode, types::Field}; // Ensure the circuit environment is clean. Circuit::reset(); diff --git a/synthesizer/snark/src/proof/bytes.rs b/synthesizer/snark/src/proof/bytes.rs index e343178603..447253a317 100644 --- a/synthesizer/snark/src/proof/bytes.rs +++ b/synthesizer/snark/src/proof/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proof/mod.rs b/synthesizer/snark/src/proof/mod.rs index 745e087c07..a31302e07d 100644 --- a/synthesizer/snark/src/proof/mod.rs +++ b/synthesizer/snark/src/proof/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proof/parse.rs b/synthesizer/snark/src/proof/parse.rs index 9fc9fdd3a0..ab234a66f8 100644 --- a/synthesizer/snark/src/proof/parse.rs +++ b/synthesizer/snark/src/proof/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proof/serialize.rs b/synthesizer/snark/src/proof/serialize.rs index 2accff2e6e..bce458518d 100644 --- a/synthesizer/snark/src/proof/serialize.rs +++ b/synthesizer/snark/src/proof/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proving_key/bytes.rs b/synthesizer/snark/src/proving_key/bytes.rs index c47536b6ba..85221ed5fc 100644 --- a/synthesizer/snark/src/proving_key/bytes.rs +++ b/synthesizer/snark/src/proving_key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proving_key/mod.rs b/synthesizer/snark/src/proving_key/mod.rs index 5f13807c33..6113878c16 100644 --- a/synthesizer/snark/src/proving_key/mod.rs +++ b/synthesizer/snark/src/proving_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proving_key/parse.rs b/synthesizer/snark/src/proving_key/parse.rs index 3d47a1e5ed..f48a363696 100644 --- a/synthesizer/snark/src/proving_key/parse.rs +++ b/synthesizer/snark/src/proving_key/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/proving_key/serialize.rs b/synthesizer/snark/src/proving_key/serialize.rs index 2a7ac7250e..5af18f0741 100644 --- a/synthesizer/snark/src/proving_key/serialize.rs +++ b/synthesizer/snark/src/proving_key/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/universal_srs.rs b/synthesizer/snark/src/universal_srs.rs index 5abb721558..b9993a2dde 100644 --- a/synthesizer/snark/src/universal_srs.rs +++ b/synthesizer/snark/src/universal_srs.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/verifying_key/bytes.rs b/synthesizer/snark/src/verifying_key/bytes.rs index 542656c603..19db5d0f2a 100644 --- a/synthesizer/snark/src/verifying_key/bytes.rs +++ b/synthesizer/snark/src/verifying_key/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/verifying_key/mod.rs b/synthesizer/snark/src/verifying_key/mod.rs index 07e8db1e28..293c532083 100644 --- a/synthesizer/snark/src/verifying_key/mod.rs +++ b/synthesizer/snark/src/verifying_key/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -49,6 +50,7 @@ impl VerifyingKey { let fiat_shamir = N::varuna_fs_parameters(); // Verify the proof. + #[allow(clippy::manual_unwrap_or_default)] match Varuna::::verify(universal_verifier, fiat_shamir, self, inputs, proof) { Ok(is_valid) => { #[cfg(feature = "aleo-cli")] diff --git a/synthesizer/snark/src/verifying_key/parse.rs b/synthesizer/snark/src/verifying_key/parse.rs index eff9515eee..374bfed621 100644 --- a/synthesizer/snark/src/verifying_key/parse.rs +++ b/synthesizer/snark/src/verifying_key/parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/snark/src/verifying_key/serialize.rs b/synthesizer/snark/src/verifying_key/serialize.rs index 84c2ddb11c..9903f58704 100644 --- a/synthesizer/snark/src/verifying_key/serialize.rs +++ b/synthesizer/snark/src/verifying_key/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/lib.rs b/synthesizer/src/lib.rs index 58904d39b4..be4c9595ec 100644 --- a/synthesizer/src/lib.rs +++ b/synthesizer/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/restrictions/helpers/argument_locator.rs b/synthesizer/src/restrictions/helpers/argument_locator.rs index 1f733a6c5d..7e7fbcafc9 100644 --- a/synthesizer/src/restrictions/helpers/argument_locator.rs +++ b/synthesizer/src/restrictions/helpers/argument_locator.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/restrictions/helpers/block_range.rs b/synthesizer/src/restrictions/helpers/block_range.rs index 9e61e90bec..9c84bcef6a 100644 --- a/synthesizer/src/restrictions/helpers/block_range.rs +++ b/synthesizer/src/restrictions/helpers/block_range.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use console::{ network::Network, - prelude::{de, Deserialize, Deserializer, EnumAccess, One, Result, Serialize, Serializer, VariantAccess, Visitor}, + prelude::{Deserialize, Deserializer, EnumAccess, One, Result, Serialize, Serializer, VariantAccess, Visitor, de}, types::Field, }; @@ -161,7 +162,7 @@ impl<'de> Deserialize<'de> for BlockRange { Ok(BlockRange::RangeInclusive(RangeInclusive::new(start, end))) } Field::FullRange => { - variant.newtype_variant()?; + variant.unit_variant()?; Ok(BlockRange::FullRange) } } diff --git a/synthesizer/src/restrictions/helpers/mod.rs b/synthesizer/src/restrictions/helpers/mod.rs index 221dad23e0..62ecb40d57 100644 --- a/synthesizer/src/restrictions/helpers/mod.rs +++ b/synthesizer/src/restrictions/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/restrictions/mod.rs b/synthesizer/src/restrictions/mod.rs index 67b01f6fcb..b9e5db26fc 100644 --- a/synthesizer/src/restrictions/mod.rs +++ b/synthesizer/src/restrictions/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/restrictions/serialize.rs b/synthesizer/src/restrictions/serialize.rs index 3433e56899..81898fe6c7 100644 --- a/synthesizer/src/restrictions/serialize.rs +++ b/synthesizer/src/restrictions/serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/restrictions/string.rs b/synthesizer/src/restrictions/string.rs index 0e351e5c80..293ae079d5 100644 --- a/synthesizer/src/restrictions/string.rs +++ b/synthesizer/src/restrictions/string.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/authorize.rs b/synthesizer/src/vm/authorize.rs index 75aed8d4c4..4e51e88813 100644 --- a/synthesizer/src/vm/authorize.rs +++ b/synthesizer/src/vm/authorize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/deploy.rs b/synthesizer/src/vm/deploy.rs index f9e260793c..e8104291ea 100644 --- a/synthesizer/src/vm/deploy.rs +++ b/synthesizer/src/vm/deploy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/execute.rs b/synthesizer/src/vm/execute.rs index c8888a735b..1b6d54e5f4 100644 --- a/synthesizer/src/vm/execute.rs +++ b/synthesizer/src/vm/execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 1ab759736b..2cbef6359a 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/helpers/committee.rs b/synthesizer/src/vm/helpers/committee.rs index ea91527c47..77a51bb695 100644 --- a/synthesizer/src/vm/helpers/committee.rs +++ b/synthesizer/src/vm/helpers/committee.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -19,12 +20,12 @@ use console::{ network::Network, prelude::{cfg_into_iter, cfg_iter, cfg_reduce}, program::{Identifier, Literal, Plaintext, Value}, - types::{Boolean, U64, U8}, + types::{Boolean, U8, U64}, }; use ledger_committee::Committee; -use anyhow::{bail, ensure, Result}; -use indexmap::{indexmap, IndexMap}; +use anyhow::{Result, bail, ensure}; +use indexmap::{IndexMap, indexmap}; use std::str::FromStr; #[cfg(not(feature = "serial"))] diff --git a/synthesizer/src/vm/helpers/history.rs b/synthesizer/src/vm/helpers/history.rs index efea1e1825..568d93f624 100644 --- a/synthesizer/src/vm/helpers/history.rs +++ b/synthesizer/src/vm/helpers/history.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use console::prelude::{Deserialize, Serialize}; -use aleo_std::{aleo_ledger_dir, StorageMode}; +use aleo_std::{StorageMode, aleo_ledger_dir}; use anyhow::Result; use serde_json; diff --git a/synthesizer/src/vm/helpers/macros.rs b/synthesizer/src/vm/helpers/macros.rs index 1859ec2934..0309e825ef 100644 --- a/synthesizer/src/vm/helpers/macros.rs +++ b/synthesizer/src/vm/helpers/macros.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/helpers/mod.rs b/synthesizer/src/vm/helpers/mod.rs index 7b9b7c238c..bb9ae9dcd8 100644 --- a/synthesizer/src/vm/helpers/mod.rs +++ b/synthesizer/src/vm/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/src/vm/helpers/rewards.rs b/synthesizer/src/vm/helpers/rewards.rs index 24c03c4d4c..54ac028a26 100644 --- a/synthesizer/src/vm/helpers/rewards.rs +++ b/synthesizer/src/vm/helpers/rewards.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -36,9 +37,10 @@ const MAX_COINBASE_REWARD: u64 = ledger_block::MAX_COINBASE_REWARD; // Coinbase /// of the total stake will not receive a staking reward. In addition, this method /// ensures delegators who have less than 10,000 credits are not eligible for a staking reward. /// -/// The choice of 25% is to ensure at least 4 validators are operational at any given time, -/// since our security model adheres to 3f+1, where f=1. As such, we tolerate Byzantine behavior -/// up to 33% of the total stake. +/// The choice of 25% is to ensure at least 4 validators are operational at any given time. +/// Our security model tolerates Byzantines behavior by validators staking up to f stake, +/// where f = max{m: integer | m < N/3}, N being the total amount staked. +/// Therefore, 1 Byzantine validator out of 4 equal-staked validators will be tolerated. pub fn staking_rewards( stakers: &IndexMap, (Address, u64)>, committee: &Committee, diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index d1750c614b..0be0f85440 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -21,7 +22,7 @@ mod execute; mod finalize; mod verify; -use crate::{cast_mut_ref, cast_ref, convert, process, Restrictions}; +use crate::{Restrictions, cast_mut_ref, cast_ref, convert, process}; use console::{ account::{Address, PrivateKey}, network::prelude::*, @@ -44,10 +45,10 @@ use ledger_block::{ Transactions, }; use ledger_committee::Committee; +use ledger_narwhal_data::Data; use ledger_puzzle::Puzzle; use ledger_query::Query; use ledger_store::{ - atomic_finalize, BlockStore, ConsensusStorage, ConsensusStore, @@ -56,8 +57,9 @@ use ledger_store::{ TransactionStorage, TransactionStore, TransitionStore, + atomic_finalize, }; -use synthesizer_process::{deployment_cost, execution_cost, Authorization, Process, Trace}; +use synthesizer_process::{Authorization, Process, Trace, deployment_cost, execution_cost}; use synthesizer_program::{FinalizeGlobalState, FinalizeOperation, FinalizeStoreTrait, Program}; use utilities::try_vm_runtime; @@ -66,7 +68,7 @@ use indexmap::{IndexMap, IndexSet}; use itertools::Either; use lru::LruCache; use parking_lot::{Mutex, RwLock}; -use rand::{rngs::StdRng, SeedableRng}; +use rand::{SeedableRng, rngs::StdRng}; use std::{collections::HashSet, num::NonZeroUsize, sync::Arc}; #[cfg(not(feature = "serial"))] @@ -81,7 +83,7 @@ pub struct VM> { /// The VM store. store: ConsensusStore, /// A cache containing the list of recent partially-verified transactions. - partially_verified_transactions: Arc>>, + partially_verified_transactions: Arc>>, /// The restrictions list. restrictions: Restrictions, /// The lock to guarantee atomicity over calls to speculate and finalize. @@ -218,7 +220,7 @@ impl> VM { /// Returns the partially-verified transactions. #[inline] - pub fn partially_verified_transactions(&self) -> Arc>> { + pub fn partially_verified_transactions(&self) -> Arc>> { self.partially_verified_transactions.clone() } @@ -441,19 +443,15 @@ impl> VM { // Note: This call is guaranteed to succeed (without error), because `DISCARD_BATCH == true`. self.block_store().unpause_atomic_writes::()?; // Rollback the Merkle tree. - self.block_store().remove_last_n_from_tree_only(1).map_err(|removal_error| { + self.block_store().remove_last_n_from_tree_only(1).inspect_err(|_| { // Log the finalize error. error!("Failed to finalize block {} - {finalize_error}", block.height()); - // Return the removal error. - removal_error })?; } else { // Rollback the block. - self.block_store().remove_last_n(1).map_err(|removal_error| { + self.block_store().remove_last_n(1).inspect_err(|_| { // Log the finalize error. error!("Failed to finalize block {} - {finalize_error}", block.height()); - // Return the removal error. - removal_error })?; } // Return the finalize error. @@ -481,7 +479,6 @@ pub(crate) mod test_helpers { use indexmap::IndexMap; use once_cell::sync::OnceCell; - use std::borrow::Borrow; #[cfg(feature = "rocks")] use std::path::Path; use synthesizer_snark::VerifyingKey; @@ -763,8 +760,7 @@ function compute: rng: &mut R, ) -> Result> { // Get the most recent block. - let block_hash = - vm.block_store().get_block_hash(*vm.block_store().heights().max().unwrap().borrow()).unwrap().unwrap(); + let block_hash = vm.block_store().get_block_hash(vm.block_store().max_height().unwrap()).unwrap().unwrap(); let previous_block = vm.block_store().get_block(&block_hash).unwrap().unwrap(); // Construct the new block header. diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index 4f9372a4ea..5a2a2d3617 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -134,8 +135,12 @@ impl> VM { // First, verify the fee. self.check_fee(transaction, rejected_id)?; + // Construct the transaction checksum. + let checksum = Data::>::Buffer(transaction.to_bytes_le()?.into()).to_checksum::()?; + // Check if the transaction exists in the partially-verified cache. - let is_partially_verified = self.partially_verified_transactions.read().peek(&transaction.id()).is_some(); + let is_partially_verified = + self.partially_verified_transactions.read().peek(&(transaction.id())) == Some(&checksum); // Next, verify the deployment or execution. match transaction { @@ -188,7 +193,7 @@ impl> VM { // If the above checks have passed and this is not a fee transaction, // then add the transaction ID to the partially-verified transactions cache. if !matches!(transaction, Transaction::Fee(..)) && !is_partially_verified { - self.partially_verified_transactions.write().push(transaction.id(), ()); + self.partially_verified_transactions.write().push(transaction.id(), checksum); } finish!(timer, "Verify the transaction"); @@ -383,7 +388,7 @@ mod tests { account::{Address, ViewKey}, types::Field, }; - use ledger_block::{Block, Header, Metadata, Transaction}; + use ledger_block::{Block, Header, Metadata, Transaction, Transition}; type CurrentNetwork = test_helpers::CurrentNetwork; @@ -641,4 +646,73 @@ function compute: // Ensure that the program can't be deployed. assert!(vm.deploy_raw(&program, rng).is_err()); } + + #[test] + fn test_check_mutated_execution() { + let rng = &mut TestRng::default(); + + // Initialize the VM. + let vm = crate::vm::test_helpers::sample_vm(); + // Fetch the caller's private key. + let caller_private_key = crate::vm::test_helpers::sample_genesis_private_key(rng); + // Initialize the genesis block. + let genesis = crate::vm::test_helpers::sample_genesis_block(rng); + // Update the VM. + vm.add_next_block(&genesis).unwrap(); + + // Fetch a valid execution transaction with a public fee. + let valid_transaction = crate::vm::test_helpers::sample_execution_transaction_with_public_fee(rng); + vm.check_transaction(&valid_transaction, None, rng).unwrap(); + + // Mutate the execution transaction by inserting a Field::Zero as an output. + let execution = valid_transaction.execution().unwrap(); + + // Extract the first transition from the execution. + let transitions: Vec<_> = execution.transitions().collect(); + assert_eq!(transitions.len(), 1); + let transition = transitions[0].clone(); + + // Mutate the transition by adding an additional `Field::zero` output. This is significant because the Varuna + // verifier pads the inputs with `Field::zero`s, which means that the same proof is valid for both the + // original and the mutated executions. + let added_output = Output::ExternalRecord(Field::zero()); + let mutated_outputs = [transition.outputs(), &[added_output]].concat(); + let mutated_transition = Transition::new( + *transition.program_id(), + *transition.function_name(), + transition.inputs().to_vec(), + mutated_outputs, + *transition.tpk(), + *transition.tcm(), + *transition.scm(), + ) + .unwrap(); + + // Construct the mutated execution. + let mutated_execution = Execution::from( + [mutated_transition].into_iter(), + execution.global_state_root(), + execution.proof().cloned(), + ) + .unwrap(); + + // Authorize the fee. + let authorization = vm + .authorize_fee_public( + &caller_private_key, + 10_000_000, + 100, + mutated_execution.to_execution_id().unwrap(), + rng, + ) + .unwrap(); + // Compute the fee. + let fee = vm.execute_fee_authorization(authorization, None, rng).unwrap(); + + // Construct the transaction. + let mutated_transaction = Transaction::from_execution(mutated_execution, Some(fee)).unwrap(); + + // Ensure that the mutated transaction fails verification due to an extra output. + assert!(vm.check_transaction(&mutated_transaction, None, rng).is_err()); + } } diff --git a/synthesizer/tests/test_command_parse.rs b/synthesizer/tests/test_command_parse.rs index f8402b0061..d6cbd0e112 100644 --- a/synthesizer/tests/test_command_parse.rs +++ b/synthesizer/tests/test_command_parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/tests/test_instruction_parse.rs b/synthesizer/tests/test_instruction_parse.rs index 2c4f8ff58f..116967c607 100644 --- a/synthesizer/tests/test_instruction_parse.rs +++ b/synthesizer/tests/test_instruction_parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/tests/test_process_execute.rs b/synthesizer/tests/test_process_execute.rs index d57b5b91cf..8d63e707fd 100644 --- a/synthesizer/tests/test_process_execute.rs +++ b/synthesizer/tests/test_process_execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -58,7 +59,7 @@ fn run_test(process: Process, test: &ProgramTest) -> serde_yaml: for program in test.programs() { if let Err(err) = process.add_program(program) { output - .get_mut(&serde_yaml::Value::String("errors".to_string())) + .get_mut(serde_yaml::Value::String("errors".to_string())) .unwrap() .as_sequence_mut() .unwrap() diff --git a/synthesizer/tests/test_program_parse.rs b/synthesizer/tests/test_program_parse.rs index 17c06e272b..c51a6ecaeb 100644 --- a/synthesizer/tests/test_program_parse.rs +++ b/synthesizer/tests/test_program_parse.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/tests/test_vm_execute_and_finalize.rs b/synthesizer/tests/test_vm_execute_and_finalize.rs index 01a5f282a7..0eeb15aa79 100644 --- a/synthesizer/tests/test_vm_execute_and_finalize.rs +++ b/synthesizer/tests/test_vm_execute_and_finalize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ mod utilities; use console::{ account::{PrivateKey, ViewKey}, network::prelude::*, - program::{Entry, Identifier, Literal, Plaintext, ProgramID, Record, Value, U64}, + program::{Entry, Identifier, Literal, Plaintext, ProgramID, Record, U64, Value}, types::{Boolean, Field}, }; use ledger_block::{ @@ -30,15 +31,14 @@ use ledger_block::{ Transactions, Transition, }; -use ledger_store::{helpers::memory::ConsensusMemory, ConsensusStorage, ConsensusStore}; -use snarkvm_synthesizer::{program::FinalizeOperation, VM}; +use ledger_store::{ConsensusStorage, ConsensusStore, helpers::memory::ConsensusMemory}; +use snarkvm_synthesizer::{VM, program::FinalizeOperation}; use synthesizer_program::FinalizeGlobalState; use anyhow::Result; use console::account::Address; use indexmap::IndexMap; use rayon::prelude::*; -use std::borrow::Borrow; use utilities::*; #[test] @@ -457,8 +457,7 @@ fn construct_next_block, R: Rng + CryptoRng> rng: &mut R, ) -> Result> { // Get the most recent block. - let block_hash = - vm.block_store().get_block_hash(*vm.block_store().heights().max().unwrap().borrow()).unwrap().unwrap(); + let block_hash = vm.block_store().get_block_hash(vm.block_store().max_height().unwrap()).unwrap().unwrap(); let previous_block = vm.block_store().get_block(&block_hash).unwrap().unwrap(); // Construct the metadata associated with the block. @@ -523,7 +522,7 @@ fn construct_finalize_global_state>( vm: &VM, ) -> FinalizeGlobalState { // Retrieve the latest block. - let block_height = *vm.block_store().heights().max().unwrap().clone(); + let block_height = vm.block_store().max_height().unwrap(); let latest_block_hash = vm.block_store().get_block_hash(block_height).unwrap().unwrap(); let latest_block = vm.block_store().get_block(&latest_block_hash).unwrap().unwrap(); // Retrieve the latest round. diff --git a/synthesizer/tests/utilities/expectation.rs b/synthesizer/tests/utilities/expectation.rs index 549718ba7c..47e2a9f0cf 100644 --- a/synthesizer/tests/utilities/expectation.rs +++ b/synthesizer/tests/utilities/expectation.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/tests/utilities/mod.rs b/synthesizer/tests/utilities/mod.rs index 665327b579..74b45bc6d6 100644 --- a/synthesizer/tests/utilities/mod.rs +++ b/synthesizer/tests/utilities/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/tests/utilities/tests/file_parse_test.rs b/synthesizer/tests/utilities/tests/file_parse_test.rs index 035811d6b1..66da5c350a 100644 --- a/synthesizer/tests/utilities/tests/file_parse_test.rs +++ b/synthesizer/tests/utilities/tests/file_parse_test.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{get_expectation_path, print_difference, ExpectedTest}; +use crate::{ExpectedTest, get_expectation_path, print_difference}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use std::path::{Path, PathBuf}; /// A test for a parser, where the entire file is the test input. diff --git a/synthesizer/tests/utilities/tests/line_parse_test.rs b/synthesizer/tests/utilities/tests/line_parse_test.rs index 5456f26bb5..af27483727 100644 --- a/synthesizer/tests/utilities/tests/line_parse_test.rs +++ b/synthesizer/tests/utilities/tests/line_parse_test.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{get_expectation_path, print_difference, ExpectedTest}; +use crate::{ExpectedTest, get_expectation_path, print_difference}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use itertools::Itertools; use std::path::{Path, PathBuf}; diff --git a/synthesizer/tests/utilities/tests/mod.rs b/synthesizer/tests/utilities/tests/mod.rs index f42ebac475..941df4b18a 100644 --- a/synthesizer/tests/utilities/tests/mod.rs +++ b/synthesizer/tests/utilities/tests/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/synthesizer/tests/utilities/tests/program_test.rs b/synthesizer/tests/utilities/tests/program_test.rs index 71290b0a0b..713b700f5e 100644 --- a/synthesizer/tests/utilities/tests/program_test.rs +++ b/synthesizer/tests/utilities/tests/program_test.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{get_expectation_path, print_difference, CurrentNetwork, ExpectedTest}; +use crate::{CurrentNetwork, ExpectedTest, get_expectation_path, print_difference}; use console::{account::PrivateKey, program::Identifier}; use snarkvm_synthesizer::program::Program; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use itertools::Itertools; use serde_yaml::{Mapping, Sequence, Value}; use std::{ @@ -140,8 +141,8 @@ impl ExpectedTest for ProgramTest { if !self.rewrite { // Check that the errors match. let expected_errors = - self.expected.get(&Value::String("errors".to_string())).unwrap().as_sequence().unwrap(); - let actual_errors = output.get(&Value::String("errors".to_string())).unwrap().as_sequence().unwrap(); + self.expected.get(Value::String("errors".to_string())).unwrap().as_sequence().unwrap(); + let actual_errors = output.get(Value::String("errors".to_string())).unwrap().as_sequence().unwrap(); expected_errors.iter().zip_eq(actual_errors.iter()).for_each(|(expected, actual)| { if expected != actual { let expected = @@ -152,8 +153,8 @@ impl ExpectedTest for ProgramTest { }); // Check that the outputs match. let expected_outputs = - self.expected.get(&Value::String("outputs".to_string())).unwrap().as_sequence().unwrap(); - let actual_outputs = output.get(&Value::String("outputs".to_string())).unwrap().as_sequence().unwrap(); + self.expected.get(Value::String("outputs".to_string())).unwrap().as_sequence().unwrap(); + let actual_outputs = output.get(Value::String("outputs".to_string())).unwrap().as_sequence().unwrap(); self.cases.iter().zip_eq(expected_outputs.iter().zip_eq(actual_outputs.iter())).for_each( |(test, (expected, actual))| { if expected != actual { diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 0614b4f1f9..be9f7256b4 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-utilities" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Utilities for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities-derives] path = "./derives" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.aleo-std] diff --git a/utilities/derives/Cargo.toml b/utilities/derives/Cargo.toml index 560b7cfdff..0191b6565e 100644 --- a/utilities/derives/Cargo.toml +++ b/utilities/derives/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-utilities-derives" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "Canonical serialization for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", diff --git a/utilities/derives/src/canonical_deserialize.rs b/utilities/derives/src/canonical_deserialize.rs index 7dfc4397c4..1349f0a199 100644 --- a/utilities/derives/src/canonical_deserialize.rs +++ b/utilities/derives/src/canonical_deserialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/derives/src/canonical_serialize.rs b/utilities/derives/src/canonical_serialize.rs index 794eec190a..3e7d8b2053 100644 --- a/utilities/derives/src/canonical_serialize.rs +++ b/utilities/derives/src/canonical_serialize.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,7 +14,7 @@ // limitations under the License. use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{Data, Index, Type}; pub(crate) enum IdentOrIndex { diff --git a/utilities/derives/src/lib.rs b/utilities/derives/src/lib.rs index 7e1938bbc9..13e24006b2 100644 --- a/utilities/derives/src/lib.rs +++ b/utilities/derives/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/biginteger/bigint_256.rs b/utilities/src/biginteger/bigint_256.rs index 02c8438379..ac9f78d7db 100644 --- a/utilities/src/biginteger/bigint_256.rs +++ b/utilities/src/biginteger/bigint_256.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,21 +14,21 @@ // limitations under the License. use crate::{ - biginteger::BigInteger, - bititerator::{BitIteratorBE, BitIteratorLE}, - io::{Read, Result as IoResult, Write}, FromBits, FromBytes, ToBits, ToBytes, + biginteger::BigInteger, + bititerator::{BitIteratorBE, BitIteratorLE}, + io::{Read, Result as IoResult, Write}, }; use anyhow::Result; use core::fmt::{Debug, Display}; use num_bigint::BigUint; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use zeroize::Zeroize; @@ -229,12 +230,16 @@ impl crate::biginteger::BigInteger for BigInteger256 { impl ToBits for BigInteger256 { #[doc = " Returns `self` as a boolean array in little-endian order, with trailing zeros."] fn write_bits_le(&self, vec: &mut Vec) { - vec.extend(BitIteratorLE::new(self)); + let iter = BitIteratorLE::new(self); + vec.reserve(iter.len()); + vec.extend(iter); } #[doc = " Returns `self` as a boolean array in big-endian order, with leading zeros."] fn write_bits_be(&self, vec: &mut Vec) { - vec.extend(BitIteratorBE::new(self)); + let iter = BitIteratorBE::new(self); + vec.reserve(iter.len()); + vec.extend(iter); } } diff --git a/utilities/src/biginteger/bigint_384.rs b/utilities/src/biginteger/bigint_384.rs index 6177a5cffa..4ee46574a5 100644 --- a/utilities/src/biginteger/bigint_384.rs +++ b/utilities/src/biginteger/bigint_384.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,21 +14,21 @@ // limitations under the License. use crate::{ - biginteger::BigInteger, - bititerator::{BitIteratorBE, BitIteratorLE}, - io::{Read, Result as IoResult, Write}, FromBits, FromBytes, ToBits, ToBytes, + biginteger::BigInteger, + bititerator::{BitIteratorBE, BitIteratorLE}, + io::{Read, Result as IoResult, Write}, }; use anyhow::Result; use core::fmt::{Debug, Display}; use num_bigint::BigUint; use rand::{ - distributions::{Distribution, Standard}, Rng, + distributions::{Distribution, Standard}, }; use zeroize::Zeroize; diff --git a/utilities/src/biginteger/mod.rs b/utilities/src/biginteger/mod.rs index 34fe2e1d4b..e404bb1648 100644 --- a/utilities/src/biginteger/mod.rs +++ b/utilities/src/biginteger/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{rand::Uniform, FromBits, FromBytes, ToBits, ToBytes}; +use crate::{FromBits, FromBytes, ToBits, ToBytes, rand::Uniform}; use num_bigint::BigUint; use std::fmt::{Debug, Display}; diff --git a/utilities/src/biginteger/tests.rs b/utilities/src/biginteger/tests.rs index d76b7d72f6..f21af15a30 100644 --- a/utilities/src/biginteger/tests.rs +++ b/utilities/src/biginteger/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/bititerator.rs b/utilities/src/bititerator.rs index 90b2340b0f..53b46f7279 100644 --- a/utilities/src/bititerator.rs +++ b/utilities/src/bititerator.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/bits.rs b/utilities/src/bits.rs index 53e9a04c44..257ebff250 100644 --- a/utilities/src/bits.rs +++ b/utilities/src/bits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use crate::Vec; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; /// Takes as input a sequence of objects, and converts them to a series of little-endian bits. /// All traits that implement `ToBits` can be automatically converted to bits in this manner. @@ -318,7 +319,7 @@ mod tests { use crate::{TestRng, Uniform}; use anyhow::Result; - use rand::{distributions::Alphanumeric, Rng}; + use rand::{Rng, distributions::Alphanumeric}; const ITERATIONS: u64 = 10000; diff --git a/utilities/src/bytes.rs b/utilities/src/bytes.rs index d49ac74db2..d7e7477559 100644 --- a/utilities/src/bytes.rs +++ b/utilities/src/bytes.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,17 +14,17 @@ // limitations under the License. use crate::{ + Vec, error, fmt, io::{Read, Result as IoResult, Write}, marker::PhantomData, - Vec, }; use serde::{ - de::{self, Error, SeqAccess, Visitor}, - ser::{self, SerializeTuple}, Deserializer, Serializer, + de::{self, Error, SeqAccess, Visitor}, + ser::{self, SerializeTuple}, }; use smol_str::SmolStr; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; diff --git a/utilities/src/error.rs b/utilities/src/error.rs index 6ecd1f09bc..4de22d2c1e 100644 --- a/utilities/src/error.rs +++ b/utilities/src/error.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/io.rs b/utilities/src/io.rs index a52d4a8205..2b94680da0 100644 --- a/utilities/src/io.rs +++ b/utilities/src/io.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/iterator.rs b/utilities/src/iterator.rs index df3a7f2a0b..4a5b11dc08 100644 --- a/utilities/src/iterator.rs +++ b/utilities/src/iterator.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/lib.rs b/utilities/src/lib.rs index a6c5fd85d3..4991cbc8a5 100644 --- a/utilities/src/lib.rs +++ b/utilities/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/parallel.rs b/utilities/src/parallel.rs index be2520f7ef..6c998b96ec 100644 --- a/utilities/src/parallel.rs +++ b/utilities/src/parallel.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -292,3 +293,19 @@ macro_rules! cfg_sort_by_cached_key { $self.par_sort_by_cached_key($closure); }}; } + +/// Returns a sorted, by-value iterator for the given IndexMap/IndexSet +#[macro_export] +macro_rules! cfg_sorted_by { + ($self: expr, $closure: expr) => {{ + #[cfg(feature = "serial")] + { + $self.sorted_by($closure) + } + + #[cfg(not(feature = "serial"))] + { + $self.par_sorted_by($closure) + } + }}; +} diff --git a/utilities/src/rand.rs b/utilities/src/rand.rs index b92f0e95da..b93671256a 100644 --- a/utilities/src/rand.rs +++ b/utilities/src/rand.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,10 +14,10 @@ // limitations under the License. use rand::{ - distributions::{Distribution, Standard}, - rngs::StdRng, Rng, SeedableRng, + distributions::{Distribution, Standard}, + rngs::StdRng, }; use rand_xorshift::XorShiftRng; diff --git a/utilities/src/serialize/error.rs b/utilities/src/serialize/error.rs index c98779005b..8231015387 100644 --- a/utilities/src/serialize/error.rs +++ b/utilities/src/serialize/error.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/serialize/flags.rs b/utilities/src/serialize/flags.rs index 436c66f3fc..026f394f6b 100644 --- a/utilities/src/serialize/flags.rs +++ b/utilities/src/serialize/flags.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/serialize/helpers.rs b/utilities/src/serialize/helpers.rs index 53600b66f8..3385795a99 100644 --- a/utilities/src/serialize/helpers.rs +++ b/utilities/src/serialize/helpers.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,12 +14,12 @@ // limitations under the License. pub use crate::{ - io::{self, Read, Write}, FromBytes, ToBytes, Vec, + io::{self, Read, Write}, }; -use crate::{serialize::traits::*, SerializationError}; +use crate::{SerializationError, serialize::traits::*}; /// Serialize a Vector's elements without serializing the Vector's length /// If you want to serialize the full Vector, use `CanonicalSerialize for Vec` diff --git a/utilities/src/serialize/impls.rs b/utilities/src/serialize/impls.rs index ee09a23478..e20d707d3a 100644 --- a/utilities/src/serialize/impls.rs +++ b/utilities/src/serialize/impls.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -13,12 +14,12 @@ // limitations under the License. pub use crate::{ - io::{Read, Write}, FromBytes, ToBytes, Vec, + io::{Read, Write}, }; -use crate::{serialize::traits::*, SerializationError}; +use crate::{SerializationError, serialize::traits::*}; use bincode::Options; diff --git a/utilities/src/serialize/mod.rs b/utilities/src/serialize/mod.rs index 00048a9ea2..68328d63a6 100644 --- a/utilities/src/serialize/mod.rs +++ b/utilities/src/serialize/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/utilities/src/serialize/traits.rs b/utilities/src/serialize/traits.rs index 373ca02abd..8e4e3702f7 100644 --- a/utilities/src/serialize/traits.rs +++ b/utilities/src/serialize/traits.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -pub use crate::io::{Read, Write}; use crate::SerializationError; +pub use crate::io::{Read, Write}; use serde::de::{self, DeserializeOwned, Deserializer}; diff --git a/vm/cli/cli.rs b/vm/cli/cli.rs index deb1c70d97..6597cf1012 100644 --- a/vm/cli/cli.rs +++ b/vm/cli/cli.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use crate::cli::commands::{Build, Clean, Execute, New, Run, Update}; use anstyle::{AnsiColor, Color, Style}; use anyhow::Result; -use clap::{builder::Styles, Parser}; +use clap::{Parser, builder::Styles}; const HEADER_COLOR: Option = Some(Color::Ansi(AnsiColor::Yellow)); const LITERAL_COLOR: Option = Some(Color::Ansi(AnsiColor::Green)); diff --git a/vm/cli/commands/build.rs b/vm/cli/commands/build.rs index ac72b101f8..4ca5023f9a 100644 --- a/vm/cli/commands/build.rs +++ b/vm/cli/commands/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/commands/clean.rs b/vm/cli/commands/clean.rs index 7662f40acc..a3d25050ea 100644 --- a/vm/cli/commands/clean.rs +++ b/vm/cli/commands/clean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/commands/execute.rs b/vm/cli/commands/execute.rs index 6fd0f50164..1d7eea971c 100644 --- a/vm/cli/commands/execute.rs +++ b/vm/cli/commands/execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/commands/mod.rs b/vm/cli/commands/mod.rs index 93475a3e48..5fe8695be7 100644 --- a/vm/cli/commands/mod.rs +++ b/vm/cli/commands/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/commands/new.rs b/vm/cli/commands/new.rs index 9c54d3bae2..c555aeeba5 100644 --- a/vm/cli/commands/new.rs +++ b/vm/cli/commands/new.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/commands/run.rs b/vm/cli/commands/run.rs index 285b46034b..7a98e075fb 100644 --- a/vm/cli/commands/run.rs +++ b/vm/cli/commands/run.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -100,7 +101,7 @@ impl Run { mod tests { use super::*; use crate::{ - cli::{Command, CLI}, + cli::{CLI, Command}, prelude::{Identifier, Value}, }; diff --git a/vm/cli/commands/update.rs b/vm/cli/commands/update.rs index 84fd1966b4..eeb6f46355 100644 --- a/vm/cli/commands/update.rs +++ b/vm/cli/commands/update.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/errors.rs b/vm/cli/errors.rs index e82b80920b..ff2f8aacc4 100644 --- a/vm/cli/errors.rs +++ b/vm/cli/errors.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/helpers/env.rs b/vm/cli/helpers/env.rs index 8e8c725ac0..e4b2111b6d 100644 --- a/vm/cli/helpers/env.rs +++ b/vm/cli/helpers/env.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,7 +15,7 @@ use crate::{cli::CurrentNetwork, console::account::PrivateKey}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; fn env_template() -> String { r#" diff --git a/vm/cli/helpers/mod.rs b/vm/cli/helpers/mod.rs index 564a3181a7..76ce3d7ce6 100644 --- a/vm/cli/helpers/mod.rs +++ b/vm/cli/helpers/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/cli/helpers/updater.rs b/vm/cli/helpers/updater.rs index 47c8769b2b..7912cdfa03 100644 --- a/vm/cli/helpers/updater.rs +++ b/vm/cli/helpers/updater.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -16,7 +17,7 @@ use crate::cli::errors::UpdaterError; use anyhow::Result; use colored::Colorize; -use self_update::{backends::github, version::bump_is_greater, Status}; +use self_update::{Status, backends::github, version::bump_is_greater}; pub struct Updater; @@ -24,7 +25,7 @@ pub struct Updater; impl Updater { const SNARKVM_BIN_NAME: &'static str = "snarkvm"; const SNARKVM_REPO_NAME: &'static str = "snarkvm"; - const SNARKVM_REPO_OWNER: &'static str = "AleoHQ"; + const SNARKVM_REPO_OWNER: &'static str = "AleoNet"; /// Show all available releases for `snarkvm`. #[allow(clippy::format_push_string)] diff --git a/vm/cli/main.rs b/vm/cli/main.rs index 2d5de7b2ae..402532954c 100644 --- a/vm/cli/main.rs +++ b/vm/cli/main.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use snarkvm::cli::{Updater, CLI}; +use snarkvm::cli::{CLI, Updater}; use clap::Parser; diff --git a/vm/cli/mod.rs b/vm/cli/mod.rs index 765e3d8ea7..8276ba33b5 100644 --- a/vm/cli/mod.rs +++ b/vm/cli/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/file/aleo.rs b/vm/file/aleo.rs index 4d22626117..9eaecd769f 100644 --- a/vm/file/aleo.rs +++ b/vm/file/aleo.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -18,7 +19,7 @@ use crate::{ synthesizer::Program, }; -use anyhow::{anyhow, bail, ensure, Result}; +use anyhow::{Result, anyhow, bail, ensure}; use core::str::FromStr; use std::{ fs::{self, File}, diff --git a/vm/file/avm.rs b/vm/file/avm.rs index 2fbdd1af40..ee0b7443a5 100644 --- a/vm/file/avm.rs +++ b/vm/file/avm.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ use crate::{ synthesizer::Program, }; -use anyhow::{anyhow, ensure, Result}; +use anyhow::{Result, anyhow, ensure}; use std::{ fs::{self, File}, io::Write, diff --git a/vm/file/manifest.rs b/vm/file/manifest.rs index af3a1aa23c..e9e4ee68a1 100644 --- a/vm/file/manifest.rs +++ b/vm/file/manifest.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ use crate::{ synthesizer::Program, }; -use anyhow::{anyhow, ensure, Result}; +use anyhow::{Result, anyhow, ensure}; use core::str::FromStr; use std::{ fs::{self, File}, diff --git a/vm/file/mod.rs b/vm/file/mod.rs index 43d7141f5f..645b25f763 100644 --- a/vm/file/mod.rs +++ b/vm/file/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/file/prover.rs b/vm/file/prover.rs index 740971849d..1bac807b46 100644 --- a/vm/file/prover.rs +++ b/vm/file/prover.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,10 +15,10 @@ use crate::{ prelude::{FromBytes, Identifier, IoResult, Network, Read, ToBytes}, - synthesizer::{snark::ProvingKey, Program}, + synthesizer::{Program, snark::ProvingKey}, }; -use anyhow::{anyhow, bail, ensure, Result}; +use anyhow::{Result, anyhow, bail, ensure}; use std::{ fs::{self, File}, io::Write, diff --git a/vm/file/readme_file.rs b/vm/file/readme_file.rs index 687780ca89..8b5e049c18 100644 --- a/vm/file/readme_file.rs +++ b/vm/file/readme_file.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -17,7 +18,7 @@ use crate::{ synthesizer::Program, }; -use anyhow::{ensure, Result}; +use anyhow::{Result, ensure}; use std::{ fs::File, io::Write, diff --git a/vm/file/verifier.rs b/vm/file/verifier.rs index 2def859ed1..af0b4f9673 100644 --- a/vm/file/verifier.rs +++ b/vm/file/verifier.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -14,10 +15,10 @@ use crate::{ prelude::{FromBytes, Identifier, IoResult, Network, Read, ToBytes}, - synthesizer::{snark::VerifyingKey, Program}, + synthesizer::{Program, snark::VerifyingKey}, }; -use anyhow::{anyhow, bail, ensure, Result}; +use anyhow::{Result, anyhow, bail, ensure}; use std::{ fs::{self, File}, io::Write, diff --git a/vm/lib.rs b/vm/lib.rs index 60d18da0df..2b7c215ada 100644 --- a/vm/lib.rs +++ b/vm/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/package/build.rs b/vm/package/build.rs index d7057df8e6..251e8cf1b5 100644 --- a/vm/package/build.rs +++ b/vm/package/build.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/package/clean.rs b/vm/package/clean.rs index 0d1859a78c..9ca16756a2 100644 --- a/vm/package/clean.rs +++ b/vm/package/clean.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/package/deploy.rs b/vm/package/deploy.rs index ebc04a447e..f423ed51de 100644 --- a/vm/package/deploy.rs +++ b/vm/package/deploy.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/package/execute.rs b/vm/package/execute.rs index 190ef66199..e848a14ad9 100644 --- a/vm/package/execute.rs +++ b/vm/package/execute.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/package/is_build_required.rs b/vm/package/is_build_required.rs index a7cec05183..dfaa62390d 100644 --- a/vm/package/is_build_required.rs +++ b/vm/package/is_build_required.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/vm/package/mod.rs b/vm/package/mod.rs index 7568a01e5a..678d892400 100644 --- a/vm/package/mod.rs +++ b/vm/package/mod.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -28,7 +29,7 @@ use crate::{ network::Network, program::{Identifier, Locator, ProgramID, Response, Value}, }, - file::{AVMFile, AleoFile, Manifest, ProverFile, VerifierFile, README}, + file::{AVMFile, AleoFile, Manifest, ProverFile, README, VerifierFile}, ledger::{block::Execution, query::Query, store::helpers::memory::BlockMemory}, prelude::{Deserialize, Deserializer, Serialize, SerializeStruct, Serializer}, synthesizer::{ @@ -38,7 +39,7 @@ use crate::{ }, }; -use anyhow::{bail, ensure, Error, Result}; +use anyhow::{Error, Result, bail, ensure}; use core::str::FromStr; use rand::{CryptoRng, Rng}; use std::path::{Path, PathBuf}; diff --git a/vm/package/run.rs b/vm/package/run.rs index 59ace04ac4..5cfb358741 100644 --- a/vm/package/run.rs +++ b/vm/package/run.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 4183bbf38c..ece1022b6c 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "snarkvm-wasm" -version = "0.16.19" +version = "1.0.0" authors = [ "The Aleo Team " ] description = "WASM for a decentralized virtual machine" homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/snarkVM" +repository = "https://github.com/AleoNet/snarkVM" keywords = [ "aleo", "cryptography", @@ -51,54 +51,54 @@ utilities = [ "snarkvm-utilities" ] [dependencies.snarkvm-circuit-network] path = "../circuit/network" -version = "=0.16.19" +version = "=1.0.0" features = [ "wasm" ] optional = true [dependencies.snarkvm-console] path = "../console" -version = "=0.16.19" +version = "=1.0.0" features = [ "wasm" ] optional = true [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.19" +version = "=1.0.0" optional = true [dependencies.snarkvm-ledger-block] path = "../ledger/block" -version = "=0.16.19" +version = "=1.0.0" features = [ "wasm" ] optional = true [dependencies.snarkvm-ledger-query] path = "../ledger/query" -version = "=0.16.19" +version = "=1.0.0" features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-ledger-store] path = "../ledger/store" -version = "=0.16.19" +version = "=1.0.0" features = [ "wasm" ] optional = true [dependencies.snarkvm-synthesizer] path = "../synthesizer" -version = "=0.16.19" +version = "=1.0.0" default-features = false features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.19" +version = "=1.0.0" features = [ "wasm" ] optional = true diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs index 2d9e723294..3477882213 100644 --- a/wasm/src/lib.rs +++ b/wasm/src/lib.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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 @@ -12,12 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[cfg(feature = "network")] -pub use snarkvm_circuit_network as circuit_network; #[cfg(feature = "console")] pub use snarkvm_console as console; -#[cfg(feature = "network")] -pub use snarkvm_console::network as console_network; #[cfg(feature = "curves")] pub use snarkvm_curves as curves; #[cfg(feature = "fields")] diff --git a/wasm/src/tests.rs b/wasm/src/tests.rs index 5610df5b39..1d3f2f843b 100644 --- a/wasm/src/tests.rs +++ b/wasm/src/tests.rs @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. +// Copyright 2024 Aleo Network Foundation // This file is part of the snarkVM library. // 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