├── .cargo └── zepter.yaml ├── .devcontainer └── devcontainer.json ├── .github ├── ISSUE_TEMPLATE │ ├── ask-a-question.md │ ├── report-a-bug.md │ └── suggest-a-feature.md └── workflows │ ├── ci.yml │ ├── delete-release.yml │ └── publish-docker-release.yml ├── .gitignore ├── .taplo.toml ├── .vscode └── tasks.json ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── Jenkinsfile ├── LICENSE ├── README.md ├── about.hbs ├── about.toml ├── ci ├── check_fmt_log.sh └── install_rust.sh ├── docker-compose.yml ├── node ├── Cargo.toml ├── build.rs ├── res │ ├── cranny.json │ └── integritee-solo.json └── src │ ├── benchmarking.rs │ ├── chain_spec.rs │ ├── cli.rs │ ├── command.rs │ ├── main.rs │ ├── rpc.rs │ └── service.rs ├── runtime ├── Cargo.toml ├── build.rs └── src │ ├── lib.rs │ └── weights │ ├── frame_system.rs │ ├── mod.rs │ ├── pallet_balances.rs │ ├── pallet_claims.rs │ ├── pallet_enclave_bridge.rs │ ├── pallet_multisig.rs │ ├── pallet_preimage.rs │ ├── pallet_proxy.rs │ ├── pallet_scheduler.rs │ ├── pallet_sidechain.rs │ ├── pallet_sudo.rs │ ├── pallet_teeracle.rs │ ├── pallet_teerdays.rs │ ├── pallet_teerex.rs │ ├── pallet_timestamp.rs │ ├── pallet_treasury.rs │ ├── pallet_utility.rs │ └── pallet_vesting.rs ├── rust-toolchain.toml ├── rustfmt.toml ├── scripts ├── benchmark_all_pallets.sh ├── docker_run.sh ├── dump_wasm_state_and_spec.sh ├── github │ └── lib.rb ├── treasury-test.py ├── update_hardcoded_chain_specs.py └── vesting-transfers.py └── shell.nix /.cargo/zepter.yaml: -------------------------------------------------------------------------------- 1 | version: 2 | format: 1 3 | # Minimum version of the binary that is expected to work. This is just for printing a nice error 4 | # message when someone tries to use an older version. 5 | binary: 0.13.2 6 | 7 | # The examples in this file assume crate `A` to have a dependency on crate `B`. 8 | workflows: 9 | check: 10 | - [ 11 | 'lint', 12 | # Check that `A` activates the features of `B`. 13 | 'propagate-feature', 14 | # These are the features to check: 15 | '--features=try-runtime,runtime-benchmarks,std', 16 | # Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually. 17 | '--left-side-feature-missing=ignore', 18 | # Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on. 19 | '--left-side-outside-workspace=ignore', 20 | # Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used. 21 | '--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking', 22 | # Auxillary flags: 23 | '--offline', 24 | '--locked', 25 | '--show-path', 26 | '--quiet', 27 | ] 28 | # Same as `check`, but with the `--fix` flag. 29 | default: 30 | - [ $check.0, '--fix' ] 31 | 32 | # Will be displayed when any workflow fails: 33 | help: 34 | text: | 35 | This repo uses the Zepter CLI to detect abnormalities in the feature configuration. 36 | It looks like one more more checks failed; please check the console output. You can try to automatically address them by running `zepter`. 37 | Otherwise please ask directly in the Merge Request, GitHub Discussions or on Matrix Chat, thank you. 38 | links: 39 | - "https://github.com/ggwpez/zepter" 40 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Substrate Node template", 3 | "context": "..", 4 | "settings": { 5 | "terminal.integrated.shell.linux": "/bin/bash", 6 | "lldb.executable": "/usr/bin/lldb" 7 | }, 8 | "extensions": [ 9 | "rust-lang.rust", 10 | "bungcip.better-toml", 11 | "vadimcn.vscode-lldb" 12 | ], 13 | "forwardPorts": [ 14 | 3000, 15 | 9944 16 | ], 17 | "preCreateCommand": "cargo build --release && cargo check", 18 | "postStartCommand": "./target/release/node-template --dev --ws-external", 19 | "menuActions": [ 20 | {"id": "polkadotjs", 21 | "label": "Open PolkadotJS Apps", 22 | "type": "external-preview", 23 | "args": ["https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F/$HOST/wss"]} 24 | ], 25 | "image": "paritytech/substrate-playground-template-node-template:latest" 26 | } 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ask-a-question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ask a Question 3 | about: Ask a question about this template. 4 | title: "" 5 | labels: question 6 | assignees: "" 7 | --- 8 | 9 | **Question** 10 | 11 | _Please include information such as the following: is your question to clarify an existing resource 12 | or are you asking about something new? what are you trying to accomplish? where have you looked for 13 | answers?_ 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/report-a-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Report a Bug 3 | about: Report a problem with this template. 4 | title: "" 5 | labels: bug 6 | assignees: "" 7 | --- 8 | 9 | **Description** 10 | 11 | _Tell us what happened. In particular, be specific about any changes you made to this template. 12 | Ideally, provide a link to your project's GitHub repository. Please note that we are not able to 13 | support all conceivable changes to this template project, but the more information you are able to 14 | provide the more equipped we will be to help._ 15 | 16 | **Steps to Reproduce** 17 | 18 | _Replace the example steps below with actual steps to reproduce the bug you're reporting._ 19 | 20 | 1. Go to '...' 21 | 2. Click on '....' 22 | 3. Scroll down to '....' 23 | 4. See error 24 | 25 | **Expected vs. Actual Behavior** 26 | 27 | _What did you expect to happen after you followed the steps you described in the last section? What 28 | actually happened?_ 29 | 30 | **Environment** 31 | 32 | _Describe the environment in which you encountered this bug. Use the list below as a starting point 33 | and add additional information if you think it's relevant._ 34 | 35 | - Operating system: 36 | - Template version/tag: 37 | - Rust version (run `rustup show`): 38 | 39 | **Logs, Errors or Screenshots** 40 | 41 | _Please provide the text of any logs or errors that you experienced; if 42 | applicable, provide screenshots to help illustrate the problem._ 43 | 44 | **Additional Information** 45 | 46 | _Please add any other details that you think may help us solve your problem._ 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/suggest-a-feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Suggest a Feature 3 | about: Suggest a new feature or an improvement to an existing feature for this template. 4 | title: "" 5 | labels: enhancement 6 | assignees: "" 7 | --- 8 | 9 | **Motivation** 10 | 11 | _Describe the need or frustration that motivated you to make this suggestion. Please note that the 12 | goal of this project is to provide a general-purpose template project, so please take care when 13 | suggesting features that may be specific to a particular use case._ 14 | 15 | **Suggested Solution** 16 | 17 | _Describe your suggested solution to the need or frustration that you are experiencing._ 18 | 19 | **Alternatives** 20 | 21 | _Describe any alternative solutions or features you considered and why you believe your suggested 22 | solution is preferable._ 23 | 24 | **Additional Information** 25 | 26 | _Provide any additional information that you believe may help us evaluate your suggestion._ 27 | -------------------------------------------------------------------------------- /.github/workflows/delete-release.yml: -------------------------------------------------------------------------------- 1 | name: Delete-Release 2 | 3 | on: 4 | release: 5 | types: [deleted] # should be deleted 6 | 7 | jobs: 8 | purge-image: 9 | name: Delete image from ghcr.io 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | binary: ["integritee-node"] 14 | steps: 15 | - uses: actions/checkout@v3 16 | 17 | - name: Set output 18 | id: vars 19 | run: echo "{tag}={${GITHUB_REF#refs/*/}}" >> $GITHUB_OUTPUT 20 | 21 | - name: Check output 22 | env: 23 | RELEASE_VERSION: ${{ steps.vars.outputs.tag }} 24 | run: | 25 | echo $RELEASE_VERSION 26 | echo ${{ steps.vars.outputs.tag }} 27 | echo ${{github.event.pull_request.number}} 28 | 29 | - name: Login to DockerHub 30 | if: github.event_name != 'pull_request' 31 | uses: docker/login-action@v1 32 | with: 33 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 34 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 35 | 36 | # Unfortunately accessing the repo with personal access token is not possible 37 | # Workaround: disable 2FA and user password instead of TOKEN 38 | - name: Delete docker tag 39 | run: | 40 | ORGANIZATION="integritee" 41 | IMAGE="${{ matrix.binary }}" 42 | TAG="${{ steps.vars.outputs.tag }}" 43 | 44 | login_data() { 45 | cat <&1 | tee build_release.log' 24 | sh 'cargo build 2>&1 | tee build_debug.log' 25 | } 26 | } 27 | stage('Archive build output') { 28 | steps { 29 | archiveArtifacts artifacts: '**/integritee-node', caseSensitive: false, fingerprint: true, onlyIfSuccessful: true 30 | } 31 | } 32 | stage('Test') { 33 | steps { 34 | sh 'BUILD_DUMMY_WASM_BINARY=1 cargo test --all 2>&1 | tee test.log' 35 | } 36 | } 37 | // running clippy doesn't actually make sense here, as it's 99% upstream code. 38 | // however, right now it didn't take much to make it pass 39 | stage('Clippy') { 40 | steps { 41 | sh 'cargo clean' 42 | catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { 43 | sh 'cargo clippy 2>&1 | tee clippy_debug.log' 44 | } 45 | } 46 | } 47 | // NEVER!!! run cargo fmt! This is 99% upstream code and we need easy-rebase! 48 | stage('Results') { 49 | steps { 50 | recordIssues( 51 | aggregatingResults: true, 52 | enabledForFailure: true, 53 | qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]], 54 | tools: [ 55 | cargo( 56 | pattern: 'build.log', 57 | reportEncoding: 'UTF-8' 58 | ), 59 | groovyScript( 60 | parserId:'clippy-warnings', 61 | pattern: 'clippy.log', 62 | reportEncoding: 'UTF-8' 63 | ), 64 | groovyScript( 65 | parserId:'clippy-errors', 66 | pattern: 'clippy.log', 67 | reportEncoding: 'UTF-8' 68 | ) 69 | ] 70 | ) 71 | // catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') { 72 | // sh './ci/check_fmt_log.sh' 73 | // } 74 | } 75 | } 76 | stage('Archive logs') { 77 | steps { 78 | archiveArtifacts artifacts: '*.log', caseSensitive: false, fingerprint: true, onlyIfSuccessful: true 79 | } 80 | } 81 | } 82 | post { 83 | unsuccessful { 84 | emailext ( 85 | subject: "Jenkins Build '${env.JOB_NAME} [${env.BUILD_NUMBER}]' is ${currentBuild.currentResult}", 86 | body: "${env.JOB_NAME} build ${env.BUILD_NUMBER} is ${currentBuild.currentResult}\n\nMore info at: ${env.BUILD_URL}", 87 | to: "${env.RECIPIENTS_SUBSTRATEE}" 88 | ) 89 | } 90 | always { 91 | cleanWs() 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # integritee-node 2 | 3 | This repository belongs to the [Integritee project](https://integritee.network). 4 | 5 | A substrate-based node that maintains a registry of remote attested integritee-service enclaves. The node also acts as a proxy for encrypted requests which are forwarded to the integritee-service. 6 | 7 | ## Build and Run 8 | 1. See the substrate install docs to install the preliminaries: [https://docs.substrate.io/install](https://docs.substrate.io/install). 9 | 2. Build the node: 10 | ``` 11 | cargo build --release 12 | ``` 13 | 14 | ## Versioning 15 | There are two important version parameters in the `RuntimeVersion` that change behaviour, see [RustDocs](https://paritytech.github.io/substrate/master/sp_version/struct.RuntimeVersion.html). 16 | * `spec_version` always needs to be updated when the runtime logic changes. 17 | * `transaction_version`, see desctription in [RustDocs](https://paritytech.github.io/substrate/master/sp_version/struct.RuntimeVersion.html). 18 | 19 | Convention: 20 | 1. The runtime's and node's crate patch version must be aligned with the `spec_version`. 21 | 2. The crate version must be the same as the tag that is created for the release. 22 | 23 | 24 | ## Benchmark the runtimes 25 | In `./scripts` we have a script for benchmarking the runtimes. 26 | 27 | ### Current benchmark 28 | The current weights have been benchmarked with the following reference hardware: 29 | 30 | GenuineIntel CPU MHz: 2494.144 31 | 8GB of RAM 32 | NVMe SSD 33 | 34 | ### Running benchmark 35 | 1. Compile the node with: `cargo build --release --features runtime-benchmarks` 36 | 2. run: `./scripts/benchmark_all_pallets.sh`. 37 | 3. If changed, update the reference hardware above. 38 | 39 | ### Adding new pallets to be benchmarked 40 | Every pallet with a `type WeightInfo` parameter in its config must be benchmarked. 41 | 42 | 1. [Cargo.toml] add `/runtime-benchmarks` in the `runtime-benchmarks` feature section. 43 | 2. [runtime] add the new pallet to the `list_benchmark!` and `add_benchmark!` list. 44 | 3. add the new pallet in the script `./scripts/benchmark_all_pallets.sh` and run it. 45 | 4. [runtime/src/weights] add the new file to the modules 46 | 5. [runtime] replace the placeholder `type WeightInfo = ()` with `type WeightInfo = weights::::WeightInfo` 47 | 48 | ## upgrade hard-coded genesis 49 | 50 | For easy use of the binary without distributing a json chain spec, we generate a spec and build it into the binary 51 | ``` 52 | ./target/release/integritee-node build-spec --chain integritee-solo-fresh --raw > integritee-solo.json 53 | ./target/release/integritee-node build-spec --chain cranny-fresh --raw > cranny.json 54 | ``` 55 | Then overwrite spec files in `./node/res/*.json` but keep bootnode definitions and check other meta too. 56 | 57 | Build the collator again and push. 58 | 59 | ## prepare and test runtime upgrade for Live chain 60 | 61 | 1. bump spec version. check if other runtime versions need to be bumped too. bump crate versions accordingly 62 | 2. tag version. this will trigger CI to produce a draft release with all artifacts 63 | 3. download release artifacts `integritee-node` (and postfix with version `-1.0.6`) and `integritee_node_runtime-v6.compact.compressed.wasm` 64 | 4. start a local chain with the previous, latest deployed version (`1.0.5`) 65 | ``` 66 | ./integritee-node-1.0.5 purge-chain --base-path /tmp/alice --chain local 67 | ./integritee-node-1.0.5 purge-chain --base-path /tmp/bob --chain local 68 | ./integritee-node-1.0.5 --base-path /tmp/alice --chain local --alice --port 30333 --ws-port 9945 --rpc-port 9933 --node-key 0000000000000000000000000000000000000000000000000000000000000001 --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --validator 69 | ``` 70 | 71 | 5. in another terminal 72 | ``` 73 | integritee-node-1.0.5 --base-path /tmp/bob --chain local --bob --port 30334 --ws-port 9946 --rpc-port 9934 --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --validator --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp 74 | ``` 75 | you should see blocks produced. 76 | 6. perform a transfer extrinsic in js/apps to test 77 | 7. upgrade runtime to `integritee_node_runtime-v6.compact.compressed.wasm` 78 | 8. verify spec version has been upgraded in js/apps 79 | 9. stop one validator and restart it with newer binary version 80 | 10. test by pointing js/apps to the updated validator ws:// and sending a transfer 81 | 11. stop second validator and restart with new binary 82 | 12. test by pointing js/apps to the updated validator ws:// and sending a transfer 83 | 13. check that the node version has increased in js/apps 84 | 14. finally, submit runtime upgrade to live chain 85 | -------------------------------------------------------------------------------- /about.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 37 | 38 | 39 |
40 |
41 |

Third Party Licenses

42 |

This page lists the licenses of the projects used in 'Integritee Networks integritee-node' repository.

43 |
44 | 45 |

Overview of licenses:

