diff --git a/.dockerignore b/.dockerignore
index aae0c8a6f9d..978a5b26769 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,2 +1,2 @@
**/target
-Dockerfile
+Dockerfile*
diff --git a/.github/scripts/ci_test/ci_image_scan.py b/.github/scripts/ci_test/ci_image_scan.py
new file mode 100644
index 00000000000..ec51046e61c
--- /dev/null
+++ b/.github/scripts/ci_test/ci_image_scan.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python
+
+"""
+CI script for locating the improperly configured images
+in Docker's Compose files.
+
+Scans a list of file masks/names and checks for allowed branches.
+"""
+
+from typing import List
+import sys
+from logging import getLogger, warning, error, info, INFO
+from argparse import ArgumentParser, Namespace
+from pathlib import Path
+from yaml import safe_load
+from yaml.error import YAMLError
+from git_root import git_root
+
+def parse_arguments() -> Namespace:
+ """
+ Returns:
+ Namespace: An object containing two attributes:
+ - masks: A list of file masks and names provided as positional arguments.
+ - allow: A list of Docker images provided
+ to the 'allow' option, or [] if not provided.
+ """
+ parser = ArgumentParser(description='Process some file names.')
+ parser.add_argument(
+ '--allow',
+ nargs='+',
+ help='one or more allowed image names',
+ default=[]
+ )
+ parser.add_argument(
+ 'masks',
+ nargs='*',
+ help='list of file masks and exact names to be checked',
+ default=[]
+ )
+ return parser.parse_args()
+
+def get_paths(file_masks: List[str], root: Path):
+ """
+ Generate a list of pathlib.Path instances for given file masks
+ and filenames within a root directory.
+
+ This function searches for files in a specified root directory
+ matching the patterns and filenames provided in `file_masks`.
+ It returns a list of pathlib.Path instances for files that exist.
+ Patterns can include wildcards (e.g., "*.yml").
+ Only files that actually exist in the filesystem are included in the result.
+
+ Args:
+ file_masks (list of str): A list of strings representing file masks
+ and filenames.
+ File masks can include wildcard characters
+ (e.g., "topic.*.yml").
+ root (pathlib.Path):
+ A pathlib.Path instance representing
+ the root directory in which to search for files.
+
+ Returns:
+ list: A list containing pathlib.Path instances for each existing
+ file matching the file masks and filenames
+ in the specified root directory.
+
+ Raises:
+ TypeError: If `root` is not an instance of pathlib.Path.
+
+ Note:
+ The function does not return paths for files that do not exist.
+ """
+ if not isinstance(root, Path):
+ raise TypeError("The root argument must be a pathlib.Path instance")
+ paths = []
+ for mask in file_masks:
+ if '*' in mask:
+ matching_files = root.glob(mask)
+ paths.extend([file for file in matching_files if file.exists()])
+ else:
+ path = root / mask
+ if path.exists():
+ paths.append(path)
+ else:
+ warning(f'File not found: {path.name}')
+ return paths
+
+def validate_docker_config(compose_file: Path, allow: List[str]):
+ """
+ Validates a single Path for a Compose config.
+
+ Returns:
+ (int) 1 if the image is using a config that isn't allowed,
+ 0 otherwise
+ """
+ status = 0
+ services = {}
+ try:
+ with open(compose_file, 'r', encoding='utf8') as compose_file_contents:
+ config_inst = safe_load(compose_file_contents.read())
+ if isinstance(config_inst, dict):
+ services = config_inst.get('services', {})
+ else:
+ error(f'Improper configuration at "{compose_file}"')
+ status = 1
+ except YAMLError:
+ error(f'Improper formatting at "{compose_file}"')
+ status = 1
+ for _, service in services.items():
+ if service.get('image', '') not in allow:
+ status = 1
+ break
+ return status
+
+def main():
+ """
+ Validate the supplied Docker configurations
+ and exit with an error if one of them is using
+ an incorrect image.
+ """
+ getLogger().setLevel(INFO)
+ args = parse_arguments()
+ for current_file in get_paths(args.masks, git_root()):
+ if validate_docker_config(current_file, args.allow):
+ warning(f'Wrong image in "{current_file.name}"')
+ sys.exit(1)
+ info('No incorrect Compose configurations found')
+
+if __name__ == '__main__':
+ main()
diff --git a/.github/scripts/ci_test/git_root.py b/.github/scripts/ci_test/git_root.py
new file mode 100644
index 00000000000..7412b928c56
--- /dev/null
+++ b/.github/scripts/ci_test/git_root.py
@@ -0,0 +1,19 @@
+"""
+This module contains a modified copy of git_root by Jan Tilly.
+It allows to find a repo root on GitHub for the CI purposes.
+
+https://github.com/jtilly/git_root/blob/master/git_root/git_root.py
+"""
+
+from subprocess import Popen, PIPE, DEVNULL
+from os.path import abspath
+from pathlib import Path
+
+def git_root():
+ root = '.'
+ with Popen(
+ ['git', 'rev-parse', '--show-toplevel'],
+ stdout=PIPE, stderr=DEVNULL
+ ) as git_proc:
+ root = git_proc.communicate()[0].rstrip().decode('utf-8')
+ return Path(abspath(root))
diff --git a/.github/scripts/ci_test/requirements.txt b/.github/scripts/ci_test/requirements.txt
new file mode 100644
index 00000000000..be2b74db40f
--- /dev/null
+++ b/.github/scripts/ci_test/requirements.txt
@@ -0,0 +1 @@
+PyYAML==6.0.1
diff --git a/.github/workflows/iroha2-ci-image.yml b/.github/workflows/iroha2-ci-image.yml
index d6b03258647..a150d18c6a1 100644
--- a/.github/workflows/iroha2-ci-image.yml
+++ b/.github/workflows/iroha2-ci-image.yml
@@ -1,6 +1,11 @@
name: I2::CI::Publish
-on: workflow_dispatch
+on:
+ workflow_dispatch:
+ inputs:
+ IROHA2_CI_DOCKERFILE:
+ required: true
+ default: Dockerfile.build
jobs:
dockerhub:
@@ -17,6 +22,6 @@ jobs:
push: true
tags: hyperledger/iroha2-ci:nightly-2024-01-12
labels: commit=${{ github.sha }}
- file: Dockerfile.build
+ file: ${{ github.event.inputs.IROHA2_CI_DOCKERFILE }}
# This context specification is required
context: .
diff --git a/.github/workflows/iroha2-dev-pr-wasm.yaml b/.github/workflows/iroha2-dev-pr-wasm.yaml
index aad3bfb085c..ff674b5bb9f 100644
--- a/.github/workflows/iroha2-dev-pr-wasm.yaml
+++ b/.github/workflows/iroha2-dev-pr-wasm.yaml
@@ -33,4 +33,4 @@ jobs:
run: cargo install --path tools/wasm_test_runner
- name: Run smart contract tests on WebAssembly VM
working-directory: smart_contract
- run: mold --run cargo test --tests --target wasm32-unknown-unknown --no-fail-fast --quiet
+ run: mold --run cargo test --release --tests --target wasm32-unknown-unknown --no-fail-fast --quiet
diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml
index 900b5397679..1d5526cff59 100644
--- a/.github/workflows/iroha2-dev-pr.yml
+++ b/.github/workflows/iroha2-dev-pr.yml
@@ -69,6 +69,13 @@ jobs:
compare-ref: ${{ github.base_ref }}
compare-sha: ${{ github.event.pull_request.base.sha}}
github-token: ${{ secrets.GITHUB_TOKEN }}
+ # (Temporally) Add the parallel coverage upload to Codecov to compare the results with Coveralls
+ # - name: Upload coverage to codecov.io
+ # uses: codecov/codecov-action@v3.1.4
+ # with:
+ # files: lcov.info
+ # commit_parent: ${{ github.event.pull_request.base.sha }}
+ # fail_ci_if_error: false
integration:
runs-on: [self-hosted, Linux, iroha2ci]
diff --git a/.github/workflows/iroha2-dev.yml b/.github/workflows/iroha2-dev.yml
index 311d376632a..f777ead22f8 100644
--- a/.github/workflows/iroha2-dev.yml
+++ b/.github/workflows/iroha2-dev.yml
@@ -10,11 +10,40 @@ env:
jobs:
registry:
runs-on: [self-hosted, Linux, iroha2-dev-push]
- container:
- image: hyperledger/iroha2-ci:nightly-2024-01-12
steps:
- uses: actions/checkout@v4
- - uses: docker/login-action@v3
+ - name: Set up Docker Buildx
+ id: buildx
+ if: always()
+ uses: docker/setup-buildx-action@v3
+ with:
+ install: true
+ - name: Build and export to Docker iroha2:dev image
+ uses: docker/build-push-action@v5
+ if: always()
+ with:
+ context: .
+ load: true
+ file: Dockerfile
+ tags: |
+ hyperledger/iroha2:dev
+ docker.soramitsu.co.jp/iroha2/iroha2:dev
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+ - name: Test docker-compose.single.yml before pushing
+ run: |
+ docker compose -f docker-compose.single.yml up --wait || exit 1
+ docker compose -f docker-compose.single.yml down
+ - name: Test docker-compose.local.yml before pushing
+ run: |
+ docker compose -f docker-compose.local.yml up --wait || exit 1
+ docker compose -f docker-compose.local.yml down
+ - name: Test docker-compose.yml before pushing
+ run: |
+ docker compose -f docker-compose.yml up --wait || exit 1
+ docker compose -f docker-compose.yml down
+ - name: Login to DockerHub
+ uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -24,27 +53,15 @@ jobs:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- - name: Set up Docker Buildx
- id: buildx
- if: always()
- uses: docker/setup-buildx-action@v3
- with:
- install: true
- - name: Build and push iroha2:dev image
+ - name: Push iroha2:dev image
uses: docker/build-push-action@v5
- if: always()
with:
+ context: .
push: true
tags: |
hyperledger/iroha2:dev
docker.soramitsu.co.jp/iroha2/iroha2:dev
labels: commit=${{ github.sha }}
- build-args: TAG=dev
- file: Dockerfile
- # This context specification is required
- context: .
- cache-from: type=gha
- cache-to: type=gha,mode=max
archive_binaries_and_schema:
runs-on: ubuntu-latest
diff --git a/.github/workflows/iroha2-no-incorrect-image.yml b/.github/workflows/iroha2-no-incorrect-image.yml
new file mode 100644
index 00000000000..fbc6aa228de
--- /dev/null
+++ b/.github/workflows/iroha2-no-incorrect-image.yml
@@ -0,0 +1,25 @@
+name: I2::CI::check_for_incorrect_images
+
+on:
+ push:
+ branches:
+ - iroha2-dev
+ - iroha2-stable
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Python 3.11
+ uses: actions/setup-python@v1
+ with:
+ python-version: "3.11"
+ - uses: actions/checkout@v3
+ - name: Install dependencies
+ run: pip install -r .github/scripts/ci_test/requirements.txt --no-input
+ - name: Check containers on iroha2-stable branch
+ if: github.base_ref == 'iroha2-stable'
+ run: python .github/scripts/ci_test/ci_image_scan.py --allow iroha2:stable -- docker-compose*.yml
+ - name: Check containers on iroha2-dev branch
+ if: github.base_ref == 'iroha2-dev'
+ run: python .github/scripts/ci_test/ci_image_scan.py --allow iroha2:dev -- docker-compose*.yml
diff --git a/.github/workflows/iroha2-profiling-image.yml b/.github/workflows/iroha2-profiling-image.yml
new file mode 100644
index 00000000000..2f14c841cca
--- /dev/null
+++ b/.github/workflows/iroha2-profiling-image.yml
@@ -0,0 +1,64 @@
+name: I2::Profiling::Publish
+
+on:
+ workflow_dispatch:
+ inputs:
+ IROHA2_IMAGE_TAG:
+ required: true
+ default: stable
+ IROHA2_IMAGE_RELEASE:
+ required: true
+ IROHA2_DOCKERFILE:
+ required: true
+ default: Dockerfile.glibc
+ IROHA2_PROFILE:
+ required: true
+ default: profiling
+ IROHA2_RUSTFLAGS:
+ required: false
+ default: -C force-frame-pointers=on
+ IROHA2_FEATURES:
+ required: false
+ default: profiling
+ IROHA2_CARGOFLAGS:
+ required: false
+ default: -Z build-std
+
+jobs:
+ registry:
+ runs-on: [self-hosted, Linux, iroha2-dev-push]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Login to Soramitsu Harbor
+ uses: docker/login-action@v3
+ with:
+ registry: docker.soramitsu.co.jp
+ username: ${{ secrets.HARBOR_USERNAME }}
+ password: ${{ secrets.HARBOR_TOKEN }}
+ - name: Set up Docker Buildx
+ id: buildx
+ if: always()
+ uses: docker/setup-buildx-action@v3
+ with:
+ install: true
+ - name: Build and push iroha2:profiling-image
+ uses: docker/build-push-action@v5
+ if: always()
+ with:
+ push: true
+ tags: |
+ hyperledger/iroha2:${{ github.event.inputs.IROHA2_IMAGE_TAG }}-${{ github.event.inputs.IROHA2_IMAGE_RELEASE }}-profiling
+ docker.soramitsu.co.jp/iroha2/iroha2:${{ github.event.inputs.IROHA2_IMAGE_TAG }}-${{ github.event.inputs.IROHA2_IMAGE_RELEASE }}-profiling
+ labels: commit=${{ github.sha }}
+ build-args: |
+ "PROFILE=${{ github.event.inputs.IROHA2_PROFILE }}"
+ "RUSTFLAGS=${{ github.event.inputs.IROHA2_RUSTFLAGS }}"
+ "FEATURES=${{ github.event.inputs.IROHA2_FEATURES }}"
+ "CARGOFLAGS=${{ github.event.inputs.IROHA2_CARGOFLAGS }}"
+ file: ${{ github.event.inputs.IROHA2_DOCKERFILE }}
+ # This context specification is required
+ context: .
diff --git a/.github/workflows/iroha2-release.yml b/.github/workflows/iroha2-release.yml
index f704b75af4e..94c85acbb3c 100644
--- a/.github/workflows/iroha2-release.yml
+++ b/.github/workflows/iroha2-release.yml
@@ -10,8 +10,6 @@ env:
jobs:
registry:
runs-on: ubuntu-latest
- container:
- image: hyperledger/iroha2-ci:nightly-2024-01-12
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
@@ -29,6 +27,31 @@ jobs:
run: |
RELEASE=$(curl -s https://raw.githubusercontent.com/hyperledger/iroha/${{ github.ref_name }}/Cargo.toml | sed -n '3p' | sed -e 's/version = "//g' -e 's/"$//' | tr -d '\n')
echo "RELEASE=$RELEASE" >>$GITHUB_ENV
+ - name: Build and export to Docker iroha2 image
+ uses: docker/build-push-action@v5
+ if: always()
+ with:
+ context: .
+ load: true
+ file: Dockerfile
+ tags: |
+ hyperledger/iroha2:${{ env.TAG }}
+ hyperledger/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
+ docker.soramitsu.co.jp/iroha2/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+ - name: Test docker-compose.single.yml before pushing
+ run: |
+ docker compose -f docker-compose.single.yml up --wait || exit 1
+ docker compose -f docker-compose.single.yml down
+ - name: Test docker-compose.local.yml before pushing
+ run: |
+ docker compose -f docker-compose.local.yml up --wait || exit 1
+ docker compose -f docker-compose.local.yml down
+ - name: Test docker-compose.yml before pushing
+ run: |
+ docker compose -f docker-compose.yml up --wait || exit 1
+ docker compose -f docker-compose.yml down
- name: Login to DockerHub
uses: docker/login-action@v3
with:
@@ -43,18 +66,13 @@ jobs:
- name: Build and push iroha2 image
uses: docker/build-push-action@v5
with:
+ context: .
push: true
tags: |
hyperledger/iroha2:${{ env.TAG }}
hyperledger/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
docker.soramitsu.co.jp/iroha2/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
labels: commit=${{ github.sha }}
- build-args: TAG=${{ env.TAG }}
- file: Dockerfile
- # This context specification is required
- context: .
- cache-from: type=gha
- cache-to: type=gha,mode=max
configs:
runs-on: ubuntu-latest
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 74bafed0f92..5ef9c16a5ec 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -266,6 +266,54 @@ tokio-console http://127.0.0.1:5555
+### Profiling
+
+ Expand to learn ho to profile iroha.
+
+To optimize performance it's useful to profile iroha.
+
+To do that you should compile iroha with `profiling` profile and with `profiling` feature:
+
+```bash
+RUSTFLAGS="-C force-frame-pointers=on" cargo +nightly -Z build-std build --target your-desired-target --profile profiling --features profiling
+```
+
+Then start iroha and attach profiler of your choice to the iroha pid.
+
+Alternatively it's possible to build iroha inside docker with profiler support and profile iroha this way.
+
+```bash
+docker build -f Dockerfile.glibc --build-arg="PROFILE=profiling" --build-arg='RUSTFLAGS=-C force-frame-pointers=on' --build-arg='FEATURES=profiling' --build-arg='CARGOFLAGS=-Z build-std' -t iroha2:profiling .
+```
+
+E.g. using perf (available only on linux):
+
+```bash
+# to capture profile
+sudo perf record -g -p
+# to analyze profile
+sudo perf report
+```
+
+To be able to observe profile of the executor during iroha profiling, executor should be compiled without stripping symbols.
+It can be done by running:
+
+```bash
+# compile executor without optimizations
+cargo run --bin iroha_wasm_builder_cli -- build ./path/to/executor --outfile executor.wasm
+```
+
+With profiling feature enabled iroha exposes endpoint to scrap pprof profiles:
+
+```bash
+# profile iroha for 30 seconds and get protobuf profile
+curl host:port/debug/pprof/profile?seconds=30 -o profile.pb
+# analyze profile in browser (required installed go)
+go tool pprof -web profile.pb
+```
+
+
+
## Style Guides
Please follow these guidelines when you make code contributions to our project:
diff --git a/Cargo.lock b/Cargo.lock
index 9e686724df6..4b76a0de150 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -30,7 +30,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
dependencies = [
"crypto-common",
- "generic-array 0.14.7",
+ "generic-array",
]
[[package]]
@@ -60,25 +60,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee5cca1ddc8b9dceb55b7f1272a9d1e643d73006f350a20ab4926d24e33f0f0d"
-[[package]]
-name = "amcl_wrapper"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c7c7c7627444413f6a488bf9e6d352aea6fcfa281123cd92ecac0b3c9ef5ef2"
-dependencies = [
- "byteorder",
- "lazy_static",
- "miracl_core",
- "rand 0.7.3",
- "rayon",
- "serde",
- "serde_bytes",
- "serde_json",
- "sha3",
- "subtle-encoding",
- "zeroize",
-]
-
[[package]]
name = "android-tzdata"
version = "0.1.1"
@@ -166,6 +147,135 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6"
+[[package]]
+name = "ark-bls12-377"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f"
+dependencies = [
+ "ark-ec",
+ "ark-ff",
+ "ark-std",
+]
+
+[[package]]
+name = "ark-bls12-381"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488"
+dependencies = [
+ "ark-ec",
+ "ark-ff",
+ "ark-serialize",
+ "ark-std",
+]
+
+[[package]]
+name = "ark-ec"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba"
+dependencies = [
+ "ark-ff",
+ "ark-poly",
+ "ark-serialize",
+ "ark-std",
+ "derivative",
+ "hashbrown 0.13.2",
+ "itertools 0.10.5",
+ "num-traits",
+ "zeroize",
+]
+
+[[package]]
+name = "ark-ff"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba"
+dependencies = [
+ "ark-ff-asm",
+ "ark-ff-macros",
+ "ark-serialize",
+ "ark-std",
+ "derivative",
+ "digest",
+ "itertools 0.10.5",
+ "num-bigint",
+ "num-traits",
+ "paste",
+ "rustc_version",
+ "zeroize",
+]
+
+[[package]]
+name = "ark-ff-asm"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348"
+dependencies = [
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "ark-ff-macros"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565"
+dependencies = [
+ "num-bigint",
+ "num-traits",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "ark-poly"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf"
+dependencies = [
+ "ark-ff",
+ "ark-serialize",
+ "ark-std",
+ "derivative",
+ "hashbrown 0.13.2",
+]
+
+[[package]]
+name = "ark-serialize"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5"
+dependencies = [
+ "ark-serialize-derive",
+ "ark-std",
+ "digest",
+ "num-bigint",
+]
+
+[[package]]
+name = "ark-serialize-derive"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "ark-std"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185"
+dependencies = [
+ "num-traits",
+ "rand",
+]
+
[[package]]
name = "arrayref"
version = "0.3.7"
@@ -390,19 +500,7 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
dependencies = [
- "digest 0.10.7",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
-dependencies = [
- "block-padding",
- "byte-tools",
- "byteorder",
- "generic-array 0.12.4",
+ "digest",
]
[[package]]
@@ -411,16 +509,7 @@ version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
- "generic-array 0.14.7",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
-dependencies = [
- "byte-tools",
+ "generic-array",
]
[[package]]
@@ -455,12 +544,6 @@ version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c"
-[[package]]
-name = "byte-tools"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
-
[[package]]
name = "byte-unit"
version = "4.0.19"
@@ -736,6 +819,12 @@ version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
+[[package]]
+name = "constcat"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08"
+
[[package]]
name = "core-foundation"
version = "0.9.4"
@@ -770,6 +859,15 @@ dependencies = [
"cfg-if",
]
+[[package]]
+name = "cpp_demangle"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119"
+dependencies = [
+ "cfg-if",
+]
+
[[package]]
name = "cpufeatures"
version = "0.2.11"
@@ -1030,8 +1128,8 @@ version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76"
dependencies = [
- "generic-array 0.14.7",
- "rand_core 0.6.4",
+ "generic-array",
+ "rand_core",
"subtle",
"zeroize",
]
@@ -1042,8 +1140,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
- "generic-array 0.14.7",
- "rand_core 0.6.4",
+ "generic-array",
"typenum",
]
@@ -1056,7 +1153,7 @@ dependencies = [
"cfg-if",
"cpufeatures",
"curve25519-dalek-derive",
- "digest 0.10.7",
+ "digest",
"fiat-crypto",
"platforms",
"rustc_version",
@@ -1207,6 +1304,17 @@ dependencies = [
"powerfmt",
]
+[[package]]
+name = "derivative"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
[[package]]
name = "derive_more"
version = "0.99.17"
@@ -1229,22 +1337,13 @@ dependencies = [
"thiserror",
]
-[[package]]
-name = "digest"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
-dependencies = [
- "generic-array 0.12.4",
-]
-
[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
- "block-buffer 0.10.4",
+ "block-buffer",
"const-oid",
"crypto-common",
"subtle",
@@ -1313,7 +1412,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca"
dependencies = [
"der",
- "digest 0.10.7",
+ "digest",
"elliptic-curve",
"rfc6979",
"signature",
@@ -1338,7 +1437,7 @@ checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0"
dependencies = [
"curve25519-dalek",
"ed25519",
- "rand_core 0.6.4",
+ "rand_core",
"serde",
"sha2",
"subtle",
@@ -1359,12 +1458,12 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47"
dependencies = [
"base16ct",
"crypto-bigint",
- "digest 0.10.7",
+ "digest",
"ff",
- "generic-array 0.14.7",
+ "generic-array",
"group",
"pkcs8",
- "rand_core 0.6.4",
+ "rand_core",
"sec1",
"subtle",
"zeroize",
@@ -1457,7 +1556,7 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
dependencies = [
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -1479,6 +1578,18 @@ dependencies = [
"windows-sys 0.52.0",
]
+[[package]]
+name = "findshlibs"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64"
+dependencies = [
+ "cc",
+ "lazy_static",
+ "libc",
+ "winapi",
+]
+
[[package]]
name = "fixedbitset"
version = "0.4.2"
@@ -1656,15 +1767,6 @@ dependencies = [
"serde_json",
]
-[[package]]
-name = "generic-array"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
-dependencies = [
- "typenum",
-]
-
[[package]]
name = "generic-array"
version = "0.14.7"
@@ -1676,17 +1778,6 @@ dependencies = [
"zeroize",
]
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
-]
-
[[package]]
name = "getrandom"
version = "0.2.11"
@@ -1695,7 +1786,7 @@ checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
dependencies = [
"cfg-if",
"libc",
- "wasi 0.11.0+wasi-snapshot-preview1",
+ "wasi",
]
[[package]]
@@ -2230,7 +2321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
dependencies = [
"ff",
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -2371,7 +2462,7 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
dependencies = [
- "digest 0.10.7",
+ "digest",
]
[[package]]
@@ -2554,7 +2645,7 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
dependencies = [
- "generic-array 0.14.7",
+ "generic-array",
]
[[package]]
@@ -2633,7 +2724,7 @@ dependencies = [
"iroha_wasm_builder",
"once_cell",
"parity-scale-codec",
- "rand 0.8.5",
+ "rand",
"serde",
"serde_json",
"tempfile",
@@ -2748,7 +2839,7 @@ dependencies = [
"once_cell",
"parity-scale-codec",
"parking_lot",
- "rand 0.8.5",
+ "rand",
"serde",
"serde_json",
"tempfile",
@@ -2776,13 +2867,12 @@ version = "2.0.0-pre-rc.20"
dependencies = [
"aead",
"amcl",
- "amcl_wrapper",
"arrayref",
"blake2",
"chacha20poly1305",
"curve25519-dalek",
"derive_more",
- "digest 0.10.7",
+ "digest",
"displaydoc",
"ed25519-dalek",
"elliptic-curve",
@@ -2798,8 +2888,8 @@ dependencies = [
"libsodium-sys-stable",
"openssl",
"parity-scale-codec",
- "rand 0.8.5",
- "rand_chacha 0.3.1",
+ "rand",
+ "rand_chacha",
"secp256k1",
"serde",
"serde_json",
@@ -2807,6 +2897,7 @@ dependencies = [
"sha2",
"signature",
"thiserror",
+ "w3f-bls",
"x25519-dalek",
"zeroize",
]
@@ -2929,7 +3020,7 @@ dependencies = [
"iroha_config",
"iroha_futures_derive",
"iroha_logger",
- "rand 0.8.5",
+ "rand",
"serde",
"serde_json",
"tokio",
@@ -3018,7 +3109,7 @@ dependencies = [
"iroha_logger",
"iroha_primitives",
"parity-scale-codec",
- "rand 0.8.5",
+ "rand",
"test_network",
"thiserror",
"tokio",
@@ -3097,6 +3188,7 @@ name = "iroha_smart_contract"
version = "2.0.0-pre-rc.20"
dependencies = [
"derive_more",
+ "getrandom",
"iroha_data_model",
"iroha_macro",
"iroha_smart_contract_derive",
@@ -3205,6 +3297,7 @@ dependencies = [
"iroha_torii_derive",
"iroha_version",
"parity-scale-codec",
+ "pprof",
"serde",
"serde_json",
"thiserror",
@@ -3417,7 +3510,6 @@ dependencies = [
"elliptic-curve",
"once_cell",
"sha2",
- "signature",
]
[[package]]
@@ -3700,16 +3792,10 @@ checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09"
dependencies = [
"libc",
"log",
- "wasi 0.11.0+wasi-snapshot-preview1",
+ "wasi",
"windows-sys 0.48.0",
]
-[[package]]
-name = "miracl_core"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4330eca86d39f2b52d0481aa1e90fe21bfa61f11b0bf9b48ab95595013cefe48"
-
[[package]]
name = "multer"
version = "2.1.0"
@@ -3755,6 +3841,17 @@ dependencies = [
"unicode-segmentation",
]
+[[package]]
+name = "nix"
+version = "0.26.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
+dependencies = [
+ "bitflags 1.3.2",
+ "cfg-if",
+ "libc",
+]
+
[[package]]
name = "nom"
version = "7.1.3"
@@ -3775,6 +3872,27 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "num-bigint"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-integer"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
[[package]]
name = "num-traits"
version = "0.2.17"
@@ -3828,12 +3946,6 @@ version = "11.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
-[[package]]
-name = "opaque-debug"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
-
[[package]]
name = "opaque-debug"
version = "0.3.0"
@@ -4186,7 +4298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
dependencies = [
"cpufeatures",
- "opaque-debug 0.3.0",
+ "opaque-debug",
"universal-hash",
]
@@ -4196,6 +4308,27 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
+[[package]]
+name = "pprof"
+version = "0.13.0"
+source = "git+https://github.com/Erigara/pprof-rs?branch=fix_pointer_align#55fa41916b9bb7f2029643e26168556efda19333"
+dependencies = [
+ "backtrace",
+ "cfg-if",
+ "findshlibs",
+ "libc",
+ "log",
+ "nix",
+ "once_cell",
+ "parking_lot",
+ "protobuf",
+ "protobuf-codegen-pure",
+ "smallvec",
+ "symbolic-demangle",
+ "tempfile",
+ "thiserror",
+]
+
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@@ -4287,8 +4420,8 @@ dependencies = [
"bitflags 2.4.1",
"lazy_static",
"num-traits",
- "rand 0.8.5",
- "rand_chacha 0.3.1",
+ "rand",
+ "rand_chacha",
"rand_xorshift",
"regex-syntax 0.8.2",
"rusty-fork",
@@ -4328,6 +4461,31 @@ dependencies = [
"prost",
]
+[[package]]
+name = "protobuf"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
+
+[[package]]
+name = "protobuf-codegen"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6"
+dependencies = [
+ "protobuf",
+]
+
+[[package]]
+name = "protobuf-codegen-pure"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95a29399fc94bcd3eeaa951c715f7bea69409b2445356b00519740bcd6ddd865"
+dependencies = [
+ "protobuf",
+ "protobuf-codegen",
+]
+
[[package]]
name = "psm"
version = "0.1.21"
@@ -4358,19 +4516,6 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc",
-]
-
[[package]]
name = "rand"
version = "0.8.5"
@@ -4378,18 +4523,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
- "rand_chacha 0.3.1",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
+ "rand_chacha",
+ "rand_core",
]
[[package]]
@@ -4399,16 +4534,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
+ "rand_core",
]
[[package]]
@@ -4417,16 +4543,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.11",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
+ "getrandom",
]
[[package]]
@@ -4435,7 +4552,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
dependencies = [
- "rand_core 0.6.4",
+ "rand_core",
]
[[package]]
@@ -4473,7 +4590,7 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4"
dependencies = [
- "getrandom 0.2.11",
+ "getrandom",
"libredox",
"thiserror",
]
@@ -4558,7 +4675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74"
dependencies = [
"cc",
- "getrandom 0.2.11",
+ "getrandom",
"libc",
"spin",
"untrusted",
@@ -4726,7 +4843,7 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
dependencies = [
"base16ct",
"der",
- "generic-array 0.14.7",
+ "generic-array",
"pkcs8",
"subtle",
"zeroize",
@@ -4738,7 +4855,7 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5"
dependencies = [
- "rand 0.8.5",
+ "rand",
"secp256k1-sys",
"serde",
]
@@ -4790,15 +4907,6 @@ dependencies = [
"serde_derive",
]
-[[package]]
-name = "serde_bytes"
-version = "0.11.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "serde_derive"
version = "1.0.193"
@@ -4901,7 +5009,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
"cfg-if",
"cpufeatures",
- "digest 0.10.7",
+ "digest",
]
[[package]]
@@ -4918,7 +5026,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
"cfg-if",
"cpufeatures",
- "digest 0.10.7",
+ "digest",
]
[[package]]
@@ -4936,15 +5044,12 @@ dependencies = [
[[package]]
name = "sha3"
-version = "0.8.2"
+version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf"
+checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
dependencies = [
- "block-buffer 0.7.3",
- "byte-tools",
- "digest 0.8.1",
+ "digest",
"keccak",
- "opaque-debug 0.2.3",
]
[[package]]
@@ -4998,8 +5103,8 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
dependencies = [
- "digest 0.10.7",
- "rand_core 0.6.4",
+ "digest",
+ "rand_core",
]
[[package]]
@@ -5199,15 +5304,6 @@ version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
-[[package]]
-name = "subtle-encoding"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945"
-dependencies = [
- "zeroize",
-]
-
[[package]]
name = "supports-color"
version = "1.3.1"
@@ -5228,6 +5324,29 @@ dependencies = [
"is_ci",
]
+[[package]]
+name = "symbolic-common"
+version = "12.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1cccfffbc6bb3bb2d3a26cd2077f4d055f6808d266f9d4d158797a4c60510dfe"
+dependencies = [
+ "debugid",
+ "memmap2 0.9.0",
+ "stable_deref_trait",
+ "uuid",
+]
+
+[[package]]
+name = "symbolic-demangle"
+version = "12.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76a99812da4020a67e76c4eb41f08c87364c14170495ff780f30dd519c221a68"
+dependencies = [
+ "cpp_demangle 0.4.3",
+ "rustc-demangle",
+ "symbolic-common",
+]
+
[[package]]
name = "syn"
version = "1.0.109"
@@ -5317,7 +5436,7 @@ dependencies = [
"iroha_logger",
"iroha_primitives",
"parity-scale-codec",
- "rand 0.8.5",
+ "rand",
"serde_json",
"tempfile",
"tokio",
@@ -5594,7 +5713,7 @@ dependencies = [
"indexmap 1.9.3",
"pin-project",
"pin-project-lite",
- "rand 0.8.5",
+ "rand",
"slab",
"tokio",
"tokio-util",
@@ -5743,7 +5862,7 @@ dependencies = [
"httparse",
"log",
"native-tls",
- "rand 0.8.5",
+ "rand",
"rustls",
"rustls-native-certs",
"sha1",
@@ -5907,7 +6026,7 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560"
dependencies = [
- "getrandom 0.2.11",
+ "getrandom",
]
[[package]]
@@ -5940,6 +6059,30 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+[[package]]
+name = "w3f-bls"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331"
+dependencies = [
+ "ark-bls12-377",
+ "ark-bls12-381",
+ "ark-ec",
+ "ark-ff",
+ "ark-serialize",
+ "ark-serialize-derive",
+ "arrayref",
+ "constcat",
+ "digest",
+ "rand",
+ "rand_chacha",
+ "rand_core",
+ "sha2",
+ "sha3",
+ "thiserror",
+ "zeroize",
+]
+
[[package]]
name = "wait-timeout"
version = "0.2.0"
@@ -5999,12 +6142,6 @@ dependencies = [
"tracing",
]
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@@ -6306,7 +6443,7 @@ dependencies = [
"anyhow",
"bincode",
"cfg-if",
- "cpp_demangle",
+ "cpp_demangle 0.3.5",
"gimli",
"ittapi",
"log",
@@ -6362,7 +6499,7 @@ dependencies = [
"memfd",
"memoffset",
"paste",
- "rand 0.8.5",
+ "rand",
"rustix",
"sptr",
"wasm-encoder 0.36.2",
@@ -6762,9 +6899,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96"
dependencies = [
"curve25519-dalek",
- "rand_core 0.6.4",
- "serde",
- "zeroize",
+ "rand_core",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index e47154c4890..b961c3d7966 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -116,7 +116,7 @@ strum = { version = "0.25.0", default-features = false }
getset = "0.1.2"
hex-literal = "0.4.1"
-rand = "0.8.5"
+rand = { version = "0.8.5", default-features = false, features = ["getrandom", "alloc"] }
warp = { version = "0.3.6", default-features = false }
wasmtime = "15.0.0"
@@ -253,3 +253,7 @@ members = [
inherits = "release"
strip = "symbols"
lto = true
+
+[profile.profiling]
+inherits = "release"
+debug = "limited"
diff --git a/Dockerfile.glibc b/Dockerfile.glibc
index 25eb2e0068a..fd4668a6e7e 100644
--- a/Dockerfile.glibc
+++ b/Dockerfile.glibc
@@ -1,16 +1,13 @@
-#base stage
-FROM archlinux:base-devel AS builder
+# base stage
+FROM debian:bookworm-slim AS builder
-# Force-sync packages, install archlinux-keyring, repopulate keys
-RUN pacman -Syy
-RUN pacman -S archlinux-keyring --noconfirm --disable-download-timeout
-RUN rm -rf /etc/pacman.d/gnupg/* && pacman-key --init && pacman-key --populate archlinux
+# install required packages
+RUN apt-get update -y && \
+ apt-get install -y curl build-essential mold
-# Install updates
-RUN pacman -Syu --noconfirm --disable-download-timeout
-
-# Set up Rust toolchain
-RUN pacman -S rustup mold wget --noconfirm --disable-download-timeout
+# set up Rust toolchain
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
+ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup toolchain install nightly-2024-01-12
RUN rustup default nightly-2024-01-12
RUN rustup target add wasm32-unknown-unknown
@@ -19,15 +16,18 @@ RUN rustup component add rust-src
# builder stage
WORKDIR /iroha
COPY . .
-RUN mold --run cargo build --target x86_64-unknown-linux-gnu --profile deploy
+ARG PROFILE="deploy"
+ARG RUSTFLAGS=""
+ARG FEATURES=""
+ARG CARGOFLAGS=""
+RUN RUSTFLAGS="${RUSTFLAGS}" mold --run cargo ${CARGOFLAGS} build --target x86_64-unknown-linux-gnu --profile "${PROFILE}" --features "${FEATURES}"
# final image
-FROM alpine:3.18
+FROM debian:bookworm-slim
-ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc
-ENV GLIBC_VERSION=2.35-r1
+ARG PROFILE="deploy"
ARG STORAGE=/storage
-ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/deploy
+ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-gnu/${PROFILE}
ENV BIN_PATH=/usr/local/bin/
ENV CONFIG_DIR=/config
ENV IROHA2_CONFIG_PATH=$CONFIG_DIR/config.json
@@ -39,12 +39,9 @@ ENV UID=1001
ENV GID=1001
RUN set -ex && \
- apk --update add libstdc++ curl ca-certificates gcompat && \
- for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION}; \
- do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \
- apk add --force-overwrite --allow-untrusted /tmp/*.apk && \
- rm -v /tmp/*.apk && \
- addgroup -g $GID $USER && \
+ apt-get update -y && \
+ apt-get install -y curl ca-certificates && \
+ addgroup --gid $GID $USER && \
adduser \
--disabled-password \
--gecos "" \
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
index 82ac7be7002..e8f89706770 100644
--- a/MAINTAINERS.md
+++ b/MAINTAINERS.md
@@ -1,32 +1,34 @@
## Maintainers
-Maintainers of Hyperledger Iroha project
-are supposed to help contributors by explain them project details,
-such as architecture, process, existing issues.
+Maintainers of the Hyperledger Iroha project
+are supposed to help contributors by explaining them project details,
+such as architecture, process, and existing issues.
-This is the list of maintainers, including their email address for direct communications:
+This is the list of maintainers, including their email addresses for direct communication:
-| Name | GitHub Id | email | Area of expertise |
-|------------------------|--------------------------|--------------------------------|---------------------------------|
-| Makoto Takemiya | @takemiyamakoto | takemiya@soramitsu.co.jp | Product vision |
-| Ryu Okada | @ryuo88 | okada@soramitsu.co.jp | Product vision |
-| Nikolai Iushkevich | @neewy | n.yushkevich@hotmail.com | Development |
-| Fyodor Muratov | @muratovv | fyodor@soramitsu.co.jp | Architecture, Java library, QA |
-| Andrei Lebedev | @lebdron | andrei@soramitsu.co.jp | Research |
-| Sergei Solonets | @Solonets | ssolonets@gmail.com | Development |
-| Yanno Ban | @yannoban | ban.yanno@nbc.org.kh | Development |
-| Dumitru Savva | @x3medima17 | savva@soramitsu.co.jp | Development |
-| Nikita Alekseev | @nickaleks | alekseev@soramitsu.co.jp | Development |
-| Victor Drobny | @victordrobny | drobny@soramitsu.co.jp | Development |
-| Bulat Nasrulin | @grimadas | bulat@soramitsu.co.jp | Development |
-| Kamil Salakhiev | @kamilsa | kamil@soramitsu.co.jp | Development |
-| Igor Egorov | @igor-egorov | igor@soramitsu.co.jp | Development, Android library |
-| Konstantin Munichev | @luckychess | konstantin@soramitsu.co.jp | Security |
-| Evgenii Mininbaev | @l4l | evgenii@soramitsu.co.jp | Security, Python library |
-| Vyacheslav Bikbaev | @laSinteZ | viacheslav@soramitsu.co.jp | Documentation, NodeJS library |
-| Arseniy Fokin | @stinger112 | stinger112@gmail.com | NodeJS library |
-| Alexey Chernyshov | @Alexey-N-Chernyshov | chernyshov@soramitsu.co.jp | Development |
-| Artyom Bakhtin | @bakhtin | a@bakhtin.net | Ansible, Jenkins, artifacts |
-| Anatoly Tyukushin | @tyvision | tyukushin@soramitsu.co.jp | Ansible, Jenkins |
-| Nikita Puzankov | @humb1t | puzankov@soramitsu.co.jp | Development |
-| Egor Ivkov | @eadventurous | ivkov@soramitsu.co.jp | Development |
+| Name | GitHub Id | email | Area of expertise |
+| --------------------- | ---------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------- |
+| Makoto Takemiya | [@takemiyamakoto](https://github.com/takemiyamakoto) | takemiya@soramitsu.co.jp | Product vision |
+| Dmitri Venger | [@dmitrivenger](https://github.com/dmitrivenger) | venger@soramitsu.co.jp | Project manager |
+| Bogdan Mingela | [@Mingela](https://github.com/Mingela) | mingela@soramitsu.co.jp | Iroha Team Lead |
+| Aleksandr Petrosyan | [@appetrosyan](https://github.com/appetrosyan) | ap886@cantab.ac.uk | Iroha 2 architect |
+| Daniil Polyakov | [@Arjentix](https://github.com/Arjentix) | daniil.polyakov@soramitsu.co.jp | Development: Rust, C++ |
+| Marin Veršić | [@mversic](https://github.com/mversic) | versic@soramitsu.co.jp | Tech lead, development: Rust, Java |
+| Sam H. Smith | [@SamHSmith](https://github.com/SamHSmith) | smith@soramitsu.co.jp | Development: Rust, C |
+| Shanin Roman | [@Erigara](https://github.com/Erigara) | shanin@soramitsu.co.jp | Development: Rust |
+| Dmitry Balashov | [@0x009922](https://github.com/0x009922) | dbalashov@soramitsu.co.jp | Development: Rust, TypeScript, JavaScript |
+| Grzegorz Bazior | [@baziorek](https://github.com/baziorek) | g.bazior@yodiss.pl | Development: C++, Python |
+| Shunkichi Sato | [@s8sato](https://github.com/s8sato) | s.sato@soramitsu.co.jp | Development: Rust |
+| Andrey Kostiuchenko | [@arndey](https://github.com/arndey) | kostiuchenko@soramitsu.co.jp | Developer: Java, Kotlin |
+| Timur Guskov | [@gv-timur](https://github.com/gv-timur) | guskov@soramitsu.co.jp | Development: Java |
+| Dmitriy Creed | [@Cre-eD](https://github.com/Cre-eD) | creed@soramitsu.co.jp | DevSecOps |
+| Vasily Zyabkin | [@BAStos525](https://github.com/BAStos525) | zyabkin@soramitsu.co.jp | DevOps |
+| Ekaterina Mekhnetsova | [@outoftardis](https://github.com/outoftardis) | mekhnetsova@soramitsu.co.jp | Documentation |
+| William Richter | [@WRRicht3r](https://github.com/WRRicht3r) | richter@soramitsu.co.jp | Documentation |
+| Victor Gridnevsky | [@6r1d](https://github.com/6r1d) | gridnevsky@soramitsu.co.jp | Community manager, documentation, development: JavaScript, TypeScript, Python |
+| Alexander Strokov | [@astrokov7](https://github.com/astrokov7) | strokov@soramitsu.co.jp | QA, Python |
+| Michael Timofeev | [@timofeevmd](https://github.com/timofeevmd) | timofeev@soramitsu.co.jp | QA |
+| Nikita Strygin | [@DCNick3](https://github.com/DCNick3) | moslike6@gmail.com | Development: Rust |
+| Bogdan Yamkovoy | [@yamkovoy](https://github.com/yamkovoy) | yamkovoy@soramitsu.co.jp | Documentation |
+| Vladislav Amuzinski | [@VAmuzing](https://github.com/VAmuzing) | amuzinski@soramitsu.co.jp | Development: Rust |
+| Artem Stukalov | [@Stukalov-A-M](https://github.com/Stukalov-A-M) | stukalov@soramitsu.co.jp | Documentation: examples |
diff --git a/cli/src/lib.rs b/cli/src/lib.rs
index 6de12024e6a..13c69571e59 100644
--- a/cli/src/lib.rs
+++ b/cli/src/lib.rs
@@ -274,7 +274,7 @@ impl Iroha {
&config.block_sync,
sumeragi.clone(),
Arc::clone(&kura),
- PeerId::new(&config.torii.p2p_addr, &config.public_key),
+ PeerId::new(config.torii.p2p_addr.clone(), config.public_key.clone()),
network.clone(),
)
.start();
@@ -459,7 +459,8 @@ impl Iroha {
// FIXME: don't like neither the message nor inability to throw Result to the outside
.expect("Cannot proceed without working subscriptions");
- // NOTE: Triggered by tokio::select
+ // See https://github.com/tokio-rs/tokio/issues/5616 and
+ // https://github.com/rust-lang/rust-clippy/issues/10636
#[allow(clippy::redundant_pub_crate)]
loop {
tokio::select! {
diff --git a/cli/src/samples.rs b/cli/src/samples.rs
index 05858803f19..94d2495b884 100644
--- a/cli/src/samples.rs
+++ b/cli/src/samples.rs
@@ -30,16 +30,10 @@ pub fn get_trusted_peers(public_key: Option<&PublicKey>) -> HashSet {
),
]
.iter()
- .map(|(a, k)| PeerId {
- address: a.parse().expect("Valid"),
- public_key: PublicKey::from_str(k).unwrap(),
- })
+ .map(|(a, k)| PeerId::new(a.parse().expect("Valid"), PublicKey::from_str(k).unwrap()))
.collect();
if let Some(pubkey) = public_key {
- trusted_peers.insert(PeerId {
- address: DEFAULT_TORII_P2P_ADDR.clone(),
- public_key: pubkey.clone(),
- });
+ trusted_peers.insert(PeerId::new(DEFAULT_TORII_P2P_ADDR.clone(), pubkey.clone()));
}
trusted_peers
}
diff --git a/client/benches/tps/utils.rs b/client/benches/tps/utils.rs
index e11e2febe90..a8e2c086c71 100644
--- a/client/benches/tps/utils.rs
+++ b/client/benches/tps/utils.rs
@@ -225,9 +225,7 @@ impl MeasurerUnit {
.with_instructions([instruction]);
transaction.set_nonce(nonce); // Use nonce to avoid transaction duplication within the same thread
- let transaction = submitter
- .sign_transaction(transaction)
- .expect("Failed to sign transaction");
+ let transaction = submitter.sign_transaction(transaction);
if let Err(error) = submitter.submit_transaction(&transaction) {
iroha_logger::error!(?error, "Failed to submit transaction");
}
diff --git a/client/examples/tutorial.rs b/client/examples/tutorial.rs
index cead2516b4a..40c56a1a3aa 100644
--- a/client/examples/tutorial.rs
+++ b/client/examples/tutorial.rs
@@ -74,9 +74,7 @@ fn domain_registration_test(config: &Configuration) -> Result<(), Error> {
// Prepare a transaction
let metadata = UnlimitedMetadata::default();
let instructions: Vec = vec![create_looking_glass.into()];
- let tx = iroha_client
- .build_transaction(instructions, metadata)
- .wrap_err("Error building a domain registration transaction")?;
+ let tx = iroha_client.build_transaction(instructions, metadata);
// #endregion domain_register_example_prepare_tx
// #region domain_register_example_submit_tx
@@ -148,7 +146,7 @@ fn account_registration_test(config: &Configuration) -> Result<(), Error> {
// Account's RegisterBox
let metadata = UnlimitedMetadata::new();
let instructions: Vec = vec![create_account.into()];
- let tx = iroha_client.build_transaction(instructions, metadata)?;
+ let tx = iroha_client.build_transaction(instructions, metadata);
// #endregion register_account_prepare_tx
// #region register_account_submit_tx
diff --git a/client/src/client.rs b/client/src/client.rs
index 427f22effc1..638c19a5305 100644
--- a/client/src/client.rs
+++ b/client/src/client.rs
@@ -63,30 +63,17 @@ pub type QueryResult = core::result::Result;
/// Trait for signing transactions
pub trait Sign {
/// Sign transaction with provided key pair.
- ///
- /// # Errors
- ///
- /// Fails if signature creation fails
- fn sign(
- self,
- key_pair: crate::crypto::KeyPair,
- ) -> Result;
+ fn sign(self, key_pair: &crate::crypto::KeyPair) -> SignedTransaction;
}
impl Sign for TransactionBuilder {
- fn sign(
- self,
- key_pair: crate::crypto::KeyPair,
- ) -> Result {
+ fn sign(self, key_pair: &crate::crypto::KeyPair) -> SignedTransaction {
self.sign(key_pair)
}
}
impl Sign for SignedTransaction {
- fn sign(
- self,
- key_pair: crate::crypto::KeyPair,
- ) -> Result {
+ fn sign(self, key_pair: &crate::crypto::KeyPair) -> SignedTransaction {
self.sign(key_pair)
}
}
@@ -468,7 +455,7 @@ impl Client {
&self,
instructions: impl Into,
metadata: UnlimitedMetadata,
- ) -> Result {
+ ) -> SignedTransaction {
let tx_builder = TransactionBuilder::new(self.chain_id.clone(), self.account_id.clone());
let mut tx_builder = match instructions.into() {
@@ -484,30 +471,23 @@ impl Client {
tx_builder.set_nonce(nonce);
};
- tx_builder
- .with_metadata(metadata)
- .sign(self.key_pair.clone())
- .wrap_err("Failed to sign transaction")
+ tx_builder.with_metadata(metadata).sign(&self.key_pair)
}
/// Signs transaction
///
/// # Errors
/// Fails if signature generation fails
- pub fn sign_transaction(&self, transaction: Tx) -> Result {
- transaction
- .sign(self.key_pair.clone())
- .wrap_err("Failed to sign transaction")
+ pub fn sign_transaction(&self, transaction: Tx) -> SignedTransaction {
+ transaction.sign(&self.key_pair)
}
/// Signs query
///
/// # Errors
/// Fails if signature generation fails
- pub fn sign_query(&self, query: QueryBuilder) -> Result {
- query
- .sign(self.key_pair.clone())
- .wrap_err("Failed to sign query")
+ pub fn sign_query(&self, query: QueryBuilder) -> SignedQuery {
+ query.sign(&self.key_pair)
}
/// Instructions API entry point. Submits one Iroha Special Instruction to `Iroha` peers.
@@ -557,7 +537,7 @@ impl Client {
instructions: impl IntoIterator- ,
metadata: UnlimitedMetadata,
) -> Result> {
- self.submit_transaction(&self.build_transaction(instructions, metadata)?)
+ self.submit_transaction(&self.build_transaction(instructions, metadata))
}
/// Submit a prebuilt transaction.
@@ -746,15 +726,12 @@ impl Client {
instructions: impl IntoIterator
- ,
metadata: UnlimitedMetadata,
) -> Result> {
- let transaction = self.build_transaction(instructions, metadata)?;
+ let transaction = self.build_transaction(instructions, metadata);
self.submit_transaction_blocking(&transaction)
}
/// Lower-level Query API entry point. Prepares an http-request and returns it with an http-response handler.
///
- /// # Errors
- /// Fails if query signing fails.
- ///
/// # Examples
///
/// ```ignore
@@ -817,12 +794,12 @@ impl Client {
pagination: Pagination,
sorting: Sorting,
fetch_size: FetchSize,
- ) -> Result<(DefaultRequestBuilder, QueryResponseHandler)>
+ ) -> (DefaultRequestBuilder, QueryResponseHandler)
where
>::Error: Into,
{
let query_builder = QueryBuilder::new(request, self.account_id.clone()).with_filter(filter);
- let request = self.sign_query(query_builder)?.encode_versioned();
+ let request = self.sign_query(query_builder).encode_versioned();
let query_request = QueryRequest {
torii_url: self.torii_url.clone(),
@@ -834,10 +811,10 @@ impl Client {
),
};
- Ok((
+ (
query_request.clone().assemble(),
QueryResponseHandler::new(query_request),
- ))
+ )
}
/// Create a request with pagination, sorting and add the filter.
@@ -858,7 +835,7 @@ impl Client {
{
iroha_logger::trace!(?request, %pagination, ?sorting, ?filter);
let (req, mut resp_handler) =
- self.prepare_query_request::(request, filter, pagination, sorting, fetch_size)?;
+ self.prepare_query_request::(request, filter, pagination, sorting, fetch_size);
let response = req.build()?.send()?;
let value = resp_handler.handle(&response)?;
@@ -1000,57 +977,37 @@ impl Client {
)
}
- /// Check if two transactions are the same. Compare their contents excluding the creation time.
- fn equals_excluding_creation_time(
- first: &TransactionPayload,
- second: &TransactionPayload,
- ) -> bool {
- first.authority() == second.authority()
- && first.instructions() == second.instructions()
- && first.time_to_live() == second.time_to_live()
- && first.metadata().eq(second.metadata())
- }
-
- /// Find the original transaction in the pending local tx
- /// queue. Should be used for an MST case. Takes pagination as
- /// parameter.
+ /// Find the original transaction in the local pending tx queue.
+ /// Should be used for an MST case.
///
/// # Errors
- /// - if subscribing to websocket fails
- pub fn get_original_transaction_with_pagination(
+ /// - if sending request fails
+ pub fn get_original_matching_transactions(
&self,
transaction: &SignedTransaction,
retry_count: u32,
retry_in: Duration,
- pagination: Pagination,
- ) -> Result