46 |
    47 | {{#each overview}} 48 |
  • {{name}} ({{count}})
  • 49 | {{/each}} 50 |
51 | 52 |

All license text:

53 |
    54 | {{#each licenses}} 55 |
  • 56 |

    {{name}}

    57 |

    Used by:

    58 | 63 |
    {{text}}
    64 |
  • 65 | {{/each}} 66 |
67 |
68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /about.toml: -------------------------------------------------------------------------------- 1 | accepted = [ 2 | "Apache-2.0", 3 | "MIT", 4 | "Apache-2.0 WITH LLVM-exception", 5 | "BSD-2-Clause", 6 | "CC0-1.0", 7 | "BSD-3-Clause", 8 | "MPL-2.0", 9 | "ISC", 10 | "OpenSSL", 11 | "Unicode-DFS-2016", 12 | "GPL-3.0 WITH Classpath-exception-2.0", 13 | # Our own DCAP-verification requires this. 14 | "GPL-3.0", 15 | # This is suddendly needed for webpki v0.22.0 16 | # because it can't identify the licence. See #153. 17 | "NOASSERTION" 18 | ] 19 | ignore-dev-dependencies = true 20 | ignore-build-dependencies = true 21 | workarounds = [ 22 | "ring", 23 | ] -------------------------------------------------------------------------------- /ci/check_fmt_log.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # script to check if file size of fmt.log is 0 4 | 5 | # Fail fast if any commands exists with error 6 | set -e 7 | 8 | # Print all executed commands 9 | set -x 10 | 11 | if [[ ! -s fmt.log ]]; then 12 | exit 0 13 | fi 14 | 15 | exit 1 16 | -------------------------------------------------------------------------------- /ci/install_rust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # call this script from repo root directory 3 | 4 | # Fail fast if any commands exists with error 5 | # Print all executed commands 6 | set -ex 7 | 8 | # Download rustup script and execute it 9 | curl https://sh.rustup.rs -sSf > ./rustup.sh 10 | chmod +x ./rustup.sh 11 | ./rustup.sh -y 12 | 13 | # Load new environment 14 | source $HOME/.cargo/env 15 | 16 | # With the new rust-toolchain.toml format, this should automatically install the correct components. 17 | rustup show 18 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.2" 2 | 3 | services: 4 | dev: 5 | container_name: node-template 6 | image: paritytech/ci-linux:production 7 | working_dir: /var/www/node-template 8 | ports: 9 | - "9944:9944" 10 | environment: 11 | - CARGO_HOME=/var/www/node-template/.cargo 12 | - WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 13 | volumes: 14 | - .:/var/www/node-template 15 | - type: bind 16 | source: ./.local 17 | target: /root/.local 18 | command: bash -c "cargo build --release && ./target/release/node-template --dev --ws-external" 19 | -------------------------------------------------------------------------------- /node/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Integritee AG "] 3 | build = 'build.rs' 4 | description = 'Integritee Node for Solochain' 5 | edition = '2021' 6 | homepage = 'https://integritee.network/' 7 | license = 'Apache-2.0' 8 | name = 'integritee-node' 9 | repository = 'https://github.com/integritee-network/integritee-node' 10 | # Align major.minor revision with polkadot sdk, bump patch revision ad lib. Make this the github release tag. 11 | version = '1.13.1' 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [[bin]] 16 | name = 'integritee-node' 17 | 18 | [dependencies] 19 | clap = { workspace = true } 20 | futures = { workspace = true } 21 | hex = { workspace = true } 22 | hex-literal = { workspace = true } 23 | serde_json = { workspace = true } 24 | 25 | frame-metadata-hash-extension = { workspace = true, features = ["std"] } 26 | frame-system = { workspace = true, features = ["std"] } 27 | pallet-transaction-payment = { workspace = true, features = ["std"] } 28 | sc-cli = { workspace = true } 29 | sc-client-api = { workspace = true } 30 | sc-consensus = { workspace = true } 31 | sc-consensus-aura = { workspace = true } 32 | sc-consensus-grandpa = { workspace = true } 33 | sc-executor = { workspace = true } 34 | sc-keystore = { workspace = true } 35 | sc-network = { workspace = true } 36 | sc-offchain = { workspace = true } 37 | sc-service = { workspace = true } 38 | sc-telemetry = { workspace = true } 39 | sc-transaction-pool = { workspace = true } 40 | sc-transaction-pool-api = { workspace = true } 41 | sp-consensus = { workspace = true } 42 | sp-consensus-aura = { workspace = true } 43 | sp-consensus-grandpa = { workspace = true, features = ["std"] } 44 | sp-core = { workspace = true, features = ["std"] } 45 | sp-inherents = { workspace = true, features = ["std"] } 46 | sp-io = { workspace = true, features = ["std"] } 47 | sp-keyring = { workspace = true } 48 | sp-runtime = { workspace = true, features = ["std"] } 49 | sp-timestamp = { workspace = true, features = ["std"] } 50 | 51 | # These dependencies are used for the node's RPCs 52 | jsonrpsee = { workspace = true } 53 | pallet-transaction-payment-rpc = { workspace = true } 54 | sc-basic-authorship = { workspace = true } 55 | sc-rpc = { workspace = true } 56 | sc-rpc-api = { workspace = true } 57 | sp-api = { workspace = true, features = ["std"] } 58 | sp-block-builder = { workspace = true, features = ["std"] } 59 | sp-blockchain = { workspace = true } 60 | substrate-frame-rpc-system = { workspace = true } 61 | 62 | # These dependencies are used for runtime benchmarking 63 | frame-benchmarking = { workspace = true, features = ["std"] } 64 | frame-benchmarking-cli = { workspace = true } 65 | 66 | # local dependencies 67 | integritee-node-runtime = { path = '../runtime' } 68 | 69 | [build-dependencies] 70 | substrate-build-script-utils = { workspace = true } 71 | 72 | [features] 73 | default = [] 74 | runtime-benchmarks = [ 75 | "integritee-node-runtime/runtime-benchmarks", 76 | "sc-service/runtime-benchmarks", 77 | "frame-benchmarking/runtime-benchmarks", 78 | "frame-benchmarking-cli/runtime-benchmarks", 79 | "frame-system/runtime-benchmarks", 80 | "sp-runtime/runtime-benchmarks", 81 | ] 82 | # for secure launch of a live solo network, do enable extrinsic filtering 83 | extrinsic-filtering = ["integritee-node-runtime/extrinsic-filtering"] 84 | -------------------------------------------------------------------------------- /node/build.rs: -------------------------------------------------------------------------------- 1 | use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; 2 | 3 | fn main() { 4 | generate_cargo_keys(); 5 | 6 | rerun_if_git_head_changed(); 7 | } 8 | -------------------------------------------------------------------------------- /node/src/benchmarking.rs: -------------------------------------------------------------------------------- 1 | //! Setup code for [`super::command`] which would otherwise bloat that module. 2 | //! 3 | //! Should only be used for benchmarking as it may break in other contexts. 4 | 5 | use crate::service::FullClient; 6 | 7 | use integritee_node_runtime as runtime; 8 | use runtime::{AccountId, Balance, BalancesCall, SystemCall}; 9 | use sc_cli::Result; 10 | use sc_client_api::BlockBackend; 11 | use sp_core::{Encode, Pair}; 12 | use sp_inherents::{InherentData, InherentDataProvider}; 13 | use sp_keyring::Sr25519Keyring; 14 | use sp_runtime::{OpaqueExtrinsic, SaturatedConversion}; 15 | 16 | use std::{sync::Arc, time::Duration}; 17 | 18 | /// Generates extrinsics for the `benchmark overhead` command. 19 | /// 20 | /// Note: Should only be used for benchmarking. 21 | pub struct RemarkBuilder { 22 | client: Arc, 23 | } 24 | 25 | impl RemarkBuilder { 26 | /// Creates a new [`Self`] from the given client. 27 | pub fn new(client: Arc) -> Self { 28 | Self { client } 29 | } 30 | } 31 | 32 | impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder { 33 | fn pallet(&self) -> &str { 34 | "system" 35 | } 36 | 37 | fn extrinsic(&self) -> &str { 38 | "remark" 39 | } 40 | 41 | fn build(&self, nonce: u32) -> std::result::Result { 42 | let acc = Sr25519Keyring::Bob.pair(); 43 | let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( 44 | self.client.as_ref(), 45 | acc, 46 | SystemCall::remark { remark: vec![] }.into(), 47 | nonce, 48 | ) 49 | .into(); 50 | 51 | Ok(extrinsic) 52 | } 53 | } 54 | 55 | /// Generates `Balances::TransferKeepAlive` extrinsics for the benchmarks. 56 | /// 57 | /// Note: Should only be used for benchmarking. 58 | pub struct TransferKeepAliveBuilder { 59 | client: Arc, 60 | dest: AccountId, 61 | value: Balance, 62 | } 63 | 64 | impl TransferKeepAliveBuilder { 65 | /// Creates a new [`Self`] from the given client. 66 | pub fn new(client: Arc, dest: AccountId, value: Balance) -> Self { 67 | Self { client, dest, value } 68 | } 69 | } 70 | 71 | impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { 72 | fn pallet(&self) -> &str { 73 | "balances" 74 | } 75 | 76 | fn extrinsic(&self) -> &str { 77 | "transfer_keep_alive" 78 | } 79 | 80 | fn build(&self, nonce: u32) -> std::result::Result { 81 | let acc = Sr25519Keyring::Bob.pair(); 82 | let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( 83 | self.client.as_ref(), 84 | acc, 85 | BalancesCall::transfer_keep_alive { dest: self.dest.clone().into(), value: self.value } 86 | .into(), 87 | nonce, 88 | ) 89 | .into(); 90 | 91 | Ok(extrinsic) 92 | } 93 | } 94 | 95 | /// Create a transaction using the given `call`. 96 | /// 97 | /// Note: Should only be used for benchmarking. 98 | pub fn create_benchmark_extrinsic( 99 | client: &FullClient, 100 | sender: sp_core::sr25519::Pair, 101 | call: runtime::RuntimeCall, 102 | nonce: u32, 103 | ) -> runtime::UncheckedExtrinsic { 104 | let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); 105 | let best_hash = client.chain_info().best_hash; 106 | let best_block = client.chain_info().best_number; 107 | 108 | let period = runtime::BlockHashCount::get() 109 | .checked_next_power_of_two() 110 | .map(|c| c / 2) 111 | .unwrap_or(2) as u64; 112 | let extra: runtime::SignedExtra = ( 113 | frame_system::CheckNonZeroSender::::new(), 114 | frame_system::CheckSpecVersion::::new(), 115 | frame_system::CheckTxVersion::::new(), 116 | frame_system::CheckGenesis::::new(), 117 | frame_system::CheckEra::::from(sp_runtime::generic::Era::mortal( 118 | period, 119 | best_block.saturated_into(), 120 | )), 121 | frame_system::CheckNonce::::from(nonce), 122 | frame_system::CheckWeight::::new(), 123 | pallet_transaction_payment::ChargeTransactionPayment::::from(0), 124 | frame_metadata_hash_extension::CheckMetadataHash::::new(false), 125 | ); 126 | 127 | let raw_payload = runtime::SignedPayload::from_raw( 128 | call.clone(), 129 | extra.clone(), 130 | ( 131 | (), 132 | runtime::VERSION.spec_version, 133 | runtime::VERSION.transaction_version, 134 | genesis_hash, 135 | best_hash, 136 | (), 137 | (), 138 | (), 139 | None, 140 | ), 141 | ); 142 | let signature = raw_payload.using_encoded(|e| sender.sign(e)); 143 | 144 | runtime::UncheckedExtrinsic::new_signed( 145 | call, 146 | sp_runtime::AccountId32::from(sender.public()).into(), 147 | runtime::Signature::Sr25519(signature), 148 | extra, 149 | ) 150 | } 151 | 152 | /// Generates inherent data for the `benchmark overhead` command. 153 | /// 154 | /// Note: Should only be used for benchmarking. 155 | pub fn inherent_benchmark_data() -> Result { 156 | let mut inherent_data = InherentData::new(); 157 | let d = Duration::from_millis(0); 158 | let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); 159 | 160 | futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)) 161 | .map_err(|e| format!("creating inherent data: {:?}", e))?; 162 | Ok(inherent_data) 163 | } 164 | -------------------------------------------------------------------------------- /node/src/chain_spec.rs: -------------------------------------------------------------------------------- 1 | use hex::ToHex; 2 | use integritee_node_runtime::{ 3 | AccountId, Balance, Multisig, Signature, TreasuryPalletId, TEER, WASM_BINARY, 4 | }; 5 | use sc_service::ChainType; 6 | use sp_consensus_aura::sr25519::AuthorityId as AuraId; 7 | use sp_consensus_grandpa::AuthorityId as GrandpaId; 8 | use sp_core::{crypto::Ss58Codec, ed25519, sr25519, Pair, Public}; 9 | use sp_runtime::traits::{AccountIdConversion, IdentifyAccount, Verify}; 10 | use std::str::FromStr; 11 | 12 | /// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. 13 | pub type ChainSpec = sc_service::GenericChainSpec; 14 | 15 | type AccountPublic = ::Signer; 16 | 17 | /// Generate a crypto pair from seed. 18 | pub fn get_from_seed(seed: &str) -> ::Public { 19 | TPublic::Pair::from_string(&format!("//{}", seed), None) 20 | .expect("static values are valid; qed") 21 | .public() 22 | } 23 | 24 | pub fn public_from_ss58(ss58: &str) -> TPublic 25 | where 26 | ::Err: std::fmt::Debug, 27 | { 28 | TPublic::from_ss58check(ss58).expect("supply valid ss58!") 29 | } 30 | 31 | /// Generate an account ID from seed. 32 | pub fn get_account_id_from_seed(seed: &str) -> AccountId 33 | where 34 | AccountPublic: From<::Public>, 35 | { 36 | AccountPublic::from(get_from_seed::(seed)).into_account() 37 | } 38 | 39 | /// Generate an Aura authority key. 40 | pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) { 41 | (get_from_seed::(s), get_from_seed::(s)) 42 | } 43 | 44 | pub fn multisig_account(mut accounts: Vec, threshold: u16) -> AccountId { 45 | // sort accounts by public key, as js/apps would do 46 | accounts.sort_by(|a, b| (*a).encode_hex::().cmp(&(*b).encode_hex::())); 47 | Multisig::multi_account_id(&accounts, threshold) 48 | } 49 | 50 | pub fn development_config() -> ChainSpec { 51 | ChainSpec::builder(WASM_BINARY.expect("WASM binary was not built, please build it!"), None) 52 | .with_name("Integritee Network (dev)") 53 | .with_id("integritee-solo-dev") 54 | .with_protocol_id("teer") 55 | .with_chain_type(ChainType::Development) 56 | .with_properties(teer_properties()) 57 | .with_genesis_config_patch(genesis_config( 58 | // Initial PoA authorities 59 | vec![authority_keys_from_seed("Alice")], 60 | // Sudo account 61 | get_account_id_from_seed::("Alice"), 62 | // Pre-funded accounts 63 | vec![ 64 | (get_account_id_from_seed::("Alice"), 1_000 * TEER), 65 | (get_account_id_from_seed::("Bob"), 1_000 * TEER), 66 | (get_account_id_from_seed::("Charlie"), 1_000 * TEER), 67 | (TreasuryPalletId::get().into_account_truncating(), 1_000 * TEER), 68 | ( 69 | multisig_account( 70 | vec![ 71 | get_account_id_from_seed::("Alice"), 72 | get_account_id_from_seed::("Bob"), 73 | get_account_id_from_seed::("Charlie"), 74 | ], 75 | 2, 76 | ), 77 | 1_000 * TEER, 78 | ), 79 | ], 80 | true, 81 | )) 82 | .build() 83 | } 84 | 85 | pub fn local_testnet_config() -> ChainSpec { 86 | ChainSpec::builder(WASM_BINARY.expect("WASM binary was not built, please build it!"), None) 87 | .with_name("Integritee Network (local)") 88 | .with_id("integritee-solo-local") 89 | .with_protocol_id("teer") 90 | .with_chain_type(ChainType::Development) 91 | .with_properties(teer_properties()) 92 | .with_genesis_config_patch(genesis_config( 93 | // Initial PoA authorities 94 | vec![authority_keys_from_seed("Alice")], 95 | // Sudo account 96 | get_account_id_from_seed::("Alice"), 97 | // Pre-funded accounts 98 | vec![ 99 | (get_account_id_from_seed::("Alice"), 1_000 * TEER), 100 | (get_account_id_from_seed::("Bob"), 1_000 * TEER), 101 | (get_account_id_from_seed::("Charlie"), 1_000 * TEER), 102 | (TreasuryPalletId::get().into_account_truncating(), 1_000 * TEER), 103 | ( 104 | multisig_account( 105 | vec![ 106 | get_account_id_from_seed::("Alice"), 107 | get_account_id_from_seed::("Bob"), 108 | get_account_id_from_seed::("Charlie"), 109 | ], 110 | 2, 111 | ), 112 | 1_000 * TEER, 113 | ), 114 | ], 115 | true, 116 | )) 117 | .build() 118 | } 119 | 120 | pub fn integritee_solo_fresh_config() -> ChainSpec { 121 | let sudo_account: AccountId = 122 | public_from_ss58::("2JPGqddf4yEU7waYt7RMp9xwYabm16h8neYEk24tKQs4bAwN") 123 | .into(); 124 | let multisig_controller_accounts: Vec = vec![ 125 | public_from_ss58::("2P3Yo9DgGxUiBgdrYorLTHpRnwTSwAiF92xhnfen1SpYc4XN") 126 | .into(), 127 | public_from_ss58::("2NXxRz9k9V8VBu2Z3HQLWiXocoKBhxYyNR1LqxRQFcNT1m2D") 128 | .into(), 129 | public_from_ss58::("2NBSuNod6Vy97nmkXkg7vsyU1guudk9Ygakr6LVCXk8mTuvD") 130 | .into(), 131 | public_from_ss58::("2PyzGJkumD4d5byCLxZnn3HESF7qqrMfHBYRgQ4Dx3hdEvuk") 132 | .into(), 133 | ]; 134 | let multisig_controller_threshold: u16 = 3; 135 | 136 | let mut allocations = vec![(sudo_account.clone(), 100 * TEER)]; 137 | allocations.append( 138 | &mut multisig_controller_accounts.iter().map(|a| (a.clone(), 100 * TEER)).collect(), 139 | ); 140 | allocations.append(&mut vec![( 141 | multisig_account(multisig_controller_accounts, multisig_controller_threshold), 142 | 500 * TEER, 143 | )]); 144 | 145 | ChainSpec::builder(WASM_BINARY.expect("WASM binary was not built, please build it!"), None) 146 | .with_name("Integritee Network (Solo)") 147 | .with_id("integritee-solo") 148 | .with_protocol_id("teer") 149 | .with_chain_type(ChainType::Live) 150 | .with_properties(teer_properties()) 151 | .with_genesis_config_patch(genesis_config( 152 | // Initial PoA authorities 153 | vec![ 154 | ( 155 | public_from_ss58::( 156 | "2PPzpwiTGvcgc4stV326en2mWqY1qFzhQ95SCqYZ4Q5dqwhJ", 157 | ) 158 | .into(), 159 | public_from_ss58::( 160 | "2N8Q3CSCrXjEEBRiSaiXSLTDcbHCSeoKdXePZiSr8ySnoP4f", 161 | ) 162 | .into(), 163 | ), 164 | ( 165 | public_from_ss58::( 166 | "2Px7JZCbMTBhBdWHT7cbC2SGqsVF2cFygdvdaYmuNgV53Bgh", 167 | ) 168 | .into(), 169 | public_from_ss58::( 170 | "2MrnyHrQgJb1omjrCu8ZJ4LYBaczcXnREREYX72gmkZZHYFG", 171 | ) 172 | .into(), 173 | ), 174 | ( 175 | public_from_ss58::( 176 | "2PGjX1Nyq2SC7uuWTHWiEMQuJBMRupaefgaG5t6t588nFMZU", 177 | ) 178 | .into(), 179 | public_from_ss58::( 180 | "2PLiyfMnuEc7mcgSqfqA7ZHstYeQh3kVZ8eJrsUcYsqTKU3W", 181 | ) 182 | .into(), 183 | ), 184 | ( 185 | public_from_ss58::( 186 | "2Jhqi21p3UdGu1SBJzeUyQM9FudC5iC7e4KryAuJ4NZMhYPe", 187 | ) 188 | .into(), 189 | public_from_ss58::( 190 | "2LCKNXvVSWpL6rBusK2RUkYaFV1wv9MnWG2UpGQecsrKpp4R", 191 | ) 192 | .into(), 193 | ), 194 | ( 195 | public_from_ss58::( 196 | "2JwCMVvx8DgzpRD7sF1PKpzCDbmGiB2oa67ka2SuUe2TSJgB", 197 | ) 198 | .into(), 199 | public_from_ss58::( 200 | "2P4Bbk7edF41ny7FSMrQ6u2UsjoTaDhD1DARzwdkeDwBiZfn", 201 | ) 202 | .into(), 203 | ), 204 | ], 205 | // Sudo account 206 | sudo_account.clone(), 207 | // Pre-funded accounts 208 | allocations.clone(), 209 | // println 210 | false, 211 | )) 212 | .build() 213 | } 214 | 215 | pub fn cranny_fresh_config() -> ChainSpec { 216 | let sudo_account: AccountId = 217 | public_from_ss58::("5CVcJfKKo7uqMGvAE9fzqw66tEfngwJat5FruAsa6hbSkejD") 218 | .into(); 219 | 220 | let allocations = vec![(sudo_account.clone(), 10_000_000 * TEER)]; 221 | 222 | ChainSpec::builder(WASM_BINARY.expect("WASM binary was not built, please build it!"), None) 223 | .with_name("Integritee Testnet Cranny") 224 | .with_id("integritee-cranny") 225 | .with_protocol_id("teer") 226 | .with_chain_type(ChainType::Live) 227 | .with_properties(cranny_properties()) 228 | .with_genesis_config_patch(genesis_config( 229 | // Initial PoA authorities 230 | vec![ 231 | ( 232 | public_from_ss58::( 233 | "5DDBqKzDw4GnEVmqRXvo8iiWzFxT76E3KUDTk79NnM9F6B8V", 234 | ) 235 | .into(), 236 | public_from_ss58::( 237 | "5CyuN5TUy6hd1WN2o3uZLpRoBjsAqzXLxUFD2GNT1Sjv3sS5", 238 | ) 239 | .into(), 240 | ), 241 | ( 242 | public_from_ss58::( 243 | "5GhK3Hm39J7yL6ZYoeUxynhfTkPxCd3EqnAPfgHcDo37wqmz", 244 | ) 245 | .into(), 246 | public_from_ss58::( 247 | "5FBqLTmuJWUFkceoeyWRqrSkYpuqJi9hXNAFFfLL3oTJzSCp", 248 | ) 249 | .into(), 250 | ), 251 | ( 252 | public_from_ss58::( 253 | "5DHwmxfN57NvGpLYFFfxrshnGxccE12VbUGsFCzGSYZQKMfD", 254 | ) 255 | .into(), 256 | public_from_ss58::( 257 | "5DpXQisSziSLWvRKBPH4F8Twdg89gnKbYpMQDtGmgTJrEzyr", 258 | ) 259 | .into(), 260 | ), 261 | ], 262 | // Sudo account 263 | sudo_account.clone(), 264 | // Pre-funded accounts 265 | allocations.clone(), 266 | // println 267 | false, 268 | )) 269 | .build() 270 | } 271 | 272 | /// Configure initial storage state for FRAME modules. 273 | /// 274 | fn genesis_config( 275 | initial_authorities: Vec<(AuraId, GrandpaId)>, 276 | root_key: AccountId, 277 | initial_token_allocation: Vec<(AccountId, Balance)>, 278 | _enable_println: bool, 279 | ) -> serde_json::Value { 280 | serde_json::json!({ 281 | "balances": { "balances": initial_token_allocation }, 282 | "aura": { 283 | "authorities": initial_authorities.iter().map(|x| (x.0.clone())).collect::>(), 284 | }, 285 | "grandpa": { 286 | "authorities": initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect::>(), 287 | }, 288 | "sudo": { 289 | // Assign network admin rights. 290 | "key": Some(root_key), 291 | }, 292 | "teerex": { "allowSgxDebugMode": true, "allowSkippingAttestation": true }, 293 | }) 294 | } 295 | 296 | /// hard-coded configs 297 | 298 | pub fn integritee_solo_config() -> Result { 299 | ChainSpec::from_json_bytes(&include_bytes!("../res/integritee-solo.json")[..]) 300 | } 301 | 302 | pub fn cranny_config() -> Result { 303 | ChainSpec::from_json_bytes(&include_bytes!("../res/cranny.json")[..]) 304 | } 305 | 306 | fn teer_properties() -> sc_service::Properties { 307 | serde_json::from_str( 308 | r#"{ 309 | "ss58Format": 13, 310 | "tokenDecimals": 12, 311 | "tokenSymbol": "TEER" 312 | }"#, 313 | ) 314 | .unwrap() 315 | } 316 | 317 | fn cranny_properties() -> sc_service::Properties { 318 | serde_json::from_str( 319 | r#"{ 320 | "ss58Format": 42, 321 | "tokenDecimals": 12, 322 | "tokenSymbol": "CRA" 323 | }"#, 324 | ) 325 | .unwrap() 326 | } 327 | -------------------------------------------------------------------------------- /node/src/cli.rs: -------------------------------------------------------------------------------- 1 | use sc_cli::RunCmd; 2 | 3 | #[derive(Debug, clap::Parser)] 4 | pub struct Cli { 5 | #[command(subcommand)] 6 | pub subcommand: Option, 7 | 8 | #[clap(flatten)] 9 | pub run: RunCmd, 10 | } 11 | 12 | #[derive(Debug, clap::Subcommand)] 13 | #[allow(clippy::large_enum_variant)] 14 | pub enum Subcommand { 15 | /// Key management cli utilities 16 | #[command(subcommand)] 17 | Key(sc_cli::KeySubcommand), 18 | 19 | /// Build a chain specification. 20 | BuildSpec(sc_cli::BuildSpecCmd), 21 | 22 | /// Validate blocks. 23 | CheckBlock(sc_cli::CheckBlockCmd), 24 | 25 | /// Export blocks. 26 | ExportBlocks(sc_cli::ExportBlocksCmd), 27 | 28 | /// Export the state of a given block into a chain spec. 29 | ExportState(sc_cli::ExportStateCmd), 30 | 31 | /// Import blocks. 32 | ImportBlocks(sc_cli::ImportBlocksCmd), 33 | 34 | /// Remove the whole chain. 35 | PurgeChain(sc_cli::PurgeChainCmd), 36 | 37 | /// Revert the chain to a previous state. 38 | Revert(sc_cli::RevertCmd), 39 | 40 | /// Sub-commands concerned with benchmarking. 41 | #[command(subcommand)] 42 | Benchmark(frame_benchmarking_cli::BenchmarkCmd), 43 | 44 | /// Db meta columns information. 45 | ChainInfo(sc_cli::ChainInfoCmd), 46 | } 47 | -------------------------------------------------------------------------------- /node/src/command.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | use crate::{ 19 | benchmarking::{inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder}, 20 | chain_spec, 21 | cli::{Cli, Subcommand}, 22 | service, 23 | }; 24 | use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE}; 25 | use integritee_node_runtime::{Block, EXISTENTIAL_DEPOSIT}; 26 | use sc_cli::SubstrateCli; 27 | use sc_service::PartialComponents; 28 | use sp_keyring::Sr25519Keyring; 29 | 30 | impl SubstrateCli for Cli { 31 | fn impl_name() -> String { 32 | "Integritee Node".into() 33 | } 34 | 35 | fn impl_version() -> String { 36 | env!("SUBSTRATE_CLI_IMPL_VERSION").into() 37 | } 38 | 39 | fn description() -> String { 40 | env!("CARGO_PKG_DESCRIPTION").into() 41 | } 42 | 43 | fn author() -> String { 44 | env!("CARGO_PKG_AUTHORS").into() 45 | } 46 | 47 | fn support_url() -> String { 48 | "https://github.com/integritee-network/integritee-node/issues".into() 49 | } 50 | 51 | fn copyright_start_year() -> i32 { 52 | 2017 53 | } 54 | 55 | fn load_spec(&self, id: &str) -> Result, String> { 56 | Ok(match id { 57 | "dev" => Box::new(chain_spec::development_config()), 58 | "integritee-solo-fresh" => Box::new(chain_spec::integritee_solo_fresh_config()), 59 | "integritee-solo" => Box::new(chain_spec::integritee_solo_config()?), 60 | "cranny-fresh" => Box::new(chain_spec::cranny_fresh_config()), 61 | "cranny" => Box::new(chain_spec::cranny_config()?), 62 | "" | "local" => Box::new(chain_spec::local_testnet_config()), 63 | path => 64 | Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), 65 | }) 66 | } 67 | } 68 | 69 | /// Parse and run command line arguments 70 | pub fn run() -> sc_cli::Result<()> { 71 | let cli = Cli::from_args(); 72 | 73 | match &cli.subcommand { 74 | Some(Subcommand::Key(cmd)) => cmd.run(&cli), 75 | Some(Subcommand::BuildSpec(cmd)) => { 76 | let runner = cli.create_runner(cmd)?; 77 | runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) 78 | }, 79 | Some(Subcommand::CheckBlock(cmd)) => { 80 | let runner = cli.create_runner(cmd)?; 81 | runner.async_run(|config| { 82 | let PartialComponents { client, task_manager, import_queue, .. } = 83 | service::new_partial(&config)?; 84 | Ok((cmd.run(client, import_queue), task_manager)) 85 | }) 86 | }, 87 | Some(Subcommand::ExportBlocks(cmd)) => { 88 | let runner = cli.create_runner(cmd)?; 89 | runner.async_run(|config| { 90 | let PartialComponents { client, task_manager, .. } = service::new_partial(&config)?; 91 | Ok((cmd.run(client, config.database), task_manager)) 92 | }) 93 | }, 94 | Some(Subcommand::ExportState(cmd)) => { 95 | let runner = cli.create_runner(cmd)?; 96 | runner.async_run(|config| { 97 | let PartialComponents { client, task_manager, .. } = service::new_partial(&config)?; 98 | Ok((cmd.run(client, config.chain_spec), task_manager)) 99 | }) 100 | }, 101 | Some(Subcommand::ImportBlocks(cmd)) => { 102 | let runner = cli.create_runner(cmd)?; 103 | runner.async_run(|config| { 104 | let PartialComponents { client, task_manager, import_queue, .. } = 105 | service::new_partial(&config)?; 106 | Ok((cmd.run(client, import_queue), task_manager)) 107 | }) 108 | }, 109 | Some(Subcommand::PurgeChain(cmd)) => { 110 | let runner = cli.create_runner(cmd)?; 111 | runner.sync_run(|config| cmd.run(config.database)) 112 | }, 113 | Some(Subcommand::Revert(cmd)) => { 114 | let runner = cli.create_runner(cmd)?; 115 | runner.async_run(|config| { 116 | let PartialComponents { client, task_manager, backend, .. } = 117 | service::new_partial(&config)?; 118 | let aux_revert = Box::new(|client, _, blocks| { 119 | sc_consensus_grandpa::revert(client, blocks)?; 120 | Ok(()) 121 | }); 122 | Ok((cmd.run(client, backend, Some(aux_revert)), task_manager)) 123 | }) 124 | }, 125 | Some(Subcommand::Benchmark(cmd)) => { 126 | let runner = cli.create_runner(cmd)?; 127 | 128 | runner.sync_run(|config| { 129 | // This switch needs to be in the client, since the client decides 130 | // which sub-commands it wants to support. 131 | match cmd { 132 | BenchmarkCmd::Pallet(cmd) => { 133 | if !cfg!(feature = "runtime-benchmarks") { 134 | return Err( 135 | "Runtime benchmarking wasn't enabled when building the node. \ 136 | You can enable it with `--features runtime-benchmarks`." 137 | .into(), 138 | ); 139 | } 140 | 141 | cmd.run_with_spec::, ()>(Some( 142 | config.chain_spec, 143 | )) 144 | }, 145 | BenchmarkCmd::Block(cmd) => { 146 | let PartialComponents { client, .. } = service::new_partial(&config)?; 147 | cmd.run(client) 148 | }, 149 | #[cfg(not(feature = "runtime-benchmarks"))] 150 | BenchmarkCmd::Storage(_) => Err( 151 | "Storage benchmarking can be enabled with `--features runtime-benchmarks`." 152 | .into(), 153 | ), 154 | #[cfg(feature = "runtime-benchmarks")] 155 | BenchmarkCmd::Storage(cmd) => { 156 | let PartialComponents { client, backend, .. } = 157 | service::new_partial(&config)?; 158 | let db = backend.expose_db(); 159 | let storage = backend.expose_storage(); 160 | 161 | cmd.run(config, client, db, storage) 162 | }, 163 | BenchmarkCmd::Overhead(cmd) => { 164 | let PartialComponents { client, .. } = service::new_partial(&config)?; 165 | let ext_builder = RemarkBuilder::new(client.clone()); 166 | 167 | cmd.run( 168 | config, 169 | client, 170 | inherent_benchmark_data()?, 171 | Vec::new(), 172 | &ext_builder, 173 | ) 174 | }, 175 | BenchmarkCmd::Extrinsic(cmd) => { 176 | let PartialComponents { client, .. } = service::new_partial(&config)?; 177 | // Register the *Remark* and *TKA* builders. 178 | let ext_factory = ExtrinsicFactory(vec![ 179 | Box::new(RemarkBuilder::new(client.clone())), 180 | Box::new(TransferKeepAliveBuilder::new( 181 | client.clone(), 182 | Sr25519Keyring::Alice.to_account_id(), 183 | EXISTENTIAL_DEPOSIT, 184 | )), 185 | ]); 186 | 187 | cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory) 188 | }, 189 | BenchmarkCmd::Machine(cmd) => 190 | cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()), 191 | } 192 | }) 193 | }, 194 | Some(Subcommand::ChainInfo(cmd)) => { 195 | let runner = cli.create_runner(cmd)?; 196 | runner.sync_run(|config| cmd.run::(&config)) 197 | }, 198 | None => { 199 | let runner = cli.create_runner(&cli.run)?; 200 | runner.run_node_until_exit(|config| async move { 201 | match config.network.network_backend { 202 | sc_network::config::NetworkBackendType::Libp2p => service::new_full::< 203 | sc_network::NetworkWorker< 204 | integritee_node_runtime::opaque::Block, 205 | ::Hash, 206 | >, 207 | >(config) 208 | .map_err(sc_cli::Error::Service), 209 | sc_network::config::NetworkBackendType::Litep2p => 210 | service::new_full::(config) 211 | .map_err(sc_cli::Error::Service), 212 | } 213 | }) 214 | }, 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /node/src/main.rs: -------------------------------------------------------------------------------- 1 | //! Substrate Node Template CLI library. 2 | #![warn(missing_docs)] 3 | 4 | mod benchmarking; 5 | mod chain_spec; 6 | mod cli; 7 | mod command; 8 | mod rpc; 9 | mod service; 10 | 11 | fn main() -> sc_cli::Result<()> { 12 | command::run() 13 | } 14 | -------------------------------------------------------------------------------- /node/src/rpc.rs: -------------------------------------------------------------------------------- 1 | //! A collection of node-specific RPC methods. 2 | //! Substrate provides the `sc-rpc` crate, which defines the core RPC layer 3 | //! used by Substrate nodes. This file extends those RPC definitions with 4 | //! capabilities that are specific to this project's runtime configuration. 5 | 6 | #![warn(missing_docs)] 7 | 8 | use std::sync::Arc; 9 | 10 | use integritee_node_runtime::{opaque::Block, AccountId, Balance, Nonce}; 11 | use jsonrpsee::RpcModule; 12 | use sc_transaction_pool_api::TransactionPool; 13 | use sp_api::ProvideRuntimeApi; 14 | use sp_block_builder::BlockBuilder; 15 | use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; 16 | 17 | pub use sc_rpc_api::DenyUnsafe; 18 | 19 | /// Full client dependencies. 20 | pub struct FullDeps { 21 | /// The client instance to use. 22 | pub client: Arc, 23 | /// Transaction pool instance. 24 | pub pool: Arc

, 25 | /// Whether to deny unsafe calls 26 | pub deny_unsafe: DenyUnsafe, 27 | } 28 | 29 | /// Instantiate all full RPC extensions. 30 | pub fn create_full( 31 | deps: FullDeps, 32 | ) -> Result, Box> 33 | where 34 | C: ProvideRuntimeApi, 35 | C: HeaderBackend + HeaderMetadata + 'static, 36 | C: Send + Sync + 'static, 37 | C::Api: substrate_frame_rpc_system::AccountNonceApi, 38 | C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, 39 | C::Api: BlockBuilder, 40 | P: TransactionPool + 'static, 41 | { 42 | use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; 43 | use substrate_frame_rpc_system::{System, SystemApiServer}; 44 | 45 | let mut module = RpcModule::new(()); 46 | let FullDeps { client, pool, deny_unsafe } = deps; 47 | 48 | module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?; 49 | module.merge(TransactionPayment::new(client).into_rpc())?; 50 | 51 | // Extend this RPC with a custom API by using the following syntax. 52 | // `YourRpcStruct` should have a reference to a client, which is needed 53 | // to call into the runtime. 54 | // `module.merge(YourRpcTrait::into_rpc(YourRpcStruct::new(ReferenceToClient, ...)))?;` 55 | 56 | // You probably want to enable the `rpc v2 chainSpec` API as well 57 | // 58 | // let chain_name = chain_spec.name().to_string(); 59 | // let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); 60 | // let properties = chain_spec.properties(); 61 | // module.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?; 62 | 63 | Ok(module) 64 | } 65 | -------------------------------------------------------------------------------- /node/src/service.rs: -------------------------------------------------------------------------------- 1 | //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. 2 | 3 | use futures::FutureExt; 4 | use integritee_node_runtime::{self, opaque::Block, RuntimeApi}; 5 | use sc_client_api::{Backend, BlockBackend}; 6 | use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; 7 | use sc_consensus_grandpa::SharedVoterState; 8 | use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams}; 9 | use sc_telemetry::{Telemetry, TelemetryWorker}; 10 | use sc_transaction_pool_api::OffchainTransactionPoolFactory; 11 | use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; 12 | use std::{sync::Arc, time::Duration}; 13 | 14 | pub(crate) type FullClient = sc_service::TFullClient< 15 | Block, 16 | RuntimeApi, 17 | sc_executor::WasmExecutor, 18 | >; 19 | type FullBackend = sc_service::TFullBackend; 20 | type FullSelectChain = sc_consensus::LongestChain; 21 | 22 | /// The minimum period of blocks on which justifications will be 23 | /// imported and generated. 24 | const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; 25 | 26 | pub type Service = sc_service::PartialComponents< 27 | FullClient, 28 | FullBackend, 29 | FullSelectChain, 30 | sc_consensus::DefaultImportQueue, 31 | sc_transaction_pool::FullPool, 32 | ( 33 | sc_consensus_grandpa::GrandpaBlockImport, 34 | sc_consensus_grandpa::LinkHalf, 35 | Option, 36 | ), 37 | >; 38 | 39 | pub fn new_partial(config: &Configuration) -> Result { 40 | let telemetry = config 41 | .telemetry_endpoints 42 | .clone() 43 | .filter(|x| !x.is_empty()) 44 | .map(|endpoints| -> Result<_, sc_telemetry::Error> { 45 | let worker = TelemetryWorker::new(16)?; 46 | let telemetry = worker.handle().new_telemetry(endpoints); 47 | Ok((worker, telemetry)) 48 | }) 49 | .transpose()?; 50 | 51 | let executor = sc_service::new_wasm_executor::(config); 52 | let (client, backend, keystore_container, task_manager) = 53 | sc_service::new_full_parts::( 54 | config, 55 | telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), 56 | executor, 57 | )?; 58 | let client = Arc::new(client); 59 | 60 | let telemetry = telemetry.map(|(worker, telemetry)| { 61 | task_manager.spawn_handle().spawn("telemetry", None, worker.run()); 62 | telemetry 63 | }); 64 | 65 | let select_chain = sc_consensus::LongestChain::new(backend.clone()); 66 | 67 | let transaction_pool = sc_transaction_pool::BasicPool::new_full( 68 | config.transaction_pool.clone(), 69 | config.role.is_authority().into(), 70 | config.prometheus_registry(), 71 | task_manager.spawn_essential_handle(), 72 | client.clone(), 73 | ); 74 | 75 | let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( 76 | client.clone(), 77 | GRANDPA_JUSTIFICATION_PERIOD, 78 | &client, 79 | select_chain.clone(), 80 | telemetry.as_ref().map(|x| x.handle()), 81 | )?; 82 | 83 | let cidp_client = client.clone(); 84 | let import_queue = 85 | sc_consensus_aura::import_queue::(ImportQueueParams { 86 | block_import: grandpa_block_import.clone(), 87 | justification_import: Some(Box::new(grandpa_block_import.clone())), 88 | client: client.clone(), 89 | create_inherent_data_providers: move |parent_hash, _| { 90 | let cidp_client = cidp_client.clone(); 91 | async move { 92 | let slot_duration = sc_consensus_aura::standalone::slot_duration_at( 93 | &*cidp_client, 94 | parent_hash, 95 | )?; 96 | let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); 97 | 98 | let slot = 99 | sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( 100 | *timestamp, 101 | slot_duration, 102 | ); 103 | 104 | Ok((slot, timestamp)) 105 | } 106 | }, 107 | spawner: &task_manager.spawn_essential_handle(), 108 | registry: config.prometheus_registry(), 109 | check_for_equivocation: Default::default(), 110 | telemetry: telemetry.as_ref().map(|x| x.handle()), 111 | compatibility_mode: Default::default(), 112 | })?; 113 | 114 | Ok(sc_service::PartialComponents { 115 | client, 116 | backend, 117 | task_manager, 118 | import_queue, 119 | keystore_container, 120 | select_chain, 121 | transaction_pool, 122 | other: (grandpa_block_import, grandpa_link, telemetry), 123 | }) 124 | } 125 | 126 | /// Builds a new service for a full client. 127 | pub fn new_full< 128 | N: sc_network::NetworkBackend::Hash>, 129 | >( 130 | config: Configuration, 131 | ) -> Result { 132 | let sc_service::PartialComponents { 133 | client, 134 | backend, 135 | mut task_manager, 136 | import_queue, 137 | keystore_container, 138 | select_chain, 139 | transaction_pool, 140 | other: (block_import, grandpa_link, mut telemetry), 141 | } = new_partial(&config)?; 142 | 143 | let mut net_config = sc_network::config::FullNetworkConfiguration::< 144 | Block, 145 | ::Hash, 146 | N, 147 | >::new(&config.network); 148 | let metrics = N::register_notification_metrics(config.prometheus_registry()); 149 | 150 | let peer_store_handle = net_config.peer_store_handle(); 151 | let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( 152 | &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), 153 | &config.chain_spec, 154 | ); 155 | let (grandpa_protocol_config, grandpa_notification_service) = 156 | sc_consensus_grandpa::grandpa_peers_set_config::<_, N>( 157 | grandpa_protocol_name.clone(), 158 | metrics.clone(), 159 | peer_store_handle, 160 | ); 161 | net_config.add_notification_protocol(grandpa_protocol_config); 162 | 163 | let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( 164 | backend.clone(), 165 | grandpa_link.shared_authority_set().clone(), 166 | Vec::default(), 167 | )); 168 | 169 | let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = 170 | sc_service::build_network(sc_service::BuildNetworkParams { 171 | config: &config, 172 | net_config, 173 | client: client.clone(), 174 | transaction_pool: transaction_pool.clone(), 175 | spawn_handle: task_manager.spawn_handle(), 176 | import_queue, 177 | block_announce_validator_builder: None, 178 | warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)), 179 | block_relay: None, 180 | metrics, 181 | })?; 182 | 183 | if config.offchain_worker.enabled { 184 | task_manager.spawn_handle().spawn( 185 | "offchain-workers-runner", 186 | "offchain-worker", 187 | sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { 188 | runtime_api_provider: client.clone(), 189 | is_validator: config.role.is_authority(), 190 | keystore: Some(keystore_container.keystore()), 191 | offchain_db: backend.offchain_storage(), 192 | transaction_pool: Some(OffchainTransactionPoolFactory::new( 193 | transaction_pool.clone(), 194 | )), 195 | network_provider: Arc::new(network.clone()), 196 | enable_http_requests: true, 197 | custom_extensions: |_| vec![], 198 | }) 199 | .run(client.clone(), task_manager.spawn_handle()) 200 | .boxed(), 201 | ); 202 | } 203 | 204 | let role = config.role.clone(); 205 | let force_authoring = config.force_authoring; 206 | let backoff_authoring_blocks: Option<()> = None; 207 | let name = config.network.node_name.clone(); 208 | let enable_grandpa = !config.disable_grandpa; 209 | let prometheus_registry = config.prometheus_registry().cloned(); 210 | 211 | let rpc_extensions_builder = { 212 | let client = client.clone(); 213 | let pool = transaction_pool.clone(); 214 | 215 | Box::new(move |deny_unsafe, _| { 216 | let deps = 217 | crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe }; 218 | crate::rpc::create_full(deps).map_err(Into::into) 219 | }) 220 | }; 221 | 222 | let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { 223 | network: Arc::new(network.clone()), 224 | client: client.clone(), 225 | keystore: keystore_container.keystore(), 226 | task_manager: &mut task_manager, 227 | transaction_pool: transaction_pool.clone(), 228 | rpc_builder: rpc_extensions_builder, 229 | backend, 230 | system_rpc_tx, 231 | tx_handler_controller, 232 | sync_service: sync_service.clone(), 233 | config, 234 | telemetry: telemetry.as_mut(), 235 | })?; 236 | 237 | if role.is_authority() { 238 | let proposer_factory = sc_basic_authorship::ProposerFactory::new( 239 | task_manager.spawn_handle(), 240 | client.clone(), 241 | transaction_pool.clone(), 242 | prometheus_registry.as_ref(), 243 | telemetry.as_ref().map(|x| x.handle()), 244 | ); 245 | 246 | let slot_duration = sc_consensus_aura::slot_duration(&*client)?; 247 | 248 | let aura = sc_consensus_aura::start_aura::( 249 | StartAuraParams { 250 | slot_duration, 251 | client, 252 | select_chain, 253 | block_import, 254 | proposer_factory, 255 | create_inherent_data_providers: move |_, ()| async move { 256 | let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); 257 | 258 | let slot = 259 | sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( 260 | *timestamp, 261 | slot_duration, 262 | ); 263 | 264 | Ok((slot, timestamp)) 265 | }, 266 | force_authoring, 267 | backoff_authoring_blocks, 268 | keystore: keystore_container.keystore(), 269 | sync_oracle: sync_service.clone(), 270 | justification_sync_link: sync_service.clone(), 271 | block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), 272 | max_block_proposal_slot_portion: None, 273 | telemetry: telemetry.as_ref().map(|x| x.handle()), 274 | compatibility_mode: Default::default(), 275 | }, 276 | )?; 277 | 278 | // the AURA authoring task is considered essential, i.e. if it 279 | // fails we take down the service with it. 280 | task_manager 281 | .spawn_essential_handle() 282 | .spawn_blocking("aura", Some("block-authoring"), aura); 283 | } 284 | 285 | if enable_grandpa { 286 | // if the node isn't actively participating in consensus then it doesn't 287 | // need a keystore, regardless of which protocol we use below. 288 | let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None }; 289 | 290 | let grandpa_config = sc_consensus_grandpa::Config { 291 | // FIXME #1578 make this available through chainspec 292 | gossip_duration: Duration::from_millis(333), 293 | justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD, 294 | name: Some(name), 295 | observer_enabled: false, 296 | keystore, 297 | local_role: role, 298 | telemetry: telemetry.as_ref().map(|x| x.handle()), 299 | protocol_name: grandpa_protocol_name, 300 | }; 301 | 302 | // start the full GRANDPA voter 303 | // NOTE: non-authorities could run the GRANDPA observer protocol, but at 304 | // this point the full voter should provide better guarantees of block 305 | // and vote data availability than the observer. The observer has not 306 | // been tested extensively yet and having most nodes in a network run it 307 | // could lead to finality stalls. 308 | let grandpa_config = sc_consensus_grandpa::GrandpaParams { 309 | config: grandpa_config, 310 | link: grandpa_link, 311 | network, 312 | sync: Arc::new(sync_service), 313 | notification_service: grandpa_notification_service, 314 | voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), 315 | prometheus_registry, 316 | shared_voter_state: SharedVoterState::empty(), 317 | telemetry: telemetry.as_ref().map(|x| x.handle()), 318 | offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool), 319 | }; 320 | 321 | // the GRANDPA voter task is considered infallible, i.e. 322 | // if it fails we take down the service with it. 323 | task_manager.spawn_essential_handle().spawn_blocking( 324 | "grandpa-voter", 325 | None, 326 | sc_consensus_grandpa::run_grandpa_voter(grandpa_config)?, 327 | ); 328 | } 329 | 330 | network_starter.start_network(); 331 | Ok(task_manager) 332 | } 333 | -------------------------------------------------------------------------------- /runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Integritee AG "] 3 | edition = '2021' 4 | homepage = 'https://integritee.network/' 5 | license = 'Apache-2.0' 6 | name = 'integritee-node-runtime' 7 | repository = 'https://github.com/integritee-network/integritee-node' 8 | # keep patch revision with spec_version of runtime 9 | version = '1.13.400' 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [dependencies] 15 | parity-scale-codec = { workspace = true } 16 | scale-info = { workspace = true } 17 | 18 | pallet-aura = { workspace = true } 19 | pallet-balances = { workspace = true } 20 | pallet-grandpa = { workspace = true } 21 | pallet-insecure-randomness-collective-flip = { workspace = true } 22 | pallet-multisig = { workspace = true } 23 | pallet-preimage = { workspace = true } 24 | pallet-proxy = { workspace = true } 25 | pallet-scheduler = { workspace = true } 26 | pallet-sudo = { workspace = true } 27 | pallet-timestamp = { workspace = true } 28 | pallet-transaction-payment = { workspace = true } 29 | pallet-treasury = { workspace = true } 30 | pallet-utility = { workspace = true } 31 | pallet-vesting = { workspace = true } 32 | 33 | pallet-claims = { workspace = true } 34 | pallet-enclave-bridge = { workspace = true } 35 | pallet-sidechain = { workspace = true } 36 | pallet-teeracle = { workspace = true } 37 | pallet-teerdays = { workspace = true } 38 | pallet-teerex = { workspace = true } 39 | 40 | sp-api = { workspace = true } 41 | sp-block-builder = { workspace = true } 42 | sp-consensus-aura = { workspace = true } 43 | sp-consensus-grandpa = { workspace = true } 44 | sp-core = { workspace = true } 45 | sp-genesis-builder = { workspace = true } 46 | sp-inherents = { workspace = true } 47 | sp-offchain = { workspace = true } 48 | sp-runtime = { workspace = true } 49 | sp-session = { workspace = true } 50 | sp-staking = { workspace = true } 51 | sp-std = { workspace = true } 52 | sp-storage = { workspace = true } 53 | sp-transaction-pool = { workspace = true } 54 | sp-version = { workspace = true } 55 | 56 | # frame 57 | frame-executive = { workspace = true } 58 | frame-metadata-hash-extension = { workspace = true } 59 | frame-support = { workspace = true } 60 | frame-system = { workspace = true } 61 | 62 | # Used for the node template's RPCs 63 | frame-system-rpc-runtime-api = { workspace = true } 64 | pallet-transaction-payment-rpc-runtime-api = { workspace = true } 65 | 66 | # Used for runtime benchmarking 67 | frame-benchmarking = { optional = true, workspace = true } 68 | frame-system-benchmarking = { optional = true, workspace = true } 69 | hex-literal = { workspace = true, optional = true } 70 | 71 | [build-dependencies] 72 | substrate-wasm-builder = { workspace = true, optional = true, features = ["metadata-hash"] } 73 | 74 | [features] 75 | default = ["std"] 76 | extrinsic-filtering = [] 77 | std = [ 78 | "parity-scale-codec/std", 79 | "scale-info/std", 80 | "frame-executive/std", 81 | "frame-metadata-hash-extension/std", 82 | "frame-support/std", 83 | "frame-system-rpc-runtime-api/std", 84 | "frame-system/std", 85 | "pallet-aura/std", 86 | "pallet-balances/std", 87 | "pallet-grandpa/std", 88 | "pallet-insecure-randomness-collective-flip/std", 89 | "pallet-sudo/std", 90 | "pallet-sidechain/std", 91 | "pallet-timestamp/std", 92 | "pallet-transaction-payment-rpc-runtime-api/std", 93 | "pallet-transaction-payment/std", 94 | "pallet-treasury/std", 95 | "pallet-multisig/std", 96 | "pallet-vesting/std", 97 | "pallet-scheduler/std", 98 | "sp-api/std", 99 | "sp-block-builder/std", 100 | "sp-consensus-aura/std", 101 | "sp-consensus-grandpa/std", 102 | "sp-core/std", 103 | "sp-genesis-builder/std", 104 | "sp-inherents/std", 105 | "sp-offchain/std", 106 | "sp-runtime/std", 107 | "sp-session/std", 108 | "sp-std/std", 109 | "sp-storage/std", 110 | "sp-transaction-pool/std", 111 | "sp-version/std", 112 | "substrate-wasm-builder", 113 | "pallet-teerex/std", 114 | "pallet-claims/std", 115 | "pallet-enclave-bridge/std", 116 | "pallet-proxy/std", 117 | "pallet-utility/std", 118 | "pallet-teeracle/std", 119 | "pallet-teerdays/std", 120 | "frame-benchmarking?/std", 121 | "frame-system-benchmarking?/std", 122 | "pallet-preimage/std", 123 | "sp-staking/std", 124 | ] 125 | runtime-benchmarks = [ 126 | "frame-benchmarking/runtime-benchmarks", 127 | "frame-support/runtime-benchmarks", 128 | "frame-system-benchmarking/runtime-benchmarks", 129 | "hex-literal", 130 | "sp-runtime/runtime-benchmarks", 131 | "frame-system/runtime-benchmarks", 132 | "pallet-balances/runtime-benchmarks", 133 | "pallet-grandpa/frame-benchmarking", 134 | "pallet-multisig/runtime-benchmarks", 135 | "pallet-preimage/runtime-benchmarks", 136 | "pallet-proxy/runtime-benchmarks", 137 | "pallet-scheduler/runtime-benchmarks", 138 | "pallet-teerex/runtime-benchmarks", 139 | "pallet-claims/runtime-benchmarks", 140 | "pallet-enclave-bridge/runtime-benchmarks", 141 | "pallet-timestamp/runtime-benchmarks", 142 | "pallet-treasury/runtime-benchmarks", 143 | "pallet-vesting/runtime-benchmarks", 144 | "pallet-utility/runtime-benchmarks", 145 | "pallet-teeracle/runtime-benchmarks", 146 | "pallet-sidechain/runtime-benchmarks", 147 | "pallet-teerdays/runtime-benchmarks", 148 | "pallet-grandpa/runtime-benchmarks", 149 | "pallet-sudo/runtime-benchmarks", 150 | "sp-staking/runtime-benchmarks", 151 | ] 152 | -------------------------------------------------------------------------------- /runtime/build.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "std")] 2 | fn main() { 3 | substrate_wasm_builder::WasmBuilder::init_with_defaults() 4 | .enable_metadata_hash("ERT", 12) 5 | .build() 6 | } 7 | 8 | #[cfg(not(feature = "std"))] 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /runtime/src/weights/frame_system.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `frame_system` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=frame_system 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/frame_system.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `frame_system`. 33 | pub struct WeightInfo(PhantomData); 34 | impl frame_system::WeightInfo for WeightInfo { 35 | /// The range of component `b` is `[0, 3932160]`. 36 | fn remark(b: u32, ) -> Weight { 37 | // Proof Size summary in bytes: 38 | // Measured: `0` 39 | // Estimated: `0` 40 | // Minimum execution time: 1_462_000 picoseconds. 41 | Weight::from_parts(699_739, 0) 42 | .saturating_add(Weight::from_parts(0, 0)) 43 | // Standard Error: 0 44 | .saturating_add(Weight::from_parts(238, 0).saturating_mul(b.into())) 45 | } 46 | /// The range of component `b` is `[0, 3932160]`. 47 | fn remark_with_event(b: u32, ) -> Weight { 48 | // Proof Size summary in bytes: 49 | // Measured: `0` 50 | // Estimated: `0` 51 | // Minimum execution time: 3_824_000 picoseconds. 52 | Weight::from_parts(42_535_819, 0) 53 | .saturating_add(Weight::from_parts(0, 0)) 54 | // Standard Error: 6 55 | .saturating_add(Weight::from_parts(974, 0).saturating_mul(b.into())) 56 | } 57 | /// Storage: `System::Digest` (r:1 w:1) 58 | /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 59 | /// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) 60 | /// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) 61 | fn set_heap_pages() -> Weight { 62 | // Proof Size summary in bytes: 63 | // Measured: `0` 64 | // Estimated: `1485` 65 | // Minimum execution time: 2_654_000 picoseconds. 66 | Weight::from_parts(2_802_000, 0) 67 | .saturating_add(Weight::from_parts(0, 1485)) 68 | .saturating_add(T::DbWeight::get().reads(1)) 69 | .saturating_add(T::DbWeight::get().writes(2)) 70 | } 71 | /// Storage: `System::Digest` (r:1 w:1) 72 | /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 73 | /// Storage: UNKNOWN KEY `0x3a636f6465` (r:0 w:1) 74 | /// Proof: UNKNOWN KEY `0x3a636f6465` (r:0 w:1) 75 | fn set_code() -> Weight { 76 | // Proof Size summary in bytes: 77 | // Measured: `0` 78 | // Estimated: `1485` 79 | // Minimum execution time: 78_419_444_000 picoseconds. 80 | Weight::from_parts(79_244_235_000, 0) 81 | .saturating_add(Weight::from_parts(0, 1485)) 82 | .saturating_add(T::DbWeight::get().reads(1)) 83 | .saturating_add(T::DbWeight::get().writes(2)) 84 | } 85 | /// Storage: `Skipped::Metadata` (r:0 w:0) 86 | /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) 87 | /// The range of component `i` is `[0, 1000]`. 88 | fn set_storage(i: u32, ) -> Weight { 89 | // Proof Size summary in bytes: 90 | // Measured: `0` 91 | // Estimated: `0` 92 | // Minimum execution time: 1_802_000 picoseconds. 93 | Weight::from_parts(1_859_000, 0) 94 | .saturating_add(Weight::from_parts(0, 0)) 95 | // Standard Error: 925 96 | .saturating_add(Weight::from_parts(661_796, 0).saturating_mul(i.into())) 97 | .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) 98 | } 99 | /// Storage: `Skipped::Metadata` (r:0 w:0) 100 | /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) 101 | /// The range of component `i` is `[0, 1000]`. 102 | fn kill_storage(i: u32, ) -> Weight { 103 | // Proof Size summary in bytes: 104 | // Measured: `0` 105 | // Estimated: `0` 106 | // Minimum execution time: 1_646_000 picoseconds. 107 | Weight::from_parts(1_799_000, 0) 108 | .saturating_add(Weight::from_parts(0, 0)) 109 | // Standard Error: 888 110 | .saturating_add(Weight::from_parts(506_343, 0).saturating_mul(i.into())) 111 | .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) 112 | } 113 | /// Storage: `Skipped::Metadata` (r:0 w:0) 114 | /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) 115 | /// The range of component `p` is `[0, 1000]`. 116 | fn kill_prefix(p: u32, ) -> Weight { 117 | // Proof Size summary in bytes: 118 | // Measured: `47 + p * (69 ±0)` 119 | // Estimated: `58 + p * (70 ±0)` 120 | // Minimum execution time: 3_019_000 picoseconds. 121 | Weight::from_parts(3_086_000, 0) 122 | .saturating_add(Weight::from_parts(0, 58)) 123 | // Standard Error: 1_479 124 | .saturating_add(Weight::from_parts(968_992, 0).saturating_mul(p.into())) 125 | .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) 126 | .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) 127 | .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) 128 | } 129 | /// Storage: `System::AuthorizedUpgrade` (r:0 w:1) 130 | /// Proof: `System::AuthorizedUpgrade` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) 131 | fn authorize_upgrade() -> Weight { 132 | // Proof Size summary in bytes: 133 | // Measured: `0` 134 | // Estimated: `0` 135 | // Minimum execution time: 6_096_000 picoseconds. 136 | Weight::from_parts(7_717_000, 0) 137 | .saturating_add(Weight::from_parts(0, 0)) 138 | .saturating_add(T::DbWeight::get().writes(1)) 139 | } 140 | /// Storage: `System::AuthorizedUpgrade` (r:1 w:1) 141 | /// Proof: `System::AuthorizedUpgrade` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) 142 | /// Storage: `System::Digest` (r:1 w:1) 143 | /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 144 | /// Storage: UNKNOWN KEY `0x3a636f6465` (r:0 w:1) 145 | /// Proof: UNKNOWN KEY `0x3a636f6465` (r:0 w:1) 146 | fn apply_authorized_upgrade() -> Weight { 147 | // Proof Size summary in bytes: 148 | // Measured: `22` 149 | // Estimated: `1518` 150 | // Minimum execution time: 86_627_442_000 picoseconds. 151 | Weight::from_parts(88_160_556_000, 0) 152 | .saturating_add(Weight::from_parts(0, 1518)) 153 | .saturating_add(T::DbWeight::get().reads(2)) 154 | .saturating_add(T::DbWeight::get().writes(3)) 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /runtime/src/weights/mod.rs: -------------------------------------------------------------------------------- 1 | //! The weights used in the runtime 2 | //! 3 | //! The current weights have been obtained with the following reference hardware: 4 | //! * GenuineIntel CPU MHz: 2494.144 5 | //! * 8GB of RAM 6 | //! * NVMe SSD 7 | 8 | // the generated files to not pass clippy 9 | #![allow(clippy::all)] 10 | 11 | pub mod pallet_balances; 12 | pub mod pallet_claims; 13 | pub mod pallet_enclave_bridge; 14 | pub mod pallet_multisig; 15 | pub mod pallet_preimage; 16 | pub mod pallet_proxy; 17 | pub mod pallet_scheduler; 18 | pub mod pallet_sidechain; 19 | pub mod pallet_sudo; 20 | pub mod pallet_teeracle; 21 | pub mod pallet_teerdays; 22 | pub mod pallet_teerex; 23 | pub mod pallet_timestamp; 24 | pub mod pallet_treasury; 25 | pub mod pallet_utility; 26 | pub mod pallet_vesting; 27 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_balances.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_balances` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_balances 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_balances.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_balances`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_balances::WeightInfo for WeightInfo { 35 | /// Storage: `System::Account` (r:1 w:1) 36 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 37 | fn transfer_allow_death() -> Weight { 38 | // Proof Size summary in bytes: 39 | // Measured: `52` 40 | // Estimated: `3593` 41 | // Minimum execution time: 39_221_000 picoseconds. 42 | Weight::from_parts(40_530_000, 0) 43 | .saturating_add(Weight::from_parts(0, 3593)) 44 | .saturating_add(T::DbWeight::get().reads(1)) 45 | .saturating_add(T::DbWeight::get().writes(1)) 46 | } 47 | /// Storage: `System::Account` (r:1 w:1) 48 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 49 | fn transfer_keep_alive() -> Weight { 50 | // Proof Size summary in bytes: 51 | // Measured: `52` 52 | // Estimated: `3593` 53 | // Minimum execution time: 34_018_000 picoseconds. 54 | Weight::from_parts(35_421_000, 0) 55 | .saturating_add(Weight::from_parts(0, 3593)) 56 | .saturating_add(T::DbWeight::get().reads(1)) 57 | .saturating_add(T::DbWeight::get().writes(1)) 58 | } 59 | /// Storage: `System::Account` (r:1 w:1) 60 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 61 | fn force_set_balance_creating() -> Weight { 62 | // Proof Size summary in bytes: 63 | // Measured: `178` 64 | // Estimated: `3593` 65 | // Minimum execution time: 12_755_000 picoseconds. 66 | Weight::from_parts(13_200_000, 0) 67 | .saturating_add(Weight::from_parts(0, 3593)) 68 | .saturating_add(T::DbWeight::get().reads(1)) 69 | .saturating_add(T::DbWeight::get().writes(1)) 70 | } 71 | /// Storage: `System::Account` (r:1 w:1) 72 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 73 | fn force_set_balance_killing() -> Weight { 74 | // Proof Size summary in bytes: 75 | // Measured: `178` 76 | // Estimated: `3593` 77 | // Minimum execution time: 16_766_000 picoseconds. 78 | Weight::from_parts(18_504_000, 0) 79 | .saturating_add(Weight::from_parts(0, 3593)) 80 | .saturating_add(T::DbWeight::get().reads(1)) 81 | .saturating_add(T::DbWeight::get().writes(1)) 82 | } 83 | /// Storage: `System::Account` (r:2 w:2) 84 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 85 | fn force_transfer() -> Weight { 86 | // Proof Size summary in bytes: 87 | // Measured: `192` 88 | // Estimated: `6196` 89 | // Minimum execution time: 44_730_000 picoseconds. 90 | Weight::from_parts(45_671_000, 0) 91 | .saturating_add(Weight::from_parts(0, 6196)) 92 | .saturating_add(T::DbWeight::get().reads(2)) 93 | .saturating_add(T::DbWeight::get().writes(2)) 94 | } 95 | /// Storage: `System::Account` (r:1 w:1) 96 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 97 | fn transfer_all() -> Weight { 98 | // Proof Size summary in bytes: 99 | // Measured: `52` 100 | // Estimated: `3593` 101 | // Minimum execution time: 41_137_000 picoseconds. 102 | Weight::from_parts(42_970_000, 0) 103 | .saturating_add(Weight::from_parts(0, 3593)) 104 | .saturating_add(T::DbWeight::get().reads(1)) 105 | .saturating_add(T::DbWeight::get().writes(1)) 106 | } 107 | /// Storage: `System::Account` (r:1 w:1) 108 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 109 | fn force_unreserve() -> Weight { 110 | // Proof Size summary in bytes: 111 | // Measured: `178` 112 | // Estimated: `3593` 113 | // Minimum execution time: 15_227_000 picoseconds. 114 | Weight::from_parts(16_345_000, 0) 115 | .saturating_add(Weight::from_parts(0, 3593)) 116 | .saturating_add(T::DbWeight::get().reads(1)) 117 | .saturating_add(T::DbWeight::get().writes(1)) 118 | } 119 | /// Storage: `System::Account` (r:999 w:999) 120 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 121 | /// The range of component `u` is `[1, 1000]`. 122 | fn upgrade_accounts(u: u32, ) -> Weight { 123 | // Proof Size summary in bytes: 124 | // Measured: `0 + u * (135 ±0)` 125 | // Estimated: `990 + u * (2603 ±0)` 126 | // Minimum execution time: 14_001_000 picoseconds. 127 | Weight::from_parts(14_222_000, 0) 128 | .saturating_add(Weight::from_parts(0, 990)) 129 | // Standard Error: 19_676 130 | .saturating_add(Weight::from_parts(12_721_482, 0).saturating_mul(u.into())) 131 | .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) 132 | .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) 133 | .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) 134 | } 135 | /// Storage: `Balances::InactiveIssuance` (r:1 w:0) 136 | /// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) 137 | fn force_adjust_total_issuance() -> Weight { 138 | // Proof Size summary in bytes: 139 | // Measured: `0` 140 | // Estimated: `1501` 141 | // Minimum execution time: 4_405_000 picoseconds. 142 | Weight::from_parts(4_748_000, 0) 143 | .saturating_add(Weight::from_parts(0, 1501)) 144 | .saturating_add(T::DbWeight::get().reads(1)) 145 | } 146 | fn burn_allow_death() -> Weight { 147 | // Proof Size summary in bytes: 148 | // Measured: `0` 149 | // Estimated: `0` 150 | // Minimum execution time: 25_392_000 picoseconds. 151 | Weight::from_parts(25_981_000, 0) 152 | .saturating_add(Weight::from_parts(0, 0)) 153 | } 154 | fn burn_keep_alive() -> Weight { 155 | // Proof Size summary in bytes: 156 | // Measured: `0` 157 | // Estimated: `0` 158 | // Minimum execution time: 16_889_000 picoseconds. 159 | Weight::from_parts(17_339_000, 0) 160 | .saturating_add(Weight::from_parts(0, 0)) 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_claims.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_claims` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_claims 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_claims.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_claims`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_claims::WeightInfo for WeightInfo { 35 | /// Storage: `Claims::Claims` (r:1 w:1) 36 | /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) 37 | /// Storage: `Claims::Signing` (r:1 w:1) 38 | /// Proof: `Claims::Signing` (`max_values`: None, `max_size`: None, mode: `Measured`) 39 | /// Storage: `Claims::Total` (r:1 w:1) 40 | /// Proof: `Claims::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 41 | /// Storage: `Claims::Vesting` (r:1 w:1) 42 | /// Proof: `Claims::Vesting` (`max_values`: None, `max_size`: None, mode: `Measured`) 43 | /// Storage: `Vesting::Vesting` (r:1 w:1) 44 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 45 | /// Storage: `System::Account` (r:1 w:1) 46 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 47 | /// Storage: `Balances::Locks` (r:1 w:1) 48 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 49 | /// Storage: `Balances::Freezes` (r:1 w:0) 50 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 51 | fn claim() -> Weight { 52 | // Proof Size summary in bytes: 53 | // Measured: `487` 54 | // Estimated: `4764` 55 | // Minimum execution time: 161_698_000 picoseconds. 56 | Weight::from_parts(171_763_000, 0) 57 | .saturating_add(Weight::from_parts(0, 4764)) 58 | .saturating_add(T::DbWeight::get().reads(8)) 59 | .saturating_add(T::DbWeight::get().writes(7)) 60 | } 61 | /// Storage: `Claims::Total` (r:1 w:1) 62 | /// Proof: `Claims::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 63 | /// Storage: `Claims::Vesting` (r:0 w:1) 64 | /// Proof: `Claims::Vesting` (`max_values`: None, `max_size`: None, mode: `Measured`) 65 | /// Storage: `Claims::Claims` (r:0 w:1) 66 | /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) 67 | /// Storage: `Claims::Signing` (r:0 w:1) 68 | /// Proof: `Claims::Signing` (`max_values`: None, `max_size`: None, mode: `Measured`) 69 | fn mint_claim() -> Weight { 70 | // Proof Size summary in bytes: 71 | // Measured: `145` 72 | // Estimated: `1630` 73 | // Minimum execution time: 12_358_000 picoseconds. 74 | Weight::from_parts(14_041_000, 0) 75 | .saturating_add(Weight::from_parts(0, 1630)) 76 | .saturating_add(T::DbWeight::get().reads(1)) 77 | .saturating_add(T::DbWeight::get().writes(4)) 78 | } 79 | /// Storage: `Claims::Claims` (r:1 w:1) 80 | /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) 81 | /// Storage: `Claims::Signing` (r:1 w:1) 82 | /// Proof: `Claims::Signing` (`max_values`: None, `max_size`: None, mode: `Measured`) 83 | /// Storage: `Claims::Total` (r:1 w:1) 84 | /// Proof: `Claims::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 85 | /// Storage: `Claims::Vesting` (r:1 w:1) 86 | /// Proof: `Claims::Vesting` (`max_values`: None, `max_size`: None, mode: `Measured`) 87 | /// Storage: `Vesting::Vesting` (r:1 w:1) 88 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 89 | /// Storage: `System::Account` (r:1 w:1) 90 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 91 | /// Storage: `Balances::Locks` (r:1 w:1) 92 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 93 | /// Storage: `Balances::Freezes` (r:1 w:0) 94 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 95 | fn claim_attest() -> Weight { 96 | // Proof Size summary in bytes: 97 | // Measured: `487` 98 | // Estimated: `4764` 99 | // Minimum execution time: 165_109_000 picoseconds. 100 | Weight::from_parts(173_146_000, 0) 101 | .saturating_add(Weight::from_parts(0, 4764)) 102 | .saturating_add(T::DbWeight::get().reads(8)) 103 | .saturating_add(T::DbWeight::get().writes(7)) 104 | } 105 | /// Storage: `Claims::Preclaims` (r:1 w:1) 106 | /// Proof: `Claims::Preclaims` (`max_values`: None, `max_size`: None, mode: `Measured`) 107 | /// Storage: `Claims::Signing` (r:1 w:1) 108 | /// Proof: `Claims::Signing` (`max_values`: None, `max_size`: None, mode: `Measured`) 109 | /// Storage: `Claims::Claims` (r:1 w:1) 110 | /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) 111 | /// Storage: `Claims::Total` (r:1 w:1) 112 | /// Proof: `Claims::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 113 | /// Storage: `Claims::Vesting` (r:1 w:1) 114 | /// Proof: `Claims::Vesting` (`max_values`: None, `max_size`: None, mode: `Measured`) 115 | /// Storage: `Vesting::Vesting` (r:1 w:1) 116 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 117 | /// Storage: `System::Account` (r:1 w:1) 118 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 119 | /// Storage: `Balances::Locks` (r:1 w:1) 120 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 121 | /// Storage: `Balances::Freezes` (r:1 w:0) 122 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 123 | fn attest() -> Weight { 124 | // Proof Size summary in bytes: 125 | // Measured: `561` 126 | // Estimated: `4764` 127 | // Minimum execution time: 92_439_000 picoseconds. 128 | Weight::from_parts(99_940_000, 0) 129 | .saturating_add(Weight::from_parts(0, 4764)) 130 | .saturating_add(T::DbWeight::get().reads(9)) 131 | .saturating_add(T::DbWeight::get().writes(8)) 132 | } 133 | /// Storage: `Claims::Claims` (r:1 w:2) 134 | /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) 135 | /// Storage: `Claims::Vesting` (r:1 w:2) 136 | /// Proof: `Claims::Vesting` (`max_values`: None, `max_size`: None, mode: `Measured`) 137 | /// Storage: `Claims::Signing` (r:1 w:2) 138 | /// Proof: `Claims::Signing` (`max_values`: None, `max_size`: None, mode: `Measured`) 139 | /// Storage: `Claims::Preclaims` (r:1 w:1) 140 | /// Proof: `Claims::Preclaims` (`max_values`: None, `max_size`: None, mode: `Measured`) 141 | fn move_claim() -> Weight { 142 | // Proof Size summary in bytes: 143 | // Measured: `369` 144 | // Estimated: `3834` 145 | // Minimum execution time: 28_020_000 picoseconds. 146 | Weight::from_parts(29_512_000, 0) 147 | .saturating_add(Weight::from_parts(0, 3834)) 148 | .saturating_add(T::DbWeight::get().reads(4)) 149 | .saturating_add(T::DbWeight::get().writes(7)) 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_enclave_bridge.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_enclave_bridge` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_enclave_bridge 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_enclave_bridge.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_enclave_bridge`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_enclave_bridge::WeightInfo for WeightInfo { 35 | fn invoke() -> Weight { 36 | // Proof Size summary in bytes: 37 | // Measured: `0` 38 | // Estimated: `0` 39 | // Minimum execution time: 11_337_000 picoseconds. 40 | Weight::from_parts(11_976_000, 0) 41 | .saturating_add(Weight::from_parts(0, 0)) 42 | } 43 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 44 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 45 | /// Storage: `EnclaveBridge::ShardConfigRegistry` (r:1 w:0) 46 | /// Proof: `EnclaveBridge::ShardConfigRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`) 47 | /// Storage: `EnclaveBridge::ShardStatus` (r:1 w:1) 48 | /// Proof: `EnclaveBridge::ShardStatus` (`max_values`: None, `max_size`: None, mode: `Measured`) 49 | fn confirm_processed_parentchain_block() -> Weight { 50 | // Proof Size summary in bytes: 51 | // Measured: `371` 52 | // Estimated: `3836` 53 | // Minimum execution time: 30_198_000 picoseconds. 54 | Weight::from_parts(32_031_000, 0) 55 | .saturating_add(Weight::from_parts(0, 3836)) 56 | .saturating_add(T::DbWeight::get().reads(3)) 57 | .saturating_add(T::DbWeight::get().writes(1)) 58 | } 59 | /// Storage: `System::Account` (r:1 w:1) 60 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 61 | fn shield_funds() -> Weight { 62 | // Proof Size summary in bytes: 63 | // Measured: `52` 64 | // Estimated: `3593` 65 | // Minimum execution time: 73_850_000 picoseconds. 66 | Weight::from_parts(75_837_000, 0) 67 | .saturating_add(Weight::from_parts(0, 3593)) 68 | .saturating_add(T::DbWeight::get().reads(1)) 69 | .saturating_add(T::DbWeight::get().writes(1)) 70 | } 71 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 72 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 73 | /// Storage: `EnclaveBridge::ShardConfigRegistry` (r:1 w:0) 74 | /// Proof: `EnclaveBridge::ShardConfigRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`) 75 | /// Storage: `EnclaveBridge::ShardStatus` (r:1 w:1) 76 | /// Proof: `EnclaveBridge::ShardStatus` (`max_values`: None, `max_size`: None, mode: `Measured`) 77 | /// Storage: `EnclaveBridge::ExecutedUnshieldCalls` (r:1 w:1) 78 | /// Proof: `EnclaveBridge::ExecutedUnshieldCalls` (`max_values`: None, `max_size`: None, mode: `Measured`) 79 | /// Storage: `System::Account` (r:2 w:2) 80 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 81 | fn unshield_funds() -> Weight { 82 | // Proof Size summary in bytes: 83 | // Measured: `511` 84 | // Estimated: `6196` 85 | // Minimum execution time: 105_678_000 picoseconds. 86 | Weight::from_parts(109_746_000, 0) 87 | .saturating_add(Weight::from_parts(0, 6196)) 88 | .saturating_add(T::DbWeight::get().reads(6)) 89 | .saturating_add(T::DbWeight::get().writes(4)) 90 | } 91 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 92 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 93 | /// Storage: `EnclaveBridge::ShardStatus` (r:1 w:1) 94 | /// Proof: `EnclaveBridge::ShardStatus` (`max_values`: None, `max_size`: None, mode: `Measured`) 95 | /// Storage: `System::EventTopics` (r:6 w:6) 96 | /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) 97 | /// The range of component `l` is `[0, 100]`. 98 | /// The range of component `t` is `[1, 5]`. 99 | fn publish_hash(l: u32, t: u32, ) -> Weight { 100 | // Proof Size summary in bytes: 101 | // Measured: `371` 102 | // Estimated: `3836 + t * (2475 ±0)` 103 | // Minimum execution time: 30_952_000 picoseconds. 104 | Weight::from_parts(24_040_704, 0) 105 | .saturating_add(Weight::from_parts(0, 3836)) 106 | // Standard Error: 8_154 107 | .saturating_add(Weight::from_parts(23_530, 0).saturating_mul(l.into())) 108 | // Standard Error: 178_695 109 | .saturating_add(Weight::from_parts(5_070_215, 0).saturating_mul(t.into())) 110 | .saturating_add(T::DbWeight::get().reads(3)) 111 | .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) 112 | .saturating_add(T::DbWeight::get().writes(2)) 113 | .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) 114 | .saturating_add(Weight::from_parts(0, 2475).saturating_mul(t.into())) 115 | } 116 | /// Storage: `EnclaveBridge::ShardConfigRegistry` (r:1 w:1) 117 | /// Proof: `EnclaveBridge::ShardConfigRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`) 118 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 119 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 120 | /// Storage: `EnclaveBridge::ShardStatus` (r:1 w:1) 121 | /// Proof: `EnclaveBridge::ShardStatus` (`max_values`: None, `max_size`: None, mode: `Measured`) 122 | fn update_shard_config() -> Weight { 123 | // Proof Size summary in bytes: 124 | // Measured: `484` 125 | // Estimated: `3949` 126 | // Minimum execution time: 40_354_000 picoseconds. 127 | Weight::from_parts(41_833_000, 0) 128 | .saturating_add(Weight::from_parts(0, 3949)) 129 | .saturating_add(T::DbWeight::get().reads(3)) 130 | .saturating_add(T::DbWeight::get().writes(2)) 131 | } 132 | /// Storage: `EnclaveBridge::ShardStatus` (r:1 w:1) 133 | /// Proof: `EnclaveBridge::ShardStatus` (`max_values`: None, `max_size`: None, mode: `Measured`) 134 | fn purge_enclave_from_shard_status() -> Weight { 135 | // Proof Size summary in bytes: 136 | // Measured: `223` 137 | // Estimated: `3688` 138 | // Minimum execution time: 29_052_000 picoseconds. 139 | Weight::from_parts(30_781_000, 0) 140 | .saturating_add(Weight::from_parts(0, 3688)) 141 | .saturating_add(T::DbWeight::get().reads(1)) 142 | .saturating_add(T::DbWeight::get().writes(1)) 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_multisig.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_multisig` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_multisig 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_multisig.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_multisig`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_multisig::WeightInfo for WeightInfo { 35 | /// The range of component `z` is `[0, 10000]`. 36 | fn as_multi_threshold_1(z: u32, ) -> Weight { 37 | // Proof Size summary in bytes: 38 | // Measured: `0` 39 | // Estimated: `0` 40 | // Minimum execution time: 5_519_000 picoseconds. 41 | Weight::from_parts(6_281_946, 0) 42 | .saturating_add(Weight::from_parts(0, 0)) 43 | // Standard Error: 3 44 | .saturating_add(Weight::from_parts(372, 0).saturating_mul(z.into())) 45 | } 46 | /// Storage: `Multisig::Multisigs` (r:1 w:1) 47 | /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(465), added: 2940, mode: `MaxEncodedLen`) 48 | /// The range of component `s` is `[2, 10]`. 49 | /// The range of component `z` is `[0, 10000]`. 50 | fn as_multi_create(s: u32, z: u32, ) -> Weight { 51 | // Proof Size summary in bytes: 52 | // Measured: `130 + s * (14 ±0)` 53 | // Estimated: `3930` 54 | // Minimum execution time: 27_756_000 picoseconds. 55 | Weight::from_parts(28_130_379, 0) 56 | .saturating_add(Weight::from_parts(0, 3930)) 57 | // Standard Error: 13_564 58 | .saturating_add(Weight::from_parts(183_446, 0).saturating_mul(s.into())) 59 | // Standard Error: 11 60 | .saturating_add(Weight::from_parts(1_065, 0).saturating_mul(z.into())) 61 | .saturating_add(T::DbWeight::get().reads(1)) 62 | .saturating_add(T::DbWeight::get().writes(1)) 63 | } 64 | /// Storage: `Multisig::Multisigs` (r:1 w:1) 65 | /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(465), added: 2940, mode: `MaxEncodedLen`) 66 | /// The range of component `s` is `[3, 10]`. 67 | /// The range of component `z` is `[0, 10000]`. 68 | fn as_multi_approve(s: u32, z: u32, ) -> Weight { 69 | // Proof Size summary in bytes: 70 | // Measured: `248` 71 | // Estimated: `3930` 72 | // Minimum execution time: 15_506_000 picoseconds. 73 | Weight::from_parts(14_577_994, 0) 74 | .saturating_add(Weight::from_parts(0, 3930)) 75 | // Standard Error: 9_476 76 | .saturating_add(Weight::from_parts(174_483, 0).saturating_mul(s.into())) 77 | // Standard Error: 7 78 | .saturating_add(Weight::from_parts(1_080, 0).saturating_mul(z.into())) 79 | .saturating_add(T::DbWeight::get().reads(1)) 80 | .saturating_add(T::DbWeight::get().writes(1)) 81 | } 82 | /// Storage: `Multisig::Multisigs` (r:1 w:1) 83 | /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(465), added: 2940, mode: `MaxEncodedLen`) 84 | /// Storage: `System::Account` (r:1 w:1) 85 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 86 | /// The range of component `s` is `[2, 10]`. 87 | /// The range of component `z` is `[0, 10000]`. 88 | fn as_multi_complete(s: u32, z: u32, ) -> Weight { 89 | // Proof Size summary in bytes: 90 | // Measured: `272 + s * (46 ±0)` 91 | // Estimated: `3930` 92 | // Minimum execution time: 29_936_000 picoseconds. 93 | Weight::from_parts(27_338_959, 0) 94 | .saturating_add(Weight::from_parts(0, 3930)) 95 | // Standard Error: 39_172 96 | .saturating_add(Weight::from_parts(488_113, 0).saturating_mul(s.into())) 97 | // Standard Error: 33 98 | .saturating_add(Weight::from_parts(1_186, 0).saturating_mul(z.into())) 99 | .saturating_add(T::DbWeight::get().reads(2)) 100 | .saturating_add(T::DbWeight::get().writes(2)) 101 | } 102 | /// Storage: `Multisig::Multisigs` (r:1 w:1) 103 | /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(465), added: 2940, mode: `MaxEncodedLen`) 104 | /// The range of component `s` is `[2, 10]`. 105 | fn approve_as_multi_create(s: u32, ) -> Weight { 106 | // Proof Size summary in bytes: 107 | // Measured: `130 + s * (14 ±0)` 108 | // Estimated: `3930` 109 | // Minimum execution time: 25_305_000 picoseconds. 110 | Weight::from_parts(25_299_178, 0) 111 | .saturating_add(Weight::from_parts(0, 3930)) 112 | // Standard Error: 11_627 113 | .saturating_add(Weight::from_parts(702_686, 0).saturating_mul(s.into())) 114 | .saturating_add(T::DbWeight::get().reads(1)) 115 | .saturating_add(T::DbWeight::get().writes(1)) 116 | } 117 | /// Storage: `Multisig::Multisigs` (r:1 w:1) 118 | /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(465), added: 2940, mode: `MaxEncodedLen`) 119 | /// The range of component `s` is `[2, 10]`. 120 | fn approve_as_multi_approve(_s: u32, ) -> Weight { 121 | // Proof Size summary in bytes: 122 | // Measured: `248` 123 | // Estimated: `3930` 124 | // Minimum execution time: 13_809_000 picoseconds. 125 | Weight::from_parts(15_782_661, 0) 126 | .saturating_add(Weight::from_parts(0, 3930)) 127 | .saturating_add(T::DbWeight::get().reads(1)) 128 | .saturating_add(T::DbWeight::get().writes(1)) 129 | } 130 | /// Storage: `Multisig::Multisigs` (r:1 w:1) 131 | /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(465), added: 2940, mode: `MaxEncodedLen`) 132 | /// The range of component `s` is `[2, 10]`. 133 | fn cancel_as_multi(s: u32, ) -> Weight { 134 | // Proof Size summary in bytes: 135 | // Measured: `336 + s * (14 ±0)` 136 | // Estimated: `3930` 137 | // Minimum execution time: 25_035_000 picoseconds. 138 | Weight::from_parts(25_920_273, 0) 139 | .saturating_add(Weight::from_parts(0, 3930)) 140 | // Standard Error: 9_311 141 | .saturating_add(Weight::from_parts(349_878, 0).saturating_mul(s.into())) 142 | .saturating_add(T::DbWeight::get().reads(1)) 143 | .saturating_add(T::DbWeight::get().writes(1)) 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_proxy.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_proxy` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_proxy 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_proxy.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_proxy`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_proxy::WeightInfo for WeightInfo { 35 | /// Storage: `Proxy::Proxies` (r:1 w:0) 36 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 37 | /// The range of component `p` is `[1, 31]`. 38 | fn proxy(_p: u32, ) -> Weight { 39 | // Proof Size summary in bytes: 40 | // Measured: `90 + p * (37 ±0)` 41 | // Estimated: `4706` 42 | // Minimum execution time: 12_347_000 picoseconds. 43 | Weight::from_parts(25_311_460, 0) 44 | .saturating_add(Weight::from_parts(0, 4706)) 45 | .saturating_add(T::DbWeight::get().reads(1)) 46 | } 47 | /// Storage: `Proxy::Proxies` (r:1 w:0) 48 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 49 | /// Storage: `Proxy::Announcements` (r:1 w:1) 50 | /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) 51 | /// Storage: `System::Account` (r:1 w:1) 52 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 53 | /// The range of component `a` is `[0, 31]`. 54 | /// The range of component `p` is `[1, 31]`. 55 | fn proxy_announced(a: u32, p: u32, ) -> Weight { 56 | // Proof Size summary in bytes: 57 | // Measured: `380 + a * (68 ±0) + p * (37 ±0)` 58 | // Estimated: `5698` 59 | // Minimum execution time: 31_721_000 picoseconds. 60 | Weight::from_parts(28_313_589, 0) 61 | .saturating_add(Weight::from_parts(0, 5698)) 62 | // Standard Error: 35_000 63 | .saturating_add(Weight::from_parts(404_412, 0).saturating_mul(a.into())) 64 | // Standard Error: 36_162 65 | .saturating_add(Weight::from_parts(200_328, 0).saturating_mul(p.into())) 66 | .saturating_add(T::DbWeight::get().reads(3)) 67 | .saturating_add(T::DbWeight::get().writes(2)) 68 | } 69 | /// Storage: `Proxy::Announcements` (r:1 w:1) 70 | /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) 71 | /// Storage: `System::Account` (r:1 w:1) 72 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 73 | /// The range of component `a` is `[0, 31]`. 74 | /// The range of component `p` is `[1, 31]`. 75 | fn remove_announcement(_a: u32, _p: u32, ) -> Weight { 76 | // Proof Size summary in bytes: 77 | // Measured: `295 + a * (68 ±0)` 78 | // Estimated: `5698` 79 | // Minimum execution time: 24_516_000 picoseconds. 80 | Weight::from_parts(31_792_088, 0) 81 | .saturating_add(Weight::from_parts(0, 5698)) 82 | .saturating_add(T::DbWeight::get().reads(2)) 83 | .saturating_add(T::DbWeight::get().writes(2)) 84 | } 85 | /// Storage: `Proxy::Announcements` (r:1 w:1) 86 | /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) 87 | /// Storage: `System::Account` (r:1 w:1) 88 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 89 | /// The range of component `a` is `[0, 31]`. 90 | /// The range of component `p` is `[1, 31]`. 91 | fn reject_announcement(a: u32, p: u32, ) -> Weight { 92 | // Proof Size summary in bytes: 93 | // Measured: `295 + a * (68 ±0)` 94 | // Estimated: `5698` 95 | // Minimum execution time: 21_879_000 picoseconds. 96 | Weight::from_parts(21_096_778, 0) 97 | .saturating_add(Weight::from_parts(0, 5698)) 98 | // Standard Error: 10_779 99 | .saturating_add(Weight::from_parts(234_668, 0).saturating_mul(a.into())) 100 | // Standard Error: 11_136 101 | .saturating_add(Weight::from_parts(62_666, 0).saturating_mul(p.into())) 102 | .saturating_add(T::DbWeight::get().reads(2)) 103 | .saturating_add(T::DbWeight::get().writes(2)) 104 | } 105 | /// Storage: `Proxy::Proxies` (r:1 w:0) 106 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 107 | /// Storage: `Proxy::Announcements` (r:1 w:1) 108 | /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) 109 | /// Storage: `System::Account` (r:1 w:1) 110 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 111 | /// The range of component `a` is `[0, 31]`. 112 | /// The range of component `p` is `[1, 31]`. 113 | fn announce(a: u32, p: u32, ) -> Weight { 114 | // Proof Size summary in bytes: 115 | // Measured: `312 + a * (68 ±0) + p * (37 ±0)` 116 | // Estimated: `5698` 117 | // Minimum execution time: 28_371_000 picoseconds. 118 | Weight::from_parts(27_569_104, 0) 119 | .saturating_add(Weight::from_parts(0, 5698)) 120 | // Standard Error: 8_842 121 | .saturating_add(Weight::from_parts(241_185, 0).saturating_mul(a.into())) 122 | // Standard Error: 9_136 123 | .saturating_add(Weight::from_parts(104_153, 0).saturating_mul(p.into())) 124 | .saturating_add(T::DbWeight::get().reads(3)) 125 | .saturating_add(T::DbWeight::get().writes(2)) 126 | } 127 | /// Storage: `Proxy::Proxies` (r:1 w:1) 128 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 129 | /// The range of component `p` is `[1, 31]`. 130 | fn add_proxy(p: u32, ) -> Weight { 131 | // Proof Size summary in bytes: 132 | // Measured: `90 + p * (37 ±0)` 133 | // Estimated: `4706` 134 | // Minimum execution time: 20_577_000 picoseconds. 135 | Weight::from_parts(22_109_667, 0) 136 | .saturating_add(Weight::from_parts(0, 4706)) 137 | // Standard Error: 5_387 138 | .saturating_add(Weight::from_parts(46_121, 0).saturating_mul(p.into())) 139 | .saturating_add(T::DbWeight::get().reads(1)) 140 | .saturating_add(T::DbWeight::get().writes(1)) 141 | } 142 | /// Storage: `Proxy::Proxies` (r:1 w:1) 143 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 144 | /// The range of component `p` is `[1, 31]`. 145 | fn remove_proxy(_p: u32, ) -> Weight { 146 | // Proof Size summary in bytes: 147 | // Measured: `90 + p * (37 ±0)` 148 | // Estimated: `4706` 149 | // Minimum execution time: 21_351_000 picoseconds. 150 | Weight::from_parts(23_646_246, 0) 151 | .saturating_add(Weight::from_parts(0, 4706)) 152 | .saturating_add(T::DbWeight::get().reads(1)) 153 | .saturating_add(T::DbWeight::get().writes(1)) 154 | } 155 | /// Storage: `Proxy::Proxies` (r:1 w:1) 156 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 157 | /// The range of component `p` is `[1, 31]`. 158 | fn remove_proxies(p: u32, ) -> Weight { 159 | // Proof Size summary in bytes: 160 | // Measured: `90 + p * (37 ±0)` 161 | // Estimated: `4706` 162 | // Minimum execution time: 18_751_000 picoseconds. 163 | Weight::from_parts(20_827_715, 0) 164 | .saturating_add(Weight::from_parts(0, 4706)) 165 | // Standard Error: 2_626 166 | .saturating_add(Weight::from_parts(3_144, 0).saturating_mul(p.into())) 167 | .saturating_add(T::DbWeight::get().reads(1)) 168 | .saturating_add(T::DbWeight::get().writes(1)) 169 | } 170 | /// Storage: `Proxy::Proxies` (r:1 w:1) 171 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 172 | /// The range of component `p` is `[1, 31]`. 173 | fn create_pure(p: u32, ) -> Weight { 174 | // Proof Size summary in bytes: 175 | // Measured: `102` 176 | // Estimated: `4706` 177 | // Minimum execution time: 21_974_000 picoseconds. 178 | Weight::from_parts(22_963_981, 0) 179 | .saturating_add(Weight::from_parts(0, 4706)) 180 | // Standard Error: 3_594 181 | .saturating_add(Weight::from_parts(65_795, 0).saturating_mul(p.into())) 182 | .saturating_add(T::DbWeight::get().reads(1)) 183 | .saturating_add(T::DbWeight::get().writes(1)) 184 | } 185 | /// Storage: `Proxy::Proxies` (r:1 w:1) 186 | /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) 187 | /// The range of component `p` is `[0, 30]`. 188 | fn kill_pure(p: u32, ) -> Weight { 189 | // Proof Size summary in bytes: 190 | // Measured: `127 + p * (37 ±0)` 191 | // Estimated: `4706` 192 | // Minimum execution time: 20_036_000 picoseconds. 193 | Weight::from_parts(22_727_326, 0) 194 | .saturating_add(Weight::from_parts(0, 4706)) 195 | // Standard Error: 12_427 196 | .saturating_add(Weight::from_parts(23_413, 0).saturating_mul(p.into())) 197 | .saturating_add(T::DbWeight::get().reads(1)) 198 | .saturating_add(T::DbWeight::get().writes(1)) 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_scheduler.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_scheduler` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_scheduler 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_scheduler.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_scheduler`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_scheduler::WeightInfo for WeightInfo { 35 | /// Storage: `Scheduler::IncompleteSince` (r:1 w:1) 36 | /// Proof: `Scheduler::IncompleteSince` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) 37 | fn service_agendas_base() -> Weight { 38 | // Proof Size summary in bytes: 39 | // Measured: `31` 40 | // Estimated: `1489` 41 | // Minimum execution time: 4_090_000 picoseconds. 42 | Weight::from_parts(4_506_000, 0) 43 | .saturating_add(Weight::from_parts(0, 1489)) 44 | .saturating_add(T::DbWeight::get().reads(1)) 45 | .saturating_add(T::DbWeight::get().writes(1)) 46 | } 47 | /// Storage: `Scheduler::Agenda` (r:1 w:1) 48 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 49 | /// The range of component `s` is `[0, 50]`. 50 | fn service_agenda_base(s: u32, ) -> Weight { 51 | // Proof Size summary in bytes: 52 | // Measured: `78 + s * (177 ±0)` 53 | // Estimated: `13928` 54 | // Minimum execution time: 5_270_000 picoseconds. 55 | Weight::from_parts(10_544_741, 0) 56 | .saturating_add(Weight::from_parts(0, 13928)) 57 | // Standard Error: 4_157 58 | .saturating_add(Weight::from_parts(315_559, 0).saturating_mul(s.into())) 59 | .saturating_add(T::DbWeight::get().reads(1)) 60 | .saturating_add(T::DbWeight::get().writes(1)) 61 | } 62 | fn service_task_base() -> Weight { 63 | // Proof Size summary in bytes: 64 | // Measured: `0` 65 | // Estimated: `0` 66 | // Minimum execution time: 2_575_000 picoseconds. 67 | Weight::from_parts(2_839_000, 0) 68 | .saturating_add(Weight::from_parts(0, 0)) 69 | } 70 | /// Storage: `Preimage::PreimageFor` (r:1 w:1) 71 | /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`) 72 | /// Storage: `Preimage::StatusFor` (r:1 w:0) 73 | /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) 74 | /// Storage: `Preimage::RequestStatusFor` (r:1 w:1) 75 | /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) 76 | /// The range of component `s` is `[128, 4194304]`. 77 | fn service_task_fetched(s: u32, ) -> Weight { 78 | // Proof Size summary in bytes: 79 | // Measured: `213 + s * (1 ±0)` 80 | // Estimated: `3678 + s * (1 ±0)` 81 | // Minimum execution time: 15_670_000 picoseconds. 82 | Weight::from_parts(16_027_000, 0) 83 | .saturating_add(Weight::from_parts(0, 3678)) 84 | // Standard Error: 3 85 | .saturating_add(Weight::from_parts(871, 0).saturating_mul(s.into())) 86 | .saturating_add(T::DbWeight::get().reads(3)) 87 | .saturating_add(T::DbWeight::get().writes(2)) 88 | .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) 89 | } 90 | /// Storage: `Scheduler::Lookup` (r:0 w:1) 91 | /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) 92 | fn service_task_named() -> Weight { 93 | // Proof Size summary in bytes: 94 | // Measured: `0` 95 | // Estimated: `0` 96 | // Minimum execution time: 4_306_000 picoseconds. 97 | Weight::from_parts(10_246_000, 0) 98 | .saturating_add(Weight::from_parts(0, 0)) 99 | .saturating_add(T::DbWeight::get().writes(1)) 100 | } 101 | fn service_task_periodic() -> Weight { 102 | // Proof Size summary in bytes: 103 | // Measured: `0` 104 | // Estimated: `0` 105 | // Minimum execution time: 2_570_000 picoseconds. 106 | Weight::from_parts(2_779_000, 0) 107 | .saturating_add(Weight::from_parts(0, 0)) 108 | } 109 | fn execute_dispatch_signed() -> Weight { 110 | // Proof Size summary in bytes: 111 | // Measured: `0` 112 | // Estimated: `0` 113 | // Minimum execution time: 1_826_000 picoseconds. 114 | Weight::from_parts(1_955_000, 0) 115 | .saturating_add(Weight::from_parts(0, 0)) 116 | } 117 | fn execute_dispatch_unsigned() -> Weight { 118 | // Proof Size summary in bytes: 119 | // Measured: `0` 120 | // Estimated: `0` 121 | // Minimum execution time: 1_909_000 picoseconds. 122 | Weight::from_parts(2_032_000, 0) 123 | .saturating_add(Weight::from_parts(0, 0)) 124 | } 125 | /// Storage: `Scheduler::Agenda` (r:1 w:1) 126 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 127 | /// The range of component `s` is `[0, 49]`. 128 | fn schedule(s: u32, ) -> Weight { 129 | // Proof Size summary in bytes: 130 | // Measured: `78 + s * (177 ±0)` 131 | // Estimated: `13928` 132 | // Minimum execution time: 8_778_000 picoseconds. 133 | Weight::from_parts(12_848_938, 0) 134 | .saturating_add(Weight::from_parts(0, 13928)) 135 | // Standard Error: 4_508 136 | .saturating_add(Weight::from_parts(380_663, 0).saturating_mul(s.into())) 137 | .saturating_add(T::DbWeight::get().reads(1)) 138 | .saturating_add(T::DbWeight::get().writes(1)) 139 | } 140 | /// Storage: `Scheduler::Agenda` (r:1 w:1) 141 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 142 | /// Storage: `Scheduler::Retries` (r:0 w:1) 143 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 144 | /// Storage: `Scheduler::Lookup` (r:0 w:1) 145 | /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) 146 | /// The range of component `s` is `[1, 50]`. 147 | fn cancel(s: u32, ) -> Weight { 148 | // Proof Size summary in bytes: 149 | // Measured: `78 + s * (177 ±0)` 150 | // Estimated: `13928` 151 | // Minimum execution time: 14_872_000 picoseconds. 152 | Weight::from_parts(19_034_252, 0) 153 | .saturating_add(Weight::from_parts(0, 13928)) 154 | // Standard Error: 12_971 155 | .saturating_add(Weight::from_parts(672_323, 0).saturating_mul(s.into())) 156 | .saturating_add(T::DbWeight::get().reads(1)) 157 | .saturating_add(T::DbWeight::get().writes(3)) 158 | } 159 | /// Storage: `Scheduler::Lookup` (r:1 w:1) 160 | /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) 161 | /// Storage: `Scheduler::Agenda` (r:1 w:1) 162 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 163 | /// The range of component `s` is `[0, 49]`. 164 | fn schedule_named(s: u32, ) -> Weight { 165 | // Proof Size summary in bytes: 166 | // Measured: `255 + s * (185 ±0)` 167 | // Estimated: `13928` 168 | // Minimum execution time: 12_044_000 picoseconds. 169 | Weight::from_parts(17_619_147, 0) 170 | .saturating_add(Weight::from_parts(0, 13928)) 171 | // Standard Error: 6_396 172 | .saturating_add(Weight::from_parts(488_293, 0).saturating_mul(s.into())) 173 | .saturating_add(T::DbWeight::get().reads(2)) 174 | .saturating_add(T::DbWeight::get().writes(2)) 175 | } 176 | /// Storage: `Scheduler::Lookup` (r:1 w:1) 177 | /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) 178 | /// Storage: `Scheduler::Agenda` (r:1 w:1) 179 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 180 | /// Storage: `Scheduler::Retries` (r:0 w:1) 181 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 182 | /// The range of component `s` is `[1, 50]`. 183 | fn cancel_named(s: u32, ) -> Weight { 184 | // Proof Size summary in bytes: 185 | // Measured: `281 + s * (185 ±0)` 186 | // Estimated: `13928` 187 | // Minimum execution time: 17_706_000 picoseconds. 188 | Weight::from_parts(18_506_936, 0) 189 | .saturating_add(Weight::from_parts(0, 13928)) 190 | // Standard Error: 2_645 191 | .saturating_add(Weight::from_parts(611_170, 0).saturating_mul(s.into())) 192 | .saturating_add(T::DbWeight::get().reads(2)) 193 | .saturating_add(T::DbWeight::get().writes(3)) 194 | } 195 | /// Storage: `Scheduler::Agenda` (r:1 w:1) 196 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 197 | /// Storage: `Scheduler::Retries` (r:0 w:1) 198 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 199 | /// The range of component `s` is `[1, 50]`. 200 | fn schedule_retry(s: u32, ) -> Weight { 201 | // Proof Size summary in bytes: 202 | // Measured: `118` 203 | // Estimated: `13928` 204 | // Minimum execution time: 8_032_000 picoseconds. 205 | Weight::from_parts(7_203_466, 0) 206 | .saturating_add(Weight::from_parts(0, 13928)) 207 | // Standard Error: 8_382 208 | .saturating_add(Weight::from_parts(149_564, 0).saturating_mul(s.into())) 209 | .saturating_add(T::DbWeight::get().reads(1)) 210 | .saturating_add(T::DbWeight::get().writes(2)) 211 | } 212 | /// Storage: `Scheduler::Agenda` (r:1 w:0) 213 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 214 | /// Storage: `Scheduler::Retries` (r:0 w:1) 215 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 216 | fn set_retry() -> Weight { 217 | // Proof Size summary in bytes: 218 | // Measured: `8928` 219 | // Estimated: `13928` 220 | // Minimum execution time: 28_125_000 picoseconds. 221 | Weight::from_parts(29_668_000, 0) 222 | .saturating_add(Weight::from_parts(0, 13928)) 223 | .saturating_add(T::DbWeight::get().reads(1)) 224 | .saturating_add(T::DbWeight::get().writes(1)) 225 | } 226 | /// Storage: `Scheduler::Lookup` (r:1 w:0) 227 | /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) 228 | /// Storage: `Scheduler::Agenda` (r:1 w:0) 229 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 230 | /// Storage: `Scheduler::Retries` (r:0 w:1) 231 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 232 | fn set_retry_named() -> Weight { 233 | // Proof Size summary in bytes: 234 | // Measured: `9606` 235 | // Estimated: `13928` 236 | // Minimum execution time: 34_322_000 picoseconds. 237 | Weight::from_parts(35_847_000, 0) 238 | .saturating_add(Weight::from_parts(0, 13928)) 239 | .saturating_add(T::DbWeight::get().reads(2)) 240 | .saturating_add(T::DbWeight::get().writes(1)) 241 | } 242 | /// Storage: `Scheduler::Agenda` (r:1 w:0) 243 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 244 | /// Storage: `Scheduler::Retries` (r:0 w:1) 245 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 246 | fn cancel_retry() -> Weight { 247 | // Proof Size summary in bytes: 248 | // Measured: `8940` 249 | // Estimated: `13928` 250 | // Minimum execution time: 25_927_000 picoseconds. 251 | Weight::from_parts(27_078_000, 0) 252 | .saturating_add(Weight::from_parts(0, 13928)) 253 | .saturating_add(T::DbWeight::get().reads(1)) 254 | .saturating_add(T::DbWeight::get().writes(1)) 255 | } 256 | /// Storage: `Scheduler::Lookup` (r:1 w:0) 257 | /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) 258 | /// Storage: `Scheduler::Agenda` (r:1 w:0) 259 | /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(10463), added: 12938, mode: `MaxEncodedLen`) 260 | /// Storage: `Scheduler::Retries` (r:0 w:1) 261 | /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) 262 | fn cancel_retry_named() -> Weight { 263 | // Proof Size summary in bytes: 264 | // Measured: `9618` 265 | // Estimated: `13928` 266 | // Minimum execution time: 31_528_000 picoseconds. 267 | Weight::from_parts(33_006_000, 0) 268 | .saturating_add(Weight::from_parts(0, 13928)) 269 | .saturating_add(T::DbWeight::get().reads(2)) 270 | .saturating_add(T::DbWeight::get().writes(1)) 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_sidechain.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_sidechain` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_sidechain 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_sidechain.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_sidechain`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_sidechain::WeightInfo for WeightInfo { 35 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 36 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 37 | /// Storage: `EnclaveBridge::ShardConfigRegistry` (r:1 w:0) 38 | /// Proof: `EnclaveBridge::ShardConfigRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`) 39 | /// Storage: `EnclaveBridge::ShardStatus` (r:1 w:1) 40 | /// Proof: `EnclaveBridge::ShardStatus` (`max_values`: None, `max_size`: None, mode: `Measured`) 41 | /// Storage: `Sidechain::LatestSidechainBlockConfirmation` (r:1 w:1) 42 | /// Proof: `Sidechain::LatestSidechainBlockConfirmation` (`max_values`: None, `max_size`: None, mode: `Measured`) 43 | fn confirm_imported_sidechain_block() -> Weight { 44 | // Proof Size summary in bytes: 45 | // Measured: `375` 46 | // Estimated: `3840` 47 | // Minimum execution time: 35_435_000 picoseconds. 48 | Weight::from_parts(37_897_000, 0) 49 | .saturating_add(Weight::from_parts(0, 3840)) 50 | .saturating_add(T::DbWeight::get().reads(4)) 51 | .saturating_add(T::DbWeight::get().writes(2)) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_sudo.rs: -------------------------------------------------------------------------------- 1 | // Ajuna Node 2 | // Copyright (C) 2022 BlogaTech AG 3 | 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Affero General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Affero General Public License for more details. 13 | 14 | // You should have received a copy of the GNU Affero General Public License 15 | // along with this program. If not, see . 16 | 17 | //! Autogenerated weights for `pallet_sudo` 18 | //! 19 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 20 | //! DATE: 2024-04-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 21 | //! WORST CASE MAP SIZE: `1000000` 22 | //! HOSTNAME: `DESKTOP-0F6V7QQ`, CPU: `Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz` 23 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("local")`, DB CACHE: 1024 24 | 25 | // Executed Command: 26 | // ./target/release/ajuna-node 27 | // benchmark 28 | // pallet 29 | // --chain=local 30 | // --steps=50 31 | // --repeat=20 32 | // --pallet=pallet_sudo 33 | // --extrinsic=* 34 | // --wasm-execution=compiled 35 | // --heap-pages=4096 36 | // --header=./HEADER-AGPL 37 | // --output=./runtime/ajuna/src/weights/pallet_sudo.rs 38 | 39 | #![cfg_attr(rustfmt, rustfmt_skip)] 40 | #![allow(unused_parens)] 41 | #![allow(unused_imports)] 42 | #![allow(missing_docs)] 43 | 44 | use frame_support::{traits::Get, weights::Weight}; 45 | use core::marker::PhantomData; 46 | 47 | /// Weight functions for `pallet_sudo`. 48 | pub struct WeightInfo(PhantomData); 49 | impl pallet_sudo::WeightInfo for WeightInfo { 50 | /// Storage: `Sudo::Key` (r:1 w:1) 51 | /// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) 52 | fn set_key() -> Weight { 53 | // Proof Size summary in bytes: 54 | // Measured: `170` 55 | // Estimated: `1517` 56 | // Minimum execution time: 15_000_000 picoseconds. 57 | Weight::from_parts(15_500_000, 0) 58 | .saturating_add(Weight::from_parts(0, 1517)) 59 | .saturating_add(T::DbWeight::get().reads(1)) 60 | .saturating_add(T::DbWeight::get().writes(1)) 61 | } 62 | /// Storage: `Sudo::Key` (r:1 w:0) 63 | /// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) 64 | fn sudo() -> Weight { 65 | // Proof Size summary in bytes: 66 | // Measured: `170` 67 | // Estimated: `1517` 68 | // Minimum execution time: 22_100_000 picoseconds. 69 | Weight::from_parts(25_900_000, 0) 70 | .saturating_add(Weight::from_parts(0, 1517)) 71 | .saturating_add(T::DbWeight::get().reads(1)) 72 | } 73 | /// Storage: `Sudo::Key` (r:1 w:0) 74 | /// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) 75 | fn sudo_as() -> Weight { 76 | // Proof Size summary in bytes: 77 | // Measured: `170` 78 | // Estimated: `1517` 79 | // Minimum execution time: 19_600_000 picoseconds. 80 | Weight::from_parts(20_200_000, 0) 81 | .saturating_add(Weight::from_parts(0, 1517)) 82 | .saturating_add(T::DbWeight::get().reads(1)) 83 | } 84 | /// Storage: `Sudo::Key` (r:1 w:1) 85 | /// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) 86 | fn remove_key() -> Weight { 87 | // Proof Size summary in bytes: 88 | // Measured: `170` 89 | // Estimated: `1517` 90 | // Minimum execution time: 14_800_000 picoseconds. 91 | Weight::from_parts(15_300_000, 0) 92 | .saturating_add(Weight::from_parts(0, 1517)) 93 | .saturating_add(T::DbWeight::get().reads(1)) 94 | .saturating_add(T::DbWeight::get().writes(1)) 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_teeracle.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_teeracle` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_teeracle 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_teeracle.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_teeracle`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_teeracle::WeightInfo for WeightInfo { 35 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 36 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 37 | /// Storage: `Teeracle::Whitelists` (r:1 w:0) 38 | /// Proof: `Teeracle::Whitelists` (`max_values`: None, `max_size`: None, mode: `Measured`) 39 | /// Storage: `Teeracle::ExchangeRates` (r:1 w:1) 40 | /// Proof: `Teeracle::ExchangeRates` (`max_values`: None, `max_size`: None, mode: `Measured`) 41 | fn update_exchange_rate() -> Weight { 42 | // Proof Size summary in bytes: 43 | // Measured: `454` 44 | // Estimated: `3919` 45 | // Minimum execution time: 30_075_000 picoseconds. 46 | Weight::from_parts(33_584_000, 0) 47 | .saturating_add(Weight::from_parts(0, 3919)) 48 | .saturating_add(T::DbWeight::get().reads(3)) 49 | .saturating_add(T::DbWeight::get().writes(1)) 50 | } 51 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:0) 52 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 53 | /// Storage: `Teeracle::Whitelists` (r:1 w:0) 54 | /// Proof: `Teeracle::Whitelists` (`max_values`: None, `max_size`: None, mode: `Measured`) 55 | /// Storage: `Teeracle::OracleData` (r:0 w:1) 56 | /// Proof: `Teeracle::OracleData` (`max_values`: None, `max_size`: None, mode: `Measured`) 57 | fn update_oracle() -> Weight { 58 | // Proof Size summary in bytes: 59 | // Measured: `445` 60 | // Estimated: `3910` 61 | // Minimum execution time: 24_320_000 picoseconds. 62 | Weight::from_parts(25_638_000, 0) 63 | .saturating_add(Weight::from_parts(0, 3910)) 64 | .saturating_add(T::DbWeight::get().reads(2)) 65 | .saturating_add(T::DbWeight::get().writes(1)) 66 | } 67 | /// Storage: `Teeracle::Whitelists` (r:1 w:1) 68 | /// Proof: `Teeracle::Whitelists` (`max_values`: None, `max_size`: None, mode: `Measured`) 69 | fn add_to_whitelist() -> Weight { 70 | // Proof Size summary in bytes: 71 | // Measured: `6` 72 | // Estimated: `3471` 73 | // Minimum execution time: 11_915_000 picoseconds. 74 | Weight::from_parts(13_020_000, 0) 75 | .saturating_add(Weight::from_parts(0, 3471)) 76 | .saturating_add(T::DbWeight::get().reads(1)) 77 | .saturating_add(T::DbWeight::get().writes(1)) 78 | } 79 | /// Storage: `Teeracle::Whitelists` (r:1 w:1) 80 | /// Proof: `Teeracle::Whitelists` (`max_values`: None, `max_size`: None, mode: `Measured`) 81 | fn remove_from_whitelist() -> Weight { 82 | // Proof Size summary in bytes: 83 | // Measured: `107` 84 | // Estimated: `3572` 85 | // Minimum execution time: 14_245_000 picoseconds. 86 | Weight::from_parts(14_790_000, 0) 87 | .saturating_add(Weight::from_parts(0, 3572)) 88 | .saturating_add(T::DbWeight::get().reads(1)) 89 | .saturating_add(T::DbWeight::get().writes(1)) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_teerdays.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_teerdays` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_teerdays 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_teerdays.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_teerdays`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_teerdays::WeightInfo for WeightInfo { 35 | /// Storage: `TeerDays::TeerDayBonds` (r:1 w:1) 36 | /// Proof: `TeerDays::TeerDayBonds` (`max_values`: None, `max_size`: None, mode: `Measured`) 37 | /// Storage: `System::Account` (r:1 w:1) 38 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 39 | /// Storage: `Balances::Locks` (r:1 w:1) 40 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 41 | /// Storage: `Balances::Freezes` (r:1 w:0) 42 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 43 | /// Storage: `Timestamp::Now` (r:1 w:0) 44 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 45 | fn bond() -> Weight { 46 | // Proof Size summary in bytes: 47 | // Measured: `240` 48 | // Estimated: `4764` 49 | // Minimum execution time: 53_157_000 picoseconds. 50 | Weight::from_parts(54_869_000, 0) 51 | .saturating_add(Weight::from_parts(0, 4764)) 52 | .saturating_add(T::DbWeight::get().reads(5)) 53 | .saturating_add(T::DbWeight::get().writes(3)) 54 | } 55 | /// Storage: `TeerDays::PendingUnlock` (r:1 w:1) 56 | /// Proof: `TeerDays::PendingUnlock` (`max_values`: None, `max_size`: None, mode: `Measured`) 57 | /// Storage: `TeerDays::TeerDayBonds` (r:1 w:1) 58 | /// Proof: `TeerDays::TeerDayBonds` (`max_values`: None, `max_size`: None, mode: `Measured`) 59 | /// Storage: `Timestamp::Now` (r:1 w:0) 60 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 61 | fn unbond() -> Weight { 62 | // Proof Size summary in bytes: 63 | // Measured: `253` 64 | // Estimated: `3718` 65 | // Minimum execution time: 32_747_000 picoseconds. 66 | Weight::from_parts(35_019_000, 0) 67 | .saturating_add(Weight::from_parts(0, 3718)) 68 | .saturating_add(T::DbWeight::get().reads(3)) 69 | .saturating_add(T::DbWeight::get().writes(2)) 70 | } 71 | /// Storage: `TeerDays::TeerDayBonds` (r:1 w:1) 72 | /// Proof: `TeerDays::TeerDayBonds` (`max_values`: None, `max_size`: None, mode: `Measured`) 73 | /// Storage: `Timestamp::Now` (r:1 w:0) 74 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 75 | fn update_other() -> Weight { 76 | // Proof Size summary in bytes: 77 | // Measured: `253` 78 | // Estimated: `3718` 79 | // Minimum execution time: 22_243_000 picoseconds. 80 | Weight::from_parts(22_940_000, 0) 81 | .saturating_add(Weight::from_parts(0, 3718)) 82 | .saturating_add(T::DbWeight::get().reads(2)) 83 | .saturating_add(T::DbWeight::get().writes(1)) 84 | } 85 | /// Storage: `TeerDays::PendingUnlock` (r:1 w:1) 86 | /// Proof: `TeerDays::PendingUnlock` (`max_values`: None, `max_size`: None, mode: `Measured`) 87 | /// Storage: `Timestamp::Now` (r:1 w:0) 88 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 89 | /// Storage: `Balances::Locks` (r:1 w:1) 90 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 91 | /// Storage: `Balances::Freezes` (r:1 w:0) 92 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 93 | /// Storage: `System::Account` (r:1 w:1) 94 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 95 | fn withdraw_unbonded() -> Weight { 96 | // Proof Size summary in bytes: 97 | // Measured: `400` 98 | // Estimated: `4764` 99 | // Minimum execution time: 49_889_000 picoseconds. 100 | Weight::from_parts(51_522_000, 0) 101 | .saturating_add(Weight::from_parts(0, 4764)) 102 | .saturating_add(T::DbWeight::get().reads(5)) 103 | .saturating_add(T::DbWeight::get().writes(3)) 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_teerex.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_teerex` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_teerex 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_teerex.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_teerex`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_teerex::WeightInfo for WeightInfo { 35 | /// Storage: `Timestamp::Now` (r:1 w:0) 36 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 37 | /// Storage: `Teerex::SgxQuotingEnclaveRegistry` (r:1 w:0) 38 | /// Proof: `Teerex::SgxQuotingEnclaveRegistry` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 39 | /// Storage: `Teerex::SgxTcbInfo` (r:1 w:0) 40 | /// Proof: `Teerex::SgxTcbInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) 41 | /// Storage: `Teerex::SgxAllowDebugMode` (r:1 w:0) 42 | /// Proof: `Teerex::SgxAllowDebugMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 43 | /// Storage: `Teerex::SovereignEnclaves` (r:0 w:1) 44 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 45 | fn register_sgx_enclave() -> Weight { 46 | // Proof Size summary in bytes: 47 | // Measured: `747` 48 | // Estimated: `4212` 49 | // Minimum execution time: 2_435_598_000 picoseconds. 50 | Weight::from_parts(2_591_558_000, 0) 51 | .saturating_add(Weight::from_parts(0, 4212)) 52 | .saturating_add(T::DbWeight::get().reads(4)) 53 | .saturating_add(T::DbWeight::get().writes(1)) 54 | } 55 | /// Storage: `Timestamp::Now` (r:1 w:0) 56 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 57 | /// Storage: `Teerex::SgxQuotingEnclaveRegistry` (r:0 w:1) 58 | /// Proof: `Teerex::SgxQuotingEnclaveRegistry` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 59 | fn register_quoting_enclave() -> Weight { 60 | // Proof Size summary in bytes: 61 | // Measured: `95` 62 | // Estimated: `1493` 63 | // Minimum execution time: 1_185_842_000 picoseconds. 64 | Weight::from_parts(1_199_479_000, 0) 65 | .saturating_add(Weight::from_parts(0, 1493)) 66 | .saturating_add(T::DbWeight::get().reads(1)) 67 | .saturating_add(T::DbWeight::get().writes(1)) 68 | } 69 | /// Storage: `Timestamp::Now` (r:1 w:0) 70 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 71 | /// Storage: `Teerex::SgxTcbInfo` (r:0 w:1) 72 | /// Proof: `Teerex::SgxTcbInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) 73 | fn register_tcb_info() -> Weight { 74 | // Proof Size summary in bytes: 75 | // Measured: `95` 76 | // Estimated: `1493` 77 | // Minimum execution time: 1_271_230_000 picoseconds. 78 | Weight::from_parts(1_279_625_000, 0) 79 | .saturating_add(Weight::from_parts(0, 1493)) 80 | .saturating_add(T::DbWeight::get().reads(1)) 81 | .saturating_add(T::DbWeight::get().writes(1)) 82 | } 83 | /// Storage: `Teerex::SovereignEnclaves` (r:1 w:1) 84 | /// Proof: `Teerex::SovereignEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 85 | /// Storage: `Timestamp::Now` (r:1 w:0) 86 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 87 | fn unregister_sovereign_enclave() -> Weight { 88 | // Proof Size summary in bytes: 89 | // Measured: `494` 90 | // Estimated: `3959` 91 | // Minimum execution time: 16_277_000 picoseconds. 92 | Weight::from_parts(16_863_000, 0) 93 | .saturating_add(Weight::from_parts(0, 3959)) 94 | .saturating_add(T::DbWeight::get().reads(2)) 95 | .saturating_add(T::DbWeight::get().writes(1)) 96 | } 97 | /// Storage: `Teerex::ProxiedEnclaves` (r:1 w:1) 98 | /// Proof: `Teerex::ProxiedEnclaves` (`max_values`: None, `max_size`: None, mode: `Measured`) 99 | /// Storage: `Timestamp::Now` (r:1 w:0) 100 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 101 | fn unregister_proxied_enclave() -> Weight { 102 | // Proof Size summary in bytes: 103 | // Measured: `596` 104 | // Estimated: `4061` 105 | // Minimum execution time: 21_453_000 picoseconds. 106 | Weight::from_parts(22_476_000, 0) 107 | .saturating_add(Weight::from_parts(0, 4061)) 108 | .saturating_add(T::DbWeight::get().reads(2)) 109 | .saturating_add(T::DbWeight::get().writes(1)) 110 | } 111 | /// Storage: `Teerex::SgxAllowDebugMode` (r:0 w:1) 112 | /// Proof: `Teerex::SgxAllowDebugMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 113 | /// Storage: `Teerex::AllowSkippingAttestation` (r:0 w:1) 114 | /// Proof: `Teerex::AllowSkippingAttestation` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 115 | fn set_security_flags() -> Weight { 116 | // Proof Size summary in bytes: 117 | // Measured: `0` 118 | // Estimated: `0` 119 | // Minimum execution time: 6_602_000 picoseconds. 120 | Weight::from_parts(6_982_000, 0) 121 | .saturating_add(Weight::from_parts(0, 0)) 122 | .saturating_add(T::DbWeight::get().writes(2)) 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_timestamp.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_timestamp` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_timestamp 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_timestamp.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_timestamp`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_timestamp::WeightInfo for WeightInfo { 35 | /// Storage: `Timestamp::Now` (r:1 w:1) 36 | /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 37 | /// Storage: `Aura::CurrentSlot` (r:1 w:0) 38 | /// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) 39 | fn set() -> Weight { 40 | // Proof Size summary in bytes: 41 | // Measured: `157` 42 | // Estimated: `1493` 43 | // Minimum execution time: 11_238_000 picoseconds. 44 | Weight::from_parts(12_023_000, 0) 45 | .saturating_add(Weight::from_parts(0, 1493)) 46 | .saturating_add(T::DbWeight::get().reads(2)) 47 | .saturating_add(T::DbWeight::get().writes(1)) 48 | } 49 | fn on_finalize() -> Weight { 50 | // Proof Size summary in bytes: 51 | // Measured: `95` 52 | // Estimated: `0` 53 | // Minimum execution time: 5_071_000 picoseconds. 54 | Weight::from_parts(5_450_000, 0) 55 | .saturating_add(Weight::from_parts(0, 0)) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_treasury.rs: -------------------------------------------------------------------------------- 1 | // Copyright (C) Parity Technologies (UK) Ltd. 2 | // This file is part of Polkadot. 3 | 4 | // Polkadot is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Polkadot is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Polkadot. If not, see . 16 | 17 | //! Autogenerated weights for `pallet_treasury` 18 | //! 19 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev 20 | //! DATE: 2023-12-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 21 | //! WORST CASE MAP SIZE: `1000000` 22 | //! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` 23 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("../kusama-chain-spec.json")`, DB CACHE: 1024 24 | 25 | // Executed Command: 26 | // ./target/production/polkadot 27 | // benchmark 28 | // pallet 29 | // --chain=../kusama-chain-spec.json 30 | // --steps 31 | // 50 32 | // --repeat 33 | // 20 34 | // --pallet=pallet_treasury 35 | // --extrinsic=* 36 | // --wasm-execution=compiled 37 | // --heap-pages=4096 38 | // --output 39 | // ./kusama-weights/ 40 | // --header 41 | // ./file_header.txt 42 | 43 | #![cfg_attr(rustfmt, rustfmt_skip)] 44 | #![allow(unused_parens)] 45 | #![allow(unused_imports)] 46 | #![allow(missing_docs)] 47 | 48 | use frame_support::{traits::Get, weights::Weight}; 49 | use core::marker::PhantomData; 50 | 51 | /// Weight functions for `pallet_treasury`. 52 | pub struct WeightInfo(PhantomData); 53 | impl pallet_treasury::WeightInfo for WeightInfo { 54 | /// Storage: `Treasury::ProposalCount` (r:1 w:1) 55 | /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) 56 | /// Storage: `Treasury::Approvals` (r:1 w:1) 57 | /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) 58 | /// Storage: `Treasury::Proposals` (r:0 w:1) 59 | /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) 60 | fn spend_local() -> Weight { 61 | // Proof Size summary in bytes: 62 | // Measured: `42` 63 | // Estimated: `1887` 64 | // Minimum execution time: 10_093_000 picoseconds. 65 | Weight::from_parts(10_655_000, 0) 66 | .saturating_add(Weight::from_parts(0, 1887)) 67 | .saturating_add(T::DbWeight::get().reads(2)) 68 | .saturating_add(T::DbWeight::get().writes(3)) 69 | } 70 | /// Storage: `Treasury::ProposalCount` (r:1 w:1) 71 | /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) 72 | /// Storage: `Treasury::Proposals` (r:0 w:1) 73 | /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) 74 | fn propose_spend() -> Weight { 75 | // Proof Size summary in bytes: 76 | // Measured: `143` 77 | // Estimated: `1489` 78 | // Minimum execution time: 20_873_000 picoseconds. 79 | Weight::from_parts(21_662_000, 0) 80 | .saturating_add(Weight::from_parts(0, 1489)) 81 | .saturating_add(T::DbWeight::get().reads(1)) 82 | .saturating_add(T::DbWeight::get().writes(2)) 83 | } 84 | /// Storage: `Treasury::Proposals` (r:1 w:1) 85 | /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) 86 | /// Storage: `System::Account` (r:1 w:1) 87 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 88 | fn reject_proposal() -> Weight { 89 | // Proof Size summary in bytes: 90 | // Measured: `301` 91 | // Estimated: `3593` 92 | // Minimum execution time: 34_277_000 picoseconds. 93 | Weight::from_parts(35_048_000, 0) 94 | .saturating_add(Weight::from_parts(0, 3593)) 95 | .saturating_add(T::DbWeight::get().reads(2)) 96 | .saturating_add(T::DbWeight::get().writes(2)) 97 | } 98 | /// Storage: `Treasury::Proposals` (r:1 w:0) 99 | /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) 100 | /// Storage: `Treasury::Approvals` (r:1 w:1) 101 | /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) 102 | /// The range of component `p` is `[0, 99]`. 103 | fn approve_proposal(p: u32, ) -> Weight { 104 | // Proof Size summary in bytes: 105 | // Measured: `470 + p * (8 ±0)` 106 | // Estimated: `3573` 107 | // Minimum execution time: 7_220_000 picoseconds. 108 | Weight::from_parts(11_765_443, 0) 109 | .saturating_add(Weight::from_parts(0, 3573)) 110 | // Standard Error: 1_732 111 | .saturating_add(Weight::from_parts(89_274, 0).saturating_mul(p.into())) 112 | .saturating_add(T::DbWeight::get().reads(2)) 113 | .saturating_add(T::DbWeight::get().writes(1)) 114 | } 115 | /// Storage: `Treasury::Approvals` (r:1 w:1) 116 | /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) 117 | fn remove_approval() -> Weight { 118 | // Proof Size summary in bytes: 119 | // Measured: `127` 120 | // Estimated: `1887` 121 | // Minimum execution time: 5_588_000 picoseconds. 122 | Weight::from_parts(6_030_000, 0) 123 | .saturating_add(Weight::from_parts(0, 1887)) 124 | .saturating_add(T::DbWeight::get().reads(1)) 125 | .saturating_add(T::DbWeight::get().writes(1)) 126 | } 127 | /// Storage: `Treasury::Deactivated` (r:1 w:1) 128 | /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) 129 | /// Storage: `Treasury::Approvals` (r:1 w:1) 130 | /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) 131 | /// Storage: `Treasury::Proposals` (r:99 w:99) 132 | /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) 133 | /// Storage: `System::Account` (r:199 w:199) 134 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 135 | /// Storage: `Bounties::BountyApprovals` (r:1 w:1) 136 | /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) 137 | /// The range of component `p` is `[0, 99]`. 138 | fn on_initialize_proposals(p: u32, ) -> Weight { 139 | // Proof Size summary in bytes: 140 | // Measured: `331 + p * (251 ±0)` 141 | // Estimated: `3593 + p * (5206 ±0)` 142 | // Minimum execution time: 43_318_000 picoseconds. 143 | Weight::from_parts(34_774_675, 0) 144 | .saturating_add(Weight::from_parts(0, 3593)) 145 | // Standard Error: 19_729 146 | .saturating_add(Weight::from_parts(32_072_479, 0).saturating_mul(p.into())) 147 | .saturating_add(T::DbWeight::get().reads(4)) 148 | .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) 149 | .saturating_add(T::DbWeight::get().writes(4)) 150 | .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) 151 | .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into())) 152 | } 153 | /// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0) 154 | /// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(1238), added: 3713, mode: `MaxEncodedLen`) 155 | /// Storage: `Treasury::SpendCount` (r:1 w:1) 156 | /// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) 157 | /// Storage: `Treasury::Spends` (r:0 w:1) 158 | /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) 159 | fn spend() -> Weight { 160 | // Proof Size summary in bytes: 161 | // Measured: `115` 162 | // Estimated: `4703` 163 | // Minimum execution time: 17_134_000 picoseconds. 164 | Weight::from_parts(17_652_000, 0) 165 | .saturating_add(Weight::from_parts(0, 4703)) 166 | .saturating_add(T::DbWeight::get().reads(2)) 167 | .saturating_add(T::DbWeight::get().writes(2)) 168 | } 169 | /// Storage: `Treasury::Spends` (r:1 w:1) 170 | /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) 171 | /// Storage: `XcmPallet::QueryCounter` (r:1 w:1) 172 | /// Proof: `XcmPallet::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) 173 | /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) 174 | /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) 175 | /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) 176 | /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) 177 | /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) 178 | /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) 179 | /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) 180 | /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) 181 | /// Storage: `XcmPallet::Queries` (r:0 w:1) 182 | /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) 183 | fn payout() -> Weight { 184 | // Proof Size summary in bytes: 185 | // Measured: `287` 186 | // Estimated: `5318` 187 | // Minimum execution time: 43_303_000 picoseconds. 188 | Weight::from_parts(44_488_000, 0) 189 | .saturating_add(Weight::from_parts(0, 5318)) 190 | .saturating_add(T::DbWeight::get().reads(6)) 191 | .saturating_add(T::DbWeight::get().writes(5)) 192 | } 193 | /// Storage: `Treasury::Spends` (r:1 w:1) 194 | /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) 195 | /// Storage: `XcmPallet::Queries` (r:1 w:1) 196 | /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) 197 | fn check_status() -> Weight { 198 | // Proof Size summary in bytes: 199 | // Measured: `206` 200 | // Estimated: `5318` 201 | // Minimum execution time: 22_854_000 picoseconds. 202 | Weight::from_parts(23_185_000, 0) 203 | .saturating_add(Weight::from_parts(0, 5318)) 204 | .saturating_add(T::DbWeight::get().reads(2)) 205 | .saturating_add(T::DbWeight::get().writes(2)) 206 | } 207 | /// Storage: `Treasury::Spends` (r:1 w:1) 208 | /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) 209 | fn void_spend() -> Weight { 210 | // Proof Size summary in bytes: 211 | // Measured: `178` 212 | // Estimated: `5318` 213 | // Minimum execution time: 12_421_000 picoseconds. 214 | Weight::from_parts(12_885_000, 0) 215 | .saturating_add(Weight::from_parts(0, 5318)) 216 | .saturating_add(T::DbWeight::get().reads(1)) 217 | .saturating_add(T::DbWeight::get().writes(1)) 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_utility.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_utility` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_utility 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_utility.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_utility`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_utility::WeightInfo for WeightInfo { 35 | /// The range of component `c` is `[0, 1000]`. 36 | fn batch(c: u32, ) -> Weight { 37 | // Proof Size summary in bytes: 38 | // Measured: `0` 39 | // Estimated: `0` 40 | // Minimum execution time: 6_557_000 picoseconds. 41 | Weight::from_parts(54_563_708, 0) 42 | .saturating_add(Weight::from_parts(0, 0)) 43 | // Standard Error: 17_878 44 | .saturating_add(Weight::from_parts(2_758_469, 0).saturating_mul(c.into())) 45 | } 46 | fn as_derivative() -> Weight { 47 | // Proof Size summary in bytes: 48 | // Measured: `0` 49 | // Estimated: `0` 50 | // Minimum execution time: 3_856_000 picoseconds. 51 | Weight::from_parts(4_141_000, 0) 52 | .saturating_add(Weight::from_parts(0, 0)) 53 | } 54 | /// The range of component `c` is `[0, 1000]`. 55 | fn batch_all(c: u32, ) -> Weight { 56 | // Proof Size summary in bytes: 57 | // Measured: `0` 58 | // Estimated: `0` 59 | // Minimum execution time: 4_055_000 picoseconds. 60 | Weight::from_parts(4_267_000, 0) 61 | .saturating_add(Weight::from_parts(0, 0)) 62 | // Standard Error: 10_040 63 | .saturating_add(Weight::from_parts(3_054_870, 0).saturating_mul(c.into())) 64 | } 65 | fn dispatch_as() -> Weight { 66 | // Proof Size summary in bytes: 67 | // Measured: `0` 68 | // Estimated: `0` 69 | // Minimum execution time: 5_467_000 picoseconds. 70 | Weight::from_parts(5_919_000, 0) 71 | .saturating_add(Weight::from_parts(0, 0)) 72 | } 73 | /// The range of component `c` is `[0, 1000]`. 74 | fn force_batch(c: u32, ) -> Weight { 75 | // Proof Size summary in bytes: 76 | // Measured: `0` 77 | // Estimated: `0` 78 | // Minimum execution time: 3_826_000 picoseconds. 79 | Weight::from_parts(4_196_000, 0) 80 | .saturating_add(Weight::from_parts(0, 0)) 81 | // Standard Error: 13_904 82 | .saturating_add(Weight::from_parts(2_891_778, 0).saturating_mul(c.into())) 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /runtime/src/weights/pallet_vesting.rs: -------------------------------------------------------------------------------- 1 | 2 | //! Autogenerated weights for `pallet_vesting` 3 | //! 4 | //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 39.0.0 5 | //! DATE: 2024-07-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` 6 | //! WORST CASE MAP SIZE: `1000000` 7 | //! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` 8 | //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("integritee-solo-fresh")`, DB CACHE: 1024 9 | 10 | // Executed Command: 11 | // target/release/integritee-node 12 | // benchmark 13 | // pallet 14 | // --chain=integritee-solo-fresh 15 | // --steps=50 16 | // --repeat=20 17 | // --pallet=pallet_vesting 18 | // --extrinsic=* 19 | // --execution=wasm 20 | // --wasm-execution=compiled 21 | // --heap-pages=4096 22 | // --output=runtime/src/weights/pallet_vesting.rs 23 | 24 | #![cfg_attr(rustfmt, rustfmt_skip)] 25 | #![allow(unused_parens)] 26 | #![allow(unused_imports)] 27 | #![allow(missing_docs)] 28 | 29 | use frame_support::{traits::Get, weights::Weight}; 30 | use core::marker::PhantomData; 31 | 32 | /// Weight functions for `pallet_vesting`. 33 | pub struct WeightInfo(PhantomData); 34 | impl pallet_vesting::WeightInfo for WeightInfo { 35 | /// Storage: `Vesting::Vesting` (r:1 w:1) 36 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 37 | /// Storage: `Balances::Locks` (r:1 w:1) 38 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 39 | /// Storage: `Balances::Freezes` (r:1 w:0) 40 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 41 | /// The range of component `l` is `[0, 49]`. 42 | /// The range of component `s` is `[1, 28]`. 43 | fn vest_locked(l: u32, _s: u32, ) -> Weight { 44 | // Proof Size summary in bytes: 45 | // Measured: `277 + l * (25 ±0) + s * (36 ±0)` 46 | // Estimated: `4764` 47 | // Minimum execution time: 28_850_000 picoseconds. 48 | Weight::from_parts(34_002_107, 0) 49 | .saturating_add(Weight::from_parts(0, 4764)) 50 | // Standard Error: 7_212 51 | .saturating_add(Weight::from_parts(3_425, 0).saturating_mul(l.into())) 52 | .saturating_add(T::DbWeight::get().reads(3)) 53 | .saturating_add(T::DbWeight::get().writes(2)) 54 | } 55 | /// Storage: `Vesting::Vesting` (r:1 w:1) 56 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 57 | /// Storage: `Balances::Locks` (r:1 w:1) 58 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 59 | /// Storage: `Balances::Freezes` (r:1 w:0) 60 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 61 | /// The range of component `l` is `[0, 49]`. 62 | /// The range of component `s` is `[1, 28]`. 63 | fn vest_unlocked(l: u32, s: u32, ) -> Weight { 64 | // Proof Size summary in bytes: 65 | // Measured: `277 + l * (25 ±0) + s * (36 ±0)` 66 | // Estimated: `4764` 67 | // Minimum execution time: 31_058_000 picoseconds. 68 | Weight::from_parts(29_815_260, 0) 69 | .saturating_add(Weight::from_parts(0, 4764)) 70 | // Standard Error: 4_272 71 | .saturating_add(Weight::from_parts(50_347, 0).saturating_mul(l.into())) 72 | // Standard Error: 7_602 73 | .saturating_add(Weight::from_parts(132_966, 0).saturating_mul(s.into())) 74 | .saturating_add(T::DbWeight::get().reads(3)) 75 | .saturating_add(T::DbWeight::get().writes(2)) 76 | } 77 | /// Storage: `Vesting::Vesting` (r:1 w:1) 78 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 79 | /// Storage: `Balances::Locks` (r:1 w:1) 80 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 81 | /// Storage: `Balances::Freezes` (r:1 w:0) 82 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 83 | /// Storage: `System::Account` (r:1 w:1) 84 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 85 | /// The range of component `l` is `[0, 49]`. 86 | /// The range of component `s` is `[1, 28]`. 87 | fn vest_other_locked(l: u32, s: u32, ) -> Weight { 88 | // Proof Size summary in bytes: 89 | // Measured: `380 + l * (25 ±0) + s * (36 ±0)` 90 | // Estimated: `4764` 91 | // Minimum execution time: 30_260_000 picoseconds. 92 | Weight::from_parts(30_314_459, 0) 93 | .saturating_add(Weight::from_parts(0, 4764)) 94 | // Standard Error: 7_482 95 | .saturating_add(Weight::from_parts(72_837, 0).saturating_mul(l.into())) 96 | // Standard Error: 13_312 97 | .saturating_add(Weight::from_parts(96_937, 0).saturating_mul(s.into())) 98 | .saturating_add(T::DbWeight::get().reads(4)) 99 | .saturating_add(T::DbWeight::get().writes(3)) 100 | } 101 | /// Storage: `Vesting::Vesting` (r:1 w:1) 102 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 103 | /// Storage: `Balances::Locks` (r:1 w:1) 104 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 105 | /// Storage: `Balances::Freezes` (r:1 w:0) 106 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 107 | /// Storage: `System::Account` (r:1 w:1) 108 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 109 | /// The range of component `l` is `[0, 49]`. 110 | /// The range of component `s` is `[1, 28]`. 111 | fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { 112 | // Proof Size summary in bytes: 113 | // Measured: `380 + l * (25 ±0) + s * (36 ±0)` 114 | // Estimated: `4764` 115 | // Minimum execution time: 32_552_000 picoseconds. 116 | Weight::from_parts(31_164_123, 0) 117 | .saturating_add(Weight::from_parts(0, 4764)) 118 | // Standard Error: 14_350 119 | .saturating_add(Weight::from_parts(162_203, 0).saturating_mul(l.into())) 120 | // Standard Error: 25_531 121 | .saturating_add(Weight::from_parts(72_688, 0).saturating_mul(s.into())) 122 | .saturating_add(T::DbWeight::get().reads(4)) 123 | .saturating_add(T::DbWeight::get().writes(3)) 124 | } 125 | /// Storage: `Vesting::Vesting` (r:1 w:1) 126 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 127 | /// Storage: `System::Account` (r:1 w:1) 128 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 129 | /// Storage: `Balances::Locks` (r:1 w:1) 130 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 131 | /// Storage: `Balances::Freezes` (r:1 w:0) 132 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 133 | /// The range of component `l` is `[0, 49]`. 134 | /// The range of component `s` is `[0, 27]`. 135 | fn vested_transfer(l: u32, s: u32, ) -> Weight { 136 | // Proof Size summary in bytes: 137 | // Measured: `380 + l * (25 ±0) + s * (36 ±0)` 138 | // Estimated: `4764` 139 | // Minimum execution time: 62_792_000 picoseconds. 140 | Weight::from_parts(62_668_826, 0) 141 | .saturating_add(Weight::from_parts(0, 4764)) 142 | // Standard Error: 12_480 143 | .saturating_add(Weight::from_parts(41_854, 0).saturating_mul(l.into())) 144 | // Standard Error: 22_205 145 | .saturating_add(Weight::from_parts(410_696, 0).saturating_mul(s.into())) 146 | .saturating_add(T::DbWeight::get().reads(4)) 147 | .saturating_add(T::DbWeight::get().writes(3)) 148 | } 149 | /// Storage: `Vesting::Vesting` (r:1 w:1) 150 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 151 | /// Storage: `System::Account` (r:2 w:2) 152 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 153 | /// Storage: `Balances::Locks` (r:1 w:1) 154 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 155 | /// Storage: `Balances::Freezes` (r:1 w:0) 156 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 157 | /// The range of component `l` is `[0, 49]`. 158 | /// The range of component `s` is `[0, 27]`. 159 | fn force_vested_transfer(_l: u32, s: u32, ) -> Weight { 160 | // Proof Size summary in bytes: 161 | // Measured: `520 + l * (25 ±0) + s * (36 ±0)` 162 | // Estimated: `6196` 163 | // Minimum execution time: 66_703_000 picoseconds. 164 | Weight::from_parts(78_059_791, 0) 165 | .saturating_add(Weight::from_parts(0, 6196)) 166 | // Standard Error: 31_947 167 | .saturating_add(Weight::from_parts(179_743, 0).saturating_mul(s.into())) 168 | .saturating_add(T::DbWeight::get().reads(5)) 169 | .saturating_add(T::DbWeight::get().writes(4)) 170 | } 171 | /// Storage: `Vesting::Vesting` (r:1 w:1) 172 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 173 | /// Storage: `Balances::Locks` (r:1 w:1) 174 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 175 | /// Storage: `Balances::Freezes` (r:1 w:0) 176 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 177 | /// Storage: `System::Account` (r:1 w:1) 178 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 179 | /// The range of component `l` is `[0, 49]`. 180 | /// The range of component `s` is `[2, 28]`. 181 | fn not_unlocking_merge_schedules(_l: u32, s: u32, ) -> Weight { 182 | // Proof Size summary in bytes: 183 | // Measured: `328 + l * (25 ±0) + s * (36 ±0)` 184 | // Estimated: `4764` 185 | // Minimum execution time: 30_520_000 picoseconds. 186 | Weight::from_parts(34_396_025, 0) 187 | .saturating_add(Weight::from_parts(0, 4764)) 188 | // Standard Error: 12_813 189 | .saturating_add(Weight::from_parts(92_797, 0).saturating_mul(s.into())) 190 | .saturating_add(T::DbWeight::get().reads(4)) 191 | .saturating_add(T::DbWeight::get().writes(3)) 192 | } 193 | /// Storage: `Vesting::Vesting` (r:1 w:1) 194 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 195 | /// Storage: `Balances::Locks` (r:1 w:1) 196 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 197 | /// Storage: `Balances::Freezes` (r:1 w:0) 198 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 199 | /// Storage: `System::Account` (r:1 w:1) 200 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 201 | /// The range of component `l` is `[0, 49]`. 202 | /// The range of component `s` is `[2, 28]`. 203 | fn unlocking_merge_schedules(_l: u32, s: u32, ) -> Weight { 204 | // Proof Size summary in bytes: 205 | // Measured: `328 + l * (25 ±0) + s * (36 ±0)` 206 | // Estimated: `4764` 207 | // Minimum execution time: 33_774_000 picoseconds. 208 | Weight::from_parts(37_657_520, 0) 209 | .saturating_add(Weight::from_parts(0, 4764)) 210 | // Standard Error: 12_529 211 | .saturating_add(Weight::from_parts(88_818, 0).saturating_mul(s.into())) 212 | .saturating_add(T::DbWeight::get().reads(4)) 213 | .saturating_add(T::DbWeight::get().writes(3)) 214 | } 215 | /// Storage: `Vesting::Vesting` (r:1 w:1) 216 | /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) 217 | /// Storage: `Balances::Locks` (r:1 w:1) 218 | /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) 219 | /// Storage: `Balances::Freezes` (r:1 w:0) 220 | /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) 221 | /// Storage: `System::Account` (r:1 w:1) 222 | /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) 223 | /// The range of component `l` is `[0, 49]`. 224 | /// The range of component `s` is `[2, 28]`. 225 | fn force_remove_vesting_schedule(l: u32, _s: u32, ) -> Weight { 226 | // Proof Size summary in bytes: 227 | // Measured: `380 + l * (25 ±0) + s * (36 ±0)` 228 | // Estimated: `4764` 229 | // Minimum execution time: 35_017_000 picoseconds. 230 | Weight::from_parts(42_838_596, 0) 231 | .saturating_add(Weight::from_parts(0, 4764)) 232 | // Standard Error: 8_310 233 | .saturating_add(Weight::from_parts(17_149, 0).saturating_mul(l.into())) 234 | .saturating_add(T::DbWeight::get().reads(4)) 235 | .saturating_add(T::DbWeight::get().writes(3)) 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.78.0" 3 | components = [ 4 | "clippy", 5 | "rust-src", 6 | "rustfmt", 7 | ] 8 | targets = ["wasm32-unknown-unknown"] -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Basic 2 | hard_tabs = true 3 | max_width = 100 4 | use_small_heuristics = "Max" 5 | # Imports 6 | imports_granularity = "Crate" 7 | reorder_imports = true 8 | # Consistency 9 | newline_style = "Unix" 10 | # Misc 11 | chain_width = 80 12 | spaces_around_ranges = false 13 | binop_separator = "Back" 14 | reorder_impl_items = false 15 | match_arm_leading_pipes = "Preserve" 16 | match_arm_blocks = false 17 | match_block_trailing_comma = true 18 | trailing_comma = "Vertical" 19 | trailing_semicolon = false 20 | use_field_init_shorthand = true 21 | -------------------------------------------------------------------------------- /scripts/benchmark_all_pallets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create `WeightInfo` implementations for all the pallets and store it in the weight module of the `runtime`. 4 | 5 | NODE=${1:-target/release/integritee-node} 6 | CHAIN_SPEC=${2:-integritee-solo-fresh} 7 | WEIGHT_OUTPUT_DIR=${3:-runtime/src/weights} 8 | 9 | echo "Running benchmarks for all pallets:" 10 | echo "NODE: ${NODE}" 11 | echo "CHAIN_SPEC: ${CHAIN_SPEC}" 12 | echo "WEIGHT_OUTPUT_DIR: ${WEIGHT_OUTPUT_DIR}" 13 | 14 | mkdir -p "$WEIGHT_OUTPUT_DIR" 15 | 16 | pallets=( 17 | "frame_system" \ 18 | "pallet_balances" \ 19 | "pallet_multisig" \ 20 | "pallet_preimage" \ 21 | "pallet_proxy" \ 22 | "pallet_scheduler" \ 23 | "pallet_teerex" \ 24 | "pallet_sidechain" \ 25 | "pallet_enclave_bridge" \ 26 | "pallet_claims" \ 27 | "pallet_timestamp" \ 28 | "pallet_treasury" \ 29 | "pallet_vesting" \ 30 | "pallet_utility" \ 31 | "pallet_teeracle" \ 32 | "pallet_teerdays" \ 33 | ) 34 | 35 | for pallet in ${pallets[*]}; do 36 | echo benchmarking "$pallet"... 37 | 38 | $NODE \ 39 | benchmark pallet \ 40 | --chain="$CHAIN_SPEC" \ 41 | --steps=50 \ 42 | --repeat=20 \ 43 | --pallet="$pallet" \ 44 | --extrinsic="*" \ 45 | --execution=wasm \ 46 | --wasm-execution=compiled \ 47 | --heap-pages=4096 \ 48 | --output="$WEIGHT_OUTPUT_DIR"/"$pallet".rs \ 49 | 50 | done 51 | -------------------------------------------------------------------------------- /scripts/docker_run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | echo "*** Start Substrate node template ***" 6 | 7 | cd $(dirname ${BASH_SOURCE[0]})/.. 8 | 9 | docker-compose down --remove-orphans 10 | docker-compose run --rm --service-ports dev $@ -------------------------------------------------------------------------------- /scripts/dump_wasm_state_and_spec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Helper script to generate the wasm, state and chain-spec/ -raw.json for a given chain-spec. 4 | # 5 | # Usage: ./scripts/dump_wasm_state_and_spec.sh 6 | # 7 | # Example: ./scripts/dump_wasm_state_and_spec.sh shell-kusama-local-dev 2000 collator ./dump_dir 8 | # 9 | # chain-spec is mandatory, the rest is optional. 10 | 11 | 12 | CHAIN_SPEC=$1 13 | COLLATOR=${2:-./target/release/encointer-collator} 14 | DUMP_DIR=${3:-./chain_dumps} 15 | 16 | mkdir -p ${DUMP_DIR} 17 | 18 | echo "dumping spec for: $CHAIN_SPEC" 19 | echo "collator: ${COLLATOR}" 20 | echo "dump_dir: ${DUMP_DIR}" 21 | echo "" 22 | 23 | $COLLATOR build-spec --chain ${CHAIN_SPEC} >$DUMP_DIR/${CHAIN_SPEC}.json 24 | $COLLATOR build-spec --chain ${CHAIN_SPEC} --raw >$DUMP_DIR/${CHAIN_SPEC}-raw-unsorted.json 25 | jq --sort-keys . $DUMP_DIR/${CHAIN_SPEC}-raw-unsorted.json > $DUMP_DIR/${CHAIN_SPEC}-raw.json 26 | 27 | $COLLATOR export-state --chain $DUMP_DIR/${CHAIN_SPEC}-raw.json >$DUMP_DIR/${CHAIN_SPEC}.state 28 | -------------------------------------------------------------------------------- /scripts/github/lib.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # A collection of helper functions that might be useful for various scripts 4 | 5 | # Gets the runtime version for a given runtime. 6 | # Optionally accepts a path that is the root of the project which defaults to 7 | # the current working directory 8 | def get_runtime(path = '.') 9 | File.open(path + "/runtime/src/lib.rs") do |f| 10 | f.find { |l| l =~ /spec_version:/ }.match(/[0-9]+/)[0] 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /scripts/treasury-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Thu Sep 16 20:41:13 2021 5 | 6 | @author: brenzi 7 | """ 8 | 9 | from substrateinterface import SubstrateInterface, Keypair 10 | from substrateinterface.utils.ss58 import ss58_encode 11 | 12 | def get_balance(who): 13 | return substrate.query('System', 'Account', params=[who]).value['data']['free'] 14 | 15 | substrate = SubstrateInterface( 16 | url="ws://127.0.0.1:9944", 17 | type_registry_preset='kusama' 18 | ) 19 | alice = Keypair.create_from_uri('//Alice') 20 | dave = Keypair.create_from_uri('//Dave') 21 | treasury = ss58_encode('0x' + b'modlpy/trsry'.hex() + '0000000000000000000000000000000000000000') 22 | 23 | alicebefore = get_balance(alice.ss58_address) 24 | treasurybefore = get_balance(treasury) 25 | totalissuancebefore = substrate.query('Balances', 'TotalIssuance') 26 | print('total issuance', totalissuancebefore) 27 | 28 | amount = 10 * 10**9 #milli 29 | 30 | call = substrate.compose_call( 31 | call_module='Balances', 32 | call_function='transfer', 33 | call_params={ 34 | 'dest': dave.ss58_address, 35 | 'value': amount 36 | } 37 | ) 38 | 39 | payment_info = substrate.get_payment_info(call=call, keypair=alice) 40 | print("Payment info: ", payment_info) 41 | 42 | extrinsic = substrate.create_signed_extrinsic( 43 | call=call, 44 | keypair=alice, 45 | era={'period': 64} 46 | ) 47 | receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True) 48 | print('extrinsic sent') 49 | 50 | totalissuanceafter = substrate.query('Balances', 'TotalIssuance') 51 | print('difference in total issuance: ', totalissuancebefore.value - totalissuanceafter.value) 52 | 53 | aliceafter = get_balance(alice.ss58_address) 54 | 55 | paidfee = alicebefore - aliceafter - amount 56 | print('fee paid : ', paidfee) 57 | 58 | treasuryafter = get_balance(treasury) 59 | 60 | print('treasury balance is ', treasuryafter, ' and has increased by', treasuryafter-treasurybefore) -------------------------------------------------------------------------------- /scripts/update_hardcoded_chain_specs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | Simple script to upgrade the hardcoded chain-spec.json files. 5 | This the main purpose is that to automate migration of values from the old files to the new files that can not 6 | be inserted by the rust code, e.g., the `bootNodes`. 7 | Usage: ./scripts/update_hardcoded_specs.py <--migrate-genesis> 8 | Optionally define if the `genesis` field of the chain-spec should also be migrated. This field should be set as follows: 9 | * True, if a completely new chain-spec shall be created. This will create a new genesis state, which is not compatible 10 | with chains running on the old chain-spec. 11 | * False, if we only want to change other fields that are relevant to the node (i.e., the client) only, but not 12 | the runtime. For instance if we update the substrate/polkadot. 13 | """ 14 | 15 | import argparse 16 | import json 17 | import os 18 | import subprocess 19 | 20 | SPECS = [ 21 | { 22 | "chain_id": "cranny", 23 | }, 24 | { 25 | "chain_id": "integritee-solo", 26 | } 27 | ] 28 | COLLATOR = "target/release/integritee-node" 29 | RES_DIR = "node/res" 30 | 31 | 32 | def main(regenesis: bool): 33 | for s in SPECS: 34 | chain_spec = s["chain_id"] 35 | 36 | ret = subprocess.call( 37 | f'scripts/dump_wasm_state_and_spec.sh {chain_spec}-fresh {COLLATOR} {RES_DIR}', 38 | stdout=subprocess.PIPE, 39 | shell=True 40 | ) 41 | 42 | print(ret) 43 | 44 | orig_file = f'{RES_DIR}/{chain_spec}.json' 45 | new_file_base = f'{RES_DIR}/{chain_spec}-fresh' 46 | 47 | with open(orig_file, 'r+') as spec_orig_file: 48 | orig_json = json.load(spec_orig_file) 49 | 50 | # migrate old values to new spec 51 | with open(f'{new_file_base}.json', 'r+') as spec_new_file: 52 | new_json = json.load(spec_new_file) 53 | 54 | new_json["bootNodes"] = orig_json["bootNodes"] 55 | 56 | if not regenesis: 57 | new_json["genesis"] = orig_json["genesis"] 58 | 59 | # go to beginning of the file to overwrite 60 | spec_orig_file.seek(0) 61 | json.dump(new_json, spec_orig_file, indent=2) 62 | spec_orig_file.truncate() 63 | 64 | # remove side-products 65 | os.remove(f'{new_file_base}.json') 66 | os.remove(f'{new_file_base}-raw.json') 67 | os.remove(f'{new_file_base}-raw-unsorted.json') 68 | os.remove(f'{new_file_base}.state') 69 | 70 | if __name__ == '__main__': 71 | parser = argparse.ArgumentParser() 72 | parser.add_argument('--regenesis', help='Overwrite genesis state in chain spec. Use this for resetting chains entirely', action='store_true') 73 | 74 | args = parser.parse_args() 75 | print(f'Updating chain specs. Preserving bootnodes. (re-genesis == {args.regenesis})') 76 | 77 | main(args.regenesis) 78 | -------------------------------------------------------------------------------- /scripts/vesting-transfers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Thu Sep 16 20:41:13 2021 5 | 6 | @author: brenzi 7 | """ 8 | 9 | from substrateinterface import SubstrateInterface, Keypair 10 | from substrateinterface.utils.ss58 import ss58_encode 11 | 12 | def get_balance(who): 13 | return substrate.query('System', 'Account', params=[who]).value['data']['free'] 14 | def float_balance(val): 15 | return float(val) / pow(10.0,12.0) 16 | 17 | substrate = SubstrateInterface( 18 | url="wss://api.solo.integritee.io:443", 19 | type_registry_preset='kusama' 20 | ) 21 | treasury = ss58_encode('0x' + b'modlpy/trsry'.hex() + '0000000000000000000000000000000000000000', ss58_format=13) 22 | 23 | anonproxy = '2KF2YRZbMVmDTCEhw5Bjz7Na5dG7fCCtUcd9KccUBaRngUW9' 24 | #beneficiary = '2PaWxAa4RKMY2HrHwy4aAWF1KiGbv7haDasF34PwZLaMvBvb' 25 | beneficiary='2PuNvnHydtgtS4Adpmj4NGn6qsGd3xJmsEdEhn1gjABcpLYo' 26 | 27 | print(f"treasury {treasury} balance is {float_balance(get_balance(treasury))}") 28 | print(f"anon proxy {anonproxy} balance is {float_balance(get_balance(anonproxy))}") 29 | 30 | signer = Keypair.create_from_uri('//SomeTemporaryCustodian', ss58_format=13) 31 | print(f"temporary account: {signer.ss58_address}") 32 | 33 | 34 | block_number_now = substrate.get_block_number(substrate.get_chain_head()) 35 | print(f"current block number: {block_number_now}") 36 | 37 | call = substrate.compose_call( 38 | call_module='Vesting', 39 | call_function='vested_transfer', 40 | call_params={ 41 | 'target': beneficiary, 42 | 'schedule' : { 43 | 'locked': 1000000000000, 44 | 'per_block': 10000000000, 45 | 'starting_block': block_number_now + 10 46 | } 47 | } 48 | ) 49 | 50 | extrinsic = substrate.create_signed_extrinsic( 51 | call=call, 52 | keypair=signer, 53 | era={'period': 64} 54 | ) 55 | receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True) 56 | print('extrinsic sent') 57 | print(f"beneficiary balance: {float_balance(get_balance(beneficiary))}") 58 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | mozillaOverlay = 3 | import (builtins.fetchGit { 4 | url = "https://github.com/mozilla/nixpkgs-mozilla.git"; 5 | rev = "57c8084c7ef41366993909c20491e359bbb90f54"; 6 | }); 7 | nixpkgs = import { overlays = [ mozillaOverlay ]; }; 8 | rust-nightly = with nixpkgs; ((rustChannelOf { date = "2020-10-05"; channel = "nightly"; }).rust.override { 9 | targets = [ "wasm32-unknown-unknown" ]; 10 | }); 11 | in 12 | with nixpkgs; pkgs.mkShell { 13 | buildInputs = [ 14 | clang 15 | cmake 16 | pkg-config 17 | rust-nightly 18 | ] ++ stdenv.lib.optionals stdenv.isDarwin [ 19 | darwin.apple_sdk.frameworks.Security 20 | ]; 21 | 22 | LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; 23 | PROTOC = "${protobuf}/bin/protoc"; 24 | ROCKSDB_LIB_DIR = "${rocksdb}/lib"; 25 | } 26 | --------------------------------------------------------------------------------