diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2716b018d6c0..f6f714ea52b10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -209,18 +209,6 @@ default: AWS_SECRET_ACCESS_KEY: vault: cicd/gitlab/$CI_PROJECT_PATH/AWS_SECRET_ACCESS_KEY@kv file: false - AWX_TOKEN: - vault: cicd/gitlab/$CI_PROJECT_PATH/AWX_TOKEN@kv - file: false - CRATES_TOKEN: - vault: cicd/gitlab/$CI_PROJECT_PATH/CRATES_TOKEN@kv - file: false - DOCKER_CHAOS_TOKEN: - vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_TOKEN@kv - file: false - DOCKER_CHAOS_USER: - vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_USER@kv - file: false GITHUB_EMAIL: vault: cicd/gitlab/$CI_PROJECT_PATH/GITHUB_EMAIL@kv file: false @@ -239,22 +227,13 @@ default: MATRIX_ROOM_ID: vault: cicd/gitlab/$CI_PROJECT_PATH/MATRIX_ROOM_ID@kv file: false - PIPELINE_TOKEN: - vault: cicd/gitlab/$CI_PROJECT_PATH/PIPELINE_TOKEN@kv - file: false - VALIDATOR_KEYS: - vault: cicd/gitlab/$CI_PROJECT_PATH/VALIDATOR_KEYS@kv - file: false - VALIDATOR_KEYS_CHAOS: - vault: cicd/gitlab/$CI_PROJECT_PATH/VALIDATOR_KEYS_CHAOS@kv - file: false + #### stage: .pre skip-if-draft: image: paritytech/tools:latest <<: *kubernetes-env - <<: *vault-secrets stage: .pre rules: - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs @@ -270,7 +249,6 @@ check-runtime: stage: check image: paritytech/tools:latest <<: *kubernetes-env - <<: *vault-secrets rules: - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs variables: @@ -285,7 +263,6 @@ check-signed-tag: stage: check image: paritytech/tools:latest <<: *kubernetes-env - <<: *vault-secrets rules: - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 @@ -548,7 +525,6 @@ cargo-check-macos: stage: build <<: *docker-env <<: *test-refs-no-trigger-prs-only - <<: *vault-secrets script: - git clone --depth=1 diff --git a/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml b/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml index 7ad916f022154..df5e020d067ea 100644 --- a/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml +++ b/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml @@ -6,39 +6,39 @@ evaluation_interval: 1m tests: - interval: 1m input_series: - - series: 'polkadot_sub_libp2p_peers_count{ - job="polkadot", - pod="polkadot-abcdef01234-abcdef", - instance="polkadot-abcdef01234-abcdef", + - series: 'substrate_sub_libp2p_peers_count{ + job="substrate", + pod="substrate-abcdef01234-abcdef", + instance="substrate-abcdef01234-abcdef", }' values: '3 2+0x4 1+0x9' # 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 - - series: 'polkadot_sub_txpool_validations_scheduled{ - job="polkadot", - pod="polkadot-abcdef01234-abcdef", - instance="polkadot-abcdef01234-abcdef", + - series: 'substrate_sub_txpool_validations_scheduled{ + job="substrate", + pod="substrate-abcdef01234-abcdef", + instance="substrate-abcdef01234-abcdef", }' values: '11+1x10 22+2x30 10043x5' - - series: 'polkadot_sub_txpool_validations_finished{ - job="polkadot", - pod="polkadot-abcdef01234-abcdef", - instance="polkadot-abcdef01234-abcdef", + - series: 'substrate_sub_txpool_validations_finished{ + job="substrate", + pod="substrate-abcdef01234-abcdef", + instance="substrate-abcdef01234-abcdef", }' values: '0+1x42 42x5' - - series: 'polkadot_block_height{ - status="best", job="polkadot", - pod="polkadot-abcdef01234-abcdef", - instance="polkadot-abcdef01234-abcdef", + - series: 'substrate_block_height{ + status="best", job="substrate", + pod="substrate-abcdef01234-abcdef", + instance="substrate-abcdef01234-abcdef", }' values: '1+1x3 4+0x13' # 1 2 3 4 4 4 4 4 4 4 4 4 ... - - series: 'polkadot_block_height{ + - series: 'substrate_block_height{ status="finalized", - job="polkadot", - pod="polkadot-abcdef01234-abcdef", - instance="polkadot-abcdef01234-abcdef", + job="substrate", + pod="substrate-abcdef01234-abcdef", + instance="substrate-abcdef01234-abcdef", }' values: '1+1x3 4+0x13' # 1 2 3 4 4 4 4 4 4 4 4 4 ... @@ -56,13 +56,13 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate status: best exp_annotations: message: "Best block on instance - polkadot-abcdef01234-abcdef increases by less than 1 per + substrate-abcdef01234-abcdef increases by less than 1 per minute for more than 3 minutes." - eval_time: 14m @@ -70,23 +70,23 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate status: best exp_annotations: message: "Best block on instance - polkadot-abcdef01234-abcdef increases by less than 1 per + substrate-abcdef01234-abcdef increases by less than 1 per minute for more than 3 minutes." - exp_labels: severity: critical - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate status: best exp_annotations: message: "Best block on instance - polkadot-abcdef01234-abcdef increases by less than 1 per + substrate-abcdef01234-abcdef increases by less than 1 per minute for more than 10 minutes." ###################################################################### @@ -101,13 +101,13 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate status: finalized exp_annotations: message: "Finalized block on instance - polkadot-abcdef01234-abcdef increases by less than 1 per + substrate-abcdef01234-abcdef increases by less than 1 per minute for more than 3 minutes." - eval_time: 14m @@ -115,23 +115,23 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate status: finalized exp_annotations: message: "Finalized block on instance - polkadot-abcdef01234-abcdef increases by less than 1 per + substrate-abcdef01234-abcdef increases by less than 1 per minute for more than 3 minutes." - exp_labels: severity: critical - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate status: finalized exp_annotations: message: "Finalized block on instance - polkadot-abcdef01234-abcdef increases by less than 1 per + substrate-abcdef01234-abcdef increases by less than 1 per minute for more than 10 minutes." ###################################################################### @@ -152,12 +152,12 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: message: "The transaction pool size on node - polkadot-abcdef01234-abcdef has been monotonically + substrate-abcdef01234-abcdef has been monotonically increasing for more than 10 minutes." - eval_time: 43m alertname: TransactionQueueSizeIncreasing @@ -167,21 +167,21 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: message: "The transaction pool size on node - polkadot-abcdef01234-abcdef has been monotonically + substrate-abcdef01234-abcdef has been monotonically increasing for more than 10 minutes." - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: message: "The transaction pool size on node - polkadot-abcdef01234-abcdef has been monotonically + substrate-abcdef01234-abcdef has been monotonically increasing for more than 30 minutes." - eval_time: 49m alertname: TransactionQueueSizeHigh @@ -191,12 +191,12 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: message: "The transaction pool size on node - polkadot-abcdef01234-abcdef has been above 10_000 for more + substrate-abcdef01234-abcdef has been above 10_000 for more than 5 minutes." ###################################################################### @@ -211,11 +211,11 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: - message: "The node polkadot-abcdef01234-abcdef has less + message: "The node substrate-abcdef01234-abcdef has less than 3 peers for more than 3 minutes" - eval_time: 16m # Values: 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 @@ -223,17 +223,17 @@ tests: exp_alerts: - exp_labels: severity: warning - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: - message: "The node polkadot-abcdef01234-abcdef has less + message: "The node substrate-abcdef01234-abcdef has less than 3 peers for more than 3 minutes" - exp_labels: severity: critical - pod: polkadot-abcdef01234-abcdef - instance: polkadot-abcdef01234-abcdef - job: polkadot + pod: substrate-abcdef01234-abcdef + instance: substrate-abcdef01234-abcdef + job: substrate exp_annotations: - message: "The node polkadot-abcdef01234-abcdef has less + message: "The node substrate-abcdef01234-abcdef has less than 3 peers for more than 15 minutes" diff --git a/.maintain/monitoring/alerting-rules/alerting-rules.yaml b/.maintain/monitoring/alerting-rules/alerting-rules.yaml index 2711610024330..4171f92f68fef 100644 --- a/.maintain/monitoring/alerting-rules/alerting-rules.yaml +++ b/.maintain/monitoring/alerting-rules/alerting-rules.yaml @@ -1,5 +1,5 @@ groups: -- name: polkadot.rules +- name: substrate.rules rules: ############################################################################## @@ -10,7 +10,7 @@ groups: annotations: message: 'Best block on instance {{ $labels.instance }} increases by less than 1 per minute for more than 3 minutes.' - expr: increase(polkadot_block_height{status="best"}[1m]) < 1 + expr: increase(substrate_block_height{status="best"}[1m]) < 1 for: 3m labels: severity: warning @@ -18,7 +18,7 @@ groups: annotations: message: 'Best block on instance {{ $labels.instance }} increases by less than 1 per minute for more than 10 minutes.' - expr: increase(polkadot_block_height{status="best"}[1m]) < 1 + expr: increase(substrate_block_height{status="best"}[1m]) < 1 for: 10m labels: severity: critical @@ -28,7 +28,7 @@ groups: ############################################################################## - alert: BlockFinalizationSlow - expr: increase(polkadot_block_height{status="finalized"}[1m]) < 1 + expr: increase(substrate_block_height{status="finalized"}[1m]) < 1 for: 3m labels: severity: warning @@ -36,7 +36,7 @@ groups: message: 'Finalized block on instance {{ $labels.instance }} increases by less than 1 per minute for more than 3 minutes.' - alert: BlockFinalizationSlow - expr: increase(polkadot_block_height{status="finalized"}[1m]) < 1 + expr: increase(substrate_block_height{status="finalized"}[1m]) < 1 for: 10m labels: severity: critical @@ -47,8 +47,8 @@ groups: # Under the assumption of an average block production of 6 seconds, # "best" and "finalized" being more than 10 blocks apart would imply # more than a 1 minute delay between block production and finalization. - expr: '(polkadot_block_height{status="best"} - ignoring(status) - polkadot_block_height{status="finalized"}) > 10' + expr: '(substrate_block_height{status="best"} - ignoring(status) + substrate_block_height{status="finalized"}) > 10' for: 8m labels: severity: critical @@ -61,8 +61,8 @@ groups: ############################################################################## - alert: TransactionQueueSizeIncreasing - expr: 'increase(polkadot_sub_txpool_validations_scheduled[5m]) - - increase(polkadot_sub_txpool_validations_finished[5m]) > 0' + expr: 'increase(substrate_sub_txpool_validations_scheduled[5m]) - + increase(substrate_sub_txpool_validations_finished[5m]) > 0' for: 10m labels: severity: warning @@ -70,8 +70,8 @@ groups: message: 'The transaction pool size on node {{ $labels.instance }} has been monotonically increasing for more than 10 minutes.' - alert: TransactionQueueSizeIncreasing - expr: 'increase(polkadot_sub_txpool_validations_scheduled[5m]) - - increase(polkadot_sub_txpool_validations_finished[5m]) > 0' + expr: 'increase(substrate_sub_txpool_validations_scheduled[5m]) - + increase(substrate_sub_txpool_validations_finished[5m]) > 0' for: 30m labels: severity: warning @@ -79,8 +79,8 @@ groups: message: 'The transaction pool size on node {{ $labels.instance }} has been monotonically increasing for more than 30 minutes.' - alert: TransactionQueueSizeHigh - expr: 'polkadot_sub_txpool_validations_scheduled - - polkadot_sub_txpool_validations_finished > 10000' + expr: 'substrate_sub_txpool_validations_scheduled - + substrate_sub_txpool_validations_finished > 10000' for: 5m labels: severity: warning @@ -93,7 +93,7 @@ groups: ############################################################################## - alert: NumberOfPeersLow - expr: polkadot_sub_libp2p_peers_count < 3 + expr: substrate_sub_libp2p_peers_count < 3 for: 3m labels: severity: warning @@ -101,7 +101,7 @@ groups: message: 'The node {{ $labels.instance }} has less than 3 peers for more than 3 minutes' - alert: NumberOfPeersLow - expr: polkadot_sub_libp2p_peers_count < 3 + expr: substrate_sub_libp2p_peers_count < 3 for: 15m labels: severity: critical @@ -109,7 +109,7 @@ groups: message: 'The node {{ $labels.instance }} has less than 3 peers for more than 15 minutes' - alert: NoIncomingConnection - expr: increase(polkadot_sub_libp2p_incoming_connections_total[20m]) == 0 + expr: increase(substrate_sub_libp2p_incoming_connections_total[20m]) == 0 labels: severity: warning annotations: @@ -121,7 +121,7 @@ groups: ############################################################################## - alert: NumberOfFileDescriptorsHigh - expr: 'node_filefd_allocated{domain=~"kusama|polkadot"} > 10000' + expr: 'node_filefd_allocated{chain!=""} > 10000' for: 3m labels: severity: warning @@ -134,9 +134,9 @@ groups: ############################################################################## - alert: AuthorityDiscoveryDiscoveryFailureHigh - expr: 'polkadot_authority_discovery_handle_value_found_event_failure / + expr: 'substrate_authority_discovery_handle_value_found_event_failure / ignoring(name) - polkadot_authority_discovery_dht_event_received{name="value_found"} > 0.5' + substrate_authority_discovery_dht_event_received{name="value_found"} > 0.5' for: 2h labels: severity: warning @@ -147,9 +147,9 @@ groups: - alert: UnboundedChannelPersistentlyLarge expr: '( - (polkadot_unbounded_channel_len{action = "send"} - - ignoring(action) polkadot_unbounded_channel_len{action = "received"}) - or on(instance) polkadot_unbounded_channel_len{action = "send"} + (substrate_unbounded_channel_len{action = "send"} - + ignoring(action) substrate_unbounded_channel_len{action = "received"}) + or on(instance) substrate_unbounded_channel_len{action = "send"} ) >= 200' for: 5m labels: @@ -160,9 +160,9 @@ groups: - alert: UnboundedChannelVeryLarge expr: '( - (polkadot_unbounded_channel_len{action = "send"} - - ignoring(action) polkadot_unbounded_channel_len{action = "received"}) - or on(instance) polkadot_unbounded_channel_len{action = "send"} + (substrate_unbounded_channel_len{action = "send"} - + ignoring(action) substrate_unbounded_channel_len{action = "received"}) + or on(instance) substrate_unbounded_channel_len{action = "send"} ) > 15000' labels: severity: warning diff --git a/.maintain/monitoring/grafana-dashboards/substrate-networking.json b/.maintain/monitoring/grafana-dashboards/substrate-networking.json index 46942cf582fc6..abd675ed13ec3 100644 --- a/.maintain/monitoring/grafana-dashboards/substrate-networking.json +++ b/.maintain/monitoring/grafana-dashboards/substrate-networking.json @@ -4,7 +4,7 @@ "name": "VAR_METRIC_NAMESPACE", "type": "constant", "label": "Prefix of the metrics", - "value": "polkadot", + "value": "substrate", "description": "" } ], diff --git a/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json b/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json index 2f08ac7bb34c5..ce7e9f78cd8ae 100644 --- a/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json +++ b/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json @@ -4,7 +4,7 @@ "name": "VAR_METRIC_NAMESPACE", "type": "constant", "label": "Prefix of the metrics", - "value": "polkadot", + "value": "substrate", "description": "" } ], diff --git a/Cargo.lock b/Cargo.lock index a8092fffa7c07..af6cb045f7a6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1438,7 +1438,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" dependencies = [ - "sct", + "sct 0.6.0", ] [[package]] @@ -2038,6 +2038,7 @@ dependencies = [ "parity-scale-codec", "paste 1.0.6", "scale-info", + "serde", "sp-api", "sp-application-crypto", "sp-io", @@ -2066,6 +2067,7 @@ dependencies = [ "sc-executor", "sc-service", "serde", + "serde_json", "sp-core", "sp-externalities", "sp-keystore", @@ -2425,8 +2427,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" dependencies = [ "futures-io", - "rustls", - "webpki", + "rustls 0.19.1", + "webpki 0.21.4", ] [[package]] @@ -2874,11 +2876,11 @@ dependencies = [ "futures-util", "hyper 0.14.16", "log 0.4.14", - "rustls", - "rustls-native-certs", + "rustls 0.19.1", + "rustls-native-certs 0.5.0", "tokio", - "tokio-rustls", - "webpki", + "tokio-rustls 0.22.0", + "webpki 0.21.4", ] [[package]] @@ -3240,19 +3242,73 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6373a33d987866ccfe1af4bc11b089dce941764313f9fd8b7cf13fcb51b72dc5" dependencies = [ - "jsonrpsee-proc-macros", - "jsonrpsee-types", + "jsonrpsee-types 0.4.1", "jsonrpsee-utils", - "jsonrpsee-ws-client", + "jsonrpsee-ws-client 0.4.1", +] + +[[package]] +name = "jsonrpsee" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05fd8cd6c6b1bbd06881d2cf88f1fc83cc36c98f2219090f839115fb4a956cb9" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-proc-macros", + "jsonrpsee-types 0.8.0", + "jsonrpsee-ws-client 0.8.0", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3303cdf246e6ab76e2866fb3d9acb6c76a068b1b28bd923a1b7a8122257ad7b5" +dependencies = [ + "futures 0.3.16", + "http", + "jsonrpsee-core", + "jsonrpsee-types 0.8.0", + "pin-project 1.0.10", + "rustls-native-certs 0.6.1", + "soketto 0.7.1", + "thiserror", + "tokio", + "tokio-rustls 0.23.2", + "tokio-util", + "tracing", + "webpki-roots 0.22.2", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f220b5a238dc7992b90f1144fbf6eaa585872c9376afe6fe6863ffead6191bf3" +dependencies = [ + "anyhow", + "arrayvec 0.7.1", + "async-trait", + "beef", + "futures-channel", + "futures-util", + "hyper 0.14.16", + "jsonrpsee-types 0.8.0", + "rustc-hash", + "serde", + "serde_json", + "soketto 0.7.1", + "thiserror", + "tokio", + "tracing", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.4.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d802063f7a3c867456955f9d2f15eb3ee0edb5ec9ec2b5526324756759221c0f" +checksum = "4299ebf790ea9de1cb72e73ff2ae44c723ef264299e5e2d5ef46a371eb3ac3d8" dependencies = [ - "log 0.4.14", "proc-macro-crate 1.1.0", "proc-macro2", "quote", @@ -3274,10 +3330,24 @@ dependencies = [ "log 0.4.14", "serde", "serde_json", - "soketto 0.7.0", + "soketto 0.7.1", "thiserror", ] +[[package]] +name = "jsonrpsee-types" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b3f601bbbe45cd63f5407b6f7d7950e08a7d4f82aa699ff41a4a5e9e54df58" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "jsonrpsee-utils" version = "0.4.1" @@ -3286,7 +3356,7 @@ checksum = "0109c4f972058f3b1925b73a17210aff7b63b65967264d0045d15ee88fe84f0c" dependencies = [ "arrayvec 0.7.1", "beef", - "jsonrpsee-types", + "jsonrpsee-types 0.4.1", ] [[package]] @@ -3300,19 +3370,30 @@ dependencies = [ "fnv", "futures 0.3.16", "http", - "jsonrpsee-types", + "jsonrpsee-types 0.4.1", "log 0.4.14", "pin-project 1.0.10", - "rustls-native-certs", + "rustls-native-certs 0.5.0", "serde", "serde_json", - "soketto 0.7.0", + "soketto 0.7.1", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.22.0", "tokio-util", ] +[[package]] +name = "jsonrpsee-ws-client" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff425cee7c779e33920913bc695447416078ee6d119f443f3060feffa4e86b5" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types 0.8.0", +] + [[package]] name = "keccak" version = "0.1.0" @@ -3920,9 +4001,9 @@ dependencies = [ "log 0.4.14", "quicksink", "rw-stream-sink", - "soketto 0.7.0", + "soketto 0.7.1", "url 2.2.1", - "webpki-roots", + "webpki-roots 0.21.0", ] [[package]] @@ -4602,7 +4683,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.16", "hex-literal", - "jsonrpsee-ws-client", + "jsonrpsee-ws-client 0.4.1", "log 0.4.14", "nix", "node-executor", @@ -4858,7 +4939,7 @@ dependencies = [ [[package]] name = "node-template" -version = "3.0.0" +version = "4.0.0-dev" dependencies = [ "clap 3.0.7", "frame-benchmarking", @@ -4895,7 +4976,7 @@ dependencies = [ [[package]] name = "node-template-runtime" -version = "3.0.0" +version = "4.0.0-dev" dependencies = [ "frame-benchmarking", "frame-executive", @@ -5539,7 +5620,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" -version = "4.0.0-dev" +version = "5.0.0" dependencies = [ "bitflags", "parity-scale-codec", @@ -5632,7 +5713,6 @@ dependencies = [ "sp-tracing", "static_assertions", "strum", - "strum_macros 0.23.1", ] [[package]] @@ -6200,7 +6280,7 @@ dependencies = [ [[package]] name = "pallet-template" -version = "3.0.0" +version = "4.0.0-dev" dependencies = [ "frame-benchmarking", "frame-support", @@ -7427,7 +7507,7 @@ version = "0.10.0-dev" dependencies = [ "env_logger 0.9.0", "frame-support", - "jsonrpsee", + "jsonrpsee 0.8.0", "log 0.4.14", "pallet-elections-phragmen", "parity-scale-codec", @@ -7559,8 +7639,20 @@ dependencies = [ "base64 0.13.0", "log 0.4.14", "ring", - "sct", - "webpki", + "sct 0.6.0", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +dependencies = [ + "log 0.4.14", + "ring", + "sct 0.7.0", + "webpki 0.22.0", ] [[package]] @@ -7570,11 +7662,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" dependencies = [ "openssl-probe", - "rustls", + "rustls 0.19.1", "schannel", "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca9ebdfa27d3fc180e42879037b5338ab1c040c06affd00d8338598e7800943" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64 0.13.0", +] + [[package]] name = "rustversion" version = "1.0.6" @@ -8855,6 +8968,16 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -9202,9 +9325,9 @@ dependencies = [ [[package]] name = "soketto" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083624472e8817d44d02c0e55df043737ff11f279af924abdf93845717c2b75c" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.0", "bytes 1.1.0", @@ -9267,7 +9390,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "4.0.0" +version = "5.0.0" dependencies = [ "parity-scale-codec", "scale-info", @@ -9460,7 +9583,7 @@ dependencies = [ [[package]] name = "sp-core" -version = "4.1.0-dev" +version = "5.0.0" dependencies = [ "base58", "bitflags", @@ -9551,7 +9674,7 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.10.0" +version = "0.11.0" dependencies = [ "environmental", "parity-scale-codec", @@ -9592,7 +9715,7 @@ dependencies = [ [[package]] name = "sp-io" -version = "4.0.0" +version = "5.0.0" dependencies = [ "futures 0.3.16", "hash-db", @@ -9625,7 +9748,7 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.10.0" +version = "0.11.0" dependencies = [ "async-trait", "futures 0.3.16", @@ -9712,7 +9835,7 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "4.0.0-dev" +version = "5.0.0" dependencies = [ "rustc-hash", "serde", @@ -9722,7 +9845,7 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "4.1.0-dev" +version = "5.0.0" dependencies = [ "either", "hash256-std-hasher", @@ -9749,7 +9872,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "4.1.0-dev" +version = "5.0.0" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9866,7 +9989,7 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.10.0" +version = "0.11.0" dependencies = [ "hash-db", "hex-literal", @@ -9895,7 +10018,7 @@ version = "4.0.0" [[package]] name = "sp-storage" -version = "4.0.0" +version = "5.0.0" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9981,7 +10104,7 @@ dependencies = [ [[package]] name = "sp-trie" -version = "4.0.0" +version = "5.0.0" dependencies = [ "criterion", "hash-db", @@ -10027,7 +10150,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "4.1.0-dev" +version = "5.0.0" dependencies = [ "impl-trait-for-tuples", "log 0.4.14", @@ -10090,23 +10213,11 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" -dependencies = [ - "strum_macros 0.22.0", -] - -[[package]] -name = "strum_macros" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" dependencies = [ - "heck 0.3.2", - "proc-macro2", - "quote", - "syn", + "strum_macros", ] [[package]] @@ -10357,6 +10468,7 @@ dependencies = [ "build-helper", "cargo_metadata", "sp-maybe-compressed-blob", + "strum", "tempfile", "toml", "walkdir", @@ -10647,9 +10759,20 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ - "rustls", + "rustls 0.19.1", + "tokio", + "webpki 0.21.4", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" +dependencies = [ + "rustls 0.20.2", "tokio", - "webpki", + "webpki 0.22.0", ] [[package]] @@ -10941,7 +11064,7 @@ name = "try-runtime-cli" version = "0.10.0-dev" dependencies = [ "clap 3.0.7", - "jsonrpsee", + "jsonrpsee 0.4.1", "log 0.4.14", "parity-scale-codec", "remote-externalities", @@ -11311,9 +11434,9 @@ dependencies = [ [[package]] name = "wasm-instrument" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67369bb53d409b67e57ef31797b1b2d628955fc82f86f2ea78bb403acc7c73" +checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" dependencies = [ "parity-wasm 0.42.2", ] @@ -11755,13 +11878,32 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki-roots" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" dependencies = [ - "webpki", + "webpki 0.21.4", +] + +[[package]] +name = "webpki-roots" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +dependencies = [ + "webpki 0.22.0", ] [[package]] diff --git a/bin/node-template/README.md b/bin/node-template/README.md index bb4df52f41a8f..a04f6a12ed73a 100644 --- a/bin/node-template/README.md +++ b/bin/node-template/README.md @@ -72,20 +72,20 @@ Start the development chain with detailed logging: ```bash RUST_BACKTRACE=1 ./target/release/node-template -ldebug --dev ``` + > Development chain means that the state of our chain will be in a tmp folder while the nodes are -> running. Also, **alice** account will be authority and sudo account as declared in the [genesis -> state](https://github.com/substrate-developer-hub/substrate-node-template/blob/main/node/src/chain_spec.rs#L49). -> At the same time the following accounts will be prefunded: +> running. Also, **alice** account will be authority and sudo account as declared in the +> [genesis state](https://github.com/substrate-developer-hub/substrate-node-template/blob/main/node/src/chain_spec.rs#L49). +> At the same time the following accounts will be pre-funded: > - Alice > - Bob > - Alice//stash > - Bob//stash -In case of being interested in maintaining the chain' state futher in time a base path other than -a temporary directory must be added so the db can be stored in the provided folder. We could use -this folder to store different chain databases, as a different folder will be created per different - chain that is ran. The following commands shows how to use a newly created folder as our db base - path. +In case of being interested in maintaining the chain' state between runs a base path must be added +so the db can be stored in the provided folder instead of a temporal one. We could use this folder +to store different chain databases, as a different folder will be created per different chain that +is ran. The following commands shows how to use a newly created folder as our db base path. ```bash // Create a folder to use as the db base path @@ -103,6 +103,7 @@ $ ls ./my-chain-state/chains/dev db keystore network ``` + ### Connect with Polkadot-JS Apps Front-end Once the node template is running locally, you can connect it with **Polkadot-JS Apps** front-end diff --git a/bin/node-template/docs/rust-setup.md b/bin/node-template/docs/rust-setup.md index 4b96da1146b8e..ea133ca847af7 100644 --- a/bin/node-template/docs/rust-setup.md +++ b/bin/node-template/docs/rust-setup.md @@ -2,32 +2,21 @@ title: Installation --- -This page will guide you through the steps needed to prepare a computer for development with the -Substrate Node Template. Since Substrate is built with -[the Rust programming language](https://www.rust-lang.org/), the first thing you will need to do is -prepare the computer for Rust development - these steps will vary based on the computer's operating -system. Once Rust is configured, you will use its toolchains to interact with Rust projects; the -commands for Rust's toolchains will be the same for all supported, Unix-based operating systems. +This guide is for reference only, please check the latest information on getting starting with Substrate +[here](https://docs.substrate.io/v3/getting-started/installation/). -## Unix-Based Operating Systems +This page will guide you through the **2 steps** needed to prepare a computer for **Substrate** development. +Since Substrate is built with [the Rust programming language](https://www.rust-lang.org/), the first +thing you will need to do is prepare the computer for Rust development - these steps will vary based +on the computer's operating system. Once Rust is configured, you will use its toolchains to interact +with Rust projects; the commands for Rust's toolchains will be the same for all supported, +Unix-based operating systems. -Substrate development is easiest on Unix-based operating systems like macOS or Linux. The examples -in the Substrate [Tutorials](https://docs.substrate.io/tutorials/v3) and -[How-to Guides](https://docs.substrate.io/how-to-guides/v3) use Unix-style terminals to demonstrate -how to interact with Substrate from the command line. - -### macOS +## Build dependencies -Open the Terminal application and execute the following commands: - -```bash -# Install Homebrew if necessary https://brew.sh/ -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - -# Make sure Homebrew is up-to-date, install openssl and cmake -brew update -brew install openssl cmake -``` +Substrate development is easiest on Unix-based operating systems like macOS or Linux. The examples +in the [Substrate Docs](https://docs.substrate.io) use Unix-style terminals to demonstrate how to +interact with Substrate from the command line. ### Ubuntu/Debian @@ -36,7 +25,7 @@ Use a terminal shell to execute the following commands: ```bash sudo apt update # May prompt for location information -sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl +sudo apt install -y git clang curl libssl-dev llvm libudev-dev ``` ### Arch Linux @@ -44,39 +33,193 @@ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libcla Run these commands from a terminal: ```bash -pacman -Syu --needed --noconfirm cmake gcc openssl-1.0 pkgconf git clang -export OPENSSL_LIB_DIR="/usr/lib/openssl-1.0" -export OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0" +pacman -Syu --needed --noconfirm curl git clang ``` -### Fedora/RHEL/CentOS +### Fedora -Use a terminal to run the following commands: +Run these commands from a terminal: ```bash -# Update sudo dnf update -# Install packages -sudo dnf install cmake pkgconfig rocksdb rocksdb-devel llvm git libcurl libcurl-devel curl-devel clang +sudo dnf install clang curl git openssl-devel +``` + +### OpenSUSE + +Run these commands from a terminal: + +```bash +sudo zypper install clang curl git openssl-devel llvm-devel libudev-devel +``` + +### macOS + +> **Apple M1 ARM** +> If you have an Apple M1 ARM system on a chip, make sure that you have Apple Rosetta 2 +> installed through `softwareupdate --install-rosetta`. This is only needed to run the +> `protoc` tool during the build. The build itself and the target binaries would remain native. + +Open the Terminal application and execute the following commands: + +```bash +# Install Homebrew if necessary https://brew.sh/ +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + +# Make sure Homebrew is up-to-date, install openssl +brew update +brew install openssl ``` -## Rust Developer Environment +### Windows + +**_PLEASE NOTE:_** Native development of Substrate is _not_ very well supported! It is _highly_ +recommend to use [Windows Subsystem Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) +(WSL) and follow the instructions for [Ubuntu/Debian](#ubuntudebian). +Please refer to the separate +[guide for native Windows development](https://docs.substrate.io/v3/getting-started/windows-users/). -This project uses [`rustup`](https://rustup.rs/) to help manage the Rust toolchain. First install -and configure `rustup`: +## Rust developer environment + +This guide uses installer and the `rustup` tool to manage the Rust toolchain. +First install and configure `rustup`: ```bash # Install -curl https://sh.rustup.rs -sSf | sh +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Configure source ~/.cargo/env ``` -Finally, configure the Rust toolchain: +Configure the Rust toolchain to default to the latest stable version, add nightly and the nightly wasm target: ```bash rustup default stable +rustup update +rustup update nightly +rustup target add wasm32-unknown-unknown --toolchain nightly +``` + +## Test your set-up + +Now the best way to ensure that you have successfully prepared a computer for Substrate +development is to follow the steps in [our first Substrate tutorial](https://docs.substrate.io/tutorials/v3/create-your-first-substrate-chain/). + +## Troubleshooting Substrate builds + +Sometimes you can't get the Substrate node template +to compile out of the box. Here are some tips to help you work through that. + +### Rust configuration check + +To see what Rust toolchain you are presently using, run: + +```bash +rustup show +``` + +This will show something like this (Ubuntu example) output: + +```text +Default host: x86_64-unknown-linux-gnu +rustup home: /home/user/.rustup + +installed toolchains +-------------------- + +stable-x86_64-unknown-linux-gnu (default) +nightly-2020-10-06-x86_64-unknown-linux-gnu +nightly-x86_64-unknown-linux-gnu + +installed targets for active toolchain +-------------------------------------- + +wasm32-unknown-unknown +x86_64-unknown-linux-gnu + +active toolchain +---------------- + +stable-x86_64-unknown-linux-gnu (default) +rustc 1.50.0 (cb75ad5db 2021-02-10) +``` + +As you can see above, the default toolchain is stable, and the +`nightly-x86_64-unknown-linux-gnu` toolchain as well as its `wasm32-unknown-unknown` target is installed. +You also see that `nightly-2020-10-06-x86_64-unknown-linux-gnu` is installed, but is not used unless explicitly defined as illustrated in the [specify your nightly version](#specifying-nightly-version) +section. + +### WebAssembly compilation + +Substrate uses [WebAssembly](https://webassembly.org) (Wasm) to produce portable blockchain +runtimes. You will need to configure your Rust compiler to use +[`nightly` builds](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) to allow you to +compile Substrate runtime code to the Wasm target. + +> There are upstream issues in Rust that need to be resolved before all of Substrate can use the stable Rust toolchain. +> [This is our tracking issue](https://github.com/paritytech/substrate/issues/1252) if you're curious as to why and how this will be resolved. + +#### Latest nightly for Substrate `master` + +Developers who are building Substrate _itself_ should always use the latest bug-free versions of +Rust stable and nightly. This is because the Substrate codebase follows the tip of Rust nightly, +which means that changes in Substrate often depend on upstream changes in the Rust nightly compiler. +To ensure your Rust compiler is always up to date, you should run: + +```bash +rustup update rustup update nightly -rustup update stable rustup target add wasm32-unknown-unknown --toolchain nightly ``` + +> NOTE: It may be necessary to occasionally rerun `rustup update` if a change in the upstream Substrate +> codebase depends on a new feature of the Rust compiler. When you do this, both your nightly +> and stable toolchains will be pulled to the most recent release, and for nightly, it is +> generally _not_ expected to compile WASM without error (although it very often does). +> Be sure to [specify your nightly version](#specifying-nightly-version) if you get WASM build errors +> from `rustup` and [downgrade nightly as needed](#downgrading-rust-nightly). + +#### Rust nightly toolchain + +If you want to guarantee that your build works on your computer as you update Rust and other +dependencies, you should use a specific Rust nightly version that is known to be +compatible with the version of Substrate they are using; this version will vary from project to +project and different projects may use different mechanisms to communicate this version to +developers. For instance, the Polkadot client specifies this information in its +[release notes](https://github.com/paritytech/polkadot/releases). + +```bash +# Specify the specific nightly toolchain in the date below: +rustup install nightly- +``` + +#### Wasm toolchain + +Now, configure the nightly version to work with the Wasm compilation target: + +```bash +rustup target add wasm32-unknown-unknown --toolchain nightly- +``` + +### Specifying nightly version + +Use the `WASM_BUILD_TOOLCHAIN` environment variable to specify the Rust nightly version a Substrate +project should use for Wasm compilation: + +```bash +WASM_BUILD_TOOLCHAIN=nightly- cargo build --release +``` + +> Note that this only builds _the runtime_ with the specified nightly. The rest of project will be +> compiled with **your default toolchain**, i.e. the latest installed stable toolchain. + +### Downgrading Rust nightly + +If your computer is configured to use the latest Rust nightly and you would like to downgrade to a +specific nightly version, follow these steps: + +```bash +rustup uninstall nightly +rustup install nightly- +rustup target add wasm32-unknown-unknown --toolchain nightly- +``` diff --git a/bin/node-template/node/Cargo.toml b/bin/node-template/node/Cargo.toml index 6b69d691d9450..1f8ff0ae1e0d4 100644 --- a/bin/node-template/node/Cargo.toml +++ b/bin/node-template/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "node-template" -version = "3.0.0" +version = "4.0.0-dev" description = "A fresh FRAME-based Substrate node, ready for hacking." authors = ["Substrate DevHub "] homepage = "https://substrate.io/" @@ -20,7 +20,7 @@ name = "node-template" clap = { version = "3.0", features = ["derive"] } sc-cli = { version = "0.10.0-dev", path = "../../../client/cli", features = ["wasmtime"] } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-executor = { version = "0.10.0-dev", path = "../../../client/executor", features = ["wasmtime"] } sc-service = { version = "0.10.0-dev", path = "../../../client/service", features = ["wasmtime"] } sc-telemetry = { version = "4.0.0-dev", path = "../../../client/telemetry" } @@ -34,7 +34,7 @@ sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/commo sc-finality-grandpa = { version = "0.10.0-dev", path = "../../../client/finality-grandpa" } sp-finality-grandpa = { version = "4.0.0-dev", path = "../../../primitives/finality-grandpa" } sc-client-api = { version = "4.0.0-dev", path = "../../../client/api" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" } # These dependencies are used for the node template's RPCs @@ -52,7 +52,8 @@ pallet-transaction-payment-rpc = { version = "4.0.0-dev", path = "../../../frame frame-benchmarking = { version = "4.0.0-dev", path = "../../../frame/benchmarking" } frame-benchmarking-cli = { version = "4.0.0-dev", path = "../../../utils/frame/benchmarking-cli" } -node-template-runtime = { version = "3.0.0", path = "../runtime" } +# Local Dependencies +node-template-runtime = { version = "4.0.0-dev", path = "../runtime" } [build-dependencies] substrate-build-script-utils = { version = "3.0.0", path = "../../../utils/build-script-utils" } diff --git a/bin/node-template/pallets/template/Cargo.toml b/bin/node-template/pallets/template/Cargo.toml index 9702501a3e0ea..0a9d0eb27a2ca 100644 --- a/bin/node-template/pallets/template/Cargo.toml +++ b/bin/node-template/pallets/template/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-template" -version = "3.0.0" +version = "4.0.0-dev" description = "FRAME pallet template for defining custom runtime logic." authors = ["Substrate DevHub "] homepage = "https://substrate.io/" @@ -22,9 +22,9 @@ frame-system = { default-features = false, version = "4.0.0-dev", path = "../../ frame-benchmarking = { default-features = false, version = "4.0.0-dev", path = "../../../../frame/benchmarking", optional = true } [dev-dependencies] -sp-core = { default-features = false, version = "4.1.0-dev", path = "../../../../primitives/core" } -sp-io = { default-features = false, version = "4.0.0-dev", path = "../../../../primitives/io" } -sp-runtime = { default-features = false, version = "4.1.0-dev", path = "../../../../primitives/runtime" } +sp-core = { default-features = false, version = "5.0.0", path = "../../../../primitives/core" } +sp-io = { default-features = false, version = "5.0.0", path = "../../../../primitives/io" } +sp-runtime = { default-features = false, version = "5.0.0", path = "../../../../primitives/runtime" } [features] default = ["std"] diff --git a/bin/node-template/runtime/Cargo.toml b/bin/node-template/runtime/Cargo.toml index b757029f2581d..98da28c4476d9 100644 --- a/bin/node-template/runtime/Cargo.toml +++ b/bin/node-template/runtime/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "node-template-runtime" -version = "3.0.0" -description = "A fresh FRAME-based Substrate runtime, ready for hacking." +version = "4.0.0-dev" +description = "A fresh FRAME-based Substrate node, ready for hacking." authors = ["Substrate DevHub "] homepage = "https://substrate.io/" edition = "2021" @@ -27,12 +27,12 @@ pallet-timestamp = { version = "4.0.0-dev", default-features = false, path = ".. pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = "../../../frame/transaction-payment" } frame-executive = { version = "4.0.0-dev", default-features = false, path = "../../../frame/executive" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/api" } -sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "4.0.0-dev"} +sp-block-builder = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/block-builder"} sp-consensus-aura = { version = "0.10.0-dev", default-features = false, path = "../../../primitives/consensus/aura" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-inherents = { path = "../../../primitives/inherents", default-features = false, version = "4.0.0-dev"} +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/inherents"} sp-offchain = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/offchain" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/session" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } sp-transaction-pool = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/transaction-pool" } @@ -47,7 +47,8 @@ frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = " frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../../frame/system/benchmarking", optional = true } hex-literal = { version = "0.3.4", optional = true } -pallet-template = { version = "3.0.0", default-features = false, path = "../pallets/template" } +# Local Dependencies +pallet-template = { version = "4.0.0-dev", default-features = false, path = "../pallets/template" } [build-dependencies] substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder" } diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index 2aa6bf1f1ae71..0b39d76fe495e 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -299,6 +299,7 @@ pub type Header = generic::Header; pub type Block = generic::Block; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( + frame_system::CheckNonZeroSender, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, frame_system::CheckGenesis, diff --git a/bin/node/bench/Cargo.toml b/bin/node/bench/Cargo.toml index 6c28f14793a92..9939f188d5d82 100644 --- a/bin/node/bench/Cargo.toml +++ b/bin/node/bench/Cargo.toml @@ -15,15 +15,15 @@ node-primitives = { version = "2.0.0", path = "../primitives" } node-testing = { version = "3.0.0-dev", path = "../testing" } node-runtime = { version = "3.0.0-dev", path = "../runtime" } sc-client-api = { version = "4.0.0-dev", path = "../../../client/api/" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../../primitives/state-machine" } serde = "1.0.132" serde_json = "1.0.74" derive_more = "0.99.16" kvdb = "0.10.0" kvdb-rocksdb = "0.14.0" -sp-trie = { version = "4.0.0", path = "../../../primitives/trie" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-trie = { version = "5.0.0", path = "../../../primitives/trie" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" } sc-basic-authorship = { version = "0.10.0-dev", path = "../../../client/basic-authorship" } sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" } diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index 2eb1618a7c986..db198592b37bc 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -47,13 +47,13 @@ sp-authority-discovery = { version = "4.0.0-dev", path = "../../../primitives/au sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" } grandpa-primitives = { version = "4.0.0-dev", package = "sp-finality-grandpa", path = "../../../primitives/finality-grandpa" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" } sp-authorship = { version = "4.0.0-dev", path = "../../../primitives/authorship" } sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" } sp-keyring = { version = "4.1.0-dev", path = "../../../primitives/keyring" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" } sp-transaction-pool = { version = "4.0.0-dev", path = "../../../primitives/transaction-pool" } sp-transaction-storage-proof = { version = "4.0.0-dev", path = "../../../primitives/transaction-storage-proof" } @@ -102,7 +102,7 @@ sc-cli = { version = "0.10.0-dev", optional = true, path = "../../../client/cli" sc-service = { version = "0.10.0-dev", default-features = false, path = "../../../client/service", features = [ "wasmtime", ] } -sp-trie = { version = "4.0.0", default-features = false, path = "../../../primitives/trie", features = [ +sp-trie = { version = "5.0.0", default-features = false, path = "../../../primitives/trie", features = [ "memory-tracker", ] } diff --git a/bin/node/cli/src/chain_spec.rs b/bin/node/cli/src/chain_spec.rs index 6fd57e31e466e..11516f964903a 100644 --- a/bin/node/cli/src/chain_spec.rs +++ b/bin/node/cli/src/chain_spec.rs @@ -362,7 +362,6 @@ pub fn testnet_genesis( assets: Default::default(), gilt: Default::default(), transaction_storage: Default::default(), - scheduler: Default::default(), transaction_payment: Default::default(), } } diff --git a/bin/node/executor/Cargo.toml b/bin/node/executor/Cargo.toml index e23152e00e5e8..39cf1ee8d8934 100644 --- a/bin/node/executor/Cargo.toml +++ b/bin/node/executor/Cargo.toml @@ -17,11 +17,11 @@ scale-info = { version = "1.0", features = ["derive"] } node-primitives = { version = "2.0.0", path = "../primitives" } node-runtime = { version = "3.0.0-dev", path = "../runtime" } sc-executor = { version = "0.10.0-dev", path = "../../../client/executor" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } -sp-state-machine = { version = "0.10.0", path = "../../../primitives/state-machine" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } +sp-state-machine = { version = "0.11.0", path = "../../../primitives/state-machine" } sp-tracing = { version = "4.0.0", path = "../../../primitives/tracing" } -sp-trie = { version = "4.0.0", path = "../../../primitives/trie" } +sp-trie = { version = "5.0.0", path = "../../../primitives/trie" } frame-benchmarking = { version = "4.0.0-dev", path = "../../../frame/benchmarking" } [dev-dependencies] @@ -34,10 +34,10 @@ pallet-contracts = { version = "4.0.0-dev", path = "../../../frame/contracts" } pallet-im-online = { version = "4.0.0-dev", path = "../../../frame/im-online" } pallet-timestamp = { version = "4.0.0-dev", path = "../../../frame/timestamp" } pallet-treasury = { version = "4.0.0-dev", path = "../../../frame/treasury" } -sp-application-crypto = { version = "4.0.0", path = "../../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", path = "../../../primitives/application-crypto" } sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-externalities = { version = "0.10.0", path = "../../../primitives/externalities" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-externalities = { version = "0.11.0", path = "../../../primitives/externalities" } sp-keyring = { version = "4.1.0-dev", path = "../../../primitives/keyring" } wat = "1.0" futures = "0.3.9" diff --git a/bin/node/inspect/Cargo.toml b/bin/node/inspect/Cargo.toml index bb9af8c66988e..e5b4c41c91b71 100644 --- a/bin/node/inspect/Cargo.toml +++ b/bin/node/inspect/Cargo.toml @@ -19,5 +19,5 @@ sc-client-api = { version = "4.0.0-dev", path = "../../../client/api" } sc-executor = { version = "0.10.0-dev", path = "../../../client/executor" } sc-service = { version = "0.10.0-dev", default-features = false, path = "../../../client/service" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } diff --git a/bin/node/primitives/Cargo.toml b/bin/node/primitives/Cargo.toml index e00f46720c947..5664318513a09 100644 --- a/bin/node/primitives/Cargo.toml +++ b/bin/node/primitives/Cargo.toml @@ -16,9 +16,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../frame/system" } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../../primitives/application-crypto" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../../primitives/application-crypto" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } [features] default = ["std"] diff --git a/bin/node/rpc/Cargo.toml b/bin/node/rpc/Cargo.toml index 36d313ebc30ae..c6ba0c9f992d8 100644 --- a/bin/node/rpc/Cargo.toml +++ b/bin/node/rpc/Cargo.toml @@ -29,9 +29,9 @@ sc-sync-state-rpc = { version = "0.10.0-dev", path = "../../../client/sync-state sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } sp-block-builder = { version = "4.0.0-dev", path = "../../../primitives/block-builder" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" } sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../client/transaction-pool/api" } substrate-frame-rpc-system = { version = "4.0.0-dev", path = "../../../utils/frame/rpc/system" } diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml index ef1b73aed854b..84eec7662361f 100644 --- a/bin/node/runtime/Cargo.toml +++ b/bin/node/runtime/Cargo.toml @@ -30,17 +30,17 @@ sp-block-builder = { path = "../../../primitives/block-builder", default-feature sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/inherents" } node-primitives = { version = "2.0.0", default-features = false, path = "../primitives" } sp-offchain = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/offchain" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/staking" } sp-keyring = { version = "4.1.0-dev", optional = true, path = "../../../primitives/keyring" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/session" } sp-transaction-pool = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/transaction-pool" } sp-version = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/version" } sp-npos-elections = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/npos-elections" } -sp-io = { version = "4.0.0", default-features = false, path = "../../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../../primitives/io" } sp-sandbox = { version = "0.10.0-dev", default-features = false, path = "../../../primitives/sandbox" } # frame dependencies @@ -62,7 +62,7 @@ pallet-bounties = { version = "4.0.0-dev", default-features = false, path = "../ pallet-child-bounties = { version = "4.0.0-dev", default-features = false, path = "../../../frame/child-bounties" } pallet-collective = { version = "4.0.0-dev", default-features = false, path = "../../../frame/collective" } pallet-contracts = { version = "4.0.0-dev", default-features = false, path = "../../../frame/contracts" } -pallet-contracts-primitives = { version = "4.0.0-dev", default-features = false, path = "../../../frame/contracts/common/" } +pallet-contracts-primitives = { version = "5.0.0", default-features = false, path = "../../../frame/contracts/common/" } pallet-contracts-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" } pallet-democracy = { version = "4.0.0-dev", default-features = false, path = "../../../frame/democracy" } pallet-election-provider-multi-phase = { version = "4.0.0-dev", default-features = false, path = "../../../frame/election-provider-multi-phase" } diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index 4fb89f872fa6b..3a5c0aade8eaf 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -23,6 +23,7 @@ #![recursion_limit = "256"] use codec::{Decode, Encode, MaxEncodedLen}; +use frame_election_provider_support::onchain; use frame_support::{ construct_runtime, parameter_types, traits::{ @@ -528,12 +529,6 @@ parameter_types! { pub OffchainRepeat: BlockNumber = 5; } -use frame_election_provider_support::onchain; -impl onchain::Config for Runtime { - type Accuracy = Perbill; - type DataProvider = Staking; -} - pub struct StakingBenchmarkingConfig; impl pallet_staking::BenchmarkingConfig for StakingBenchmarkingConfig { type MaxNominators = ConstU32<1000>; @@ -649,6 +644,11 @@ impl frame_support::pallet_prelude::Get::DataProvider; +} + impl pallet_election_provider_multi_phase::Config for Runtime { type Event = Event; type Currency = Balances; @@ -671,6 +671,8 @@ impl pallet_election_provider_multi_phase::Config for Runtime { type DataProvider = Staking; type Solution = NposSolution16; type Fallback = pallet_election_provider_multi_phase::NoFallback; + type GovernanceFallback = + frame_election_provider_support::onchain::OnChainSequentialPhragmen; type Solver = frame_election_provider_support::SequentialPhragmen< AccountId, pallet_election_provider_multi_phase::SolutionAccuracyOf, diff --git a/bin/node/testing/Cargo.toml b/bin/node/testing/Cargo.toml index 29efc0028c159..55ae52b50d9d1 100644 --- a/bin/node/testing/Cargo.toml +++ b/bin/node/testing/Cargo.toml @@ -28,9 +28,9 @@ sp-keyring = { version = "4.1.0-dev", path = "../../../primitives/keyring" } node-executor = { version = "3.0.0-dev", path = "../executor" } node-primitives = { version = "2.0.0", path = "../primitives" } node-runtime = { version = "3.0.0-dev", path = "../runtime" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sc-executor = { version = "0.10.0-dev", path = "../../../client/executor", features = [ "wasmtime", ] } diff --git a/bin/node/testing/src/genesis.rs b/bin/node/testing/src/genesis.rs index 2e2f3f9a5a80a..8d2b53b0b7210 100644 --- a/bin/node/testing/src/genesis.rs +++ b/bin/node/testing/src/genesis.rs @@ -91,7 +91,6 @@ pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec) -> Gen assets: Default::default(), gilt: Default::default(), transaction_storage: Default::default(), - scheduler: Default::default(), transaction_payment: Default::default(), } } diff --git a/bin/utils/chain-spec-builder/Cargo.toml b/bin/utils/chain-spec-builder/Cargo.toml index 452221ff6e13e..f6af82ba42eb0 100644 --- a/bin/utils/chain-spec-builder/Cargo.toml +++ b/bin/utils/chain-spec-builder/Cargo.toml @@ -21,5 +21,5 @@ rand = "0.8" sc-keystore = { version = "4.0.0-dev", path = "../../../client/keystore" } sc-chain-spec = { version = "4.0.0-dev", path = "../../../client/chain-spec" } node-cli = { version = "3.0.0-dev", path = "../../node/cli" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } diff --git a/client/allocator/Cargo.toml b/client/allocator/Cargo.toml index eb8d298e1ec25..6f20449b38bc7 100644 --- a/client/allocator/Cargo.toml +++ b/client/allocator/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-wasm-interface = { version = "4.1.0-dev", path = "../../primitives/wasm-interface" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-wasm-interface = { version = "5.0.0", path = "../../primitives/wasm-interface" } log = "0.4.11" thiserror = "1.0.30" diff --git a/client/api/Cargo.toml b/client/api/Cargo.toml index c18b920cace81..ab6ad96e286f9 100644 --- a/client/api/Cargo.toml +++ b/client/api/Cargo.toml @@ -19,7 +19,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } sc-executor = { version = "0.10.0-dev", path = "../executor" } -sp-externalities = { version = "0.10.0", path = "../../primitives/externalities" } +sp-externalities = { version = "0.11.0", path = "../../primitives/externalities" } fnv = "1.0.6" futures = "0.3.1" hash-db = { version = "0.15.2", default-features = false } @@ -27,14 +27,14 @@ sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } log = "0.4.8" parking_lot = "0.11.2" sp-database = { version = "4.0.0-dev", path = "../../primitives/database" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", default-features = false, path = "../../primitives/keystore" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", default-features = false, path = "../../primitives/keystore" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } sc-utils = { version = "4.0.0-dev", path = "../utils" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../primitives/state-machine" } -sp-trie = { version = "4.0.0", path = "../../primitives/trie" } -sp-storage = { version = "4.0.0", path = "../../primitives/storage" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../primitives/state-machine" } +sp-trie = { version = "5.0.0", path = "../../primitives/trie" } +sp-storage = { version = "5.0.0", path = "../../primitives/storage" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "../transaction-pool/api" } prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" } diff --git a/client/api/src/backend.rs b/client/api/src/backend.rs index 004c0574fcbe8..bb2579e4a420e 100644 --- a/client/api/src/backend.rs +++ b/client/api/src/backend.rs @@ -70,14 +70,26 @@ pub struct ImportSummary { pub tree_route: Option>, } -/// Import operation wrapper +/// Finalization operation summary. +/// +/// Contains information about the block that just got finalized, +/// including tree heads that became stale at the moment of finalization. +pub struct FinalizeSummary { + /// Blocks that were finalized. + /// The last entry is the one that has been explicitly finalized. + pub finalized: Vec, + /// Heads that became stale during this finalization operation. + pub stale_heads: Vec, +} + +/// Import operation wrapper. pub struct ClientImportOperation> { /// DB Operation. pub op: B::BlockImportOperation, /// Summary of imported block. pub notify_imported: Option>, - /// A list of hashes of blocks that got finalized. - pub notify_finalized: Vec, + /// Summary of finalized block. + pub notify_finalized: Option>, } /// Helper function to apply auxiliary data insertion into an operation. diff --git a/client/api/src/client.rs b/client/api/src/client.rs index b6a5fbfad47a5..9bb212099565b 100644 --- a/client/api/src/client.rs +++ b/client/api/src/client.rs @@ -273,10 +273,14 @@ pub struct BlockImportNotification { /// Summary of a finalized block. #[derive(Clone, Debug)] pub struct FinalityNotification { - /// Imported block header hash. + /// Finalized block header hash. pub hash: Block::Hash, - /// Imported block header. + /// Finalized block header. pub header: Block::Header, + /// Path from the old finalized to new finalized parent (implicitly finalized blocks). + pub tree_route: Arc>, + /// Stale branches heads. + pub stale_heads: Arc>, } impl TryFrom> for ChainEvent { @@ -293,6 +297,6 @@ impl TryFrom> for ChainEvent { impl From> for ChainEvent { fn from(n: FinalityNotification) -> Self { - Self::Finalized { hash: n.hash } + Self::Finalized { hash: n.hash, tree_route: n.tree_route } } } diff --git a/client/authority-discovery/Cargo.toml b/client/authority-discovery/Cargo.toml index ec43112a71450..e3a3ef2a3591b 100644 --- a/client/authority-discovery/Cargo.toml +++ b/client/authority-discovery/Cargo.toml @@ -32,9 +32,9 @@ sc-client-api = { version = "4.0.0-dev", path = "../api" } sc-network = { version = "0.10.0-dev", path = "../network" } sp-authority-discovery = { version = "4.0.0-dev", path = "../../primitives/authority-discovery" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } [dev-dependencies] diff --git a/client/basic-authorship/Cargo.toml b/client/basic-authorship/Cargo.toml index e1083b15a9700..85592c7c549c0 100644 --- a/client/basic-authorship/Cargo.toml +++ b/client/basic-authorship/Cargo.toml @@ -19,8 +19,8 @@ futures-timer = "3.0.1" log = "0.4.8" prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.10.0-dev"} sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sc-client-api = { version = "4.0.0-dev", path = "../api" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } diff --git a/client/beefy/Cargo.toml b/client/beefy/Cargo.toml index 9761f18d78450..3ce556e85239b 100644 --- a/client/beefy/Cargo.toml +++ b/client/beefy/Cargo.toml @@ -19,12 +19,12 @@ codec = { version = "2.2.0", package = "parity-scale-codec", features = ["derive prometheus = { version = "0.10.0-dev", package = "substrate-prometheus-endpoint", path = "../../utils/prometheus" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-application-crypto = { version = "4.0.0", path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", path = "../../primitives/application-crypto" } sp-arithmetic = { version = "4.0.0", path = "../../primitives/arithmetic" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-chain-spec = { version = "4.0.0-dev", path = "../../client/chain-spec" } sc-utils = { version = "4.0.0-dev", path = "../utils" } @@ -39,4 +39,4 @@ beefy-primitives = { version = "4.0.0-dev", path = "../../primitives/beefy" } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } sc-network-test = { version = "0.8.0", path = "../network/test" } -strum = { version = "0.22", features = ["derive"] } +strum = { version = "0.23", features = ["derive"] } diff --git a/client/beefy/rpc/Cargo.toml b/client/beefy/rpc/Cargo.toml index 444f1ff4aaf9e..4a300b26e1238 100644 --- a/client/beefy/rpc/Cargo.toml +++ b/client/beefy/rpc/Cargo.toml @@ -24,8 +24,8 @@ codec = { version = "2.2.0", package = "parity-scale-codec", features = ["derive sc-rpc = { version = "4.0.0-dev", path = "../../rpc" } sc-utils = { version = "4.0.0-dev", path = "../../utils" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } beefy-gadget = { version = "4.0.0-dev", path = "../." } beefy-primitives = { version = "4.0.0-dev", path = "../../../primitives/beefy" } diff --git a/client/block-builder/Cargo.toml b/client/block-builder/Cargo.toml index 19b8839c12280..e41ab0a5caf15 100644 --- a/client/block-builder/Cargo.toml +++ b/client/block-builder/Cargo.toml @@ -14,11 +14,11 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-state-machine = { version = "0.10.0", path = "../../primitives/state-machine" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-block-builder = { version = "4.0.0-dev", path = "../../primitives/block-builder" } sp-inherents = { version = "4.0.0-dev", path = "../../primitives/inherents" } sc-client-api = { version = "4.0.0-dev", path = "../api" } diff --git a/client/chain-spec/Cargo.toml b/client/chain-spec/Cargo.toml index 0110e82532a5c..d103c2414331b 100644 --- a/client/chain-spec/Cargo.toml +++ b/client/chain-spec/Cargo.toml @@ -16,10 +16,10 @@ targets = ["x86_64-unknown-linux-gnu"] sc-chain-spec-derive = { version = "4.0.0-dev", path = "./derive" } impl-trait-for-tuples = "0.2.1" sc-network = { version = "0.10.0-dev", path = "../network" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } serde = { version = "1.0.132", features = ["derive"] } serde_json = "1.0.74" -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-telemetry = { version = "4.0.0-dev", path = "../telemetry" } codec = { package = "parity-scale-codec", version = "2.0.0" } memmap2 = "0.5.0" diff --git a/client/chain-spec/src/chain_spec.rs b/client/chain-spec/src/chain_spec.rs index a22a68d2944fa..2412a7cdf83f0 100644 --- a/client/chain-spec/src/chain_spec.rs +++ b/client/chain-spec/src/chain_spec.rs @@ -164,6 +164,10 @@ struct ClientSpec { boot_nodes: Vec, telemetry_endpoints: Option, protocol_id: Option, + /// Arbitrary string. Nodes will only synchronize with other nodes that have the same value + /// in their `fork_id`. This can be used in order to segregate nodes in cases when multiple + /// chains have the same genesis hash. + #[serde(default = "Default::default", skip_serializing_if = "Option::is_none")] fork_id: Option, properties: Option, #[serde(flatten)] diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index a33b3e13af35c..ca7e0ac768f91 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -39,11 +39,11 @@ sc-telemetry = { version = "4.0.0-dev", path = "../telemetry" } sc-tracing = { version = "4.0.0-dev", path = "../tracing" } sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-keyring = { version = "4.1.0-dev", path = "../../primitives/keyring" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } sp-panic-handler = { version = "4.0.0", path = "../../primitives/panic-handler" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } [dev-dependencies] diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml index bcae7648ce2e8..4fb621d716a8e 100644 --- a/client/consensus/aura/Cargo.toml +++ b/client/consensus/aura/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", path = "../../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", path = "../../../primitives/application-crypto" } sp-consensus-aura = { version = "0.10.0-dev", path = "../../../primitives/consensus/aura" } sp-block-builder = { version = "4.0.0-dev", path = "../../../primitives/block-builder" } sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" } @@ -26,12 +26,12 @@ thiserror = "1.0" futures = "0.3.9" sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" } log = "0.4.8" -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } sc-consensus-slots = { version = "0.10.0-dev", path = "../slots" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } sc-telemetry = { version = "4.0.0-dev", path = "../../telemetry" } prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../../utils/prometheus", version = "0.10.0-dev" } async-trait = "0.1.50" diff --git a/client/consensus/babe/Cargo.toml b/client/consensus/babe/Cargo.toml index 5dd029f0ad4a9..79cb3a52038a3 100644 --- a/client/consensus/babe/Cargo.toml +++ b/client/consensus/babe/Cargo.toml @@ -19,15 +19,15 @@ codec = { package = "parity-scale-codec", version = "2.0.0", features = [ ] } sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" } sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-application-crypto = { version = "4.0.0", path = "../../../primitives/application-crypto" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-application-crypto = { version = "5.0.0", path = "../../../primitives/application-crypto" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } num-bigint = "0.2.3" num-rational = "0.2.2" num-traits = "0.2.8" serde = { version = "1.0.132", features = ["derive"] } sp-version = { version = "4.0.0-dev", path = "../../../primitives/version" } -sp-io = { version = "4.0.0", path = "../../../primitives/io" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" } sc-telemetry = { version = "4.0.0-dev", path = "../../telemetry" } sc-keystore = { version = "4.0.0-dev", path = "../../keystore" } @@ -40,7 +40,7 @@ sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/c sp-consensus-slots = { version = "0.10.0-dev", path = "../../../primitives/consensus/slots" } sp-consensus-vrf = { version = "0.10.0-dev", path = "../../../primitives/consensus/vrf" } sc-consensus-slots = { version = "0.10.0-dev", path = "../slots" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } fork-tree = { version = "3.0.0", path = "../../../utils/fork-tree" } prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../../utils/prometheus", version = "0.10.0-dev" } futures = "0.3.9" diff --git a/client/consensus/babe/rpc/Cargo.toml b/client/consensus/babe/rpc/Cargo.toml index 4997cfdd1eec0..87ef265ffd9b2 100644 --- a/client/consensus/babe/rpc/Cargo.toml +++ b/client/consensus/babe/rpc/Cargo.toml @@ -21,15 +21,15 @@ jsonrpc-derive = "18.0.0" sp-consensus-babe = { version = "0.10.0-dev", path = "../../../../primitives/consensus/babe" } serde = { version = "1.0.132", features = ["derive"] } sp-blockchain = { version = "4.0.0-dev", path = "../../../../primitives/blockchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../../primitives/runtime" } sc-consensus-epochs = { version = "0.10.0-dev", path = "../../epochs" } futures = "0.3.16" thiserror = "1.0" sp-api = { version = "4.0.0-dev", path = "../../../../primitives/api" } sp-consensus = { version = "0.10.0-dev", path = "../../../../primitives/consensus/common" } -sp-core = { version = "4.1.0-dev", path = "../../../../primitives/core" } -sp-application-crypto = { version = "4.0.0", path = "../../../../primitives/application-crypto" } -sp-keystore = { version = "0.10.0", path = "../../../../primitives/keystore" } +sp-core = { version = "5.0.0", path = "../../../../primitives/core" } +sp-application-crypto = { version = "5.0.0", path = "../../../../primitives/application-crypto" } +sp-keystore = { version = "0.11.0", path = "../../../../primitives/keystore" } [dev-dependencies] sc-consensus = { version = "0.10.0-dev", path = "../../../consensus/common" } diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 72a0544535ad7..a14a367690332 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -20,10 +20,10 @@ futures = { version = "0.3.1", features = ["thread-pool"] } futures-timer = "3.0.1" sc-client-api = { version = "4.0.0-dev", path = "../../api" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-core = { path = "../../../primitives/core", version = "4.1.0-dev" } +sp-core = { path = "../../../primitives/core", version = "5.0.0"} sp-consensus = { path = "../../../primitives/consensus/common", version = "0.10.0-dev" } -sp-state-machine = { version = "0.10.0", path = "../../../primitives/state-machine" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sc-utils = { version = "4.0.0-dev", path = "../../utils" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } parking_lot = "0.11.2" diff --git a/client/consensus/epochs/Cargo.toml b/client/consensus/epochs/Cargo.toml index bb4a77b559e0a..b377dccfd3689 100644 --- a/client/consensus/epochs/Cargo.toml +++ b/client/consensus/epochs/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } fork-tree = { version = "3.0.0", path = "../../../utils/fork-tree" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } sc-client-api = { path = "../../api" , version = "4.0.0-dev"} sc-consensus = { path = "../common" , version = "0.10.0-dev"} diff --git a/client/consensus/manual-seal/Cargo.toml b/client/consensus/manual-seal/Cargo.toml index ff2264e641740..c2c36b1fc5867 100644 --- a/client/consensus/manual-seal/Cargo.toml +++ b/client/consensus/manual-seal/Cargo.toml @@ -37,9 +37,9 @@ sp-blockchain = { path = "../../../primitives/blockchain", version = "4.0.0-dev" sp-consensus = { path = "../../../primitives/consensus/common", version = "0.10.0-dev" } sp-consensus-slots = { path = "../../../primitives/consensus/slots", version = "0.10.0-dev" } sp-inherents = { path = "../../../primitives/inherents", version = "4.0.0-dev" } -sp-runtime = { path = "../../../primitives/runtime", version = "4.1.0-dev" } -sp-core = { path = "../../../primitives/core", version = "4.1.0-dev" } -sp-keystore = { path = "../../../primitives/keystore", version = "0.10.0" } +sp-runtime = { path = "../../../primitives/runtime", version = "5.0.0"} +sp-core = { path = "../../../primitives/core", version = "5.0.0"} +sp-keystore = { path = "../../../primitives/keystore", version = "0.11.0"} sp-api = { path = "../../../primitives/api", version = "4.0.0-dev" } sc-transaction-pool-api = { path = "../../../client/transaction-pool/api", version = "4.0.0-dev" } sp-timestamp = { path = "../../../primitives/timestamp", version = "4.0.0-dev" } diff --git a/client/consensus/pow/Cargo.toml b/client/consensus/pow/Cargo.toml index e5bf87487c71b..eb609489290a0 100644 --- a/client/consensus/pow/Cargo.toml +++ b/client/consensus/pow/Cargo.toml @@ -14,9 +14,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } sc-client-api = { version = "4.0.0-dev", path = "../../api" } sp-block-builder = { version = "4.0.0-dev", path = "../../../primitives/block-builder" } diff --git a/client/consensus/slots/Cargo.toml b/client/consensus/slots/Cargo.toml index 60f57449a3a33..b13c1bb6b5b32 100644 --- a/client/consensus/slots/Cargo.toml +++ b/client/consensus/slots/Cargo.toml @@ -16,13 +16,13 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0" } sc-client-api = { version = "4.0.0-dev", path = "../../api" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sp-arithmetic = { version = "4.0.0", path = "../../../primitives/arithmetic" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" } sp-consensus-slots = { version = "0.10.0-dev", path = "../../../primitives/consensus/slots" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../../primitives/state-machine" } sc-telemetry = { version = "4.0.0-dev", path = "../../telemetry" } sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" } sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" } diff --git a/client/consensus/uncles/Cargo.toml b/client/consensus/uncles/Cargo.toml index b9eaae4773a6a..7482fdc12d081 100644 --- a/client/consensus/uncles/Cargo.toml +++ b/client/consensus/uncles/Cargo.toml @@ -14,6 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sc-client-api = { version = "4.0.0-dev", path = "../../api" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-authorship = { version = "4.0.0-dev", path = "../../../primitives/authorship" } thiserror = "1.0.30" diff --git a/client/db/Cargo.toml b/client/db/Cargo.toml index 0db0f8309e2eb..f2c21abf6c1d6 100644 --- a/client/db/Cargo.toml +++ b/client/db/Cargo.toml @@ -26,11 +26,11 @@ codec = { package = "parity-scale-codec", version = "2.0.0", features = [ sc-client-api = { version = "4.0.0-dev", path = "../api" } sp-arithmetic = { version = "4.0.0", path = "../../primitives/arithmetic" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../primitives/state-machine" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../primitives/state-machine" } sc-state-db = { version = "0.10.0-dev", path = "../state-db" } -sp-trie = { version = "4.0.0", path = "../../primitives/trie" } +sp-trie = { version = "5.0.0", path = "../../primitives/trie" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sp-database = { version = "4.0.0-dev", path = "../../primitives/database" } parity-db = { version = "0.3.5", optional = true } diff --git a/client/executor/Cargo.toml b/client/executor/Cargo.toml index e10cbf347db59..0d0f2a8bd92ed 100644 --- a/client/executor/Cargo.toml +++ b/client/executor/Cargo.toml @@ -15,18 +15,18 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-tasks = { version = "4.0.0-dev", path = "../../primitives/tasks" } -sp-trie = { version = "4.0.0", path = "../../primitives/trie" } +sp-trie = { version = "5.0.0", path = "../../primitives/trie" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } sp-panic-handler = { version = "4.0.0", path = "../../primitives/panic-handler" } wasmi = "0.9.1" lazy_static = "1.4.0" sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-wasm-interface = { version = "4.1.0-dev", path = "../../primitives/wasm-interface" } -sp-runtime-interface = { version = "4.1.0-dev", path = "../../primitives/runtime-interface" } -sp-externalities = { version = "0.10.0", path = "../../primitives/externalities" } +sp-wasm-interface = { version = "5.0.0", path = "../../primitives/wasm-interface" } +sp-runtime-interface = { version = "5.0.0", path = "../../primitives/runtime-interface" } +sp-externalities = { version = "0.11.0", path = "../../primitives/externalities" } sc-executor-common = { version = "0.10.0-dev", path = "common" } sc-executor-wasmi = { version = "0.10.0-dev", path = "wasmi" } sc-executor-wasmtime = { version = "0.10.0-dev", path = "wasmtime", optional = true } @@ -41,8 +41,8 @@ wat = "1.0" hex-literal = "0.3.4" sc-runtime-test = { version = "2.0.0", path = "runtime-test" } substrate-test-runtime = { version = "2.0.0", path = "../../test-utils/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../primitives/state-machine" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sp-maybe-compressed-blob = { version = "4.1.0-dev", path = "../../primitives/maybe-compressed-blob" } sc-tracing = { version = "4.0.0-dev", path = "../tracing" } tracing = "0.1.29" diff --git a/client/executor/common/Cargo.toml b/client/executor/common/Cargo.toml index 104d24876d9a5..e23db203b3a40 100644 --- a/client/executor/common/Cargo.toml +++ b/client/executor/common/Cargo.toml @@ -17,9 +17,9 @@ targets = ["x86_64-unknown-linux-gnu"] wasm-instrument = "0.1" codec = { package = "parity-scale-codec", version = "2.0.0" } wasmi = "0.9.1" -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-allocator = { version = "4.1.0-dev", path = "../../allocator" } -sp-wasm-interface = { version = "4.1.0-dev", path = "../../../primitives/wasm-interface" } +sp-wasm-interface = { version = "5.0.0", path = "../../../primitives/wasm-interface" } sp-maybe-compressed-blob = { version = "4.1.0-dev", path = "../../../primitives/maybe-compressed-blob" } sp-serializer = { version = "4.0.0-dev", path = "../../../primitives/serializer" } thiserror = "1.0.30" diff --git a/client/executor/runtime-test/Cargo.toml b/client/executor/runtime-test/Cargo.toml index 1318c7246a848..b6fbe8685e35b 100644 --- a/client/executor/runtime-test/Cargo.toml +++ b/client/executor/runtime-test/Cargo.toml @@ -13,9 +13,9 @@ repository = "https://github.com/paritytech/substrate/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-sandbox = { version = "0.10.0-dev", default-features = false, path = "../../../primitives/sandbox" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } sp-tasks = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/tasks" } diff --git a/client/executor/wasmi/Cargo.toml b/client/executor/wasmi/Cargo.toml index 9dc63747166b5..d333e98bf6cfb 100644 --- a/client/executor/wasmi/Cargo.toml +++ b/client/executor/wasmi/Cargo.toml @@ -19,7 +19,7 @@ wasmi = "0.9.1" codec = { package = "parity-scale-codec", version = "2.0.0" } sc-executor-common = { version = "0.10.0-dev", path = "../common" } sc-allocator = { version = "4.1.0-dev", path = "../../allocator" } -sp-wasm-interface = { version = "4.1.0-dev", path = "../../../primitives/wasm-interface" } -sp-runtime-interface = { version = "4.1.0-dev", path = "../../../primitives/runtime-interface" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-wasm-interface = { version = "5.0.0", path = "../../../primitives/wasm-interface" } +sp-runtime-interface = { version = "5.0.0", path = "../../../primitives/runtime-interface" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } scoped-tls = "1.0" diff --git a/client/executor/wasmtime/Cargo.toml b/client/executor/wasmtime/Cargo.toml index 8b3cd1a58e75f..0423b384943e8 100644 --- a/client/executor/wasmtime/Cargo.toml +++ b/client/executor/wasmtime/Cargo.toml @@ -19,9 +19,9 @@ log = "0.4.8" parity-wasm = "0.42.0" codec = { package = "parity-scale-codec", version = "2.0.0" } sc-executor-common = { version = "0.10.0-dev", path = "../common" } -sp-wasm-interface = { version = "4.1.0-dev", path = "../../../primitives/wasm-interface", features = ["wasmtime"] } -sp-runtime-interface = { version = "4.1.0-dev", path = "../../../primitives/runtime-interface" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-wasm-interface = { version = "5.0.0", path = "../../../primitives/wasm-interface", features = ["wasmtime"] } +sp-runtime-interface = { version = "5.0.0", path = "../../../primitives/runtime-interface" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-allocator = { version = "4.1.0-dev", path = "../../allocator" } wasmtime = { version = "0.33.0", default-features = false, features = [ "cache", @@ -32,5 +32,5 @@ wasmtime = { version = "0.33.0", default-features = false, features = [ [dev-dependencies] sc-runtime-test = { version = "2.0.0", path = "../runtime-test" } -sp-io = { version = "4.0.0", path = "../../../primitives/io" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } wat = "1.0" diff --git a/client/finality-grandpa/Cargo.toml b/client/finality-grandpa/Cargo.toml index 2e6d3407a191f..e6b0b6396681e 100644 --- a/client/finality-grandpa/Cargo.toml +++ b/client/finality-grandpa/Cargo.toml @@ -23,15 +23,15 @@ log = "0.4.8" parking_lot = "0.11.2" rand = "0.8.4" parity-scale-codec = { version = "2.3.1", features = ["derive"] } -sp-application-crypto = { version = "4.0.0", path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", path = "../../primitives/application-crypto" } sp-arithmetic = { version = "4.0.0", path = "../../primitives/arithmetic" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-chain-spec = { version = "4.0.0-dev", path = "../../client/chain-spec" } sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } sc-telemetry = { version = "4.0.0-dev", path = "../telemetry" } sc-keystore = { version = "4.0.0-dev", path = "../keystore" } diff --git a/client/finality-grandpa/rpc/Cargo.toml b/client/finality-grandpa/rpc/Cargo.toml index 39bf398fe3129..2845621cadd6f 100644 --- a/client/finality-grandpa/rpc/Cargo.toml +++ b/client/finality-grandpa/rpc/Cargo.toml @@ -12,8 +12,8 @@ readme = "README.md" sc-finality-grandpa = { version = "0.10.0-dev", path = "../" } sc-rpc = { version = "4.0.0-dev", path = "../../rpc" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } finality-grandpa = { version = "0.14.4", features = ["derive-codec"] } jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" @@ -32,7 +32,7 @@ sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" } sc-rpc = { version = "4.0.0-dev", path = "../../rpc", features = [ "test-helpers", ] } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sp-finality-grandpa = { version = "4.0.0-dev", path = "../../../primitives/finality-grandpa" } sp-keyring = { version = "4.1.0-dev", path = "../../../primitives/keyring" } substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" } diff --git a/client/informant/Cargo.toml b/client/informant/Cargo.toml index ce7fe31648a19..78ee90823f226 100644 --- a/client/informant/Cargo.toml +++ b/client/informant/Cargo.toml @@ -21,5 +21,5 @@ parity-util-mem = { version = "0.10.2", default-features = false, features = ["p sc-client-api = { version = "4.0.0-dev", path = "../api" } sc-network = { version = "0.10.0-dev", path = "../network" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "../transaction-pool/api" } diff --git a/client/keystore/Cargo.toml b/client/keystore/Cargo.toml index 56d4ee0d556fa..4d67be4167dd1 100644 --- a/client/keystore/Cargo.toml +++ b/client/keystore/Cargo.toml @@ -17,9 +17,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] async-trait = "0.1.50" thiserror = "1.0" -sp-application-crypto = { version = "4.0.0", path = "../../primitives/application-crypto" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-application-crypto = { version = "5.0.0", path = "../../primitives/application-crypto" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } hex = "0.4.0" parking_lot = "0.11.2" serde_json = "1.0.74" diff --git a/client/network-gossip/Cargo.toml b/client/network-gossip/Cargo.toml index 9523e32f99e06..7952d97193ea9 100644 --- a/client/network-gossip/Cargo.toml +++ b/client/network-gossip/Cargo.toml @@ -22,7 +22,7 @@ log = "0.4.8" lru = "0.7.0" prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" } sc-network = { version = "0.10.0-dev", path = "../network" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } tracing = "0.1.29" [dev-dependencies] diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index 354991b32ba5b..fa1cc715e1512 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -52,8 +52,8 @@ sp-arithmetic = { version = "4.0.0", path = "../../primitives/arithmetic" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-finality-grandpa = { version = "4.0.0-dev", path = "../../primitives/finality-grandpa" } thiserror = "1.0" diff --git a/client/network/src/protocol/sync.rs b/client/network/src/protocol/sync.rs index d6513ca2e5b9d..fbb4e376b1b4f 100644 --- a/client/network/src/protocol/sync.rs +++ b/client/network/src/protocol/sync.rs @@ -2418,7 +2418,11 @@ fn fork_sync_request( if !r.peers.contains(id) { continue } - if r.number <= best_num { + // Download the fork only if it is behind or not too far ahead our tip of the chain + // Otherwise it should be downloaded in full sync mode. + if r.number <= best_num || + (r.number - best_num).saturated_into::() < MAX_BLOCKS_TO_REQUEST as u32 + { let parent_status = r.parent_hash.as_ref().map_or(BlockStatus::Unknown, check_block); let count = if parent_status == BlockStatus::Unknown { (r.number - finalized).saturated_into::() // up to the last finalized block @@ -2438,6 +2442,8 @@ fn fork_sync_request( max: Some(count), }, )) + } else { + trace!(target: "sync", "Fork too far in the future: {:?} (#{})", hash, r.number); } } None diff --git a/client/network/src/protocol/sync/extra_requests.rs b/client/network/src/protocol/sync/extra_requests.rs index 680094a74143e..224fbd1a1e01a 100644 --- a/client/network/src/protocol/sync/extra_requests.rs +++ b/client/network/src/protocol/sync/extra_requests.rs @@ -173,9 +173,7 @@ impl ExtraRequests { } if best_finalized_number > self.best_seen_finalized_number { - // normally we'll receive finality notifications for every block => finalize would be - // enough but if many blocks are finalized at once, some notifications may be omitted - // => let's use finalize_with_ancestors here + // we receive finality notification only for the finalized branch head. match self.tree.finalize_with_ancestors( best_finalized_hash, best_finalized_number, diff --git a/client/network/test/Cargo.toml b/client/network/test/Cargo.toml index 6b6d777e7396e..2750c613d42a2 100644 --- a/client/network/test/Cargo.toml +++ b/client/network/test/Cargo.toml @@ -25,8 +25,8 @@ sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/c sc-consensus = { version = "0.10.0-dev", path = "../../consensus/common" } sc-client-api = { version = "4.0.0-dev", path = "../../api" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" } sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" } substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" } diff --git a/client/network/test/src/lib.rs b/client/network/test/src/lib.rs index d9e27ce575110..3986ac47f3616 100644 --- a/client/network/test/src/lib.rs +++ b/client/network/test/src/lib.rs @@ -86,7 +86,6 @@ type AuthorityId = sp_consensus_babe::AuthorityId; #[derive(Clone)] pub struct PassThroughVerifier { finalized: bool, - fork_choice: ForkChoiceStrategy, } impl PassThroughVerifier { @@ -94,15 +93,7 @@ impl PassThroughVerifier { /// /// Every verified block will use `finalized` for the `BlockImportParams`. pub fn new(finalized: bool) -> Self { - Self { finalized, fork_choice: ForkChoiceStrategy::LongestChain } - } - - /// Create a new instance. - /// - /// Every verified block will use `finalized` for the `BlockImportParams` and - /// the given [`ForkChoiceStrategy`]. - pub fn new_with_fork_choice(finalized: bool, fork_choice: ForkChoiceStrategy) -> Self { - Self { finalized, fork_choice } + Self { finalized } } } @@ -121,8 +112,10 @@ impl Verifier for PassThroughVerifier { .or_else(|| l.try_as_raw(OpaqueDigestItemId::Consensus(b"babe"))) }) .map(|blob| vec![(well_known_cache_keys::AUTHORITIES, blob.to_vec())]); + if block.fork_choice.is_none() { + block.fork_choice = Some(ForkChoiceStrategy::LongestChain); + }; block.finalized = self.finalized; - block.fork_choice = Some(self.fork_choice.clone()); Ok((block, maybe_keys)) } } @@ -309,6 +302,33 @@ where false, true, true, + ForkChoiceStrategy::LongestChain, + ) + } + + /// Add blocks to the peer -- edit the block before adding and use custom fork choice rule. + pub fn generate_blocks_with_fork_choice( + &mut self, + count: usize, + origin: BlockOrigin, + edit_block: F, + fork_choice: ForkChoiceStrategy, + ) -> H256 + where + F: FnMut( + BlockBuilder, + ) -> Block, + { + let best_hash = self.client.info().best_hash; + self.generate_blocks_at( + BlockId::Hash(best_hash), + count, + origin, + edit_block, + false, + true, + true, + fork_choice, ) } @@ -323,6 +343,7 @@ where headers_only: bool, inform_sync_about_new_best_block: bool, announce_block: bool, + fork_choice: ForkChoiceStrategy, ) -> H256 where F: FnMut( @@ -346,6 +367,7 @@ where let header = block.header.clone(); let mut import_block = BlockImportParams::new(origin, header.clone()); import_block.body = if headers_only { None } else { Some(block.extrinsics) }; + import_block.fork_choice = Some(fork_choice); let (import_block, cache) = futures::executor::block_on(self.verifier.verify(import_block)).unwrap(); let cache = if let Some(cache) = cache { @@ -442,6 +464,7 @@ where headers_only, inform_sync_about_new_best_block, announce_block, + ForkChoiceStrategy::LongestChain, ) } else { self.generate_blocks_at( @@ -452,6 +475,7 @@ where headers_only, inform_sync_about_new_best_block, announce_block, + ForkChoiceStrategy::LongestChain, ) } } @@ -976,14 +1000,10 @@ where peer.network.service().announce_block(notification.hash, None); } - // We poll `finality_notification_stream`, but we only take the last event. - let mut last = None; - while let Poll::Ready(Some(item)) = + // We poll `finality_notification_stream`. + while let Poll::Ready(Some(notification)) = peer.finality_notification_stream.as_mut().poll_next(cx) { - last = Some(item); - } - if let Some(notification) = last { peer.network.on_block_finalized(notification.hash, notification.header); } } @@ -993,14 +1013,6 @@ where pub struct TestNet { peers: Vec>, - fork_choice: ForkChoiceStrategy, -} - -impl TestNet { - /// Create a `TestNet` that used the given fork choice rule. - pub fn with_fork_choice(fork_choice: ForkChoiceStrategy) -> Self { - Self { peers: Vec::new(), fork_choice } - } } impl TestNetFactory for TestNet { @@ -1010,7 +1022,7 @@ impl TestNetFactory for TestNet { /// Create new test network with peers and given config. fn from_config(_config: &ProtocolConfig) -> Self { - TestNet { peers: Vec::new(), fork_choice: ForkChoiceStrategy::LongestChain } + TestNet { peers: Vec::new() } } fn make_verifier( @@ -1019,7 +1031,7 @@ impl TestNetFactory for TestNet { _config: &ProtocolConfig, _peer_data: &(), ) -> Self::Verifier { - PassThroughVerifier::new_with_fork_choice(false, self.fork_choice.clone()) + PassThroughVerifier::new(false) } fn make_block_import( diff --git a/client/network/test/src/sync.rs b/client/network/test/src/sync.rs index 5b607a7762b34..84a5c2ca13fa5 100644 --- a/client/network/test/src/sync.rs +++ b/client/network/test/src/sync.rs @@ -453,6 +453,38 @@ fn can_sync_small_non_best_forks() { })); } +#[test] +fn can_sync_forks_ahead_of_the_best_chain() { + sp_tracing::try_init_simple(); + let mut net = TestNet::new(2); + net.peer(0).push_blocks(1, false); + net.peer(1).push_blocks(1, false); + + net.block_until_connected(); + // Peer 0 is on 2-block fork which is announced with is_best=false + let fork_hash = net.peer(0).generate_blocks_with_fork_choice( + 2, + BlockOrigin::Own, + |builder| builder.build().unwrap().block, + ForkChoiceStrategy::Custom(false), + ); + // Peer 1 is on 1-block fork + net.peer(1).push_blocks(1, false); + assert!(net.peer(0).client().header(&BlockId::Hash(fork_hash)).unwrap().is_some()); + assert_eq!(net.peer(0).client().info().best_number, 1); + assert_eq!(net.peer(1).client().info().best_number, 2); + + // after announcing, peer 1 downloads the block. + block_on(futures::future::poll_fn::<(), _>(|cx| { + net.poll(cx); + + if net.peer(1).client().header(&BlockId::Hash(fork_hash)).unwrap().is_none() { + return Poll::Pending + } + Poll::Ready(()) + })); +} + #[test] fn can_sync_explicit_forks() { sp_tracing::try_init_simple(); @@ -678,7 +710,7 @@ impl BlockAnnounceValidator for FailingBlockAnnounceValidator { #[test] fn sync_blocks_when_block_announce_validator_says_it_is_new_best() { sp_tracing::try_init_simple(); - let mut net = TestNet::with_fork_choice(ForkChoiceStrategy::Custom(false)); + let mut net = TestNet::new(0); net.add_full_peer_with_config(Default::default()); net.add_full_peer_with_config(Default::default()); net.add_full_peer_with_config(FullPeerConfig { @@ -688,16 +720,17 @@ fn sync_blocks_when_block_announce_validator_says_it_is_new_best() { net.block_until_connected(); - let block_hash = net.peer(0).push_blocks(1, false); + // Add blocks but don't set them as best + let block_hash = net.peer(0).generate_blocks_with_fork_choice( + 1, + BlockOrigin::Own, + |builder| builder.build().unwrap().block, + ForkChoiceStrategy::Custom(false), + ); while !net.peer(2).has_block(&block_hash) { net.block_until_idle(); } - - // Peer1 should not have the block, because peer 0 did not reported the block - // as new best. However, peer2 has a special block announcement validator - // that flags all blocks as `is_new_best` and thus, it should have synced the blocks. - assert!(!net.peer(1).has_block(&block_hash)); } /// Waits for some time until the validation is successfull. @@ -721,7 +754,7 @@ impl BlockAnnounceValidator for DeferredBlockAnnounceValidator { #[test] fn wait_until_deferred_block_announce_validation_is_ready() { sp_tracing::try_init_simple(); - let mut net = TestNet::with_fork_choice(ForkChoiceStrategy::Custom(false)); + let mut net = TestNet::new(0); net.add_full_peer_with_config(Default::default()); net.add_full_peer_with_config(FullPeerConfig { block_announce_validator: Some(Box::new(NewBestBlockAnnounceValidator)), @@ -730,7 +763,13 @@ fn wait_until_deferred_block_announce_validation_is_ready() { net.block_until_connected(); - let block_hash = net.peer(0).push_blocks(1, true); + // Add blocks but don't set them as best + let block_hash = net.peer(0).generate_blocks_with_fork_choice( + 1, + BlockOrigin::Own, + |builder| builder.build().unwrap().block, + ForkChoiceStrategy::Custom(false), + ); while !net.peer(1).has_block(&block_hash) { net.block_until_idle(); @@ -847,7 +886,10 @@ fn block_announce_data_is_propagated() { // Wait until peer 1 is connected to both nodes. block_on(futures::future::poll_fn::<(), _>(|cx| { net.poll(cx); - if net.peer(1).num_peers() == 2 { + if net.peer(1).num_peers() == 2 && + net.peer(0).num_peers() == 1 && + net.peer(2).num_peers() == 1 + { Poll::Ready(()) } else { Poll::Pending @@ -1109,6 +1151,7 @@ fn syncs_indexed_blocks() { false, true, true, + ForkChoiceStrategy::LongestChain, ); let indexed_key = sp_runtime::traits::BlakeTwo256::hash(&42u64.to_le_bytes()); assert!(net diff --git a/client/offchain/Cargo.toml b/client/offchain/Cargo.toml index dd4bdb71f93b6..5cd823958eed4 100644 --- a/client/offchain/Cargo.toml +++ b/client/offchain/Cargo.toml @@ -25,9 +25,9 @@ rand = "0.7.2" sc-client-api = { version = "4.0.0-dev", path = "../api" } sc-network = { version = "0.10.0-dev", path = "../network" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-offchain = { version = "4.0.0-dev", path = "../../primitives/offchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-utils = { version = "4.0.0-dev", path = "../utils" } threadpool = "1.7" hyper = { version = "0.14.16", features = ["stream", "http2"] } diff --git a/client/rpc-api/Cargo.toml b/client/rpc-api/Cargo.toml index 4b2882ee827f7..8b8b70b9747c9 100644 --- a/client/rpc-api/Cargo.toml +++ b/client/rpc-api/Cargo.toml @@ -23,12 +23,12 @@ log = "0.4.8" parking_lot = "0.11.2" thiserror = "1.0" -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-chain-spec = { path = "../chain-spec", version = "4.0.0-dev" } serde = { version = "1.0.132", features = ["derive"] } serde_json = "1.0.74" sc-transaction-pool-api = { version = "4.0.0-dev", path = "../transaction-pool/api" } -sp-rpc = { version = "4.0.0-dev", path = "../../primitives/rpc" } +sp-rpc = { version = "5.0.0", path = "../../primitives/rpc" } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 87fc263356a72..308d99bc4f376 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -20,16 +20,16 @@ codec = { package = "parity-scale-codec", version = "2.0.0" } futures = "0.3.16" jsonrpc-pubsub = "18.0.0" log = "0.4.8" -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } rpc = { package = "jsonrpc-core", version = "18.0.0" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } serde_json = "1.0.74" sp-session = { version = "4.0.0-dev", path = "../../primitives/session" } sp-offchain = { version = "4.0.0-dev", path = "../../primitives/offchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sc-utils = { version = "4.0.0-dev", path = "../utils" } -sp-rpc = { version = "4.0.0-dev", path = "../../primitives/rpc" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-rpc = { version = "5.0.0", path = "../../primitives/rpc" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } sc-chain-spec = { version = "4.0.0-dev", path = "../chain-spec" } sc-block-builder = { version = "0.10.0-dev", path = "../block-builder" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } @@ -43,7 +43,7 @@ sc-transaction-pool-api = { version = "4.0.0-dev", path = "../transaction-pool/a assert_matches = "1.3.0" lazy_static = "1.4.0" sc-network = { version = "0.10.0-dev", path = "../network" } -sp-io = { version = "4.0.0", path = "../../primitives/io" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } sc-transaction-pool = { version = "4.0.0-dev", path = "../transaction-pool" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index f23bf3f55bbfe..fb6c4a0837616 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -36,21 +36,21 @@ hash-db = "0.15.2" serde = "1.0.132" serde_json = "1.0.74" sc-keystore = { version = "4.0.0-dev", path = "../keystore" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } -sp-trie = { version = "4.0.0", path = "../../primitives/trie" } -sp-externalities = { version = "0.10.0", path = "../../primitives/externalities" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } +sp-trie = { version = "5.0.0", path = "../../primitives/trie" } +sp-externalities = { version = "0.11.0", path = "../../primitives/externalities" } sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } sp-session = { version = "4.0.0-dev", path = "../../primitives/session" } -sp-state-machine = { version = "0.10.0", path = "../../primitives/state-machine" } -sp-application-crypto = { version = "4.0.0", path = "../../primitives/application-crypto" } +sp-state-machine = { version = "0.11.0", path = "../../primitives/state-machine" } +sp-application-crypto = { version = "5.0.0", path = "../../primitives/application-crypto" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } sc-consensus = { version = "0.10.0-dev", path = "../../client/consensus/common" } sp-inherents = { version = "4.0.0-dev", path = "../../primitives/inherents" } -sp-storage = { version = "4.0.0", path = "../../primitives/storage" } +sp-storage = { version = "5.0.0", path = "../../primitives/storage" } sc-network = { version = "0.10.0-dev", path = "../network" } sc-chain-spec = { version = "4.0.0-dev", path = "../chain-spec" } sc-client-api = { version = "4.0.0-dev", path = "../api" } diff --git a/client/service/src/client/client.rs b/client/service/src/client/client.rs index 7673a7b4c5387..e8ca5343aa0d2 100644 --- a/client/service/src/client/client.rs +++ b/client/service/src/client/client.rs @@ -30,8 +30,8 @@ use rand::Rng; use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider, RecordProof}; use sc_client_api::{ backend::{ - self, apply_aux, BlockImportOperation, ClientImportOperation, Finalizer, ImportSummary, - LockImportRun, NewBlockState, StorageProvider, + self, apply_aux, BlockImportOperation, ClientImportOperation, FinalizeSummary, Finalizer, + ImportSummary, LockImportRun, NewBlockState, StorageProvider, }, client::{ BadBlocks, BlockBackend, BlockImportNotification, BlockOf, BlockchainEvents, ClientInfo, @@ -274,7 +274,7 @@ where let mut op = ClientImportOperation { op: self.backend.begin_operation()?, notify_imported: None, - notify_finalized: Vec::new(), + notify_finalized: None, }; let r = f(&mut op)?; @@ -622,18 +622,6 @@ where None }, }; - // Ensure parent chain is finalized to maintain invariant that - // finality is called sequentially. This will also send finality - // notifications for top 250 newly finalized blocks. - if finalized && parent_exists { - self.apply_finality_with_block_hash( - operation, - parent_hash, - None, - info.best_hash, - make_notifications, - )?; - } operation.op.update_cache(new_cache); storage_changes @@ -641,6 +629,18 @@ where None => None, }; + // Ensure parent chain is finalized to maintain invariant that finality is called + // sequentially. + if finalized && parent_exists { + self.apply_finality_with_block_hash( + operation, + parent_hash, + None, + info.best_hash, + make_notifications, + )?; + } + let is_new_best = !gap_block && (finalized || match fork_choice { @@ -683,11 +683,36 @@ where operation.op.insert_aux(aux)?; - // we only notify when we are already synced to the tip of the chain + // We only notify when we are already synced to the tip of the chain // or if this import triggers a re-org if make_notifications || tree_route.is_some() { if finalized { - operation.notify_finalized.push(hash); + let mut summary = match operation.notify_finalized.take() { + Some(summary) => summary, + None => FinalizeSummary { finalized: Vec::new(), stale_heads: Vec::new() }, + }; + summary.finalized.push(hash); + if parent_exists { + // Add to the stale list all heads that are branching from parent besides our + // current `head`. + for head in self + .backend + .blockchain() + .leaves()? + .into_iter() + .filter(|h| *h != parent_hash) + { + let route_from_parent = sp_blockchain::tree_route( + self.backend.blockchain(), + parent_hash, + head, + )?; + if route_from_parent.retracted().is_empty() { + summary.stale_heads.push(head); + } + } + } + operation.notify_finalized = Some(summary); } operation.notify_imported = Some(ImportSummary { @@ -831,58 +856,82 @@ where operation.op.mark_finalized(BlockId::Hash(block), justification)?; if notify { - // sometimes when syncing, tons of blocks can be finalized at once. - // we'll send notifications spuriously in that case. - const MAX_TO_NOTIFY: usize = 256; - let enacted = route_from_finalized.enacted(); - let start = enacted.len() - std::cmp::min(enacted.len(), MAX_TO_NOTIFY); - for finalized in &enacted[start..] { - operation.notify_finalized.push(finalized.hash); + let finalized = + route_from_finalized.enacted().iter().map(|elem| elem.hash).collect::>(); + + let last_finalized_number = self + .backend + .blockchain() + .number(last_finalized)? + .expect("Finalized block expected to be onchain; qed"); + let mut stale_heads = Vec::new(); + for head in self.backend.blockchain().leaves()? { + let route_from_finalized = + sp_blockchain::tree_route(self.backend.blockchain(), block, head)?; + let retracted = route_from_finalized.retracted(); + let pivot = route_from_finalized.common_block(); + // It is not guaranteed that `backend.blockchain().leaves()` doesn't return + // heads that were in a stale state before this finalization and thus already + // included in previous notifications. We want to skip such heads. + // Given the "route" from the currently finalized block to the head under + // analysis, the condition for it to be added to the new stale heads list is: + // `!retracted.is_empty() && last_finalized_number <= pivot.number` + // 1. "route" has some "retractions". + // 2. previously finalized block number is not greater than the "route" pivot: + // - if `last_finalized_number <= pivot.number` then this is a new stale head; + // - else the stale head was already included by some previous finalization. + if !retracted.is_empty() && last_finalized_number <= pivot.number { + stale_heads.push(head); + } } + operation.notify_finalized = Some(FinalizeSummary { finalized, stale_heads }); } Ok(()) } - fn notify_finalized(&self, notify_finalized: Vec) -> sp_blockchain::Result<()> { + fn notify_finalized( + &self, + notify_finalized: Option>, + ) -> sp_blockchain::Result<()> { let mut sinks = self.finality_notification_sinks.lock(); - if notify_finalized.is_empty() { - // cleanup any closed finality notification sinks - // since we won't be running the loop below which - // would also remove any closed sinks. - sinks.retain(|sink| !sink.is_closed()); - - return Ok(()) - } + let mut notify_finalized = match notify_finalized { + Some(notify_finalized) => notify_finalized, + None => { + // Cleanup any closed finality notification sinks + // since we won't be running the loop below which + // would also remove any closed sinks. + sinks.retain(|sink| !sink.is_closed()); + return Ok(()) + }, + }; - // We assume the list is sorted and only want to inform the - // telemetry once about the finalized block. - if let Some(last) = notify_finalized.last() { - let header = self.header(&BlockId::Hash(*last))?.expect( - "Header already known to exist in DB because it is indicated in the tree route; \ - qed", - ); + let last = notify_finalized.finalized.pop().expect( + "At least one finalized block shall exist within a valid finalization summary; qed", + ); - telemetry!( - self.telemetry; - SUBSTRATE_INFO; - "notify.finalized"; - "height" => format!("{}", header.number()), - "best" => ?last, - ); - } + let header = self.header(&BlockId::Hash(last))?.expect( + "Header already known to exist in DB because it is indicated in the tree route; \ + qed", + ); - for finalized_hash in notify_finalized { - let header = self.header(&BlockId::Hash(finalized_hash))?.expect( - "Header already known to exist in DB because it is indicated in the tree route; \ - qed", - ); + telemetry!( + self.telemetry; + SUBSTRATE_INFO; + "notify.finalized"; + "height" => format!("{}", header.number()), + "best" => ?last, + ); - let notification = FinalityNotification { header, hash: finalized_hash }; + let notification = FinalityNotification { + hash: last, + header, + tree_route: Arc::new(notify_finalized.finalized), + stale_heads: Arc::new(notify_finalized.stale_heads), + }; - sinks.retain(|sink| sink.unbounded_send(notification.clone()).is_ok()); - } + sinks.retain(|sink| sink.unbounded_send(notification.clone()).is_ok()); Ok(()) } @@ -901,7 +950,6 @@ where // temporary leak of closed/discarded notification sinks (e.g. // from consensus code). self.import_notification_sinks.lock().retain(|sink| !sink.is_closed()); - return Ok(()) }, }; diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 9710ba9e3d84f..430a818c0f47c 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -34,10 +34,10 @@ mod client; mod metrics; mod task_manager; -use std::{collections::HashMap, io, net::SocketAddr, pin::Pin, task::Poll}; +use std::{collections::HashMap, io, net::SocketAddr, pin::Pin}; use codec::{Decode, Encode}; -use futures::{stream, Future, FutureExt, Stream, StreamExt}; +use futures::{Future, FutureExt, StreamExt}; use log::{debug, error, warn}; use sc_network::PeerId; use sc_utils::mpsc::TracingUnboundedReceiver; @@ -152,26 +152,7 @@ async fn build_network_future< let starting_block = client.info().best_number; // Stream of finalized blocks reported by the client. - let mut finality_notification_stream = { - let mut finality_notification_stream = client.finality_notification_stream().fuse(); - - // We tweak the `Stream` in order to merge together multiple items if they happen to be - // ready. This way, we only get the latest finalized block. - stream::poll_fn(move |cx| { - let mut last = None; - while let Poll::Ready(Some(item)) = - Pin::new(&mut finality_notification_stream).poll_next(cx) - { - last = Some(item); - } - if let Some(last) = last { - Poll::Ready(Some(last)) - } else { - Poll::Pending - } - }) - .fuse() - }; + let mut finality_notification_stream = client.finality_notification_stream().fuse(); loop { futures::select! { diff --git a/client/service/test/Cargo.toml b/client/service/test/Cargo.toml index 84b1d44e7bde6..6395f9d9877dc 100644 --- a/client/service/test/Cargo.toml +++ b/client/service/test/Cargo.toml @@ -21,18 +21,18 @@ fdlimit = "0.2.1" parking_lot = "0.11.2" sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } -sp-state-machine = { version = "0.10.0", path = "../../../primitives/state-machine" } -sp-externalities = { version = "0.10.0", path = "../../../primitives/externalities" } -sp-trie = { version = "4.0.0", path = "../../../primitives/trie" } -sp-storage = { version = "4.0.0", path = "../../../primitives/storage" } +sp-state-machine = { version = "0.11.0", path = "../../../primitives/state-machine" } +sp-externalities = { version = "0.11.0", path = "../../../primitives/externalities" } +sp-trie = { version = "5.0.0", path = "../../../primitives/trie" } +sp-storage = { version = "5.0.0", path = "../../../primitives/storage" } sc-client-db = { version = "0.10.0-dev", default-features = false, path = "../../db" } futures = "0.3.16" sc-service = { version = "0.10.0-dev", features = ["test-helpers"], path = "../../service" } sc-network = { version = "0.10.0-dev", path = "../../network" } sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" } sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../client/transaction-pool/api" } substrate-test-runtime = { version = "2.0.0", path = "../../../test-utils/runtime" } substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" } diff --git a/client/service/test/src/client/mod.rs b/client/service/test/src/client/mod.rs index 535edfadaf29d..2b0ea460c4dd3 100644 --- a/client/service/test/src/client/mod.rs +++ b/client/service/test/src/client/mod.rs @@ -20,7 +20,9 @@ use futures::executor::block_on; use hex_literal::hex; use parity_scale_codec::{Decode, Encode, Joiner}; use sc_block_builder::BlockBuilderProvider; -use sc_client_api::{in_mem, BlockBackend, BlockchainEvents, StorageProvider}; +use sc_client_api::{ + in_mem, BlockBackend, BlockchainEvents, FinalityNotifications, StorageProvider, +}; use sc_client_db::{ Backend, DatabaseSettings, DatabaseSource, KeepBlocks, PruningMode, TransactionStorageMode, }; @@ -165,6 +167,24 @@ fn block1(genesis_hash: Hash, backend: &InMemoryBackend) -> (Vec, + finalized: &[Hash], + stale_heads: &[Hash], +) { + match notifications.try_next() { + Ok(Some(notif)) => { + let stale_heads_expected: HashSet<_> = stale_heads.iter().collect(); + let stale_heads: HashSet<_> = notif.stale_heads.iter().collect(); + assert_eq!(notif.tree_route.as_ref(), &finalized[..finalized.len() - 1]); + assert_eq!(notif.hash, *finalized.last().unwrap()); + assert_eq!(stale_heads, stale_heads_expected); + }, + Ok(None) => panic!("unexpected notification result, client send channel was closed"), + Err(_) => assert!(finalized.is_empty()), + } +} + #[test] fn construct_genesis_should_work_with_native() { let mut storage = GenesisConfig::new( @@ -822,8 +842,12 @@ fn best_containing_on_longest_chain_with_max_depth_higher_than_best() { #[test] fn import_with_justification() { + // block tree: + // G -> A1 -> A2 -> A3 let mut client = substrate_test_runtime_client::new(); + let mut finality_notifications = client.finality_notification_stream(); + // G -> A1 let a1 = client.new_block(Default::default()).unwrap().build().unwrap().block; block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); @@ -855,6 +879,10 @@ fn import_with_justification() { assert_eq!(client.justifications(&BlockId::Hash(a1.hash())).unwrap(), None); assert_eq!(client.justifications(&BlockId::Hash(a2.hash())).unwrap(), None); + + finality_notification_check(&mut finality_notifications, &[a1.hash(), a2.hash()], &[]); + finality_notification_check(&mut finality_notifications, &[a3.hash()], &[]); + assert!(finality_notifications.try_next().is_err()); } #[test] @@ -864,6 +892,9 @@ fn importing_diverged_finalized_block_should_trigger_reorg() { // G -> A1 -> A2 // \ // -> B1 + + let mut finality_notifications = client.finality_notification_stream(); + let a1 = client .new_block_at(&BlockId::Number(0), Default::default(), false) .unwrap() @@ -902,6 +933,9 @@ fn importing_diverged_finalized_block_should_trigger_reorg() { assert_eq!(client.chain_info().best_hash, b1.hash()); assert_eq!(client.chain_info().finalized_hash, b1.hash()); + + finality_notification_check(&mut finality_notifications, &[b1.hash()], &[a2.hash()]); + assert!(finality_notifications.try_next().is_err()); } #[test] @@ -911,6 +945,9 @@ fn finalizing_diverged_block_should_trigger_reorg() { // G -> A1 -> A2 // \ // -> B1 -> B2 + + let mut finality_notifications = client.finality_notification_stream(); + let a1 = client .new_block_at(&BlockId::Number(0), Default::default(), false) .unwrap() @@ -975,6 +1012,113 @@ fn finalizing_diverged_block_should_trigger_reorg() { block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); assert_eq!(client.chain_info().best_hash, b3.hash()); + + finality_notification_check(&mut finality_notifications, &[b1.hash()], &[a2.hash()]); + assert!(finality_notifications.try_next().is_err()); +} + +#[test] +fn finality_notifications_content() { + let (mut client, _select_chain) = TestClientBuilder::new().build_with_longest_chain(); + + // -> D3 -> D4 + // G -> A1 -> A2 -> A3 + // -> B1 -> B2 + // -> C1 + + let mut finality_notifications = client.finality_notification_stream(); + + let a1 = client + .new_block_at(&BlockId::Number(0), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + + let a2 = client + .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + let a3 = client + .new_block_at(&BlockId::Hash(a2.hash()), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + let mut b1 = client.new_block_at(&BlockId::Number(0), Default::default(), false).unwrap(); + // needed to make sure B1 gets a different hash from A1 + b1.push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let b1 = b1.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b1.clone())).unwrap(); + + let b2 = client + .new_block_at(&BlockId::Hash(b1.hash()), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + + let mut c1 = client.new_block_at(&BlockId::Number(0), Default::default(), false).unwrap(); + // needed to make sure B1 gets a different hash from A1 + c1.push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 2, + nonce: 0, + }) + .unwrap(); + let c1 = c1.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c1.clone())).unwrap(); + + let mut d3 = client + .new_block_at(&BlockId::Hash(a2.hash()), Default::default(), false) + .unwrap(); + // needed to make sure D3 gets a different hash from A3 + d3.push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 2, + nonce: 0, + }) + .unwrap(); + let d3 = d3.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d3.clone())).unwrap(); + + let d4 = client + .new_block_at(&BlockId::Hash(d3.hash()), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + + // Postpone import to test behavior of import of finalized block. + + ClientExt::finalize_block(&client, BlockId::Hash(a2.hash()), None).unwrap(); + + // Import and finalize D4 + block_on(client.import_as_final(BlockOrigin::Own, d4.clone())).unwrap(); + + finality_notification_check( + &mut finality_notifications, + &[a1.hash(), a2.hash()], + &[c1.hash(), b2.hash()], + ); + finality_notification_check(&mut finality_notifications, &[d3.hash(), d4.hash()], &[a3.hash()]); + assert!(finality_notifications.try_next().is_err()); } #[test] @@ -1069,6 +1213,8 @@ fn doesnt_import_blocks_that_revert_finality() { let mut client = TestClientBuilder::with_backend(backend).build(); + let mut finality_notifications = client.finality_notification_stream(); + // -> C1 // / // G -> A1 -> A2 @@ -1150,6 +1296,9 @@ fn doesnt_import_blocks_that_revert_finality() { ConsensusError::ClientImport(sp_blockchain::Error::NotInFinalizedChain.to_string()); assert_eq!(import_err.to_string(), expected_err.to_string()); + + finality_notification_check(&mut finality_notifications, &[a1.hash(), a2.hash()], &[b2.hash()]); + assert!(finality_notifications.try_next().is_err()); } #[test] diff --git a/client/state-db/Cargo.toml b/client/state-db/Cargo.toml index fbde840fbb8e9..fa0c5ed9810c9 100644 --- a/client/state-db/Cargo.toml +++ b/client/state-db/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] parking_lot = "0.11.2" log = "0.4.11" sc-client-api = { version = "4.0.0-dev", path = "../api" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } parity-util-mem-derive = "0.1.0" diff --git a/client/sync-state-rpc/Cargo.toml b/client/sync-state-rpc/Cargo.toml index 0aae985319d43..eab6ffa88f15c 100644 --- a/client/sync-state-rpc/Cargo.toml +++ b/client/sync-state-rpc/Cargo.toml @@ -26,5 +26,5 @@ sc-rpc-api = { version = "0.10.0-dev", path = "../rpc-api" } serde_json = "1.0.74" serde = { version = "1.0.132", features = ["derive"] } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } codec = { package = "parity-scale-codec", version = "2.0.0" } diff --git a/client/tracing/Cargo.toml b/client/tracing/Cargo.toml index 62c7f7a4becca..b8910199c0ee5 100644 --- a/client/tracing/Cargo.toml +++ b/client/tracing/Cargo.toml @@ -29,11 +29,11 @@ tracing = "0.1.29" tracing-log = "0.1.2" tracing-subscriber = { version = "0.2.25", features = ["parking_lot"] } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } -sp-rpc = { version = "4.0.0-dev", path = "../../primitives/rpc" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-rpc = { version = "5.0.0", path = "../../primitives/rpc" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sc-client-api = { version = "4.0.0-dev", path = "../api" } sc-tracing-proc-macro = { version = "4.0.0-dev", path = "./proc-macro" } sc-rpc-server = { version = "4.0.0-dev", path = "../rpc-servers" } diff --git a/client/transaction-pool/Cargo.toml b/client/transaction-pool/Cargo.toml index 73ec7cfff7f3d..06fc8298f01c0 100644 --- a/client/transaction-pool/Cargo.toml +++ b/client/transaction-pool/Cargo.toml @@ -23,8 +23,8 @@ parking_lot = "0.11.2" prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.10.0-dev"} sc-client-api = { version = "4.0.0-dev", path = "../api" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } sp-transaction-pool = { version = "4.0.0-dev", path = "../../primitives/transaction-pool" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "./api" } diff --git a/client/transaction-pool/api/Cargo.toml b/client/transaction-pool/api/Cargo.toml index a544248a4f2cc..9d7e6ea5e0f83 100644 --- a/client/transaction-pool/api/Cargo.toml +++ b/client/transaction-pool/api/Cargo.toml @@ -14,5 +14,5 @@ log = "0.4.8" serde = { version = "1.0.132", features = ["derive"] } thiserror = "1.0.30" -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } diff --git a/client/transaction-pool/api/src/lib.rs b/client/transaction-pool/api/src/lib.rs index f19a994b1b947..757674a03e850 100644 --- a/client/transaction-pool/api/src/lib.rs +++ b/client/transaction-pool/api/src/lib.rs @@ -278,7 +278,7 @@ impl ReadyTransactions for std::iter::Empty { /// Events that the transaction pool listens for. pub enum ChainEvent { - /// New best block have been added to the chain + /// New best block have been added to the chain. NewBestBlock { /// Hash of the block. hash: B::Hash, @@ -289,8 +289,10 @@ pub enum ChainEvent { }, /// An existing block has been finalized. Finalized { - /// Hash of just finalized block + /// Hash of just finalized block. hash: B::Hash, + /// Path from old finalized to new finalized parent. + tree_route: Arc>, }, } diff --git a/client/transaction-pool/src/lib.rs b/client/transaction-pool/src/lib.rs index b5af2d12d65c9..260d938217ad4 100644 --- a/client/transaction-pool/src/lib.rs +++ b/client/transaction-pool/src/lib.rs @@ -709,15 +709,17 @@ where } .boxed() }, - ChainEvent::Finalized { hash } => { + ChainEvent::Finalized { hash, tree_route } => { let pool = self.pool.clone(); async move { - if let Err(e) = pool.validated_pool().on_block_finalized(hash).await { - log::warn!( - target: "txpool", - "Error [{}] occurred while attempting to notify watchers of finalization {}", - e, hash - ) + for hash in tree_route.iter().chain(&[hash]) { + if let Err(e) = pool.validated_pool().on_block_finalized(*hash).await { + log::warn!( + target: "txpool", + "Error [{}] occurred while attempting to notify watchers of finalization {}", + e, hash + ) + } } } .boxed() diff --git a/client/transaction-pool/tests/pool.rs b/client/transaction-pool/tests/pool.rs index 4aeaf79a61540..21a87f6e006ec 100644 --- a/client/transaction-pool/tests/pool.rs +++ b/client/transaction-pool/tests/pool.rs @@ -387,7 +387,7 @@ fn should_push_watchers_during_maintenance() { let header_hash = header.hash(); block_on(pool.maintain(block_event(header))); - let event = ChainEvent::Finalized { hash: header_hash.clone() }; + let event = ChainEvent::Finalized { hash: header_hash.clone(), tree_route: Arc::new(vec![]) }; block_on(pool.maintain(event)); // then @@ -445,7 +445,7 @@ fn finalization() { let event = ChainEvent::NewBestBlock { hash: header.hash(), tree_route: None }; block_on(pool.maintain(event)); - let event = ChainEvent::Finalized { hash: header.hash() }; + let event = ChainEvent::Finalized { hash: header.hash(), tree_route: Arc::new(vec![]) }; block_on(pool.maintain(event)); let mut stream = futures::executor::block_on_stream(watcher); @@ -493,7 +493,7 @@ fn fork_aware_finalization() { b1 = header.hash(); block_on(pool.maintain(event)); assert_eq!(pool.status().ready, 0); - let event = ChainEvent::Finalized { hash: b1 }; + let event = ChainEvent::Finalized { hash: b1, tree_route: Arc::new(vec![]) }; block_on(pool.maintain(event)); } @@ -537,7 +537,7 @@ fn fork_aware_finalization() { block_on(pool.maintain(event)); assert_eq!(pool.status().ready, 2); - let event = ChainEvent::Finalized { hash: header.hash() }; + let event = ChainEvent::Finalized { hash: header.hash(), tree_route: Arc::new(vec![]) }; block_on(pool.maintain(event)); } @@ -554,7 +554,7 @@ fn fork_aware_finalization() { d1 = header.hash(); block_on(pool.maintain(event)); assert_eq!(pool.status().ready, 2); - let event = ChainEvent::Finalized { hash: d1 }; + let event = ChainEvent::Finalized { hash: d1, tree_route: Arc::new(vec![]) }; block_on(pool.maintain(event)); } @@ -567,7 +567,7 @@ fn fork_aware_finalization() { let event = ChainEvent::NewBestBlock { hash: header.hash(), tree_route: None }; block_on(pool.maintain(event)); assert_eq!(pool.status().ready, 0); - block_on(pool.maintain(ChainEvent::Finalized { hash: e1 })); + block_on(pool.maintain(ChainEvent::Finalized { hash: e1, tree_route: Arc::new(vec![]) })); } for (canon_watcher, h) in canon_watchers { @@ -637,7 +637,7 @@ fn prune_and_retract_tx_at_same_time() { block_on(pool.maintain(event)); assert_eq!(pool.status().ready, 0); - let event = ChainEvent::Finalized { hash: header.hash() }; + let event = ChainEvent::Finalized { hash: header.hash(), tree_route: Arc::new(vec![]) }; block_on(pool.maintain(event)); header.hash() diff --git a/frame/assets/Cargo.toml b/frame/assets/Cargo.toml index c250a75d4c2f0..c5d60291fc435 100644 --- a/frame/assets/Cargo.toml +++ b/frame/assets/Cargo.toml @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } # Needed for various traits. In our case, `OnFinalize`. -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } # Needed for type-safe access to storage DB. frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } # `system` module provides us with all sorts of useful stuff and macros depend on it being around. @@ -25,9 +25,9 @@ frame-system = { version = "4.0.0-dev", default-features = false, path = "../sys frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-std = { version = "4.0.0", path = "../../primitives/std" } -sp-io = { version = "4.0.0", path = "../../primitives/io" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/assets/src/weights.rs b/frame/assets/src/weights.rs index fb6e68dfc772f..a1cd77faee82e 100644 --- a/frame/assets/src/weights.rs +++ b/frame/assets/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_assets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/assets/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -76,13 +76,13 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Assets Asset (r:1 w:1) fn create() -> Weight { - (22_050_000 as Weight) + (22_102_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn force_create() -> Weight { - (11_673_000 as Weight) + (12_124_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -93,12 +93,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Assets Approvals (r:501 w:500) fn destroy(c: u32, s: u32, a: u32, ) -> Weight { (0 as Weight) - // Standard Error: 36_000 - .saturating_add((14_657_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 36_000 - .saturating_add((17_018_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 362_000 - .saturating_add((16_620_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 34_000 + .saturating_add((14_683_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 34_000 + .saturating_add((17_080_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 342_000 + .saturating_add((16_533_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) @@ -111,14 +111,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn mint() -> Weight { - (26_254_000 as Weight) + (26_632_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn burn() -> Weight { - (30_407_000 as Weight) + (30_048_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -126,7 +126,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (44_220_000 as Weight) + (44_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -134,7 +134,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (36_910_000 as Weight) + (37_286_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -142,93 +142,95 @@ impl WeightInfo for SubstrateWeight { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (44_330_000 as Weight) + (44_120_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn freeze() -> Weight { - (17_937_000 as Weight) + (18_309_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn thaw() -> Weight { - (18_224_000 as Weight) + (18_290_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn freeze_asset() -> Weight { - (14_875_000 as Weight) + (14_744_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn thaw_asset() -> Weight { - (14_792_000 as Weight) + (14_833_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Metadata (r:1 w:0) fn transfer_ownership() -> Weight { - (15_794_000 as Weight) + (16_654_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn set_team() -> Weight { - (14_702_000 as Weight) + (15_351_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn set_metadata(n: u32, s: u32, ) -> Weight { - (27_368_000 as Weight) + (27_588_000 as Weight) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((6_000 as Weight).saturating_mul(n as Weight)) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn clear_metadata() -> Weight { - (28_222_000 as Weight) + (27_710_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) - fn force_set_metadata(_n: u32, s: u32, ) -> Weight { - (15_139_000 as Weight) + fn force_set_metadata(n: u32, s: u32, ) -> Weight { + (15_345_000 as Weight) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn force_clear_metadata() -> Weight { - (28_065_000 as Weight) + (27_552_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn force_asset_status() -> Weight { - (13_808_000 as Weight) + (13_755_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn approve_transfer() -> Weight { - (31_261_000 as Weight) + (30_831_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -237,21 +239,21 @@ impl WeightInfo for SubstrateWeight { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_approved() -> Weight { - (56_329_000 as Weight) + (56_267_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn cancel_approval() -> Weight { - (32_086_000 as Weight) + (31_964_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn force_cancel_approval() -> Weight { - (32_502_000 as Weight) + (31_806_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -261,13 +263,13 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Assets Asset (r:1 w:1) fn create() -> Weight { - (22_050_000 as Weight) + (22_102_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn force_create() -> Weight { - (11_673_000 as Weight) + (12_124_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -278,12 +280,12 @@ impl WeightInfo for () { // Storage: Assets Approvals (r:501 w:500) fn destroy(c: u32, s: u32, a: u32, ) -> Weight { (0 as Weight) - // Standard Error: 36_000 - .saturating_add((14_657_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 36_000 - .saturating_add((17_018_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 362_000 - .saturating_add((16_620_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 34_000 + .saturating_add((14_683_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 34_000 + .saturating_add((17_080_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 342_000 + .saturating_add((16_533_000 as Weight).saturating_mul(a as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) @@ -296,14 +298,14 @@ impl WeightInfo for () { // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn mint() -> Weight { - (26_254_000 as Weight) + (26_632_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Account (r:1 w:1) fn burn() -> Weight { - (30_407_000 as Weight) + (30_048_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -311,7 +313,7 @@ impl WeightInfo for () { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (44_220_000 as Weight) + (44_000_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -319,7 +321,7 @@ impl WeightInfo for () { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (36_910_000 as Weight) + (37_286_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -327,93 +329,95 @@ impl WeightInfo for () { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (44_330_000 as Weight) + (44_120_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn freeze() -> Weight { - (17_937_000 as Weight) + (18_309_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Account (r:1 w:1) fn thaw() -> Weight { - (18_224_000 as Weight) + (18_290_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn freeze_asset() -> Weight { - (14_875_000 as Weight) + (14_744_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn thaw_asset() -> Weight { - (14_792_000 as Weight) + (14_833_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Metadata (r:1 w:0) fn transfer_ownership() -> Weight { - (15_794_000 as Weight) + (16_654_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn set_team() -> Weight { - (14_702_000 as Weight) + (15_351_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn set_metadata(n: u32, s: u32, ) -> Weight { - (27_368_000 as Weight) + (27_588_000 as Weight) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((6_000 as Weight).saturating_mul(n as Weight)) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn clear_metadata() -> Weight { - (28_222_000 as Weight) + (27_710_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) - fn force_set_metadata(_n: u32, s: u32, ) -> Weight { - (15_139_000 as Weight) + fn force_set_metadata(n: u32, s: u32, ) -> Weight { + (15_345_000 as Weight) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:0) // Storage: Assets Metadata (r:1 w:1) fn force_clear_metadata() -> Weight { - (28_065_000 as Weight) + (27_552_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) fn force_asset_status() -> Weight { - (13_808_000 as Weight) + (13_755_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn approve_transfer() -> Weight { - (31_261_000 as Weight) + (30_831_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -422,21 +426,21 @@ impl WeightInfo for () { // Storage: Assets Account (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_approved() -> Weight { - (56_329_000 as Weight) + (56_267_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn cancel_approval() -> Weight { - (32_086_000 as Weight) + (31_964_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Assets Asset (r:1 w:1) // Storage: Assets Approvals (r:1 w:1) fn force_cancel_approval() -> Weight { - (32_502_000 as Weight) + (31_806_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/frame/atomic-swap/Cargo.toml b/frame/atomic-swap/Cargo.toml index 0f478ab5602f9..1dcd6154d0beb 100644 --- a/frame/atomic-swap/Cargo.toml +++ b/frame/atomic-swap/Cargo.toml @@ -17,10 +17,10 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", path = "../balances" } diff --git a/frame/aura/Cargo.toml b/frame/aura/Cargo.toml index f5c71a3088585..f869ddb417029 100644 --- a/frame/aura/Cargo.toml +++ b/frame/aura/Cargo.toml @@ -13,19 +13,19 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } sp-consensus-aura = { version = "0.10.0-dev", path = "../../primitives/consensus/aura", default-features = false } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-timestamp = { version = "4.0.0-dev", default-features = false, path = "../timestamp" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } [features] default = ["std"] diff --git a/frame/authority-discovery/Cargo.toml b/frame/authority-discovery/Cargo.toml index c1233028df4e2..b6e8a400f8652 100644 --- a/frame/authority-discovery/Cargo.toml +++ b/frame/authority-discovery/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-authority-discovery = { version = "4.0.0-dev", default-features = false, path = "../../primitives/authority-discovery" } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive", ] } @@ -23,13 +23,13 @@ sp-std = { version = "4.0.0", default-features = false, path = "../../primitives pallet-session = { version = "4.0.0-dev", features = [ "historical", ], path = "../session", default-features = false } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } [features] default = ["std"] diff --git a/frame/authorship/Cargo.toml b/frame/authorship/Cargo.toml index c17fc49ecdcc1..31daa74553c23 100644 --- a/frame/authorship/Cargo.toml +++ b/frame/authorship/Cargo.toml @@ -19,14 +19,14 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-authorship = { version = "4.0.0-dev", default-features = false, path = "../../primitives/authorship" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } impl-trait-for-tuples = "0.2.1" [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } [features] default = ["std"] diff --git a/frame/babe/Cargo.toml b/frame/babe/Cargo.toml index 673af5c30ed6d..f48877746b888 100644 --- a/frame/babe/Cargo.toml +++ b/frame/babe/Cargo.toml @@ -21,11 +21,11 @@ frame-system = { version = "4.0.0-dev", default-features = false, path = "../sys pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } pallet-session = { version = "4.0.0-dev", default-features = false, path = "../session" } pallet-timestamp = { version = "4.0.0-dev", default-features = false, path = "../timestamp" } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } sp-consensus-babe = { version = "0.10.0-dev", default-features = false, path = "../../primitives/consensus/babe" } sp-consensus-vrf = { version = "0.10.0-dev", default-features = false, path = "../../primitives/consensus/vrf" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } @@ -36,7 +36,7 @@ pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-offences = { version = "4.0.0-dev", path = "../offences" } pallet-staking = { version = "4.0.0-dev", path = "../staking" } pallet-staking-reward-curve = { version = "4.0.0-dev", path = "../staking/reward-curve" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } frame-election-provider-support = { version = "4.0.0-dev", path = "../election-provider-support" } [features] diff --git a/frame/bags-list/Cargo.toml b/frame/bags-list/Cargo.toml index 9e802527f18d4..c35ff6fc6c39d 100644 --- a/frame/bags-list/Cargo.toml +++ b/frame/bags-list/Cargo.toml @@ -18,7 +18,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } # primitives -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } # FRAME @@ -32,13 +32,13 @@ log = { version = "0.4.14", default-features = false } # Optional imports for benchmarking frame-benchmarking = { version = "4.0.0-dev", path = "../benchmarking", optional = true, default-features = false } pallet-balances = { version = "4.0.0-dev", path = "../balances", optional = true, default-features = false } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", optional = true, default-features = false } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io", optional = true, default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", optional = true, default-features = false } +sp-io = { version = "5.0.0", path = "../../primitives/io", optional = true, default-features = false } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing", optional = true, default-features = false } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core"} -sp-io = { version = "4.0.0-dev", path = "../../primitives/io"} +sp-core = { version = "5.0.0", path = "../../primitives/core"} +sp-io = { version = "5.0.0", path = "../../primitives/io"} sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } frame-election-provider-support = { version = "4.0.0-dev", path = "../election-provider-support", features = ["runtime-benchmarks"] } diff --git a/frame/bags-list/remote-tests/Cargo.toml b/frame/bags-list/remote-tests/Cargo.toml index b5122ebbafe76..8f3ce53f8ebb3 100644 --- a/frame/bags-list/remote-tests/Cargo.toml +++ b/frame/bags-list/remote-tests/Cargo.toml @@ -21,10 +21,10 @@ frame-system = { path = "../../system", version = "4.0.0-dev" } frame-support = { path = "../../support", version = "4.0.0-dev" } # core -sp-storage = { path = "../../../primitives/storage", version = "4.0.0" } -sp-core = { path = "../../../primitives/core", version = "4.1.0-dev" } +sp-storage = { path = "../../../primitives/storage", version = "5.0.0"} +sp-core = { path = "../../../primitives/core", version = "5.0.0"} sp-tracing = { path = "../../../primitives/tracing", version = "4.0.0" } -sp-runtime = { path = "../../../primitives/runtime", version = "4.1.0-dev" } +sp-runtime = { path = "../../../primitives/runtime", version = "5.0.0"} sp-std = { path = "../../../primitives/std", version = "4.0.0" } # utils diff --git a/frame/bags-list/src/weights.rs b/frame/bags-list/src/weights.rs index 6cd9449b42862..f35c0aaee6d6a 100644 --- a/frame/bags-list/src/weights.rs +++ b/frame/bags-list/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_bags_list //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/bags-list/src//weights.rs +// --output=./frame/bags-list/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -59,7 +59,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:4 w:4) // Storage: BagsList ListBags (r:1 w:1) fn rebag_non_terminal() -> Weight { - (50_222_000 as Weight) + (46_965_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -68,7 +68,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn rebag_terminal() -> Weight { - (47_975_000 as Weight) + (45_952_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -78,7 +78,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: BagsList ListBags (r:1 w:1) fn put_in_front_of() -> Weight { - (55_539_000 as Weight) + (52_928_000 as Weight) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -91,7 +91,7 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:4 w:4) // Storage: BagsList ListBags (r:1 w:1) fn rebag_non_terminal() -> Weight { - (50_222_000 as Weight) + (46_965_000 as Weight) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -100,7 +100,7 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn rebag_terminal() -> Weight { - (47_975_000 as Weight) + (45_952_000 as Weight) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -110,7 +110,7 @@ impl WeightInfo for () { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: BagsList ListBags (r:1 w:1) fn put_in_front_of() -> Weight { - (55_539_000 as Weight) + (52_928_000 as Weight) .saturating_add(RocksDbWeight::get().reads(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } diff --git a/frame/balances/Cargo.toml b/frame/balances/Cargo.toml index 02b94fe606c49..f594e67ab861d 100644 --- a/frame/balances/Cargo.toml +++ b/frame/balances/Cargo.toml @@ -16,15 +16,15 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } log = { version = "0.4.14", default-features = false } [dev-dependencies] -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-transaction-payment = { version = "4.0.0-dev", path = "../transaction-payment" } [features] diff --git a/frame/balances/src/weights.rs b/frame/balances/src/weights.rs index f34dd65191e4a..435438055b333 100644 --- a/frame/balances/src/weights.rs +++ b/frame/balances/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/balances/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -60,43 +60,43 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (34_668_000 as Weight) + (34_200_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (26_826_000 as Weight) + (27_263_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (17_292_000 as Weight) + (17_425_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (19_988_000 as Weight) + (19_979_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (34_646_000 as Weight) + (34_783_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (32_040_000 as Weight) + (31_620_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (15_743_000 as Weight) + (15_750_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -106,43 +106,43 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (34_668_000 as Weight) + (34_200_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (26_826_000 as Weight) + (27_263_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (17_292_000 as Weight) + (17_425_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (19_988_000 as Weight) + (19_979_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (34_646_000 as Weight) + (34_783_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (32_040_000 as Weight) + (31_620_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (15_743_000 as Weight) + (15_750_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/beefy-mmr/Cargo.toml b/frame/beefy-mmr/Cargo.toml index c793173cc22d8..cfd18b26f9c7a 100644 --- a/frame/beefy-mmr/Cargo.toml +++ b/frame/beefy-mmr/Cargo.toml @@ -21,9 +21,9 @@ pallet-mmr = { version = "4.0.0-dev", path = "../merkle-mountain-range", default pallet-mmr-primitives = { version = "4.0.0-dev", path = "../merkle-mountain-range/primitives", default-features = false } pallet-session = { version = "4.0.0-dev", path = "../session", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io", default-features = false } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime", default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } +sp-io = { version = "5.0.0", path = "../../primitives/io", default-features = false } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime", default-features = false } sp-std = { version = "4.0.0", path = "../../primitives/std", default-features = false } beefy-merkle-tree = { version = "4.0.0-dev", path = "./primitives", default-features = false } diff --git a/frame/beefy/Cargo.toml b/frame/beefy/Cargo.toml index 52471a332dd76..13ccfb938010e 100644 --- a/frame/beefy/Cargo.toml +++ b/frame/beefy/Cargo.toml @@ -15,7 +15,7 @@ serde = { version = "1.0.132", optional = true } frame-support = { version = "4.0.0-dev", path = "../support", default-features = false } frame-system = { version = "4.0.0-dev", path = "../system", default-features = false } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime", default-features = false } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime", default-features = false } sp-std = { version = "4.0.0", path = "../../primitives/std", default-features = false } pallet-session = { version = "4.0.0-dev", path = "../session", default-features = false } @@ -23,8 +23,8 @@ pallet-session = { version = "4.0.0-dev", path = "../session", default-features beefy-primitives = { version = "4.0.0-dev", path = "../../primitives/beefy", default-features = false } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } sp-staking = { version = "4.0.0-dev", path = "../../primitives/staking" } [features] diff --git a/frame/benchmarking/Cargo.toml b/frame/benchmarking/Cargo.toml index ce110d8ba511f..0283b3f7c9489 100644 --- a/frame/benchmarking/Cargo.toml +++ b/frame/benchmarking/Cargo.toml @@ -18,25 +18,27 @@ paste = "1.0" codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", path = "../../primitives/api", default-features = false } -sp-runtime-interface = { version = "4.1.0-dev", path = "../../primitives/runtime-interface", default-features = false } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime", default-features = false } +sp-runtime-interface = { version = "5.0.0", path = "../../primitives/runtime-interface", default-features = false } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime", default-features = false } sp-std = { version = "4.0.0", path = "../../primitives/std", default-features = false } -sp-io = { version = "4.0.0", path = "../../primitives/io", default-features = false } -sp-application-crypto = { version = "4.0.0", path = "../../primitives/application-crypto", default-features = false } -sp-storage = { version = "4.0.0", path = "../../primitives/storage", default-features = false } +sp-io = { version = "5.0.0", path = "../../primitives/io", default-features = false } +sp-application-crypto = { version = "5.0.0", path = "../../primitives/application-crypto", default-features = false } +sp-storage = { version = "5.0.0", path = "../../primitives/storage", default-features = false } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } log = { version = "0.4.14", default-features = false } +serde = { version = "1.0.132", optional = true } [dev-dependencies] hex-literal = "0.3.4" -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } [features] default = ["std"] std = [ "codec/std", "scale-info/std", + "serde", "sp-runtime-interface/std", "sp-runtime/std", "sp-api/std", diff --git a/frame/benchmarking/src/utils.rs b/frame/benchmarking/src/utils.rs index bb0b8d36a752e..8c642f74358db 100644 --- a/frame/benchmarking/src/utils.rs +++ b/frame/benchmarking/src/utils.rs @@ -22,12 +22,15 @@ use frame_support::{ pallet_prelude::*, traits::StorageInfo, }; +#[cfg(feature = "std")] +use serde::Serialize; use sp_io::hashing::blake2_256; use sp_runtime::traits::TrailingZeroInput; use sp_std::{prelude::Box, vec::Vec}; use sp_storage::TrackedStorageKey; /// An alphabet of possible parameters to use for benchmarking. +#[cfg_attr(feature = "std", derive(Serialize))] #[derive(Encode, Decode, Clone, Copy, PartialEq, Debug)] #[allow(missing_docs)] #[allow(non_camel_case_types)] @@ -68,13 +71,17 @@ impl std::fmt::Display for BenchmarkParameter { } /// The results of a single of benchmark. +#[cfg_attr(feature = "std", derive(Serialize))] #[derive(Encode, Decode, Clone, PartialEq, Debug)] pub struct BenchmarkBatch { /// The pallet containing this benchmark. + #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub pallet: Vec, /// The instance of this pallet being benchmarked. + #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub instance: Vec, /// The extrinsic (or benchmark name) of this benchmark. + #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub benchmark: Vec, /// The results from this benchmark. pub results: Vec, @@ -82,13 +89,17 @@ pub struct BenchmarkBatch { // TODO: could probably make API cleaner here. /// The results of a single of benchmark, where time and db results are separated. +#[cfg_attr(feature = "std", derive(Serialize))] #[derive(Encode, Decode, Clone, PartialEq, Debug)] pub struct BenchmarkBatchSplitResults { /// The pallet containing this benchmark. + #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub pallet: Vec, /// The instance of this pallet being benchmarked. + #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub instance: Vec, /// The extrinsic (or benchmark name) of this benchmark. + #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub benchmark: Vec, /// The extrinsic timing results from this benchmark. pub time_results: Vec, @@ -99,6 +110,7 @@ pub struct BenchmarkBatchSplitResults { /// Result from running benchmarks on a FRAME pallet. /// Contains duration of the function call in nanoseconds along with the benchmark parameters /// used for that benchmark result. +#[cfg_attr(feature = "std", derive(Serialize))] #[derive(Encode, Decode, Default, Clone, PartialEq, Debug)] pub struct BenchmarkResult { pub components: Vec<(BenchmarkParameter, u32)>, @@ -109,6 +121,7 @@ pub struct BenchmarkResult { pub writes: u32, pub repeat_writes: u32, pub proof_size: u32, + #[cfg_attr(feature = "std", serde(skip_serializing))] pub keys: Vec<(Vec, u32, u32, bool)>, } @@ -118,6 +131,18 @@ impl BenchmarkResult { } } +/// Helper module to make serde serialize `Vec` as strings. +#[cfg(feature = "std")] +mod serde_as_str { + pub fn serialize(value: &Vec, serializer: S) -> Result + where + S: serde::Serializer, + { + let s = std::str::from_utf8(value).map_err(serde::ser::Error::custom)?; + serializer.collect_str(s) + } +} + /// Possible errors returned from the benchmarking pipeline. #[derive(Clone, PartialEq, Debug)] pub enum BenchmarkError { diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 2945daeaf3128..a49204fbf0b90 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for frame_benchmarking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/benchmarking/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -60,37 +60,37 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (141_000 as Weight) + (106_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (136_000 as Weight) + (111_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (136_000 as Weight) + (119_000 as Weight) } fn division(_i: u32, ) -> Weight { - (134_000 as Weight) + (111_000 as Weight) } fn hashing(_i: u32, ) -> Weight { - (21_681_881_000 as Weight) + (21_203_386_000 as Weight) } fn sr25519_verification(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 6_000 - .saturating_add((42_000_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((47_077_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 3_000 - .saturating_add((1_984_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((1_963_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((363_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((364_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -98,37 +98,37 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (141_000 as Weight) + (106_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (136_000 as Weight) + (111_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (136_000 as Weight) + (119_000 as Weight) } fn division(_i: u32, ) -> Weight { - (134_000 as Weight) + (111_000 as Weight) } fn hashing(_i: u32, ) -> Weight { - (21_681_881_000 as Weight) + (21_203_386_000 as Weight) } fn sr25519_verification(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 6_000 - .saturating_add((42_000_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((47_077_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 3_000 - .saturating_add((1_984_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((1_963_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((363_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((364_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } diff --git a/frame/bounties/Cargo.toml b/frame/bounties/Cargo.toml index 73973ab18caaa..477815a306f3c 100644 --- a/frame/bounties/Cargo.toml +++ b/frame/bounties/Cargo.toml @@ -18,12 +18,12 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-treasury = { version = "4.0.0-dev", default-features = false, path = "../treasury" } -sp-io = { version = "4.0.0", path = "../../primitives/io", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } +sp-io = { version = "5.0.0", path = "../../primitives/io", default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } log = { version = "0.4.14", default-features = false } diff --git a/frame/bounties/src/weights.rs b/frame/bounties/src/weights.rs index 9c1ce532dff73..405e11acea5aa 100644 --- a/frame/bounties/src/weights.rs +++ b/frame/bounties/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/bounties/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -67,43 +67,43 @@ impl WeightInfo for SubstrateWeight { // Storage: Bounties BountyDescriptions (r:0 w:1) // Storage: Bounties Bounties (r:0 w:1) fn propose_bounty(d: u32, ) -> Weight { - (23_165_000 as Weight) + (23_620_000 as Weight) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(d as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) fn approve_bounty() -> Weight { - (6_876_000 as Weight) + (6_655_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) fn propose_curator() -> Weight { - (5_718_000 as Weight) + (5_720_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - (27_021_000 as Weight) + (26_958_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - (20_933_000 as Weight) + (21_457_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: ChildBounties ParentChildBounties (r:1 w:0) fn award_bounty() -> Weight { - (17_285_000 as Weight) + (17_483_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -112,7 +112,7 @@ impl WeightInfo for SubstrateWeight { // Storage: ChildBounties ChildrenCuratorFees (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn claim_bounty() -> Weight { - (61_264_000 as Weight) + (61_763_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -121,7 +121,7 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_proposed() -> Weight { - (28_218_000 as Weight) + (28_862_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -130,13 +130,13 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:2 w:2) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_active() -> Weight { - (45_577_000 as Weight) + (45_129_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) fn extend_bounty_expiry() -> Weight { - (14_983_000 as Weight) + (15_169_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -146,7 +146,7 @@ impl WeightInfo for SubstrateWeight { fn spend_funds(b: u32, ) -> Weight { (0 as Weight) // Standard Error: 14_000 - .saturating_add((28_380_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((28_850_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -161,43 +161,43 @@ impl WeightInfo for () { // Storage: Bounties BountyDescriptions (r:0 w:1) // Storage: Bounties Bounties (r:0 w:1) fn propose_bounty(d: u32, ) -> Weight { - (23_165_000 as Weight) + (23_620_000 as Weight) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(d as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(d as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) fn approve_bounty() -> Weight { - (6_876_000 as Weight) + (6_655_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) fn propose_curator() -> Weight { - (5_718_000 as Weight) + (5_720_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - (27_021_000 as Weight) + (26_958_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - (20_933_000 as Weight) + (21_457_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: ChildBounties ParentChildBounties (r:1 w:0) fn award_bounty() -> Weight { - (17_285_000 as Weight) + (17_483_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -206,7 +206,7 @@ impl WeightInfo for () { // Storage: ChildBounties ChildrenCuratorFees (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn claim_bounty() -> Weight { - (61_264_000 as Weight) + (61_763_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -215,7 +215,7 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_proposed() -> Weight { - (28_218_000 as Weight) + (28_862_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -224,13 +224,13 @@ impl WeightInfo for () { // Storage: System Account (r:2 w:2) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_active() -> Weight { - (45_577_000 as Weight) + (45_129_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Bounties Bounties (r:1 w:1) fn extend_bounty_expiry() -> Weight { - (14_983_000 as Weight) + (15_169_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -240,7 +240,7 @@ impl WeightInfo for () { fn spend_funds(b: u32, ) -> Weight { (0 as Weight) // Standard Error: 14_000 - .saturating_add((28_380_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((28_850_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) diff --git a/frame/child-bounties/Cargo.toml b/frame/child-bounties/Cargo.toml index 742110a58bff7..0eeefd4de4595 100644 --- a/frame/child-bounties/Cargo.toml +++ b/frame/child-bounties/Cargo.toml @@ -18,13 +18,13 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-treasury = { version = "4.0.0-dev", default-features = false, path = "../treasury" } pallet-bounties = { version = "4.0.0-dev", default-features = false, path = "../bounties" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } +sp-io = { version = "5.0.0", path = "../../primitives/io", default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } log = { version = "0.4.14", default-features = false } diff --git a/frame/child-bounties/src/weights.rs b/frame/child-bounties/src/weights.rs index 73bc535cb300e..002388810b8a0 100644 --- a/frame/child-bounties/src/weights.rs +++ b/frame/child-bounties/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_child_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/child-bounties/src//weights.rs +// --output=./frame/child-bounties/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -65,8 +65,10 @@ impl WeightInfo for SubstrateWeight { // Storage: ChildBounties ChildBountyCount (r:1 w:1) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) // Storage: ChildBounties ChildBounties (r:0 w:1) - fn add_child_bounty(_d: u32, ) -> Weight { - (44_997_000 as Weight) + fn add_child_bounty(d: u32, ) -> Weight { + (44_503_000 as Weight) + // Standard Error: 0 + .saturating_add((3_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -74,7 +76,7 @@ impl WeightInfo for SubstrateWeight { // Storage: ChildBounties ChildBounties (r:1 w:1) // Storage: ChildBounties ChildrenCuratorFees (r:1 w:1) fn propose_curator() -> Weight { - (11_848_000 as Weight) + (11_661_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -82,7 +84,7 @@ impl WeightInfo for SubstrateWeight { // Storage: ChildBounties ChildBounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - (24_490_000 as Weight) + (24_162_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -90,14 +92,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Bounties Bounties (r:1 w:0) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - (28_605_000 as Weight) + (27_924_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:0) // Storage: ChildBounties ChildBounties (r:1 w:1) fn award_child_bounty() -> Weight { - (19_471_000 as Weight) + (19_332_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -106,7 +108,7 @@ impl WeightInfo for SubstrateWeight { // Storage: ChildBounties ParentChildBounties (r:1 w:1) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) fn claim_child_bounty() -> Weight { - (60_737_000 as Weight) + (60_363_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -117,7 +119,7 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:2 w:2) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) fn close_child_bounty_added() -> Weight { - (43_120_000 as Weight) + (42_415_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -128,7 +130,7 @@ impl WeightInfo for SubstrateWeight { // Storage: ChildBounties ParentChildBounties (r:1 w:1) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) fn close_child_bounty_active() -> Weight { - (53_610_000 as Weight) + (52_743_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -142,8 +144,10 @@ impl WeightInfo for () { // Storage: ChildBounties ChildBountyCount (r:1 w:1) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) // Storage: ChildBounties ChildBounties (r:0 w:1) - fn add_child_bounty(_d: u32, ) -> Weight { - (44_997_000 as Weight) + fn add_child_bounty(d: u32, ) -> Weight { + (44_503_000 as Weight) + // Standard Error: 0 + .saturating_add((3_000 as Weight).saturating_mul(d as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -151,7 +155,7 @@ impl WeightInfo for () { // Storage: ChildBounties ChildBounties (r:1 w:1) // Storage: ChildBounties ChildrenCuratorFees (r:1 w:1) fn propose_curator() -> Weight { - (11_848_000 as Weight) + (11_661_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -159,7 +163,7 @@ impl WeightInfo for () { // Storage: ChildBounties ChildBounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - (24_490_000 as Weight) + (24_162_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -167,14 +171,14 @@ impl WeightInfo for () { // Storage: Bounties Bounties (r:1 w:0) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - (28_605_000 as Weight) + (27_924_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Bounties Bounties (r:1 w:0) // Storage: ChildBounties ChildBounties (r:1 w:1) fn award_child_bounty() -> Weight { - (19_471_000 as Weight) + (19_332_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -183,7 +187,7 @@ impl WeightInfo for () { // Storage: ChildBounties ParentChildBounties (r:1 w:1) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) fn claim_child_bounty() -> Weight { - (60_737_000 as Weight) + (60_363_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -194,7 +198,7 @@ impl WeightInfo for () { // Storage: System Account (r:2 w:2) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) fn close_child_bounty_added() -> Weight { - (43_120_000 as Weight) + (42_415_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -205,7 +209,7 @@ impl WeightInfo for () { // Storage: ChildBounties ParentChildBounties (r:1 w:1) // Storage: ChildBounties ChildBountyDescriptions (r:0 w:1) fn close_child_bounty_active() -> Weight { - (53_610_000 as Weight) + (52_743_000 as Weight) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } diff --git a/frame/collective/Cargo.toml b/frame/collective/Cargo.toml index bd0573bace666..334b4945afa2b 100644 --- a/frame/collective/Cargo.toml +++ b/frame/collective/Cargo.toml @@ -17,9 +17,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = log = { version = "0.4.14", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } diff --git a/frame/collective/src/weights.rs b/frame/collective/src/weights.rs index a559261fdea0f..1280ced89eeea 100644 --- a/frame/collective/src/weights.rs +++ b/frame/collective/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/collective/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -67,12 +67,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Council Prime (r:0 w:1) fn set_members(m: u32, n: u32, p: u32, ) -> Weight { (0 as Weight) - // Standard Error: 7_000 - .saturating_add((12_933_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 7_000 - .saturating_add((81_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 7_000 - .saturating_add((15_645_000 as Weight).saturating_mul(p as Weight)) + // Standard Error: 10_000 + .saturating_add((14_493_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 10_000 + .saturating_add((23_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 10_000 + .saturating_add((16_909_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -80,21 +80,21 @@ impl WeightInfo for SubstrateWeight { } // Storage: Council Members (r:1 w:0) fn execute(b: u32, m: u32, ) -> Weight { - (12_975_000 as Weight) + (12_790_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 0 - .saturating_add((74_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((73_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Council Members (r:1 w:0) // Storage: Council ProposalOf (r:1 w:0) fn propose_execute(b: u32, m: u32, ) -> Weight { - (15_120_000 as Weight) + (15_087_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 0 - .saturating_add((139_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((135_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) } // Storage: Council Members (r:1 w:0) @@ -103,22 +103,22 @@ impl WeightInfo for SubstrateWeight { // Storage: Council ProposalCount (r:1 w:1) // Storage: Council Voting (r:0 w:1) fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { - (18_343_000 as Weight) + (18_269_000 as Weight) // Standard Error: 0 .saturating_add((8_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 1_000 - .saturating_add((83_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((77_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((211_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((203_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Council Members (r:1 w:0) // Storage: Council Voting (r:1 w:1) fn vote(m: u32, ) -> Weight { - (26_675_000 as Weight) + (26_624_000 as Weight) // Standard Error: 2_000 - .saturating_add((166_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((161_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -127,11 +127,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Council Proposals (r:1 w:1) // Storage: Council ProposalOf (r:0 w:1) fn close_early_disapproved(m: u32, p: u32, ) -> Weight { - (28_535_000 as Weight) + (26_527_000 as Weight) // Standard Error: 1_000 - .saturating_add((123_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((127_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((154_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((155_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -140,13 +140,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Council ProposalOf (r:1 w:1) // Storage: Council Proposals (r:1 w:1) fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { - (27_235_000 as Weight) + (26_352_000 as Weight) // Standard Error: 0 .saturating_add((6_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 1_000 - .saturating_add((158_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((154_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((201_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((203_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -156,11 +156,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Council Proposals (r:1 w:1) // Storage: Council ProposalOf (r:0 w:1) fn close_disapproved(m: u32, p: u32, ) -> Weight { - (29_502_000 as Weight) + (28_638_000 as Weight) // Standard Error: 1_000 - .saturating_add((139_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((133_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((163_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((162_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -170,13 +170,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Council ProposalOf (r:1 w:1) // Storage: Council Proposals (r:1 w:1) fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { - (28_944_000 as Weight) + (29_946_000 as Weight) // Standard Error: 0 .saturating_add((5_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 1_000 - .saturating_add((170_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 1_000 - .saturating_add((208_000 as Weight).saturating_mul(p as Weight)) + // Standard Error: 2_000 + .saturating_add((151_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 2_000 + .saturating_add((201_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -184,9 +184,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Council Voting (r:0 w:1) // Storage: Council ProposalOf (r:0 w:1) fn disapprove_proposal(p: u32, ) -> Weight { - (16_215_000 as Weight) + (15_778_000 as Weight) // Standard Error: 1_000 - .saturating_add((212_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((206_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -200,12 +200,12 @@ impl WeightInfo for () { // Storage: Council Prime (r:0 w:1) fn set_members(m: u32, n: u32, p: u32, ) -> Weight { (0 as Weight) - // Standard Error: 7_000 - .saturating_add((12_933_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 7_000 - .saturating_add((81_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 7_000 - .saturating_add((15_645_000 as Weight).saturating_mul(p as Weight)) + // Standard Error: 10_000 + .saturating_add((14_493_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 10_000 + .saturating_add((23_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 10_000 + .saturating_add((16_909_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(p as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -213,21 +213,21 @@ impl WeightInfo for () { } // Storage: Council Members (r:1 w:0) fn execute(b: u32, m: u32, ) -> Weight { - (12_975_000 as Weight) + (12_790_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 0 - .saturating_add((74_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((73_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } // Storage: Council Members (r:1 w:0) // Storage: Council ProposalOf (r:1 w:0) fn propose_execute(b: u32, m: u32, ) -> Weight { - (15_120_000 as Weight) + (15_087_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 0 - .saturating_add((139_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((135_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) } // Storage: Council Members (r:1 w:0) @@ -236,22 +236,22 @@ impl WeightInfo for () { // Storage: Council ProposalCount (r:1 w:1) // Storage: Council Voting (r:0 w:1) fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { - (18_343_000 as Weight) + (18_269_000 as Weight) // Standard Error: 0 .saturating_add((8_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 1_000 - .saturating_add((83_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((77_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((211_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((203_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Council Members (r:1 w:0) // Storage: Council Voting (r:1 w:1) fn vote(m: u32, ) -> Weight { - (26_675_000 as Weight) + (26_624_000 as Weight) // Standard Error: 2_000 - .saturating_add((166_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((161_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -260,11 +260,11 @@ impl WeightInfo for () { // Storage: Council Proposals (r:1 w:1) // Storage: Council ProposalOf (r:0 w:1) fn close_early_disapproved(m: u32, p: u32, ) -> Weight { - (28_535_000 as Weight) + (26_527_000 as Weight) // Standard Error: 1_000 - .saturating_add((123_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((127_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((154_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((155_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -273,13 +273,13 @@ impl WeightInfo for () { // Storage: Council ProposalOf (r:1 w:1) // Storage: Council Proposals (r:1 w:1) fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { - (27_235_000 as Weight) + (26_352_000 as Weight) // Standard Error: 0 .saturating_add((6_000 as Weight).saturating_mul(b as Weight)) // Standard Error: 1_000 - .saturating_add((158_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((154_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((201_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((203_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -289,11 +289,11 @@ impl WeightInfo for () { // Storage: Council Proposals (r:1 w:1) // Storage: Council ProposalOf (r:0 w:1) fn close_disapproved(m: u32, p: u32, ) -> Weight { - (29_502_000 as Weight) + (28_638_000 as Weight) // Standard Error: 1_000 - .saturating_add((139_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((133_000 as Weight).saturating_mul(m as Weight)) // Standard Error: 1_000 - .saturating_add((163_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((162_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -303,13 +303,13 @@ impl WeightInfo for () { // Storage: Council ProposalOf (r:1 w:1) // Storage: Council Proposals (r:1 w:1) fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { - (28_944_000 as Weight) + (29_946_000 as Weight) // Standard Error: 0 .saturating_add((5_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 1_000 - .saturating_add((170_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 1_000 - .saturating_add((208_000 as Weight).saturating_mul(p as Weight)) + // Standard Error: 2_000 + .saturating_add((151_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 2_000 + .saturating_add((201_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -317,9 +317,9 @@ impl WeightInfo for () { // Storage: Council Voting (r:0 w:1) // Storage: Council ProposalOf (r:0 w:1) fn disapprove_proposal(p: u32, ) -> Weight { - (16_215_000 as Weight) + (15_778_000 as Weight) // Standard Error: 1_000 - .saturating_add((212_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((206_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } diff --git a/frame/contracts/Cargo.toml b/frame/contracts/Cargo.toml index f0d2833c61fd2..f24e393daa2ee 100644 --- a/frame/contracts/Cargo.toml +++ b/frame/contracts/Cargo.toml @@ -36,11 +36,11 @@ rand_pcg = { version = "0.3", optional = true } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -pallet-contracts-primitives = { version = "4.0.0-dev", default-features = false, path = "common" } +pallet-contracts-primitives = { version = "5.0.0", default-features = false, path = "common" } pallet-contracts-proc-macro = { version = "4.0.0-dev", path = "proc-macro" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-sandbox = { version = "0.10.0-dev", default-features = false, path = "../../primitives/sandbox" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } diff --git a/frame/contracts/common/Cargo.toml b/frame/contracts/common/Cargo.toml index 05bfc212e3058..ad934c41a71fc 100644 --- a/frame/contracts/common/Cargo.toml +++ b/frame/contracts/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-contracts-primitives" -version = "4.0.0-dev" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -19,10 +19,10 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"] serde = { version = "1", features = ["derive"], optional = true } # Substrate Dependencies (This crate should not rely on frame) -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core", default-features = false } +sp-core = { version = "5.0.0", path = "../../../primitives/core", default-features = false } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } -sp-rpc = { version = "4.0.0-dev", path = "../../../primitives/rpc", optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-rpc = { version = "5.0.0", path = "../../../primitives/rpc", optional = true } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } [features] default = ["std"] diff --git a/frame/contracts/rpc/Cargo.toml b/frame/contracts/rpc/Cargo.toml index 9a88013c34083..52ca0e6d83454 100644 --- a/frame/contracts/rpc/Cargo.toml +++ b/frame/contracts/rpc/Cargo.toml @@ -20,13 +20,13 @@ jsonrpc-derive = "18.0.0" serde = { version = "1", features = ["derive"] } # Substrate Dependencies -pallet-contracts-primitives = { version = "4.0.0-dev", path = "../common" } +pallet-contracts-primitives = { version = "5.0.0", path = "../common" } pallet-contracts-rpc-runtime-api = { version = "4.0.0-dev", path = "./runtime-api" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-rpc = { version = "4.0.0-dev", path = "../../../primitives/rpc" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-rpc = { version = "5.0.0", path = "../../../primitives/rpc" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } [dev-dependencies] serde_json = "1" diff --git a/frame/contracts/rpc/runtime-api/Cargo.toml b/frame/contracts/rpc/runtime-api/Cargo.toml index bb70d0835d268..8ecdff5175372 100644 --- a/frame/contracts/rpc/runtime-api/Cargo.toml +++ b/frame/contracts/rpc/runtime-api/Cargo.toml @@ -17,9 +17,9 @@ codec = { package = "parity-scale-codec", version = "2", default-features = fals scale-info = { version = "1.0", default-features = false, features = ["derive"] } # Substrate Dependencies -pallet-contracts-primitives = { version = "4.0.0-dev", default-features = false, path = "../../common" } +pallet-contracts-primitives = { version = "5.0.0", default-features = false, path = "../../common" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../../primitives/api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../../../primitives/std" } [features] diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 3537af3d0cf78..83be846465e47 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -270,7 +270,7 @@ benchmarks! { // We cannot let `c` grow to the maximum code size because the code is not allowed // to be larger than the maximum size **after instrumentation**. instantiate_with_code { - let c in 0 .. Perbill::from_percent(50).mul_ceil(T::Schedule::get().limits.code_len / 1024); + let c in 0 .. Perbill::from_percent(49).mul_ceil(T::Schedule::get().limits.code_len) / 1024; let s in 0 .. code::max_pages::() * 64; let salt = vec![42u8; (s * 1024) as usize]; let value = T::Currency::minimum_balance(); diff --git a/frame/contracts/src/storage.rs b/frame/contracts/src/storage.rs index de65059b5b175..51a43a1782425 100644 --- a/frame/contracts/src/storage.rs +++ b/frame/contracts/src/storage.rs @@ -268,7 +268,9 @@ where let mut queue = >::get(); - if let (Some(trie), true) = (queue.get(0), remaining_key_budget > 0) { + while !queue.is_empty() && remaining_key_budget > 0 { + // Cannot panic due to loop condition + let trie = &mut queue[0]; let outcome = child::kill_storage(&child_trie_info(&trie.trie_id), Some(remaining_key_budget)); let keys_removed = match outcome { @@ -276,7 +278,7 @@ where KillStorageResult::SomeRemaining(count) => count, KillStorageResult::AllRemoved(count) => { // We do not care to preserve order. The contract is deleted already and - // noone waits for the trie to be deleted. + // no one waits for the trie to be deleted. queue.swap_remove(0); count }, diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index 3d39bc6d78d93..d95d434e6a743 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -1513,6 +1513,59 @@ fn lazy_removal_works() { }); } +#[test] +fn lazy_batch_removal_works() { + let (code, hash) = compile_module::("self_destruct").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let min_balance = ::Currency::minimum_balance(); + let _ = Balances::deposit_creating(&ALICE, 1000 * min_balance); + let mut tries: Vec = vec![]; + + for i in 0..3u8 { + assert_ok!(Contracts::instantiate_with_code( + Origin::signed(ALICE), + min_balance * 100, + GAS_LIMIT, + None, + code.clone(), + vec![], + vec![i], + ),); + + let addr = Contracts::contract_address(&ALICE, &hash, &[i]); + let info = >::get(&addr).unwrap(); + let trie = &info.child_trie_info(); + + // Put value into the contracts child trie + child::put(trie, &[99], &42); + + // Terminate the contract. Contract info should be gone, but value should be still there + // as the lazy removal did not run, yet. + assert_ok!(Contracts::call( + Origin::signed(ALICE), + addr.clone(), + 0, + GAS_LIMIT, + None, + vec![] + )); + + assert!(!>::contains_key(&addr)); + assert_matches!(child::get(trie, &[99]), Some(42)); + + tries.push(trie.clone()) + } + + // Run single lazy removal + Contracts::on_initialize(Weight::max_value()); + + // The single lazy removal should have removed all queued tries + for trie in tries.iter() { + assert_matches!(child::get::(trie, &[99]), None); + } + }); +} + #[test] fn lazy_removal_partial_remove_works() { let (code, hash) = compile_module::("self_destruct").unwrap(); @@ -2196,7 +2249,7 @@ fn upload_code_works() { phase: Phase::Initialization, event: Event::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 180, + amount: 240, }), topics: vec![], }, @@ -2275,7 +2328,7 @@ fn remove_code_works() { phase: Phase::Initialization, event: Event::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 180, + amount: 240, }), topics: vec![], }, @@ -2288,7 +2341,7 @@ fn remove_code_works() { phase: Phase::Initialization, event: Event::Balances(pallet_balances::Event::Unreserved { who: ALICE, - amount: 180, + amount: 240, }), topics: vec![], }, @@ -2330,7 +2383,7 @@ fn remove_code_wrong_origin() { phase: Phase::Initialization, event: Event::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 180, + amount: 240, }), topics: vec![], }, @@ -2461,7 +2514,7 @@ fn instantiate_with_zero_balance_works() { phase: Phase::Initialization, event: Event::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 180, + amount: 240, }), topics: vec![], }, @@ -2561,7 +2614,7 @@ fn instantiate_with_below_existential_deposit_works() { phase: Phase::Initialization, event: Event::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 180, + amount: 240, }), topics: vec![], }, diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index 2d74df9627db9..24a42cc10649a 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_contracts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -156,32 +156,32 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize() -> Weight { - (1_636_000 as Weight) + (1_642_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn on_initialize_per_trie_key(k: u32, ) -> Weight { - (7_840_000 as Weight) + (7_854_000 as Weight) // Standard Error: 0 - .saturating_add((752_000 as Weight).saturating_mul(k as Weight)) + .saturating_add((742_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) } // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize_per_queue_item(q: u32, ) -> Weight { - (31_915_000 as Weight) - // Standard Error: 1_000 - .saturating_add((98_000 as Weight).saturating_mul(q as Weight)) + (0 as Weight) + // Standard Error: 6_000 + .saturating_add((2_216_000 as Weight).saturating_mul(q as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Contracts PristineCode (r:1 w:0) // Storage: Contracts CodeStorage (r:0 w:1) fn reinstrument(c: u32, ) -> Weight { - (18_897_000 as Weight) - // Standard Error: 32_000 - .saturating_add((69_663_000 as Weight).saturating_mul(c as Weight)) + (17_413_000 as Weight) + // Standard Error: 39_000 + .saturating_add((64_495_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -190,9 +190,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call_with_code_kb(c: u32, ) -> Weight { - (204_947_000 as Weight) - // Standard Error: 54_000 - .saturating_add((58_293_000 as Weight).saturating_mul(c as Weight)) + (209_071_000 as Weight) + // Standard Error: 47_000 + .saturating_add((56_555_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -204,11 +204,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn instantiate_with_code(c: u32, s: u32, ) -> Weight { - (211_187_000 as Weight) - // Standard Error: 114_000 - .saturating_add((156_529_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 7_000 - .saturating_add((1_830_000 as Weight).saturating_mul(s as Weight)) + (210_420_000 as Weight) + // Standard Error: 133_000 + .saturating_add((145_601_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 8_000 + .saturating_add((1_760_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -219,9 +219,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn instantiate(s: u32, ) -> Weight { - (150_485_000 as Weight) + (173_397_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_769_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((1_714_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -230,7 +230,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call() -> Weight { - (117_274_000 as Weight) + (140_169_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -238,9 +238,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn upload_code(c: u32, ) -> Weight { - (51_126_000 as Weight) - // Standard Error: 49_000 - .saturating_add((72_622_000 as Weight).saturating_mul(c as Weight)) + (49_076_000 as Weight) + // Standard Error: 37_000 + .saturating_add((67_150_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -248,7 +248,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - (24_221_000 as Weight) + (24_318_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -257,9 +257,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller(r: u32, ) -> Weight { - (219_790_000 as Weight) - // Standard Error: 126_000 - .saturating_add((56_383_000 as Weight).saturating_mul(r as Weight)) + (208_256_000 as Weight) + // Standard Error: 116_000 + .saturating_add((49_878_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -268,9 +268,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_address(r: u32, ) -> Weight { - (218_377_000 as Weight) - // Standard Error: 117_000 - .saturating_add((57_243_000 as Weight).saturating_mul(r as Weight)) + (230_530_000 as Weight) + // Standard Error: 132_000 + .saturating_add((47_902_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -279,9 +279,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas_left(r: u32, ) -> Weight { - (217_999_000 as Weight) - // Standard Error: 104_000 - .saturating_add((56_674_000 as Weight).saturating_mul(r as Weight)) + (219_027_000 as Weight) + // Standard Error: 108_000 + .saturating_add((48_039_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -290,9 +290,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_balance(r: u32, ) -> Weight { - (226_932_000 as Weight) - // Standard Error: 155_000 - .saturating_add((147_401_000 as Weight).saturating_mul(r as Weight)) + (219_036_000 as Weight) + // Standard Error: 152_000 + .saturating_add((137_047_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -301,9 +301,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_value_transferred(r: u32, ) -> Weight { - (233_107_000 as Weight) - // Standard Error: 110_000 - .saturating_add((55_334_000 as Weight).saturating_mul(r as Weight)) + (214_401_000 as Weight) + // Standard Error: 96_000 + .saturating_add((48_435_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -312,9 +312,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_minimum_balance(r: u32, ) -> Weight { - (235_364_000 as Weight) - // Standard Error: 122_000 - .saturating_add((54_700_000 as Weight).saturating_mul(r as Weight)) + (216_939_000 as Weight) + // Standard Error: 106_000 + .saturating_add((48_198_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -323,9 +323,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_block_number(r: u32, ) -> Weight { - (232_875_000 as Weight) - // Standard Error: 108_000 - .saturating_add((54_510_000 as Weight).saturating_mul(r as Weight)) + (216_637_000 as Weight) + // Standard Error: 86_000 + .saturating_add((47_819_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -334,9 +334,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_now(r: u32, ) -> Weight { - (226_089_000 as Weight) - // Standard Error: 126_000 - .saturating_add((54_899_000 as Weight).saturating_mul(r as Weight)) + (214_863_000 as Weight) + // Standard Error: 110_000 + .saturating_add((48_208_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -346,9 +346,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn seal_weight_to_fee(r: u32, ) -> Weight { - (234_746_000 as Weight) - // Standard Error: 146_000 - .saturating_add((132_861_000 as Weight).saturating_mul(r as Weight)) + (216_494_000 as Weight) + // Standard Error: 141_000 + .saturating_add((120_736_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -357,9 +357,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas(r: u32, ) -> Weight { - (96_247_000 as Weight) - // Standard Error: 70_000 - .saturating_add((27_918_000 as Weight).saturating_mul(r as Weight)) + (123_867_000 as Weight) + // Standard Error: 33_000 + .saturating_add((24_578_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -368,9 +368,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input(r: u32, ) -> Weight { - (221_631_000 as Weight) - // Standard Error: 139_000 - .saturating_add((54_382_000 as Weight).saturating_mul(r as Weight)) + (215_578_000 as Weight) + // Standard Error: 108_000 + .saturating_add((47_512_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -379,9 +379,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input_per_kb(n: u32, ) -> Weight { - (306_449_000 as Weight) + (297_663_000 as Weight) // Standard Error: 3_000 - .saturating_add((11_919_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((11_863_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -390,9 +390,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_return(r: u32, ) -> Weight { - (222_176_000 as Weight) - // Standard Error: 72_000 - .saturating_add((3_223_000 as Weight).saturating_mul(r as Weight)) + (209_709_000 as Weight) + // Standard Error: 75_000 + .saturating_add((1_783_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -401,9 +401,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_return_per_kb(n: u32, ) -> Weight { - (211_079_000 as Weight) + (214_403_000 as Weight) // Standard Error: 0 - .saturating_add((237_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((197_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -414,9 +414,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts DeletionQueue (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_terminate(r: u32, ) -> Weight { - (213_994_000 as Weight) - // Standard Error: 104_000 - .saturating_add((64_453_000 as Weight).saturating_mul(r as Weight)) + (214_454_000 as Weight) + // Standard Error: 656_000 + .saturating_add((50_641_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -428,9 +428,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn seal_random(r: u32, ) -> Weight { - (228_281_000 as Weight) - // Standard Error: 150_000 - .saturating_add((166_949_000 as Weight).saturating_mul(r as Weight)) + (214_140_000 as Weight) + // Standard Error: 169_000 + .saturating_add((158_778_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -439,9 +439,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_deposit_event(r: u32, ) -> Weight { - (230_348_000 as Weight) - // Standard Error: 163_000 - .saturating_add((288_679_000 as Weight).saturating_mul(r as Weight)) + (225_998_000 as Weight) + // Standard Error: 171_000 + .saturating_add((280_296_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -451,11 +451,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:100 w:100) fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight { - (601_613_000 as Weight) - // Standard Error: 1_566_000 - .saturating_add((279_038_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 308_000 - .saturating_add((84_818_000 as Weight).saturating_mul(n as Weight)) + (491_432_000 as Weight) + // Standard Error: 1_992_000 + .saturating_add((288_376_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 392_000 + .saturating_add((82_805_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -466,17 +466,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_debug_message(r: u32, ) -> Weight { - (113_578_000 as Weight) - // Standard Error: 67_000 - .saturating_add((44_899_000 as Weight).saturating_mul(r as Weight)) + (130_861_000 as Weight) + // Standard Error: 74_000 + .saturating_add((40_268_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage(r: u32, ) -> Weight { - (59_019_000 as Weight) - // Standard Error: 995_000 - .saturating_add((414_759_000 as Weight).saturating_mul(r as Weight)) + (38_843_000 as Weight) + // Standard Error: 1_044_000 + .saturating_add((408_027_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -484,25 +484,25 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32, ) -> Weight { - (620_483_000 as Weight) - // Standard Error: 242_000 - .saturating_add((30_945_000 as Weight).saturating_mul(n as Weight)) + (610_782_000 as Weight) + // Standard Error: 265_000 + .saturating_add((28_221_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_old_kb(n: u32, ) -> Weight { - (632_391_000 as Weight) - // Standard Error: 317_000 - .saturating_add((11_431_000 as Weight).saturating_mul(n as Weight)) + (625_031_000 as Weight) + // Standard Error: 319_000 + .saturating_add((11_126_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage(r: u32, ) -> Weight { - (96_628_000 as Weight) - // Standard Error: 878_000 - .saturating_add((387_212_000 as Weight).saturating_mul(r as Weight)) + (78_566_000 as Weight) + // Standard Error: 970_000 + .saturating_add((384_877_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -510,51 +510,51 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32, ) -> Weight { - (625_960_000 as Weight) - // Standard Error: 270_000 - .saturating_add((11_170_000 as Weight).saturating_mul(n as Weight)) + (601_558_000 as Weight) + // Standard Error: 280_000 + .saturating_add((11_378_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage(r: u32, ) -> Weight { - (115_155_000 as Weight) - // Standard Error: 741_000 - .saturating_add((331_711_000 as Weight).saturating_mul(r as Weight)) + (112_328_000 as Weight) + // Standard Error: 668_000 + .saturating_add((323_031_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage_per_kb(n: u32, ) -> Weight { - (582_560_000 as Weight) - // Standard Error: 360_000 - .saturating_add((68_427_000 as Weight).saturating_mul(n as Weight)) + (556_303_000 as Weight) + // Standard Error: 346_000 + .saturating_add((64_170_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(104 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage(r: u32, ) -> Weight { - (130_096_000 as Weight) - // Standard Error: 555_000 - .saturating_add((294_514_000 as Weight).saturating_mul(r as Weight)) + (106_572_000 as Weight) + // Standard Error: 691_000 + .saturating_add((294_964_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage_per_kb(n: u32, ) -> Weight { - (528_701_000 as Weight) - // Standard Error: 246_000 - .saturating_add((10_375_000 as Weight).saturating_mul(n as Weight)) + (508_339_000 as Weight) + // Standard Error: 245_000 + .saturating_add((10_675_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(104 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage(r: u32, ) -> Weight { - (95_349_000 as Weight) - // Standard Error: 906_000 - .saturating_add((430_051_000 as Weight).saturating_mul(r as Weight)) + (88_096_000 as Weight) + // Standard Error: 927_000 + .saturating_add((415_543_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -562,9 +562,9 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32, ) -> Weight { - (676_606_000 as Weight) - // Standard Error: 389_000 - .saturating_add((70_517_000 as Weight).saturating_mul(n as Weight)) + (650_912_000 as Weight) + // Standard Error: 359_000 + .saturating_add((65_030_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } @@ -573,9 +573,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_transfer(r: u32, ) -> Weight { - (131_194_000 as Weight) - // Standard Error: 1_256_000 - .saturating_add((1_772_590_000 as Weight).saturating_mul(r as Weight)) + (102_673_000 as Weight) + // Standard Error: 1_159_000 + .saturating_add((1_711_312_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -586,9 +586,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call(r: u32, ) -> Weight { - (2_463_174_000 as Weight) - // Standard Error: 19_404_000 - .saturating_add((19_548_986_000 as Weight).saturating_mul(r as Weight)) + (0 as Weight) + // Standard Error: 3_592_000 + .saturating_add((19_565_726_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -599,13 +599,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:2 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight { - (21_356_548_000 as Weight) - // Standard Error: 31_719_000 - .saturating_add((1_874_230_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 11_000 - .saturating_add((23_243_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 12_000 - .saturating_add((34_825_000 as Weight).saturating_mul(o as Weight)) + (19_665_171_000 as Weight) + // Standard Error: 27_641_000 + .saturating_add((2_089_637_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 9_000 + .saturating_add((20_165_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 10_000 + .saturating_add((31_728_000 as Weight).saturating_mul(o as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().reads((101 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes(101 as Weight)) @@ -619,8 +619,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts OwnerInfoOf (r:100 w:100) fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 49_981_000 - .saturating_add((28_988_348_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 48_640_000 + .saturating_add((27_307_450_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads((400 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -633,13 +633,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts AccountCounter (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_instantiate_per_input_output_salt_kb(i: u32, o: u32, s: u32, ) -> Weight { - (24_726_887_000 as Weight) - // Standard Error: 32_000 - .saturating_add((23_702_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 32_000 - .saturating_add((35_841_000 as Weight).saturating_mul(o as Weight)) - // Standard Error: 32_000 - .saturating_add((161_159_000 as Weight).saturating_mul(s as Weight)) + (24_821_248_000 as Weight) + // Standard Error: 26_000 + .saturating_add((20_118_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 26_000 + .saturating_add((31_616_000 as Weight).saturating_mul(o as Weight)) + // Standard Error: 26_000 + .saturating_add((157_567_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(208 as Weight)) .saturating_add(T::DbWeight::get().writes(206 as Weight)) } @@ -648,9 +648,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256(r: u32, ) -> Weight { - (221_804_000 as Weight) - // Standard Error: 150_000 - .saturating_add((84_131_000 as Weight).saturating_mul(r as Weight)) + (213_816_000 as Weight) + // Standard Error: 147_000 + .saturating_add((80_336_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -659,9 +659,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight { - (357_186_000 as Weight) + (309_038_000 as Weight) // Standard Error: 23_000 - .saturating_add((469_081_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((465_306_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -670,9 +670,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256(r: u32, ) -> Weight { - (220_729_000 as Weight) - // Standard Error: 166_000 - .saturating_add((101_538_000 as Weight).saturating_mul(r as Weight)) + (212_825_000 as Weight) + // Standard Error: 143_000 + .saturating_add((91_947_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -681,9 +681,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight { - (272_756_000 as Weight) - // Standard Error: 18_000 - .saturating_add((311_130_000 as Weight).saturating_mul(n as Weight)) + (329_548_000 as Weight) + // Standard Error: 19_000 + .saturating_add((306_729_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -692,9 +692,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256(r: u32, ) -> Weight { - (215_784_000 as Weight) - // Standard Error: 150_000 - .saturating_add((68_809_000 as Weight).saturating_mul(r as Weight)) + (215_907_000 as Weight) + // Standard Error: 129_000 + .saturating_add((63_477_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -703,9 +703,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight { - (256_009_000 as Weight) - // Standard Error: 12_000 - .saturating_add((124_552_000 as Weight).saturating_mul(n as Weight)) + (423_811_000 as Weight) + // Standard Error: 16_000 + .saturating_add((119_607_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -714,9 +714,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128(r: u32, ) -> Weight { - (216_413_000 as Weight) - // Standard Error: 134_000 - .saturating_add((68_281_000 as Weight).saturating_mul(r as Weight)) + (214_747_000 as Weight) + // Standard Error: 115_000 + .saturating_add((62_904_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -725,9 +725,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight { - (254_477_000 as Weight) - // Standard Error: 13_000 - .saturating_add((124_483_000 as Weight).saturating_mul(n as Weight)) + (437_217_000 as Weight) + // Standard Error: 19_000 + .saturating_add((120_126_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -736,266 +736,266 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_ecdsa_recover(r: u32, ) -> Weight { - (179_001_000 as Weight) - // Standard Error: 1_674_000 - .saturating_add((15_397_995_000 as Weight).saturating_mul(r as Weight)) + (195_980_000 as Weight) + // Standard Error: 1_262_000 + .saturating_add((15_428_805_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn instr_i64const(r: u32, ) -> Weight { - (46_905_000 as Weight) - // Standard Error: 12_000 - .saturating_add((794_000 as Weight).saturating_mul(r as Weight)) + (74_569_000 as Weight) + // Standard Error: 1_000 + .saturating_add((589_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (53_636_000 as Weight) - // Standard Error: 12_000 - .saturating_add((2_476_000 as Weight).saturating_mul(r as Weight)) + (74_212_000 as Weight) + // Standard Error: 0 + .saturating_add((1_325_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (53_199_000 as Weight) - // Standard Error: 12_000 - .saturating_add((2_547_000 as Weight).saturating_mul(r as Weight)) + (74_505_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_423_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (37_268_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_987_000 as Weight).saturating_mul(r as Weight)) + (74_005_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_785_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (37_138_000 as Weight) - // Standard Error: 16_000 - .saturating_add((3_057_000 as Weight).saturating_mul(r as Weight)) + (74_212_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_890_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (39_353_000 as Weight) - // Standard Error: 17_000 - .saturating_add((1_939_000 as Weight).saturating_mul(r as Weight)) + (74_102_000 as Weight) + // Standard Error: 2_000 + .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (38_883_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_495_000 as Weight).saturating_mul(r as Weight)) + (73_523_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_456_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (45_030_000 as Weight) - // Standard Error: 21_000 - .saturating_add((2_398_000 as Weight).saturating_mul(r as Weight)) + (73_307_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_594_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (47_281_000 as Weight) - // Standard Error: 3_000 - .saturating_add((29_000 as Weight).saturating_mul(e as Weight)) + (76_272_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (49_074_000 as Weight) - // Standard Error: 20_000 - .saturating_add((19_991_000 as Weight).saturating_mul(r as Weight)) + (73_390_000 as Weight) + // Standard Error: 23_000 + .saturating_add((16_936_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (50_071_000 as Weight) - // Standard Error: 29_000 - .saturating_add((30_156_000 as Weight).saturating_mul(r as Weight)) + (89_331_000 as Weight) + // Standard Error: 30_000 + .saturating_add((28_104_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (84_902_000 as Weight) - // Standard Error: 5_000 - .saturating_add((1_124_000 as Weight).saturating_mul(p as Weight)) + (117_023_000 as Weight) + // Standard Error: 3_000 + .saturating_add((914_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (39_054_000 as Weight) - // Standard Error: 14_000 - .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) + (74_727_000 as Weight) + // Standard Error: 1_000 + .saturating_add((618_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (39_190_000 as Weight) - // Standard Error: 14_000 - .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) + (74_893_000 as Weight) + // Standard Error: 1_000 + .saturating_add((674_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (41_830_000 as Weight) - // Standard Error: 13_000 - .saturating_add((1_878_000 as Weight).saturating_mul(r as Weight)) + (74_552_000 as Weight) + // Standard Error: 1_000 + .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (40_764_000 as Weight) - // Standard Error: 13_000 - .saturating_add((1_931_000 as Weight).saturating_mul(r as Weight)) + (77_355_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_146_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (46_309_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_745_000 as Weight).saturating_mul(r as Weight)) + (77_055_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (47_071_000 as Weight) - // Standard Error: 12_000 - .saturating_add((797_000 as Weight).saturating_mul(r as Weight)) + (74_648_000 as Weight) + // Standard Error: 2_000 + .saturating_add((652_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (49_773_000 as Weight) - // Standard Error: 1_442_000 - .saturating_add((227_666_000 as Weight).saturating_mul(r as Weight)) + (73_777_000 as Weight) + // Standard Error: 226_000 + .saturating_add((187_252_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (43_879_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_486_000 as Weight).saturating_mul(r as Weight)) + (74_332_000 as Weight) + // Standard Error: 1_000 + .saturating_add((897_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (43_883_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_484_000 as Weight).saturating_mul(r as Weight)) + (74_265_000 as Weight) + // Standard Error: 1_000 + .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (43_415_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_495_000 as Weight).saturating_mul(r as Weight)) + (74_475_000 as Weight) + // Standard Error: 2_000 + .saturating_add((892_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (43_567_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_493_000 as Weight).saturating_mul(r as Weight)) + (74_297_000 as Weight) + // Standard Error: 1_000 + .saturating_add((918_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (41_332_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_912_000 as Weight).saturating_mul(r as Weight)) + (74_146_000 as Weight) + // Standard Error: 1_000 + .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (41_331_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_911_000 as Weight).saturating_mul(r as Weight)) + (74_361_000 as Weight) + // Standard Error: 1_000 + .saturating_add((877_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (43_704_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_487_000 as Weight).saturating_mul(r as Weight)) + (74_554_000 as Weight) + // Standard Error: 1_000 + .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (37_103_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_467_000 as Weight).saturating_mul(r as Weight)) + (74_169_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (36_680_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_487_000 as Weight).saturating_mul(r as Weight)) + (74_164_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (36_659_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_494_000 as Weight).saturating_mul(r as Weight)) + (74_058_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (36_491_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_495_000 as Weight).saturating_mul(r as Weight)) + (74_039_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (36_440_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_499_000 as Weight).saturating_mul(r as Weight)) + (75_055_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_338_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (36_477_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_500_000 as Weight).saturating_mul(r as Weight)) + (74_536_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_367_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (36_561_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_498_000 as Weight).saturating_mul(r as Weight)) + (74_177_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (36_418_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_501_000 as Weight).saturating_mul(r as Weight)) + (74_080_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (36_835_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_484_000 as Weight).saturating_mul(r as Weight)) + (74_237_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (36_873_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_469_000 as Weight).saturating_mul(r as Weight)) + (74_049_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (37_013_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_466_000 as Weight).saturating_mul(r as Weight)) + (74_186_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_335_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (36_885_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_469_000 as Weight).saturating_mul(r as Weight)) + (74_268_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (36_696_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_487_000 as Weight).saturating_mul(r as Weight)) + (74_334_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_331_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (36_924_000 as Weight) - // Standard Error: 16_000 - .saturating_add((3_118_000 as Weight).saturating_mul(r as Weight)) + (74_285_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_997_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (36_819_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_784_000 as Weight).saturating_mul(r as Weight)) + (74_002_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_027_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (36_855_000 as Weight) - // Standard Error: 17_000 - .saturating_add((3_047_000 as Weight).saturating_mul(r as Weight)) + (74_281_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_977_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (36_890_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_816_000 as Weight).saturating_mul(r as Weight)) + (74_160_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_038_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (36_749_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_475_000 as Weight).saturating_mul(r as Weight)) + (74_097_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (36_928_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_469_000 as Weight).saturating_mul(r as Weight)) + (74_020_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (36_868_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_470_000 as Weight).saturating_mul(r as Weight)) + (73_890_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_351_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (36_919_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_470_000 as Weight).saturating_mul(r as Weight)) + (74_139_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_355_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (36_934_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_471_000 as Weight).saturating_mul(r as Weight)) + (74_189_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (36_705_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_492_000 as Weight).saturating_mul(r as Weight)) + (74_055_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (36_684_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_477_000 as Weight).saturating_mul(r as Weight)) + (74_074_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (36_844_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_477_000 as Weight).saturating_mul(r as Weight)) + (74_005_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } } @@ -1003,32 +1003,32 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize() -> Weight { - (1_636_000 as Weight) + (1_642_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn on_initialize_per_trie_key(k: u32, ) -> Weight { - (7_840_000 as Weight) + (7_854_000 as Weight) // Standard Error: 0 - .saturating_add((752_000 as Weight).saturating_mul(k as Weight)) + .saturating_add((742_000 as Weight).saturating_mul(k as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) } // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize_per_queue_item(q: u32, ) -> Weight { - (31_915_000 as Weight) - // Standard Error: 1_000 - .saturating_add((98_000 as Weight).saturating_mul(q as Weight)) + (0 as Weight) + // Standard Error: 6_000 + .saturating_add((2_216_000 as Weight).saturating_mul(q as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Contracts PristineCode (r:1 w:0) // Storage: Contracts CodeStorage (r:0 w:1) fn reinstrument(c: u32, ) -> Weight { - (18_897_000 as Weight) - // Standard Error: 32_000 - .saturating_add((69_663_000 as Weight).saturating_mul(c as Weight)) + (17_413_000 as Weight) + // Standard Error: 39_000 + .saturating_add((64_495_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1037,9 +1037,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call_with_code_kb(c: u32, ) -> Weight { - (204_947_000 as Weight) - // Standard Error: 54_000 - .saturating_add((58_293_000 as Weight).saturating_mul(c as Weight)) + (209_071_000 as Weight) + // Standard Error: 47_000 + .saturating_add((56_555_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -1051,11 +1051,11 @@ impl WeightInfo for () { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn instantiate_with_code(c: u32, s: u32, ) -> Weight { - (211_187_000 as Weight) - // Standard Error: 114_000 - .saturating_add((156_529_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 7_000 - .saturating_add((1_830_000 as Weight).saturating_mul(s as Weight)) + (210_420_000 as Weight) + // Standard Error: 133_000 + .saturating_add((145_601_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 8_000 + .saturating_add((1_760_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -1066,9 +1066,9 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn instantiate(s: u32, ) -> Weight { - (150_485_000 as Weight) + (173_397_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_769_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((1_714_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -1077,7 +1077,7 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call() -> Weight { - (117_274_000 as Weight) + (140_169_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -1085,9 +1085,9 @@ impl WeightInfo for () { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn upload_code(c: u32, ) -> Weight { - (51_126_000 as Weight) - // Standard Error: 49_000 - .saturating_add((72_622_000 as Weight).saturating_mul(c as Weight)) + (49_076_000 as Weight) + // Standard Error: 37_000 + .saturating_add((67_150_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -1095,7 +1095,7 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - (24_221_000 as Weight) + (24_318_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -1104,9 +1104,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller(r: u32, ) -> Weight { - (219_790_000 as Weight) - // Standard Error: 126_000 - .saturating_add((56_383_000 as Weight).saturating_mul(r as Weight)) + (208_256_000 as Weight) + // Standard Error: 116_000 + .saturating_add((49_878_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1115,9 +1115,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_address(r: u32, ) -> Weight { - (218_377_000 as Weight) - // Standard Error: 117_000 - .saturating_add((57_243_000 as Weight).saturating_mul(r as Weight)) + (230_530_000 as Weight) + // Standard Error: 132_000 + .saturating_add((47_902_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1126,9 +1126,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas_left(r: u32, ) -> Weight { - (217_999_000 as Weight) - // Standard Error: 104_000 - .saturating_add((56_674_000 as Weight).saturating_mul(r as Weight)) + (219_027_000 as Weight) + // Standard Error: 108_000 + .saturating_add((48_039_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1137,9 +1137,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_balance(r: u32, ) -> Weight { - (226_932_000 as Weight) - // Standard Error: 155_000 - .saturating_add((147_401_000 as Weight).saturating_mul(r as Weight)) + (219_036_000 as Weight) + // Standard Error: 152_000 + .saturating_add((137_047_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1148,9 +1148,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_value_transferred(r: u32, ) -> Weight { - (233_107_000 as Weight) - // Standard Error: 110_000 - .saturating_add((55_334_000 as Weight).saturating_mul(r as Weight)) + (214_401_000 as Weight) + // Standard Error: 96_000 + .saturating_add((48_435_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1159,9 +1159,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_minimum_balance(r: u32, ) -> Weight { - (235_364_000 as Weight) - // Standard Error: 122_000 - .saturating_add((54_700_000 as Weight).saturating_mul(r as Weight)) + (216_939_000 as Weight) + // Standard Error: 106_000 + .saturating_add((48_198_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1170,9 +1170,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_block_number(r: u32, ) -> Weight { - (232_875_000 as Weight) - // Standard Error: 108_000 - .saturating_add((54_510_000 as Weight).saturating_mul(r as Weight)) + (216_637_000 as Weight) + // Standard Error: 86_000 + .saturating_add((47_819_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1181,9 +1181,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_now(r: u32, ) -> Weight { - (226_089_000 as Weight) - // Standard Error: 126_000 - .saturating_add((54_899_000 as Weight).saturating_mul(r as Weight)) + (214_863_000 as Weight) + // Standard Error: 110_000 + .saturating_add((48_208_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1193,9 +1193,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn seal_weight_to_fee(r: u32, ) -> Weight { - (234_746_000 as Weight) - // Standard Error: 146_000 - .saturating_add((132_861_000 as Weight).saturating_mul(r as Weight)) + (216_494_000 as Weight) + // Standard Error: 141_000 + .saturating_add((120_736_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1204,9 +1204,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas(r: u32, ) -> Weight { - (96_247_000 as Weight) - // Standard Error: 70_000 - .saturating_add((27_918_000 as Weight).saturating_mul(r as Weight)) + (123_867_000 as Weight) + // Standard Error: 33_000 + .saturating_add((24_578_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1215,9 +1215,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input(r: u32, ) -> Weight { - (221_631_000 as Weight) - // Standard Error: 139_000 - .saturating_add((54_382_000 as Weight).saturating_mul(r as Weight)) + (215_578_000 as Weight) + // Standard Error: 108_000 + .saturating_add((47_512_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1226,9 +1226,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input_per_kb(n: u32, ) -> Weight { - (306_449_000 as Weight) + (297_663_000 as Weight) // Standard Error: 3_000 - .saturating_add((11_919_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((11_863_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1237,9 +1237,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_return(r: u32, ) -> Weight { - (222_176_000 as Weight) - // Standard Error: 72_000 - .saturating_add((3_223_000 as Weight).saturating_mul(r as Weight)) + (209_709_000 as Weight) + // Standard Error: 75_000 + .saturating_add((1_783_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1248,9 +1248,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_return_per_kb(n: u32, ) -> Weight { - (211_079_000 as Weight) + (214_403_000 as Weight) // Standard Error: 0 - .saturating_add((237_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((197_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1261,9 +1261,9 @@ impl WeightInfo for () { // Storage: Contracts DeletionQueue (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_terminate(r: u32, ) -> Weight { - (213_994_000 as Weight) - // Standard Error: 104_000 - .saturating_add((64_453_000 as Weight).saturating_mul(r as Weight)) + (214_454_000 as Weight) + // Standard Error: 656_000 + .saturating_add((50_641_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1275,9 +1275,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn seal_random(r: u32, ) -> Weight { - (228_281_000 as Weight) - // Standard Error: 150_000 - .saturating_add((166_949_000 as Weight).saturating_mul(r as Weight)) + (214_140_000 as Weight) + // Standard Error: 169_000 + .saturating_add((158_778_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1286,9 +1286,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_deposit_event(r: u32, ) -> Weight { - (230_348_000 as Weight) - // Standard Error: 163_000 - .saturating_add((288_679_000 as Weight).saturating_mul(r as Weight)) + (225_998_000 as Weight) + // Standard Error: 171_000 + .saturating_add((280_296_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1298,11 +1298,11 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:100 w:100) fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight { - (601_613_000 as Weight) - // Standard Error: 1_566_000 - .saturating_add((279_038_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 308_000 - .saturating_add((84_818_000 as Weight).saturating_mul(n as Weight)) + (491_432_000 as Weight) + // Standard Error: 1_992_000 + .saturating_add((288_376_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 392_000 + .saturating_add((82_805_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1313,17 +1313,17 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_debug_message(r: u32, ) -> Weight { - (113_578_000 as Weight) - // Standard Error: 67_000 - .saturating_add((44_899_000 as Weight).saturating_mul(r as Weight)) + (130_861_000 as Weight) + // Standard Error: 74_000 + .saturating_add((40_268_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage(r: u32, ) -> Weight { - (59_019_000 as Weight) - // Standard Error: 995_000 - .saturating_add((414_759_000 as Weight).saturating_mul(r as Weight)) + (38_843_000 as Weight) + // Standard Error: 1_044_000 + .saturating_add((408_027_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1331,25 +1331,25 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32, ) -> Weight { - (620_483_000 as Weight) - // Standard Error: 242_000 - .saturating_add((30_945_000 as Weight).saturating_mul(n as Weight)) + (610_782_000 as Weight) + // Standard Error: 265_000 + .saturating_add((28_221_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_old_kb(n: u32, ) -> Weight { - (632_391_000 as Weight) - // Standard Error: 317_000 - .saturating_add((11_431_000 as Weight).saturating_mul(n as Weight)) + (625_031_000 as Weight) + // Standard Error: 319_000 + .saturating_add((11_126_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage(r: u32, ) -> Weight { - (96_628_000 as Weight) - // Standard Error: 878_000 - .saturating_add((387_212_000 as Weight).saturating_mul(r as Weight)) + (78_566_000 as Weight) + // Standard Error: 970_000 + .saturating_add((384_877_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -1357,51 +1357,51 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32, ) -> Weight { - (625_960_000 as Weight) - // Standard Error: 270_000 - .saturating_add((11_170_000 as Weight).saturating_mul(n as Weight)) + (601_558_000 as Weight) + // Standard Error: 280_000 + .saturating_add((11_378_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage(r: u32, ) -> Weight { - (115_155_000 as Weight) - // Standard Error: 741_000 - .saturating_add((331_711_000 as Weight).saturating_mul(r as Weight)) + (112_328_000 as Weight) + // Standard Error: 668_000 + .saturating_add((323_031_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage_per_kb(n: u32, ) -> Weight { - (582_560_000 as Weight) - // Standard Error: 360_000 - .saturating_add((68_427_000 as Weight).saturating_mul(n as Weight)) + (556_303_000 as Weight) + // Standard Error: 346_000 + .saturating_add((64_170_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(104 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage(r: u32, ) -> Weight { - (130_096_000 as Weight) - // Standard Error: 555_000 - .saturating_add((294_514_000 as Weight).saturating_mul(r as Weight)) + (106_572_000 as Weight) + // Standard Error: 691_000 + .saturating_add((294_964_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage_per_kb(n: u32, ) -> Weight { - (528_701_000 as Weight) - // Standard Error: 246_000 - .saturating_add((10_375_000 as Weight).saturating_mul(n as Weight)) + (508_339_000 as Weight) + // Standard Error: 245_000 + .saturating_add((10_675_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(104 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage(r: u32, ) -> Weight { - (95_349_000 as Weight) - // Standard Error: 906_000 - .saturating_add((430_051_000 as Weight).saturating_mul(r as Weight)) + (88_096_000 as Weight) + // Standard Error: 927_000 + .saturating_add((415_543_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -1409,9 +1409,9 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32, ) -> Weight { - (676_606_000 as Weight) - // Standard Error: 389_000 - .saturating_add((70_517_000 as Weight).saturating_mul(n as Weight)) + (650_912_000 as Weight) + // Standard Error: 359_000 + .saturating_add((65_030_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } @@ -1420,9 +1420,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_transfer(r: u32, ) -> Weight { - (131_194_000 as Weight) - // Standard Error: 1_256_000 - .saturating_add((1_772_590_000 as Weight).saturating_mul(r as Weight)) + (102_673_000 as Weight) + // Standard Error: 1_159_000 + .saturating_add((1_711_312_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -1433,9 +1433,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call(r: u32, ) -> Weight { - (2_463_174_000 as Weight) - // Standard Error: 19_404_000 - .saturating_add((19_548_986_000 as Weight).saturating_mul(r as Weight)) + (0 as Weight) + // Standard Error: 3_592_000 + .saturating_add((19_565_726_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1446,13 +1446,13 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:2 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight { - (21_356_548_000 as Weight) - // Standard Error: 31_719_000 - .saturating_add((1_874_230_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 11_000 - .saturating_add((23_243_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 12_000 - .saturating_add((34_825_000 as Weight).saturating_mul(o as Weight)) + (19_665_171_000 as Weight) + // Standard Error: 27_641_000 + .saturating_add((2_089_637_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 9_000 + .saturating_add((20_165_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 10_000 + .saturating_add((31_728_000 as Weight).saturating_mul(o as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().reads((101 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes(101 as Weight)) @@ -1466,8 +1466,8 @@ impl WeightInfo for () { // Storage: Contracts OwnerInfoOf (r:100 w:100) fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 49_981_000 - .saturating_add((28_988_348_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 48_640_000 + .saturating_add((27_307_450_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads((400 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -1480,13 +1480,13 @@ impl WeightInfo for () { // Storage: Contracts AccountCounter (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_instantiate_per_input_output_salt_kb(i: u32, o: u32, s: u32, ) -> Weight { - (24_726_887_000 as Weight) - // Standard Error: 32_000 - .saturating_add((23_702_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 32_000 - .saturating_add((35_841_000 as Weight).saturating_mul(o as Weight)) - // Standard Error: 32_000 - .saturating_add((161_159_000 as Weight).saturating_mul(s as Weight)) + (24_821_248_000 as Weight) + // Standard Error: 26_000 + .saturating_add((20_118_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 26_000 + .saturating_add((31_616_000 as Weight).saturating_mul(o as Weight)) + // Standard Error: 26_000 + .saturating_add((157_567_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(208 as Weight)) .saturating_add(RocksDbWeight::get().writes(206 as Weight)) } @@ -1495,9 +1495,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256(r: u32, ) -> Weight { - (221_804_000 as Weight) - // Standard Error: 150_000 - .saturating_add((84_131_000 as Weight).saturating_mul(r as Weight)) + (213_816_000 as Weight) + // Standard Error: 147_000 + .saturating_add((80_336_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1506,9 +1506,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight { - (357_186_000 as Weight) + (309_038_000 as Weight) // Standard Error: 23_000 - .saturating_add((469_081_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((465_306_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1517,9 +1517,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256(r: u32, ) -> Weight { - (220_729_000 as Weight) - // Standard Error: 166_000 - .saturating_add((101_538_000 as Weight).saturating_mul(r as Weight)) + (212_825_000 as Weight) + // Standard Error: 143_000 + .saturating_add((91_947_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1528,9 +1528,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight { - (272_756_000 as Weight) - // Standard Error: 18_000 - .saturating_add((311_130_000 as Weight).saturating_mul(n as Weight)) + (329_548_000 as Weight) + // Standard Error: 19_000 + .saturating_add((306_729_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1539,9 +1539,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256(r: u32, ) -> Weight { - (215_784_000 as Weight) - // Standard Error: 150_000 - .saturating_add((68_809_000 as Weight).saturating_mul(r as Weight)) + (215_907_000 as Weight) + // Standard Error: 129_000 + .saturating_add((63_477_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1550,9 +1550,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight { - (256_009_000 as Weight) - // Standard Error: 12_000 - .saturating_add((124_552_000 as Weight).saturating_mul(n as Weight)) + (423_811_000 as Weight) + // Standard Error: 16_000 + .saturating_add((119_607_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1561,9 +1561,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128(r: u32, ) -> Weight { - (216_413_000 as Weight) - // Standard Error: 134_000 - .saturating_add((68_281_000 as Weight).saturating_mul(r as Weight)) + (214_747_000 as Weight) + // Standard Error: 115_000 + .saturating_add((62_904_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1572,9 +1572,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight { - (254_477_000 as Weight) - // Standard Error: 13_000 - .saturating_add((124_483_000 as Weight).saturating_mul(n as Weight)) + (437_217_000 as Weight) + // Standard Error: 19_000 + .saturating_add((120_126_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1583,265 +1583,265 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_ecdsa_recover(r: u32, ) -> Weight { - (179_001_000 as Weight) - // Standard Error: 1_674_000 - .saturating_add((15_397_995_000 as Weight).saturating_mul(r as Weight)) + (195_980_000 as Weight) + // Standard Error: 1_262_000 + .saturating_add((15_428_805_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn instr_i64const(r: u32, ) -> Weight { - (46_905_000 as Weight) - // Standard Error: 12_000 - .saturating_add((794_000 as Weight).saturating_mul(r as Weight)) + (74_569_000 as Weight) + // Standard Error: 1_000 + .saturating_add((589_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (53_636_000 as Weight) - // Standard Error: 12_000 - .saturating_add((2_476_000 as Weight).saturating_mul(r as Weight)) + (74_212_000 as Weight) + // Standard Error: 0 + .saturating_add((1_325_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (53_199_000 as Weight) - // Standard Error: 12_000 - .saturating_add((2_547_000 as Weight).saturating_mul(r as Weight)) + (74_505_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_423_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (37_268_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_987_000 as Weight).saturating_mul(r as Weight)) + (74_005_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_785_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (37_138_000 as Weight) - // Standard Error: 16_000 - .saturating_add((3_057_000 as Weight).saturating_mul(r as Weight)) + (74_212_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_890_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (39_353_000 as Weight) - // Standard Error: 17_000 - .saturating_add((1_939_000 as Weight).saturating_mul(r as Weight)) + (74_102_000 as Weight) + // Standard Error: 2_000 + .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (38_883_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_495_000 as Weight).saturating_mul(r as Weight)) + (73_523_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_456_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (45_030_000 as Weight) - // Standard Error: 21_000 - .saturating_add((2_398_000 as Weight).saturating_mul(r as Weight)) + (73_307_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_594_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (47_281_000 as Weight) - // Standard Error: 3_000 - .saturating_add((29_000 as Weight).saturating_mul(e as Weight)) + (76_272_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (49_074_000 as Weight) - // Standard Error: 20_000 - .saturating_add((19_991_000 as Weight).saturating_mul(r as Weight)) + (73_390_000 as Weight) + // Standard Error: 23_000 + .saturating_add((16_936_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (50_071_000 as Weight) - // Standard Error: 29_000 - .saturating_add((30_156_000 as Weight).saturating_mul(r as Weight)) + (89_331_000 as Weight) + // Standard Error: 30_000 + .saturating_add((28_104_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (84_902_000 as Weight) - // Standard Error: 5_000 - .saturating_add((1_124_000 as Weight).saturating_mul(p as Weight)) + (117_023_000 as Weight) + // Standard Error: 3_000 + .saturating_add((914_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (39_054_000 as Weight) - // Standard Error: 14_000 - .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) + (74_727_000 as Weight) + // Standard Error: 1_000 + .saturating_add((618_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (39_190_000 as Weight) - // Standard Error: 14_000 - .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) + (74_893_000 as Weight) + // Standard Error: 1_000 + .saturating_add((674_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (41_830_000 as Weight) - // Standard Error: 13_000 - .saturating_add((1_878_000 as Weight).saturating_mul(r as Weight)) + (74_552_000 as Weight) + // Standard Error: 1_000 + .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (40_764_000 as Weight) - // Standard Error: 13_000 - .saturating_add((1_931_000 as Weight).saturating_mul(r as Weight)) + (77_355_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_146_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (46_309_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_745_000 as Weight).saturating_mul(r as Weight)) + (77_055_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (47_071_000 as Weight) - // Standard Error: 12_000 - .saturating_add((797_000 as Weight).saturating_mul(r as Weight)) + (74_648_000 as Weight) + // Standard Error: 2_000 + .saturating_add((652_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (49_773_000 as Weight) - // Standard Error: 1_442_000 - .saturating_add((227_666_000 as Weight).saturating_mul(r as Weight)) + (73_777_000 as Weight) + // Standard Error: 226_000 + .saturating_add((187_252_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (43_879_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_486_000 as Weight).saturating_mul(r as Weight)) + (74_332_000 as Weight) + // Standard Error: 1_000 + .saturating_add((897_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (43_883_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_484_000 as Weight).saturating_mul(r as Weight)) + (74_265_000 as Weight) + // Standard Error: 1_000 + .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (43_415_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_495_000 as Weight).saturating_mul(r as Weight)) + (74_475_000 as Weight) + // Standard Error: 2_000 + .saturating_add((892_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (43_567_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_493_000 as Weight).saturating_mul(r as Weight)) + (74_297_000 as Weight) + // Standard Error: 1_000 + .saturating_add((918_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (41_332_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_912_000 as Weight).saturating_mul(r as Weight)) + (74_146_000 as Weight) + // Standard Error: 1_000 + .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (41_331_000 as Weight) - // Standard Error: 12_000 - .saturating_add((1_911_000 as Weight).saturating_mul(r as Weight)) + (74_361_000 as Weight) + // Standard Error: 1_000 + .saturating_add((877_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (43_704_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_487_000 as Weight).saturating_mul(r as Weight)) + (74_554_000 as Weight) + // Standard Error: 1_000 + .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (37_103_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_467_000 as Weight).saturating_mul(r as Weight)) + (74_169_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (36_680_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_487_000 as Weight).saturating_mul(r as Weight)) + (74_164_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (36_659_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_494_000 as Weight).saturating_mul(r as Weight)) + (74_058_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (36_491_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_495_000 as Weight).saturating_mul(r as Weight)) + (74_039_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (36_440_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_499_000 as Weight).saturating_mul(r as Weight)) + (75_055_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_338_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (36_477_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_500_000 as Weight).saturating_mul(r as Weight)) + (74_536_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_367_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (36_561_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_498_000 as Weight).saturating_mul(r as Weight)) + (74_177_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (36_418_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_501_000 as Weight).saturating_mul(r as Weight)) + (74_080_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (36_835_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_484_000 as Weight).saturating_mul(r as Weight)) + (74_237_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (36_873_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_469_000 as Weight).saturating_mul(r as Weight)) + (74_049_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (37_013_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_466_000 as Weight).saturating_mul(r as Weight)) + (74_186_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_335_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (36_885_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_469_000 as Weight).saturating_mul(r as Weight)) + (74_268_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (36_696_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_487_000 as Weight).saturating_mul(r as Weight)) + (74_334_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_331_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (36_924_000 as Weight) - // Standard Error: 16_000 - .saturating_add((3_118_000 as Weight).saturating_mul(r as Weight)) + (74_285_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_997_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (36_819_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_784_000 as Weight).saturating_mul(r as Weight)) + (74_002_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_027_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (36_855_000 as Weight) - // Standard Error: 17_000 - .saturating_add((3_047_000 as Weight).saturating_mul(r as Weight)) + (74_281_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_977_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (36_890_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_816_000 as Weight).saturating_mul(r as Weight)) + (74_160_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_038_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (36_749_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_475_000 as Weight).saturating_mul(r as Weight)) + (74_097_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (36_928_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_469_000 as Weight).saturating_mul(r as Weight)) + (74_020_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (36_868_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_470_000 as Weight).saturating_mul(r as Weight)) + (73_890_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_351_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (36_919_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_470_000 as Weight).saturating_mul(r as Weight)) + (74_139_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_355_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (36_934_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_471_000 as Weight).saturating_mul(r as Weight)) + (74_189_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (36_705_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_492_000 as Weight).saturating_mul(r as Weight)) + (74_055_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (36_684_000 as Weight) - // Standard Error: 16_000 - .saturating_add((2_477_000 as Weight).saturating_mul(r as Weight)) + (74_074_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (36_844_000 as Weight) - // Standard Error: 17_000 - .saturating_add((2_477_000 as Weight).saturating_mul(r as Weight)) + (74_005_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } } diff --git a/frame/democracy/Cargo.toml b/frame/democracy/Cargo.toml index 730bc6fffbdf4..125decaca8241 100644 --- a/frame/democracy/Cargo.toml +++ b/frame/democracy/Cargo.toml @@ -19,14 +19,14 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-scheduler = { version = "4.0.0-dev", path = "../scheduler" } diff --git a/frame/democracy/src/tests.rs b/frame/democracy/src/tests.rs index 641014923c233..0fe83a07610d1 100644 --- a/frame/democracy/src/tests.rs +++ b/frame/democracy/src/tests.rs @@ -63,7 +63,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Config, Event}, + Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event}, Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event}, } ); diff --git a/frame/democracy/src/weights.rs b/frame/democracy/src/weights.rs index 22743124253b4..19bf602c5d291 100644 --- a/frame/democracy/src/weights.rs +++ b/frame/democracy/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/democracy/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -82,15 +82,15 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - (42_599_000 as Weight) + (42_560_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Democracy DepositOf (r:1 w:1) fn second(s: u32, ) -> Weight { - (25_521_000 as Weight) + (25_603_000 as Weight) // Standard Error: 1_000 - .saturating_add((171_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((167_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -98,9 +98,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_new(r: u32, ) -> Weight { - (34_035_000 as Weight) - // Standard Error: 1_000 - .saturating_add((142_000 as Weight).saturating_mul(r as Weight)) + (34_248_000 as Weight) + // Standard Error: 2_000 + .saturating_add((135_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -108,16 +108,16 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_existing(r: u32, ) -> Weight { - (33_910_000 as Weight) - // Standard Error: 1_000 - .saturating_add((147_000 as Weight).saturating_mul(r as Weight)) + (33_927_000 as Weight) + // Standard Error: 2_000 + .saturating_add((138_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - (14_874_000 as Weight) + (14_714_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -128,45 +128,45 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) fn blacklist(p: u32, ) -> Weight { - (49_557_000 as Weight) + (49_423_000 as Weight) // Standard Error: 3_000 - .saturating_add((267_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((275_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) fn external_propose(v: u32, ) -> Weight { - (7_540_000 as Weight) + (7_321_000 as Weight) // Standard Error: 0 - .saturating_add((76_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((75_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - (1_272_000 as Weight) + (1_325_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - (1_274_000 as Weight) + (1_283_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - (15_216_000 as Weight) + (15_355_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) fn veto_external(v: u32, ) -> Weight { - (16_713_000 as Weight) + (16_597_000 as Weight) // Standard Error: 0 - .saturating_add((92_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((90_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -174,23 +174,23 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) fn cancel_proposal(p: u32, ) -> Weight { - (37_990_000 as Weight) + (37_695_000 as Weight) // Standard Error: 2_000 - .saturating_add((259_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((258_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - (9_756_000 as Weight) + (9_456_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_queued(r: u32, ) -> Weight { - (19_408_000 as Weight) + (19_915_000 as Weight) // Standard Error: 1_000 - .saturating_add((650_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((609_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -198,9 +198,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy ReferendumCount (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base(r: u32, ) -> Weight { - (2_134_000 as Weight) - // Standard Error: 3_000 - .saturating_add((3_041_000 as Weight).saturating_mul(r as Weight)) + (3_787_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_852_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -212,9 +212,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy PublicProps (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - (6_357_000 as Weight) - // Standard Error: 3_000 - .saturating_add((3_054_000 as Weight).saturating_mul(r as Weight)) + (7_890_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_856_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -223,9 +223,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn delegate(r: u32, ) -> Weight { - (30_822_000 as Weight) + (31_190_000 as Weight) // Standard Error: 3_000 - .saturating_add((3_826_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((3_753_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) @@ -234,9 +234,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy VotingOf (r:2 w:2) // Storage: Democracy ReferendumInfoOf (r:1 w:1) fn undelegate(r: u32, ) -> Weight { - (15_307_000 as Weight) + (15_121_000 as Weight) // Standard Error: 3_000 - .saturating_add((3_827_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((3_852_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -244,12 +244,12 @@ impl WeightInfo for SubstrateWeight { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - (1_624_000 as Weight) + (1_583_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Democracy Preimages (r:1 w:1) fn note_preimage(b: u32, ) -> Weight { - (22_731_000 as Weight) + (22_681_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) @@ -257,7 +257,7 @@ impl WeightInfo for SubstrateWeight { } // Storage: Democracy Preimages (r:1 w:1) fn note_imminent_preimage(b: u32, ) -> Weight { - (15_518_000 as Weight) + (15_599_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) @@ -266,7 +266,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Democracy Preimages (r:1 w:1) // Storage: System Account (r:1 w:0) fn reap_preimage(b: u32, ) -> Weight { - (23_749_000 as Weight) + (23_663_000 as Weight) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) @@ -276,9 +276,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_remove(r: u32, ) -> Weight { - (21_818_000 as Weight) + (21_928_000 as Weight) // Standard Error: 1_000 - .saturating_add((66_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((61_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -286,27 +286,27 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_set(r: u32, ) -> Weight { - (21_491_000 as Weight) + (21_548_000 as Weight) // Standard Error: 1_000 - .saturating_add((121_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((123_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_vote(r: u32, ) -> Weight { - (11_767_000 as Weight) + (11_797_000 as Weight) // Standard Error: 1_000 - .saturating_add((115_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((117_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_other_vote(r: u32, ) -> Weight { - (11_959_000 as Weight) + (11_930_000 as Weight) // Standard Error: 1_000 - .saturating_add((111_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((122_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -319,15 +319,15 @@ impl WeightInfo for () { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - (42_599_000 as Weight) + (42_560_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Democracy DepositOf (r:1 w:1) fn second(s: u32, ) -> Weight { - (25_521_000 as Weight) + (25_603_000 as Weight) // Standard Error: 1_000 - .saturating_add((171_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((167_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -335,9 +335,9 @@ impl WeightInfo for () { // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_new(r: u32, ) -> Weight { - (34_035_000 as Weight) - // Standard Error: 1_000 - .saturating_add((142_000 as Weight).saturating_mul(r as Weight)) + (34_248_000 as Weight) + // Standard Error: 2_000 + .saturating_add((135_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -345,16 +345,16 @@ impl WeightInfo for () { // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_existing(r: u32, ) -> Weight { - (33_910_000 as Weight) - // Standard Error: 1_000 - .saturating_add((147_000 as Weight).saturating_mul(r as Weight)) + (33_927_000 as Weight) + // Standard Error: 2_000 + .saturating_add((138_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - (14_874_000 as Weight) + (14_714_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -365,45 +365,45 @@ impl WeightInfo for () { // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) fn blacklist(p: u32, ) -> Weight { - (49_557_000 as Weight) + (49_423_000 as Weight) // Standard Error: 3_000 - .saturating_add((267_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((275_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) fn external_propose(v: u32, ) -> Weight { - (7_540_000 as Weight) + (7_321_000 as Weight) // Standard Error: 0 - .saturating_add((76_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((75_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - (1_272_000 as Weight) + (1_325_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - (1_274_000 as Weight) + (1_283_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - (15_216_000 as Weight) + (15_355_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) fn veto_external(v: u32, ) -> Weight { - (16_713_000 as Weight) + (16_597_000 as Weight) // Standard Error: 0 - .saturating_add((92_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((90_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -411,23 +411,23 @@ impl WeightInfo for () { // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) fn cancel_proposal(p: u32, ) -> Weight { - (37_990_000 as Weight) + (37_695_000 as Weight) // Standard Error: 2_000 - .saturating_add((259_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((258_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - (9_756_000 as Weight) + (9_456_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_queued(r: u32, ) -> Weight { - (19_408_000 as Weight) + (19_915_000 as Weight) // Standard Error: 1_000 - .saturating_add((650_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((609_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -435,9 +435,9 @@ impl WeightInfo for () { // Storage: Democracy ReferendumCount (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base(r: u32, ) -> Weight { - (2_134_000 as Weight) - // Standard Error: 3_000 - .saturating_add((3_041_000 as Weight).saturating_mul(r as Weight)) + (3_787_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_852_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -449,9 +449,9 @@ impl WeightInfo for () { // Storage: Democracy PublicProps (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - (6_357_000 as Weight) - // Standard Error: 3_000 - .saturating_add((3_054_000 as Weight).saturating_mul(r as Weight)) + (7_890_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_856_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -460,9 +460,9 @@ impl WeightInfo for () { // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn delegate(r: u32, ) -> Weight { - (30_822_000 as Weight) + (31_190_000 as Weight) // Standard Error: 3_000 - .saturating_add((3_826_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((3_753_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) @@ -471,9 +471,9 @@ impl WeightInfo for () { // Storage: Democracy VotingOf (r:2 w:2) // Storage: Democracy ReferendumInfoOf (r:1 w:1) fn undelegate(r: u32, ) -> Weight { - (15_307_000 as Weight) + (15_121_000 as Weight) // Standard Error: 3_000 - .saturating_add((3_827_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((3_852_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -481,12 +481,12 @@ impl WeightInfo for () { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - (1_624_000 as Weight) + (1_583_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Democracy Preimages (r:1 w:1) fn note_preimage(b: u32, ) -> Weight { - (22_731_000 as Weight) + (22_681_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) @@ -494,7 +494,7 @@ impl WeightInfo for () { } // Storage: Democracy Preimages (r:1 w:1) fn note_imminent_preimage(b: u32, ) -> Weight { - (15_518_000 as Weight) + (15_599_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) @@ -503,7 +503,7 @@ impl WeightInfo for () { // Storage: Democracy Preimages (r:1 w:1) // Storage: System Account (r:1 w:0) fn reap_preimage(b: u32, ) -> Weight { - (23_749_000 as Weight) + (23_663_000 as Weight) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) @@ -513,9 +513,9 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_remove(r: u32, ) -> Weight { - (21_818_000 as Weight) + (21_928_000 as Weight) // Standard Error: 1_000 - .saturating_add((66_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((61_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -523,27 +523,27 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_set(r: u32, ) -> Weight { - (21_491_000 as Weight) + (21_548_000 as Weight) // Standard Error: 1_000 - .saturating_add((121_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((123_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_vote(r: u32, ) -> Weight { - (11_767_000 as Weight) + (11_797_000 as Weight) // Standard Error: 1_000 - .saturating_add((115_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((117_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_other_vote(r: u32, ) -> Weight { - (11_959_000 as Weight) + (11_930_000 as Weight) // Standard Error: 1_000 - .saturating_add((111_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((122_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/frame/election-provider-multi-phase/Cargo.toml b/frame/election-provider-multi-phase/Cargo.toml index 7add94dc76c80..c0d85737ec221 100644 --- a/frame/election-provider-multi-phase/Cargo.toml +++ b/frame/election-provider-multi-phase/Cargo.toml @@ -23,10 +23,10 @@ log = { version = "0.4.14", default-features = false } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-npos-elections = { version = "4.0.0-dev", default-features = false, path = "../../primitives/npos-elections" } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../../primitives/arithmetic" } frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../election-provider-support" } @@ -37,14 +37,13 @@ rand = { version = "0.7.3", default-features = false, optional = true, features "alloc", "small_rng", ] } -strum = { optional = true, version = "0.22.0" } -strum_macros = { optional = true, version = "0.23.1" } +strum = { optional = true, default-features = false, version = "0.23.0", features = ["derive"] } [dev-dependencies] parking_lot = "0.11.2" rand = { version = "0.7.3" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } sp-npos-elections = { version = "4.0.0-dev", default-features = false, path = "../../primitives/npos-elections" } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } frame-election-provider-support = { version = "4.0.0-dev", features = [ @@ -70,12 +69,15 @@ std = [ "sp-arithmetic/std", "frame-election-provider-support/std", "log/std", + + "frame-benchmarking/std", + "rand/std", + "strum/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-election-provider-support/runtime-benchmarks", "rand", "strum", - "strum_macros", ] try-runtime = ["frame-support/try-runtime"] diff --git a/frame/election-provider-multi-phase/src/lib.rs b/frame/election-provider-multi-phase/src/lib.rs index f1d1d78912c46..0a620e6c12827 100644 --- a/frame/election-provider-multi-phase/src/lib.rs +++ b/frame/election-provider-multi-phase/src/lib.rs @@ -230,7 +230,9 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode}; -use frame_election_provider_support::{ElectionDataProvider, ElectionProvider}; +use frame_election_provider_support::{ + ElectionDataProvider, ElectionProvider, InstantElectionProvider, +}; use frame_support::{ dispatch::DispatchResultWithPostInfo, ensure, @@ -322,6 +324,15 @@ impl ElectionProvider for NoFallback { } } +impl InstantElectionProvider for NoFallback { + fn instant_elect( + _: Option, + _: Option, + ) -> Result, Self::Error> { + Err("NoFallback.") + } +} + /// Current phase of the pallet. #[derive(PartialEq, Eq, Clone, Copy, Encode, Decode, Debug, TypeInfo)] pub enum Phase { @@ -477,7 +488,7 @@ pub struct SolutionOrSnapshotSize { /// /// Note that this is different from [`pallet::Error`]. #[derive(frame_support::DebugNoBound)] -#[cfg_attr(feature = "runtime-benchmarks", derive(strum_macros::IntoStaticStr))] +#[cfg_attr(feature = "runtime-benchmarks", derive(strum::IntoStaticStr))] pub enum ElectionError { /// An error happened in the feasibility check sub-system. Feasibility(FeasibilityError), @@ -522,7 +533,7 @@ impl From> for ElectionError { /// Errors that can happen in the feasibility check. #[derive(Debug, Eq, PartialEq)] -#[cfg_attr(feature = "runtime-benchmarks", derive(strum_macros::IntoStaticStr))] +#[cfg_attr(feature = "runtime-benchmarks", derive(strum::IntoStaticStr))] pub enum FeasibilityError { /// Wrong number of winners presented. WrongWinnerCount, @@ -555,7 +566,7 @@ pub use pallet::*; #[frame_support::pallet] pub mod pallet { use super::*; - use frame_election_provider_support::NposSolver; + use frame_election_provider_support::{InstantElectionProvider, NposSolver}; use frame_support::{pallet_prelude::*, traits::EstimateCallFee}; use frame_system::pallet_prelude::*; @@ -672,13 +683,23 @@ pub mod pallet { + NposSolution + TypeInfo; - /// Configuration for the fallback + /// Configuration for the fallback. type Fallback: ElectionProvider< AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Self::DataProvider, >; + /// Configuration of the governance-only fallback. + /// + /// As a side-note, it is recommend for test-nets to use `type ElectionProvider = + /// OnChainSeqPhragmen<_>` if the test-net is not expected to have thousands of nominators. + type GovernanceFallback: InstantElectionProvider< + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + DataProvider = Self::DataProvider, + >; + /// OCW election solution miner algorithm implementation. type Solver: NposSolver; @@ -1013,6 +1034,37 @@ pub mod pallet { }); Ok(()) } + + /// Trigger the governance fallback. + /// + /// This can only be called when [`Phase::Emergency`] is enabled, as an alternative to + /// calling [`Call::set_emergency_election_result`]. + #[pallet::weight(T::DbWeight::get().reads_writes(1, 1))] + pub fn governance_fallback( + origin: OriginFor, + maybe_max_voters: Option, + maybe_max_targets: Option, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + ensure!(Self::current_phase().is_emergency(), >::CallNotAllowed); + + let maybe_max_voters = maybe_max_voters.map(|x| x as usize); + let maybe_max_targets = maybe_max_targets.map(|x| x as usize); + + let supports = + T::GovernanceFallback::instant_elect(maybe_max_voters, maybe_max_targets).map_err( + |e| { + log!(error, "GovernanceFallback failed: {:?}", e); + Error::::FallbackFailed + }, + )?; + + let solution = + ReadySolution { supports, score: [0, 0, 0], compute: ElectionCompute::Fallback }; + + >::put(solution); + Ok(()) + } } #[pallet::event] @@ -1063,6 +1115,8 @@ pub mod pallet { InvalidSubmissionIndex, /// The call is not allowed at this point. CallNotAllowed, + /// The fallback failed + FallbackFailed, } #[pallet::validate_unsigned] diff --git a/frame/election-provider-multi-phase/src/mock.rs b/frame/election-provider-multi-phase/src/mock.rs index 1be93c363e321..9ac0ecfef5dce 100644 --- a/frame/election-provider-multi-phase/src/mock.rs +++ b/frame/election-provider-multi-phase/src/mock.rs @@ -410,6 +410,7 @@ impl crate::Config for Runtime { type WeightInfo = DualMockWeightInfo; type BenchmarkingConfig = TestBenchmarkingConfig; type Fallback = MockFallback; + type GovernanceFallback = NoFallback; type ForceOrigin = frame_system::EnsureRoot; type Solution = TestNposSolution; type VoterSnapshotPerBlock = VoterSnapshotPerBlock; diff --git a/frame/election-provider-multi-phase/src/weights.rs b/frame/election-provider-multi-phase/src/weights.rs index 8e627b246d376..99e149eff2410 100644 --- a/frame/election-provider-multi-phase/src/weights.rs +++ b/frame/election-provider-multi-phase/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_election_provider_multi_phase //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/election-provider-multi-phase/src//weights.rs +// --output=./frame/election-provider-multi-phase/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -70,33 +70,33 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ForceEra (r:1 w:0) // Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0) fn on_initialize_nothing() -> Weight { - (12_360_000 as Weight) + (12_763_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) } // Storage: ElectionProviderMultiPhase Round (r:1 w:0) // Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) fn on_initialize_open_signed() -> Weight { - (12_981_000 as Weight) + (13_195_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: ElectionProviderMultiPhase Round (r:1 w:0) // Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) fn on_initialize_open_unsigned() -> Weight { - (12_684_000 as Weight) + (12_782_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) // Storage: ElectionProviderMultiPhase QueuedSolution (r:0 w:1) fn finalize_signed_phase_accept_solution() -> Weight { - (27_272_000 as Weight) + (27_421_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: System Account (r:1 w:1) fn finalize_signed_phase_reject_solution() -> Weight { - (20_798_000 as Weight) + (21_325_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -104,11 +104,11 @@ impl WeightInfo for SubstrateWeight { // Storage: ElectionProviderMultiPhase DesiredTargets (r:0 w:1) // Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1) fn create_snapshot_internal(v: u32, t: u32, ) -> Weight { - (13_760_000 as Weight) + (0 as Weight) // Standard Error: 1_000 - .saturating_add((201_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((216_000 as Weight).saturating_mul(v as Weight)) // Standard Error: 3_000 - .saturating_add((49_000 as Weight).saturating_mul(t as Weight)) + .saturating_add((51_000 as Weight).saturating_mul(t as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1) @@ -121,11 +121,11 @@ impl WeightInfo for SubstrateWeight { // Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1) // Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) fn elect_queued(a: u32, d: u32, ) -> Weight { - (108_461_000 as Weight) - // Standard Error: 3_000 - .saturating_add((1_318_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 5_000 - .saturating_add((194_000 as Weight).saturating_mul(d as Weight)) + (38_368_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_414_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 7_000 + .saturating_add((175_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -136,9 +136,9 @@ impl WeightInfo for SubstrateWeight { // Storage: ElectionProviderMultiPhase SignedSubmissionNextIndex (r:1 w:1) // Storage: ElectionProviderMultiPhase SignedSubmissionsMap (r:0 w:1) fn submit(c: u32, ) -> Weight { - (39_721_000 as Weight) - // Standard Error: 24_000 - .saturating_add((298_000 as Weight).saturating_mul(c as Weight)) + (39_488_000 as Weight) + // Standard Error: 22_000 + .saturating_add((230_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -151,14 +151,14 @@ impl WeightInfo for SubstrateWeight { // Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0) fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((1_612_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 8_000 - .saturating_add((105_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 13_000 - .saturating_add((7_024_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 20_000 - .saturating_add((1_361_000 as Weight).saturating_mul(d as Weight)) + // Standard Error: 2_000 + .saturating_add((1_544_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 5_000 + .saturating_add((60_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 9_000 + .saturating_add((6_555_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 14_000 + .saturating_add((1_318_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -168,14 +168,14 @@ impl WeightInfo for SubstrateWeight { // Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0) fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_000 - .saturating_add((1_639_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 5_000 - .saturating_add((138_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 8_000 - .saturating_add((5_665_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 13_000 - .saturating_add((980_000 as Weight).saturating_mul(d as Weight)) + // Standard Error: 3_000 + .saturating_add((1_527_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 6_000 + .saturating_add((151_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 10_000 + .saturating_add((5_433_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 15_000 + .saturating_add((1_420_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } } @@ -191,33 +191,33 @@ impl WeightInfo for () { // Storage: Staking ForceEra (r:1 w:0) // Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0) fn on_initialize_nothing() -> Weight { - (12_360_000 as Weight) + (12_763_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) } // Storage: ElectionProviderMultiPhase Round (r:1 w:0) // Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) fn on_initialize_open_signed() -> Weight { - (12_981_000 as Weight) + (13_195_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: ElectionProviderMultiPhase Round (r:1 w:0) // Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) fn on_initialize_open_unsigned() -> Weight { - (12_684_000 as Weight) + (12_782_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) // Storage: ElectionProviderMultiPhase QueuedSolution (r:0 w:1) fn finalize_signed_phase_accept_solution() -> Weight { - (27_272_000 as Weight) + (27_421_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: System Account (r:1 w:1) fn finalize_signed_phase_reject_solution() -> Weight { - (20_798_000 as Weight) + (21_325_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -225,11 +225,11 @@ impl WeightInfo for () { // Storage: ElectionProviderMultiPhase DesiredTargets (r:0 w:1) // Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1) fn create_snapshot_internal(v: u32, t: u32, ) -> Weight { - (13_760_000 as Weight) + (0 as Weight) // Standard Error: 1_000 - .saturating_add((201_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((216_000 as Weight).saturating_mul(v as Weight)) // Standard Error: 3_000 - .saturating_add((49_000 as Weight).saturating_mul(t as Weight)) + .saturating_add((51_000 as Weight).saturating_mul(t as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1) @@ -242,11 +242,11 @@ impl WeightInfo for () { // Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1) // Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) fn elect_queued(a: u32, d: u32, ) -> Weight { - (108_461_000 as Weight) - // Standard Error: 3_000 - .saturating_add((1_318_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 5_000 - .saturating_add((194_000 as Weight).saturating_mul(d as Weight)) + (38_368_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_414_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 7_000 + .saturating_add((175_000 as Weight).saturating_mul(d as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -257,9 +257,9 @@ impl WeightInfo for () { // Storage: ElectionProviderMultiPhase SignedSubmissionNextIndex (r:1 w:1) // Storage: ElectionProviderMultiPhase SignedSubmissionsMap (r:0 w:1) fn submit(c: u32, ) -> Weight { - (39_721_000 as Weight) - // Standard Error: 24_000 - .saturating_add((298_000 as Weight).saturating_mul(c as Weight)) + (39_488_000 as Weight) + // Standard Error: 22_000 + .saturating_add((230_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -272,14 +272,14 @@ impl WeightInfo for () { // Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0) fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((1_612_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 8_000 - .saturating_add((105_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 13_000 - .saturating_add((7_024_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 20_000 - .saturating_add((1_361_000 as Weight).saturating_mul(d as Weight)) + // Standard Error: 2_000 + .saturating_add((1_544_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 5_000 + .saturating_add((60_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 9_000 + .saturating_add((6_555_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 14_000 + .saturating_add((1_318_000 as Weight).saturating_mul(d as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -289,14 +289,14 @@ impl WeightInfo for () { // Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0) fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_000 - .saturating_add((1_639_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 5_000 - .saturating_add((138_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 8_000 - .saturating_add((5_665_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 13_000 - .saturating_add((980_000 as Weight).saturating_mul(d as Weight)) + // Standard Error: 3_000 + .saturating_add((1_527_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 6_000 + .saturating_add((151_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 10_000 + .saturating_add((5_433_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 15_000 + .saturating_add((1_420_000 as Weight).saturating_mul(d as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } } diff --git a/frame/election-provider-support/Cargo.toml b/frame/election-provider-support/Cargo.toml index 1cb477d6c79c7..662762ef63068 100644 --- a/frame/election-provider-support/Cargo.toml +++ b/frame/election-provider-support/Cargo.toml @@ -23,9 +23,9 @@ frame-system = { version = "4.0.0-dev", default-features = false, path = "../sys [dev-dependencies] sp-npos-elections = { version = "4.0.0-dev", path = "../../primitives/npos-elections" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } [features] default = ["std"] diff --git a/frame/election-provider-support/src/lib.rs b/frame/election-provider-support/src/lib.rs index 3374e1e97b8be..26efe5107b670 100644 --- a/frame/election-provider-support/src/lib.rs +++ b/frame/election-provider-support/src/lib.rs @@ -319,6 +319,22 @@ pub trait ElectionProvider { fn elect() -> Result, Self::Error>; } +/// A sub-trait of the [`ElectionProvider`] for cases where we need to be sure an election needs to +/// happen instantly, not asynchronously. +/// +/// The same `DataProvider` is assumed to be used. +/// +/// Consequently, allows for control over the amount of data that is being fetched from the +/// [`ElectionProvider::DataProvider`]. +pub trait InstantElectionProvider: ElectionProvider { + /// Elect a new set of winners, instantly, with the given given limits set on the + /// `DataProvider`. + fn instant_elect( + maybe_max_voters: Option, + maybe_max_targets: Option, + ) -> Result, Self::Error>; +} + /// An election provider to be used only for testing. #[cfg(feature = "std")] pub struct NoElection(sp_std::marker::PhantomData); diff --git a/frame/election-provider-support/src/onchain.rs b/frame/election-provider-support/src/onchain.rs index 808b49ba6234d..41245f67fb02c 100644 --- a/frame/election-provider-support/src/onchain.rs +++ b/frame/election-provider-support/src/onchain.rs @@ -17,7 +17,7 @@ //! An implementation of [`ElectionProvider`] that does an on-chain sequential phragmen. -use crate::{ElectionDataProvider, ElectionProvider}; +use crate::{ElectionDataProvider, ElectionProvider, InstantElectionProvider}; use frame_support::{traits::Get, weights::DispatchClass}; use sp_npos_elections::*; use sp_std::{collections::btree_map::BTreeMap, marker::PhantomData, prelude::*}; @@ -47,8 +47,14 @@ impl From for Error { /// implementation ignores the additional data of the election data provider and gives no insight on /// how much weight was consumed. /// -/// Finally, this implementation does not impose any limits on the number of voters and targets that -/// are provided. +/// Finally, the [`ElectionProvider`] implementation of this type does not impose any limits on the +/// number of voters and targets that are fetched. This could potentially make this unsuitable for +/// execution onchain. On the other hand, the [`InstantElectionProvider`] implementation does limit +/// these inputs. +/// +/// It is advisable to use the former ([`ElectionProvider::elect`]) only at genesis, or for testing, +/// the latter [`InstantElectionProvider::instant_elect`] for onchain operations, with thoughtful +/// bounds. pub struct OnChainSequentialPhragmen(PhantomData); /// Configuration trait of [`OnChainSequentialPhragmen`]. @@ -68,16 +74,17 @@ pub trait Config: frame_system::Config { >; } -impl ElectionProvider for OnChainSequentialPhragmen { - type AccountId = T::AccountId; - type BlockNumber = T::BlockNumber; - type Error = Error; - type DataProvider = T::DataProvider; - - fn elect() -> Result, Self::Error> { - let voters = Self::DataProvider::voters(None).map_err(Error::DataProvider)?; - let targets = Self::DataProvider::targets(None).map_err(Error::DataProvider)?; - let desired_targets = Self::DataProvider::desired_targets().map_err(Error::DataProvider)?; +impl OnChainSequentialPhragmen { + fn elect_with( + maybe_max_voters: Option, + maybe_max_targets: Option, + ) -> Result, Error> { + let voters = ::DataProvider::voters(maybe_max_voters) + .map_err(Error::DataProvider)?; + let targets = ::DataProvider::targets(maybe_max_targets) + .map_err(Error::DataProvider)?; + let desired_targets = ::DataProvider::desired_targets() + .map_err(Error::DataProvider)?; let stake_map: BTreeMap = voters .iter() @@ -102,6 +109,26 @@ impl ElectionProvider for OnChainSequentialPhragmen { } } +impl ElectionProvider for OnChainSequentialPhragmen { + type AccountId = T::AccountId; + type BlockNumber = T::BlockNumber; + type Error = Error; + type DataProvider = T::DataProvider; + + fn elect() -> Result, Self::Error> { + Self::elect_with(None, None) + } +} + +impl InstantElectionProvider for OnChainSequentialPhragmen { + fn instant_elect( + maybe_max_voters: Option, + maybe_max_targets: Option, + ) -> Result, Self::Error> { + Self::elect_with(maybe_max_voters, maybe_max_targets) + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/frame/elections-phragmen/Cargo.toml b/frame/elections-phragmen/Cargo.toml index 867b1627272a7..f70eb568349b4 100644 --- a/frame/elections-phragmen/Cargo.toml +++ b/frame/elections-phragmen/Cargo.toml @@ -17,19 +17,19 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = "derive", ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-npos-elections = { version = "4.0.0-dev", default-features = false, path = "../../primitives/npos-elections" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } log = { version = "0.4.14", default-features = false } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", path = "../balances" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } substrate-test-utils = { version = "4.0.0-dev", path = "../../test-utils" } [features] diff --git a/frame/elections-phragmen/src/weights.rs b/frame/elections-phragmen/src/weights.rs index 57cb1b718fb7b..22c1c1cbeb406 100644 --- a/frame/elections-phragmen/src/weights.rs +++ b/frame/elections-phragmen/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_elections_phragmen //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/elections-phragmen/src//weights.rs +// --output=./frame/elections-phragmen/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -70,9 +70,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_equal(v: u32, ) -> Weight { - (24_231_000 as Weight) - // Standard Error: 4_000 - .saturating_add((305_000 as Weight).saturating_mul(v as Weight)) + (23_406_000 as Weight) + // Standard Error: 6_000 + .saturating_add((270_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -82,9 +82,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_more(v: u32, ) -> Weight { - (37_524_000 as Weight) + (35_660_000 as Weight) // Standard Error: 6_000 - .saturating_add((285_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((316_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -94,16 +94,16 @@ impl WeightInfo for SubstrateWeight { // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_less(v: u32, ) -> Weight { - (37_350_000 as Weight) - // Standard Error: 7_000 - .saturating_add((311_000 as Weight).saturating_mul(v as Weight)) + (35_999_000 as Weight) + // Standard Error: 6_000 + .saturating_add((299_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn remove_voter() -> Weight { - (35_119_000 as Weight) + (33_692_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -111,17 +111,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Elections Members (r:1 w:0) // Storage: Elections RunnersUp (r:1 w:0) fn submit_candidacy(c: u32, ) -> Weight { - (36_110_000 as Weight) + (35_506_000 as Weight) // Standard Error: 1_000 - .saturating_add((193_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((192_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Elections Candidates (r:1 w:1) fn renounce_candidacy_candidate(c: u32, ) -> Weight { - (30_976_000 as Weight) + (31_402_000 as Weight) // Standard Error: 1_000 - .saturating_add((129_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((113_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -131,13 +131,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Council Proposals (r:1 w:0) // Storage: Council Members (r:0 w:1) fn renounce_candidacy_members() -> Weight { - (44_456_000 as Weight) + (42_727_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Elections RunnersUp (r:1 w:1) fn renounce_candidacy_runners_up() -> Weight { - (31_990_000 as Weight) + (30_638_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -152,13 +152,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Council Proposals (r:1 w:0) // Storage: Council Members (r:0 w:1) fn remove_member_with_replacement() -> Weight { - (51_221_000 as Weight) + (49_317_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Elections RunnersUp (r:1 w:0) fn remove_member_wrong_refund() -> Weight { - (4_773_000 as Weight) + (4_688_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Elections Voting (r:251 w:250) @@ -169,8 +169,8 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:250 w:250) fn clean_defunct_voters(v: u32, _d: u32, ) -> Weight { (0 as Weight) - // Standard Error: 31_000 - .saturating_add((51_744_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 36_000 + .saturating_add((51_016_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) @@ -186,12 +186,12 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:2 w:2) fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_744_000 - .saturating_add((29_677_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 725_000 - .saturating_add((51_480_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 1_760_000 + .saturating_add((29_569_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 732_000 + .saturating_add((51_842_000 as Weight).saturating_mul(v as Weight)) // Standard Error: 49_000 - .saturating_add((3_491_000 as Weight).saturating_mul(e as Weight)) + .saturating_add((3_546_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) @@ -206,9 +206,9 @@ impl WeightInfo for () { // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_equal(v: u32, ) -> Weight { - (24_231_000 as Weight) - // Standard Error: 4_000 - .saturating_add((305_000 as Weight).saturating_mul(v as Weight)) + (23_406_000 as Weight) + // Standard Error: 6_000 + .saturating_add((270_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -218,9 +218,9 @@ impl WeightInfo for () { // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_more(v: u32, ) -> Weight { - (37_524_000 as Weight) + (35_660_000 as Weight) // Standard Error: 6_000 - .saturating_add((285_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((316_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -230,16 +230,16 @@ impl WeightInfo for () { // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_less(v: u32, ) -> Weight { - (37_350_000 as Weight) - // Standard Error: 7_000 - .saturating_add((311_000 as Weight).saturating_mul(v as Weight)) + (35_999_000 as Weight) + // Standard Error: 6_000 + .saturating_add((299_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Elections Voting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn remove_voter() -> Weight { - (35_119_000 as Weight) + (33_692_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -247,17 +247,17 @@ impl WeightInfo for () { // Storage: Elections Members (r:1 w:0) // Storage: Elections RunnersUp (r:1 w:0) fn submit_candidacy(c: u32, ) -> Weight { - (36_110_000 as Weight) + (35_506_000 as Weight) // Standard Error: 1_000 - .saturating_add((193_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((192_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Elections Candidates (r:1 w:1) fn renounce_candidacy_candidate(c: u32, ) -> Weight { - (30_976_000 as Weight) + (31_402_000 as Weight) // Standard Error: 1_000 - .saturating_add((129_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((113_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -267,13 +267,13 @@ impl WeightInfo for () { // Storage: Council Proposals (r:1 w:0) // Storage: Council Members (r:0 w:1) fn renounce_candidacy_members() -> Weight { - (44_456_000 as Weight) + (42_727_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Elections RunnersUp (r:1 w:1) fn renounce_candidacy_runners_up() -> Weight { - (31_990_000 as Weight) + (30_638_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -288,13 +288,13 @@ impl WeightInfo for () { // Storage: Council Proposals (r:1 w:0) // Storage: Council Members (r:0 w:1) fn remove_member_with_replacement() -> Weight { - (51_221_000 as Weight) + (49_317_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Elections RunnersUp (r:1 w:0) fn remove_member_wrong_refund() -> Weight { - (4_773_000 as Weight) + (4_688_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } // Storage: Elections Voting (r:251 w:250) @@ -305,8 +305,8 @@ impl WeightInfo for () { // Storage: System Account (r:250 w:250) fn clean_defunct_voters(v: u32, _d: u32, ) -> Weight { (0 as Weight) - // Standard Error: 31_000 - .saturating_add((51_744_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 36_000 + .saturating_add((51_016_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) @@ -322,12 +322,12 @@ impl WeightInfo for () { // Storage: System Account (r:2 w:2) fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_744_000 - .saturating_add((29_677_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 725_000 - .saturating_add((51_480_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 1_760_000 + .saturating_add((29_569_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 732_000 + .saturating_add((51_842_000 as Weight).saturating_mul(v as Weight)) // Standard Error: 49_000 - .saturating_add((3_491_000 as Weight).saturating_mul(e as Weight)) + .saturating_add((3_546_000 as Weight).saturating_mul(e as Weight)) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) diff --git a/frame/examples/basic/Cargo.toml b/frame/examples/basic/Cargo.toml index 894b9b4d5010d..73c11475fdf61 100644 --- a/frame/examples/basic/Cargo.toml +++ b/frame/examples/basic/Cargo.toml @@ -21,12 +21,12 @@ frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = " frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" } pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../../balances" } -sp-io = { version = "4.0.0", default-features = false, path = "../../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core", default-features = false } +sp-core = { version = "5.0.0", path = "../../../primitives/core", default-features = false } [features] default = ["std"] diff --git a/frame/examples/offchain-worker/Cargo.toml b/frame/examples/offchain-worker/Cargo.toml index 68ad2125eef42..e7ae323050ee1 100644 --- a/frame/examples/offchain-worker/Cargo.toml +++ b/frame/examples/offchain-worker/Cargo.toml @@ -20,10 +20,10 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"] frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/io" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore", optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../../primitives/io" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore", optional = true } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } [features] diff --git a/frame/examples/parallel/Cargo.toml b/frame/examples/parallel/Cargo.toml index b3ec1a72506b4..8d291df191368 100644 --- a/frame/examples/parallel/Cargo.toml +++ b/frame/examples/parallel/Cargo.toml @@ -17,9 +17,9 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"] frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } sp-tasks = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/tasks" } diff --git a/frame/executive/Cargo.toml b/frame/executive/Cargo.toml index 1b6a237f3b93f..b261aecdf9262 100644 --- a/frame/executive/Cargo.toml +++ b/frame/executive/Cargo.toml @@ -19,16 +19,16 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-tracing = { version = "4.0.0", default-features = false, path = "../../primitives/tracing" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } [dev-dependencies] hex-literal = "0.3.4" -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-transaction-payment = { version = "4.0.0-dev", path = "../transaction-payment" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } diff --git a/frame/gilt/Cargo.toml b/frame/gilt/Cargo.toml index b958b7ba337fe..7ed17d152a01e 100644 --- a/frame/gilt/Cargo.toml +++ b/frame/gilt/Cargo.toml @@ -16,15 +16,15 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../../primitives/arithmetic" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/gilt/src/weights.rs b/frame/gilt/src/weights.rs index b56b6051a9aee..6084d494c5c3a 100644 --- a/frame/gilt/src/weights.rs +++ b/frame/gilt/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_gilt //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/gilt/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -62,44 +62,44 @@ impl WeightInfo for SubstrateWeight { // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt QueueTotals (r:1 w:1) fn place_bid(l: u32, ) -> Weight { - (32_876_000 as Weight) + (32_753_000 as Weight) // Standard Error: 0 - .saturating_add((97_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((96_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt QueueTotals (r:1 w:1) fn place_bid_max() -> Weight { - (125_854_000 as Weight) + (124_814_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt QueueTotals (r:1 w:1) fn retract_bid(l: u32, ) -> Weight { - (33_643_000 as Weight) + (33_544_000 as Weight) // Standard Error: 0 - .saturating_add((88_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((86_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Gilt ActiveTotal (r:1 w:1) fn set_target() -> Weight { - (2_570_000 as Weight) + (2_648_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Gilt Active (r:1 w:1) // Storage: Gilt ActiveTotal (r:1 w:1) fn thaw() -> Weight { - (40_854_000 as Weight) + (41_549_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Gilt ActiveTotal (r:1 w:0) fn pursue_target_noop() -> Weight { - (1_598_000 as Weight) + (1_583_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Gilt ActiveTotal (r:1 w:1) @@ -107,9 +107,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt Active (r:0 w:1) fn pursue_target_per_item(b: u32, ) -> Weight { - (34_848_000 as Weight) + (35_836_000 as Weight) // Standard Error: 1_000 - .saturating_add((3_951_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((4_008_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) @@ -119,9 +119,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt Active (r:0 w:1) fn pursue_target_per_queue(q: u32, ) -> Weight { - (9_735_000 as Weight) + (12_139_000 as Weight) // Standard Error: 6_000 - .saturating_add((7_873_000 as Weight).saturating_mul(q as Weight)) + .saturating_add((7_819_000 as Weight).saturating_mul(q as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(q as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -134,44 +134,44 @@ impl WeightInfo for () { // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt QueueTotals (r:1 w:1) fn place_bid(l: u32, ) -> Weight { - (32_876_000 as Weight) + (32_753_000 as Weight) // Standard Error: 0 - .saturating_add((97_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((96_000 as Weight).saturating_mul(l as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt QueueTotals (r:1 w:1) fn place_bid_max() -> Weight { - (125_854_000 as Weight) + (124_814_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt QueueTotals (r:1 w:1) fn retract_bid(l: u32, ) -> Weight { - (33_643_000 as Weight) + (33_544_000 as Weight) // Standard Error: 0 - .saturating_add((88_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((86_000 as Weight).saturating_mul(l as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Gilt ActiveTotal (r:1 w:1) fn set_target() -> Weight { - (2_570_000 as Weight) + (2_648_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Gilt Active (r:1 w:1) // Storage: Gilt ActiveTotal (r:1 w:1) fn thaw() -> Weight { - (40_854_000 as Weight) + (41_549_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Gilt ActiveTotal (r:1 w:0) fn pursue_target_noop() -> Weight { - (1_598_000 as Weight) + (1_583_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } // Storage: Gilt ActiveTotal (r:1 w:1) @@ -179,9 +179,9 @@ impl WeightInfo for () { // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt Active (r:0 w:1) fn pursue_target_per_item(b: u32, ) -> Weight { - (34_848_000 as Weight) + (35_836_000 as Weight) // Standard Error: 1_000 - .saturating_add((3_951_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((4_008_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) @@ -191,9 +191,9 @@ impl WeightInfo for () { // Storage: Gilt Queues (r:1 w:1) // Storage: Gilt Active (r:0 w:1) fn pursue_target_per_queue(q: u32, ) -> Weight { - (9_735_000 as Weight) + (12_139_000 as Weight) // Standard Error: 6_000 - .saturating_add((7_873_000 as Weight).saturating_mul(q as Weight)) + .saturating_add((7_819_000 as Weight).saturating_mul(q as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(q as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) diff --git a/frame/grandpa/Cargo.toml b/frame/grandpa/Cargo.toml index 4b2ab7eca8712..002ceed369299 100644 --- a/frame/grandpa/Cargo.toml +++ b/frame/grandpa/Cargo.toml @@ -15,13 +15,13 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } sp-finality-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../primitives/finality-grandpa" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } diff --git a/frame/identity/Cargo.toml b/frame/identity/Cargo.toml index 00be4d767ec2b..209896ec0e557 100644 --- a/frame/identity/Cargo.toml +++ b/frame/identity/Cargo.toml @@ -17,14 +17,14 @@ codec = { package = "parity-scale-codec", version = "2.2.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } enumflags2 = { version = "0.6.2" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/identity/src/weights.rs b/frame/identity/src/weights.rs index 1d0a7825ec403..cf164d3cbd73f 100644 --- a/frame/identity/src/weights.rs +++ b/frame/identity/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/identity/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -69,19 +69,19 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Identity Registrars (r:1 w:1) fn add_registrar(r: u32, ) -> Weight { - (12_513_000 as Weight) - // Standard Error: 4_000 - .saturating_add((257_000 as Weight).saturating_mul(r as Weight)) + (13_150_000 as Weight) + // Standard Error: 3_000 + .saturating_add((253_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Identity IdentityOf (r:1 w:1) fn set_identity(r: u32, x: u32, ) -> Weight { - (27_904_000 as Weight) + (27_745_000 as Weight) // Standard Error: 7_000 - .saturating_add((215_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((294_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((210_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 1_000 + .saturating_add((289_000 as Weight).saturating_mul(x as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -89,9 +89,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:1 w:1) fn set_subs_new(s: u32, ) -> Weight { - (24_530_000 as Weight) + (25_184_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_914_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_722_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -101,9 +101,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:1) fn set_subs_old(p: u32, ) -> Weight { - (23_957_000 as Weight) + (24_144_000 as Weight) // Standard Error: 0 - .saturating_add((954_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((890_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) @@ -112,13 +112,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Identity IdentityOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:100) fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { - (31_213_000 as Weight) + (32_167_000 as Weight) // Standard Error: 8_000 - .saturating_add((99_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((46_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((931_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((875_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 - .saturating_add((188_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((184_000 as Weight).saturating_mul(x as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -126,27 +126,27 @@ impl WeightInfo for SubstrateWeight { // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn request_judgement(r: u32, x: u32, ) -> Weight { - (30_691_000 as Weight) - // Standard Error: 4_000 - .saturating_add((269_000 as Weight).saturating_mul(r as Weight)) + (30_009_000 as Weight) + // Standard Error: 3_000 + .saturating_add((287_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((338_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((331_000 as Weight).saturating_mul(x as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Identity IdentityOf (r:1 w:1) fn cancel_request(r: u32, x: u32, ) -> Weight { - (27_356_000 as Weight) + (28_195_000 as Weight) // Standard Error: 3_000 - .saturating_add((179_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((137_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((335_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((328_000 as Weight).saturating_mul(x as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Identity Registrars (r:1 w:1) fn set_fee(r: u32, ) -> Weight { - (4_761_000 as Weight) + (5_080_000 as Weight) // Standard Error: 2_000 .saturating_add((202_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) @@ -154,28 +154,28 @@ impl WeightInfo for SubstrateWeight { } // Storage: Identity Registrars (r:1 w:1) fn set_account_id(r: u32, ) -> Weight { - (4_801_000 as Weight) - // Standard Error: 3_000 - .saturating_add((211_000 as Weight).saturating_mul(r as Weight)) + (5_298_000 as Weight) + // Standard Error: 2_000 + .saturating_add((195_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Identity Registrars (r:1 w:1) fn set_fields(r: u32, ) -> Weight { - (4_756_000 as Weight) + (5_263_000 as Weight) // Standard Error: 2_000 - .saturating_add((204_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((191_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn provide_judgement(r: u32, x: u32, ) -> Weight { - (21_047_000 as Weight) + (21_511_000 as Weight) // Standard Error: 3_000 - .saturating_add((246_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((219_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((341_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((327_000 as Weight).saturating_mul(x as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -184,11 +184,11 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Identity SuperOf (r:0 w:100) fn kill_identity(r: u32, s: u32, _x: u32, ) -> Weight { - (41_324_000 as Weight) - // Standard Error: 7_000 - .saturating_add((192_000 as Weight).saturating_mul(r as Weight)) + (40_654_000 as Weight) + // Standard Error: 6_000 + .saturating_add((179_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((951_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((908_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -197,18 +197,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn add_sub(s: u32, ) -> Weight { - (31_405_000 as Weight) + (31_573_000 as Weight) // Standard Error: 1_000 - .saturating_add((160_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((151_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) fn rename_sub(s: u32, ) -> Weight { - (10_622_000 as Weight) + (10_452_000 as Weight) // Standard Error: 0 - .saturating_add((47_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((45_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -216,18 +216,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn remove_sub(s: u32, ) -> Weight { - (32_765_000 as Weight) + (32_711_000 as Weight) // Standard Error: 1_000 - .saturating_add((158_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((150_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn quit_sub(s: u32, ) -> Weight { - (21_925_000 as Weight) - // Standard Error: 1_000 - .saturating_add((156_000 as Weight).saturating_mul(s as Weight)) + (21_975_000 as Weight) + // Standard Error: 0 + .saturating_add((149_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -237,19 +237,19 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Identity Registrars (r:1 w:1) fn add_registrar(r: u32, ) -> Weight { - (12_513_000 as Weight) - // Standard Error: 4_000 - .saturating_add((257_000 as Weight).saturating_mul(r as Weight)) + (13_150_000 as Weight) + // Standard Error: 3_000 + .saturating_add((253_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Identity IdentityOf (r:1 w:1) fn set_identity(r: u32, x: u32, ) -> Weight { - (27_904_000 as Weight) + (27_745_000 as Weight) // Standard Error: 7_000 - .saturating_add((215_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((294_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((210_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 1_000 + .saturating_add((289_000 as Weight).saturating_mul(x as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -257,9 +257,9 @@ impl WeightInfo for () { // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:1 w:1) fn set_subs_new(s: u32, ) -> Weight { - (24_530_000 as Weight) + (25_184_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_914_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_722_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -269,9 +269,9 @@ impl WeightInfo for () { // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:1) fn set_subs_old(p: u32, ) -> Weight { - (23_957_000 as Weight) + (24_144_000 as Weight) // Standard Error: 0 - .saturating_add((954_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((890_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) @@ -280,13 +280,13 @@ impl WeightInfo for () { // Storage: Identity IdentityOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:100) fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { - (31_213_000 as Weight) + (32_167_000 as Weight) // Standard Error: 8_000 - .saturating_add((99_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((46_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((931_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((875_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 - .saturating_add((188_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((184_000 as Weight).saturating_mul(x as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -294,27 +294,27 @@ impl WeightInfo for () { // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn request_judgement(r: u32, x: u32, ) -> Weight { - (30_691_000 as Weight) - // Standard Error: 4_000 - .saturating_add((269_000 as Weight).saturating_mul(r as Weight)) + (30_009_000 as Weight) + // Standard Error: 3_000 + .saturating_add((287_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((338_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((331_000 as Weight).saturating_mul(x as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Identity IdentityOf (r:1 w:1) fn cancel_request(r: u32, x: u32, ) -> Weight { - (27_356_000 as Weight) + (28_195_000 as Weight) // Standard Error: 3_000 - .saturating_add((179_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((137_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((335_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((328_000 as Weight).saturating_mul(x as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Identity Registrars (r:1 w:1) fn set_fee(r: u32, ) -> Weight { - (4_761_000 as Weight) + (5_080_000 as Weight) // Standard Error: 2_000 .saturating_add((202_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) @@ -322,28 +322,28 @@ impl WeightInfo for () { } // Storage: Identity Registrars (r:1 w:1) fn set_account_id(r: u32, ) -> Weight { - (4_801_000 as Weight) - // Standard Error: 3_000 - .saturating_add((211_000 as Weight).saturating_mul(r as Weight)) + (5_298_000 as Weight) + // Standard Error: 2_000 + .saturating_add((195_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Identity Registrars (r:1 w:1) fn set_fields(r: u32, ) -> Weight { - (4_756_000 as Weight) + (5_263_000 as Weight) // Standard Error: 2_000 - .saturating_add((204_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((191_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn provide_judgement(r: u32, x: u32, ) -> Weight { - (21_047_000 as Weight) + (21_511_000 as Weight) // Standard Error: 3_000 - .saturating_add((246_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((219_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((341_000 as Weight).saturating_mul(x as Weight)) + .saturating_add((327_000 as Weight).saturating_mul(x as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -352,11 +352,11 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Identity SuperOf (r:0 w:100) fn kill_identity(r: u32, s: u32, _x: u32, ) -> Weight { - (41_324_000 as Weight) - // Standard Error: 7_000 - .saturating_add((192_000 as Weight).saturating_mul(r as Weight)) + (40_654_000 as Weight) + // Standard Error: 6_000 + .saturating_add((179_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 0 - .saturating_add((951_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((908_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -365,18 +365,18 @@ impl WeightInfo for () { // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn add_sub(s: u32, ) -> Weight { - (31_405_000 as Weight) + (31_573_000 as Weight) // Standard Error: 1_000 - .saturating_add((160_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((151_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) fn rename_sub(s: u32, ) -> Weight { - (10_622_000 as Weight) + (10_452_000 as Weight) // Standard Error: 0 - .saturating_add((47_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((45_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -384,18 +384,18 @@ impl WeightInfo for () { // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn remove_sub(s: u32, ) -> Weight { - (32_765_000 as Weight) + (32_711_000 as Weight) // Standard Error: 1_000 - .saturating_add((158_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((150_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn quit_sub(s: u32, ) -> Weight { - (21_925_000 as Weight) - // Standard Error: 1_000 - .saturating_add((156_000 as Weight).saturating_mul(s as Weight)) + (21_975_000 as Weight) + // Standard Error: 0 + .saturating_add((149_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/frame/im-online/Cargo.toml b/frame/im-online/Cargo.toml index 9d659d304dbbe..d223e5e8502d3 100644 --- a/frame/im-online/Cargo.toml +++ b/frame/im-online/Cargo.toml @@ -13,14 +13,14 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } diff --git a/frame/im-online/src/weights.rs b/frame/im-online/src/weights.rs index 4fa5727251b3a..f7d4d1441da27 100644 --- a/frame/im-online/src/weights.rs +++ b/frame/im-online/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_im_online //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/im-online/src//weights.rs +// --output=./frame/im-online/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -58,11 +58,11 @@ impl WeightInfo for SubstrateWeight { // Storage: ImOnline AuthoredBlocks (r:1 w:0) // Storage: ImOnline Keys (r:1 w:0) fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight { - (73_594_000 as Weight) + (74_137_000 as Weight) // Standard Error: 0 - .saturating_add((128_000 as Weight).saturating_mul(k as Weight)) + .saturating_add((125_000 as Weight).saturating_mul(k as Weight)) // Standard Error: 0 - .saturating_add((295_000 as Weight).saturating_mul(e as Weight)) + .saturating_add((291_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -76,11 +76,11 @@ impl WeightInfo for () { // Storage: ImOnline AuthoredBlocks (r:1 w:0) // Storage: ImOnline Keys (r:1 w:0) fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight { - (73_594_000 as Weight) + (74_137_000 as Weight) // Standard Error: 0 - .saturating_add((128_000 as Weight).saturating_mul(k as Weight)) + .saturating_add((125_000 as Weight).saturating_mul(k as Weight)) // Standard Error: 0 - .saturating_add((295_000 as Weight).saturating_mul(e as Weight)) + .saturating_add((291_000 as Weight).saturating_mul(e as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/indices/Cargo.toml b/frame/indices/Cargo.toml index a2998c7cfae94..487eb47164228 100644 --- a/frame/indices/Cargo.toml +++ b/frame/indices/Cargo.toml @@ -17,9 +17,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-keyring = { version = "4.1.0-dev", optional = true, path = "../../primitives/keyring" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } diff --git a/frame/indices/src/weights.rs b/frame/indices/src/weights.rs index 569af75af6dc8..1687237394fbd 100644 --- a/frame/indices/src/weights.rs +++ b/frame/indices/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_indices //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/indices/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -58,33 +58,33 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Indices Accounts (r:1 w:1) fn claim() -> Weight { - (20_754_000 as Weight) + (21_121_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Indices Accounts (r:1 w:1) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (26_655_000 as Weight) + (26_843_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Indices Accounts (r:1 w:1) fn free() -> Weight { - (22_112_000 as Weight) + (22_174_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Indices Accounts (r:1 w:1) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (22_175_000 as Weight) + (22_191_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Indices Accounts (r:1 w:1) fn freeze() -> Weight { - (24_344_000 as Weight) + (24_813_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -94,33 +94,33 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Indices Accounts (r:1 w:1) fn claim() -> Weight { - (20_754_000 as Weight) + (21_121_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Indices Accounts (r:1 w:1) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (26_655_000 as Weight) + (26_843_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Indices Accounts (r:1 w:1) fn free() -> Weight { - (22_112_000 as Weight) + (22_174_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Indices Accounts (r:1 w:1) // Storage: System Account (r:1 w:1) fn force_transfer() -> Weight { - (22_175_000 as Weight) + (22_191_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Indices Accounts (r:1 w:1) fn freeze() -> Weight { - (24_344_000 as Weight) + (24_813_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/lottery/Cargo.toml b/frame/lottery/Cargo.toml index cef152a185880..2e2c2287a2ab6 100644 --- a/frame/lottery/Cargo.toml +++ b/frame/lottery/Cargo.toml @@ -18,7 +18,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } @@ -27,8 +27,8 @@ frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = " [dev-dependencies] frame-support-test = { version = "3.0.0", path = "../support/test" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } [features] default = ["std"] diff --git a/frame/lottery/src/weights.rs b/frame/lottery/src/weights.rs index 080222125c844..3b6114a73cfaa 100644 --- a/frame/lottery/src/weights.rs +++ b/frame/lottery/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_lottery //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/lottery/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -65,28 +65,28 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Lottery Tickets (r:0 w:1) fn buy_ticket() -> Weight { - (38_270_000 as Weight) + (37_257_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Lottery CallIndices (r:0 w:1) fn set_calls(n: u32, ) -> Weight { - (8_830_000 as Weight) - // Standard Error: 7_000 - .saturating_add((291_000 as Weight).saturating_mul(n as Weight)) + (8_966_000 as Weight) + // Standard Error: 5_000 + .saturating_add((302_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Lottery Lottery (r:1 w:1) // Storage: Lottery LotteryIndex (r:1 w:1) // Storage: System Account (r:1 w:1) fn start_lottery() -> Weight { - (31_404_000 as Weight) + (32_282_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Lottery Lottery (r:1 w:1) fn stop_repeat() -> Weight { - (3_825_000 as Weight) + (3_903_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -96,7 +96,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Lottery TicketsCount (r:1 w:1) // Storage: Lottery Tickets (r:1 w:0) fn on_initialize_end() -> Weight { - (49_760_000 as Weight) + (51_489_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -107,7 +107,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Lottery Tickets (r:1 w:0) // Storage: Lottery LotteryIndex (r:1 w:1) fn on_initialize_repeat() -> Weight { - (53_159_000 as Weight) + (53_046_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -123,28 +123,28 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Lottery Tickets (r:0 w:1) fn buy_ticket() -> Weight { - (38_270_000 as Weight) + (37_257_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Lottery CallIndices (r:0 w:1) fn set_calls(n: u32, ) -> Weight { - (8_830_000 as Weight) - // Standard Error: 7_000 - .saturating_add((291_000 as Weight).saturating_mul(n as Weight)) + (8_966_000 as Weight) + // Standard Error: 5_000 + .saturating_add((302_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Lottery Lottery (r:1 w:1) // Storage: Lottery LotteryIndex (r:1 w:1) // Storage: System Account (r:1 w:1) fn start_lottery() -> Weight { - (31_404_000 as Weight) + (32_282_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Lottery Lottery (r:1 w:1) fn stop_repeat() -> Weight { - (3_825_000 as Weight) + (3_903_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -154,7 +154,7 @@ impl WeightInfo for () { // Storage: Lottery TicketsCount (r:1 w:1) // Storage: Lottery Tickets (r:1 w:0) fn on_initialize_end() -> Weight { - (49_760_000 as Weight) + (51_489_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -165,7 +165,7 @@ impl WeightInfo for () { // Storage: Lottery Tickets (r:1 w:0) // Storage: Lottery LotteryIndex (r:1 w:1) fn on_initialize_repeat() -> Weight { - (53_159_000 as Weight) + (53_046_000 as Weight) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } diff --git a/frame/membership/Cargo.toml b/frame/membership/Cargo.toml index 7ded2fd586e19..f2f7607ce9a52 100644 --- a/frame/membership/Cargo.toml +++ b/frame/membership/Cargo.toml @@ -17,9 +17,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } log = { version = "0.4.0", default-features = false } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } diff --git a/frame/membership/src/weights.rs b/frame/membership/src/weights.rs index 59215d3a5bff6..0d4936cfba1f9 100644 --- a/frame/membership/src/weights.rs +++ b/frame/membership/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/membership/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -63,9 +63,9 @@ impl WeightInfo for SubstrateWeight { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn add_member(m: u32, ) -> Weight { - (14_403_000 as Weight) - // Standard Error: 1_000 - .saturating_add((94_000 as Weight).saturating_mul(m as Weight)) + (14_884_000 as Weight) + // Standard Error: 0 + .saturating_add((95_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -75,9 +75,9 @@ impl WeightInfo for SubstrateWeight { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn remove_member(m: u32, ) -> Weight { - (17_005_000 as Weight) + (17_612_000 as Weight) // Standard Error: 0 - .saturating_add((90_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((86_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -87,7 +87,7 @@ impl WeightInfo for SubstrateWeight { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn swap_member(m: u32, ) -> Weight { - (17_210_000 as Weight) + (17_580_000 as Weight) // Standard Error: 0 .saturating_add((98_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) @@ -99,9 +99,9 @@ impl WeightInfo for SubstrateWeight { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn reset_member(m: u32, ) -> Weight { - (17_425_000 as Weight) + (17_610_000 as Weight) // Standard Error: 0 - .saturating_add((194_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((199_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -111,9 +111,9 @@ impl WeightInfo for SubstrateWeight { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn change_key(m: u32, ) -> Weight { - (17_948_000 as Weight) + (18_208_000 as Weight) // Standard Error: 0 - .saturating_add((95_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((96_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -121,18 +121,18 @@ impl WeightInfo for SubstrateWeight { // Storage: TechnicalMembership Prime (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn set_prime(m: u32, ) -> Weight { - (4_579_000 as Weight) + (4_661_000 as Weight) // Standard Error: 0 - .saturating_add((71_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((70_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: TechnicalMembership Prime (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn clear_prime(m: u32, ) -> Weight { - (1_481_000 as Weight) + (1_574_000 as Weight) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((1_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } } @@ -144,9 +144,9 @@ impl WeightInfo for () { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn add_member(m: u32, ) -> Weight { - (14_403_000 as Weight) - // Standard Error: 1_000 - .saturating_add((94_000 as Weight).saturating_mul(m as Weight)) + (14_884_000 as Weight) + // Standard Error: 0 + .saturating_add((95_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -156,9 +156,9 @@ impl WeightInfo for () { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn remove_member(m: u32, ) -> Weight { - (17_005_000 as Weight) + (17_612_000 as Weight) // Standard Error: 0 - .saturating_add((90_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((86_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -168,7 +168,7 @@ impl WeightInfo for () { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn swap_member(m: u32, ) -> Weight { - (17_210_000 as Weight) + (17_580_000 as Weight) // Standard Error: 0 .saturating_add((98_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) @@ -180,9 +180,9 @@ impl WeightInfo for () { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn reset_member(m: u32, ) -> Weight { - (17_425_000 as Weight) + (17_610_000 as Weight) // Standard Error: 0 - .saturating_add((194_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((199_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -192,9 +192,9 @@ impl WeightInfo for () { // Storage: TechnicalCommittee Members (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn change_key(m: u32, ) -> Weight { - (17_948_000 as Weight) + (18_208_000 as Weight) // Standard Error: 0 - .saturating_add((95_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((96_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -202,18 +202,18 @@ impl WeightInfo for () { // Storage: TechnicalMembership Prime (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn set_prime(m: u32, ) -> Weight { - (4_579_000 as Weight) + (4_661_000 as Weight) // Standard Error: 0 - .saturating_add((71_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((70_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: TechnicalMembership Prime (r:0 w:1) // Storage: TechnicalCommittee Prime (r:0 w:1) fn clear_prime(m: u32, ) -> Weight { - (1_481_000 as Weight) + (1_574_000 as Weight) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((1_000 as Weight).saturating_mul(m as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } } diff --git a/frame/merkle-mountain-range/Cargo.toml b/frame/merkle-mountain-range/Cargo.toml index 495b0add5b1c4..a614ffa977154 100644 --- a/frame/merkle-mountain-range/Cargo.toml +++ b/frame/merkle-mountain-range/Cargo.toml @@ -16,9 +16,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } mmr-lib = { package = "ckb-merkle-mountain-range", default-features = false, version = "0.3.2" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } diff --git a/frame/merkle-mountain-range/primitives/Cargo.toml b/frame/merkle-mountain-range/primitives/Cargo.toml index 2e483360facc1..9df5094abd815 100644 --- a/frame/merkle-mountain-range/primitives/Cargo.toml +++ b/frame/merkle-mountain-range/primitives/Cargo.toml @@ -17,8 +17,8 @@ log = { version = "0.4.14", default-features = false } serde = { version = "1.0.132", optional = true, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/api" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } diff --git a/frame/merkle-mountain-range/rpc/Cargo.toml b/frame/merkle-mountain-range/rpc/Cargo.toml index d6bf66cefefbb..575b2a79fcd28 100644 --- a/frame/merkle-mountain-range/rpc/Cargo.toml +++ b/frame/merkle-mountain-range/rpc/Cargo.toml @@ -21,8 +21,8 @@ serde = { version = "1.0.132", features = ["derive"] } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } pallet-mmr-primitives = { version = "4.0.0-dev", path = "../primitives" } diff --git a/frame/multisig/Cargo.toml b/frame/multisig/Cargo.toml index 696f8afe0d85c..dfc05888b1aa9 100644 --- a/frame/multisig/Cargo.toml +++ b/frame/multisig/Cargo.toml @@ -17,14 +17,14 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/multisig/src/weights.rs b/frame/multisig/src/weights.rs index 5dc40197db554..501fb9c184194 100644 --- a/frame/multisig/src/weights.rs +++ b/frame/multisig/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/multisig/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -62,16 +62,16 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn as_multi_threshold_1(z: u32, ) -> Weight { - (16_904_000 as Weight) + (16_534_000 as Weight) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create(s: u32, z: u32, ) -> Weight { - (30_172_000 as Weight) - // Standard Error: 0 - .saturating_add((142_000 as Weight).saturating_mul(s as Weight)) + (30_917_000 as Weight) + // Standard Error: 1_000 + .saturating_add((131_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) @@ -81,9 +81,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Multisig Calls (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (33_039_000 as Weight) + (33_570_000 as Weight) // Standard Error: 1_000 - .saturating_add((140_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((138_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) @@ -91,9 +91,9 @@ impl WeightInfo for SubstrateWeight { } // Storage: Multisig Multisigs (r:1 w:1) fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (20_752_000 as Weight) + (21_051_000 as Weight) // Standard Error: 0 - .saturating_add((133_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((126_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) @@ -102,7 +102,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (33_198_000 as Weight) + (32_581_000 as Weight) // Standard Error: 1_000 .saturating_add((135_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 @@ -114,9 +114,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (39_407_000 as Weight) + (39_215_000 as Weight) // Standard Error: 1_000 - .saturating_add((230_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((221_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) @@ -125,18 +125,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn approve_as_multi_create(s: u32, ) -> Weight { - (28_365_000 as Weight) + (28_572_000 as Weight) // Standard Error: 1_000 - .saturating_add((156_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((146_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:0) fn approve_as_multi_approve(s: u32, ) -> Weight { - (17_960_000 as Weight) + (18_032_000 as Weight) // Standard Error: 0 - .saturating_add((158_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((151_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -144,18 +144,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn approve_as_multi_complete(s: u32, ) -> Weight { - (56_920_000 as Weight) + (56_353_000 as Weight) // Standard Error: 1_000 - .saturating_add((243_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((239_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) fn cancel_as_multi(s: u32, ) -> Weight { - (45_336_000 as Weight) - // Standard Error: 1_000 - .saturating_add((155_000 as Weight).saturating_mul(s as Weight)) + (44_544_000 as Weight) + // Standard Error: 0 + .saturating_add((158_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -164,16 +164,16 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn as_multi_threshold_1(z: u32, ) -> Weight { - (16_904_000 as Weight) + (16_534_000 as Weight) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create(s: u32, z: u32, ) -> Weight { - (30_172_000 as Weight) - // Standard Error: 0 - .saturating_add((142_000 as Weight).saturating_mul(s as Weight)) + (30_917_000 as Weight) + // Standard Error: 1_000 + .saturating_add((131_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) @@ -183,9 +183,9 @@ impl WeightInfo for () { // Storage: Multisig Calls (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (33_039_000 as Weight) + (33_570_000 as Weight) // Standard Error: 1_000 - .saturating_add((140_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((138_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) @@ -193,9 +193,9 @@ impl WeightInfo for () { } // Storage: Multisig Multisigs (r:1 w:1) fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (20_752_000 as Weight) + (21_051_000 as Weight) // Standard Error: 0 - .saturating_add((133_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((126_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) @@ -204,7 +204,7 @@ impl WeightInfo for () { // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (33_198_000 as Weight) + (32_581_000 as Weight) // Standard Error: 1_000 .saturating_add((135_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 @@ -216,9 +216,9 @@ impl WeightInfo for () { // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (39_407_000 as Weight) + (39_215_000 as Weight) // Standard Error: 1_000 - .saturating_add((230_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((221_000 as Weight).saturating_mul(s as Weight)) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) @@ -227,18 +227,18 @@ impl WeightInfo for () { // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn approve_as_multi_create(s: u32, ) -> Weight { - (28_365_000 as Weight) + (28_572_000 as Weight) // Standard Error: 1_000 - .saturating_add((156_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((146_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:0) fn approve_as_multi_approve(s: u32, ) -> Weight { - (17_960_000 as Weight) + (18_032_000 as Weight) // Standard Error: 0 - .saturating_add((158_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((151_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -246,18 +246,18 @@ impl WeightInfo for () { // Storage: Multisig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn approve_as_multi_complete(s: u32, ) -> Weight { - (56_920_000 as Weight) + (56_353_000 as Weight) // Standard Error: 1_000 - .saturating_add((243_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((239_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Calls (r:1 w:1) fn cancel_as_multi(s: u32, ) -> Weight { - (45_336_000 as Weight) - // Standard Error: 1_000 - .saturating_add((155_000 as Weight).saturating_mul(s as Weight)) + (44_544_000 as Weight) + // Standard Error: 0 + .saturating_add((158_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/frame/nicks/Cargo.toml b/frame/nicks/Cargo.toml index 221a386c752a4..bf5afd26ebb59 100644 --- a/frame/nicks/Cargo.toml +++ b/frame/nicks/Cargo.toml @@ -16,13 +16,13 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/node-authorization/Cargo.toml b/frame/node-authorization/Cargo.toml index 610e536a2c818..0d64251885383 100644 --- a/frame/node-authorization/Cargo.toml +++ b/frame/node-authorization/Cargo.toml @@ -16,9 +16,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } log = { version = "0.4.14", default-features = false } diff --git a/frame/offences/Cargo.toml b/frame/offences/Cargo.toml index 49aa1d770e5b5..6fe36aea89eec 100644 --- a/frame/offences/Cargo.toml +++ b/frame/offences/Cargo.toml @@ -18,15 +18,15 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } serde = { version = "1.0.132", optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } log = { version = "0.4.14", default-features = false } [dev-dependencies] -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } [features] default = ["std"] diff --git a/frame/offences/benchmarking/Cargo.toml b/frame/offences/benchmarking/Cargo.toml index 2764eedc1191b..9742545383227 100644 --- a/frame/offences/benchmarking/Cargo.toml +++ b/frame/offences/benchmarking/Cargo.toml @@ -29,7 +29,7 @@ pallet-session = { version = "4.0.0-dev", default-features = false, path = "../. pallet-staking = { version = "4.0.0-dev", default-features = false, features = [ "runtime-benchmarks", ], path = "../../staking" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/staking" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../../election-provider-support" } @@ -37,8 +37,8 @@ frame-election-provider-support = { version = "4.0.0-dev", default-features = fa [dev-dependencies] pallet-staking-reward-curve = { version = "4.0.0-dev", path = "../../staking/reward-curve" } pallet-timestamp = { version = "4.0.0-dev", path = "../../timestamp" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } [features] default = ["std"] diff --git a/frame/preimage/Cargo.toml b/frame/preimage/Cargo.toml index 17fed986f7575..66ef8467be28a 100644 --- a/frame/preimage/Cargo.toml +++ b/frame/preimage/Cargo.toml @@ -14,15 +14,15 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", default-features = false, optional = true, path = "../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-core = { version = "5.0.0", default-features = false, optional = true, path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/preimage/src/weights.rs b/frame/preimage/src/weights.rs index b0f22a49297b6..0d7f583727c99 100644 --- a/frame/preimage/src/weights.rs +++ b/frame/preimage/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/preimage/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -93,58 +93,58 @@ impl WeightInfo for SubstrateWeight { // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - (38_155_000 as Weight) + (39_239_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - (24_132_000 as Weight) + (24_905_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - (36_703_000 as Weight) + (37_451_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - (23_056_000 as Weight) + (23_397_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - (12_937_000 as Weight) + (13_407_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - (4_460_000 as Weight) + (4_202_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - (23_761_000 as Weight) + (24_858_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - (13_829_000 as Weight) + (13_763_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - (4_595_000 as Weight) + (4_262_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -182,58 +182,58 @@ impl WeightInfo for () { // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - (38_155_000 as Weight) + (39_239_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - (24_132_000 as Weight) + (24_905_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - (36_703_000 as Weight) + (37_451_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - (23_056_000 as Weight) + (23_397_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - (12_937_000 as Weight) + (13_407_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - (4_460_000 as Weight) + (4_202_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - (23_761_000 as Weight) + (24_858_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - (13_829_000 as Weight) + (13_763_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - (4_595_000 as Weight) + (4_262_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/proxy/Cargo.toml b/frame/proxy/Cargo.toml index a07ecb4997741..f0bd9391789bb 100644 --- a/frame/proxy/Cargo.toml +++ b/frame/proxy/Cargo.toml @@ -17,14 +17,14 @@ codec = { package = "parity-scale-codec", version = "2.2.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-utility = { version = "4.0.0-dev", path = "../utility" } diff --git a/frame/proxy/src/weights.rs b/frame/proxy/src/weights.rs index 4628ada8d3c8b..176f8683e0b5f 100644 --- a/frame/proxy/src/weights.rs +++ b/frame/proxy/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/proxy/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -63,42 +63,42 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32, ) -> Weight { - (13_623_000 as Weight) - // Standard Error: 2_000 - .saturating_add((121_000 as Weight).saturating_mul(p as Weight)) + (13_323_000 as Weight) + // Standard Error: 1_000 + .saturating_add((114_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32, ) -> Weight { - (29_560_000 as Weight) - // Standard Error: 2_000 - .saturating_add((259_000 as Weight).saturating_mul(a as Weight)) + (28_825_000 as Weight) + // Standard Error: 1_000 + .saturating_add((254_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 2_000 - .saturating_add((121_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((120_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_announcement(a: u32, p: u32, ) -> Weight { - (21_004_000 as Weight) + (20_594_000 as Weight) // Standard Error: 1_000 - .saturating_add((266_000 as Weight).saturating_mul(a as Weight)) + .saturating_add((259_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 1_000 - .saturating_add((13_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((15_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_announcement(a: u32, p: u32, ) -> Weight { - (20_992_000 as Weight) + (20_316_000 as Weight) // Standard Error: 1_000 - .saturating_add((266_000 as Weight).saturating_mul(a as Weight)) + .saturating_add((265_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 1_000 - .saturating_add((14_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((18_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -106,52 +106,52 @@ impl WeightInfo for SubstrateWeight { // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn announce(a: u32, p: u32, ) -> Weight { - (28_118_000 as Weight) + (27_696_000 as Weight) // Standard Error: 2_000 - .saturating_add((250_000 as Weight).saturating_mul(a as Weight)) + .saturating_add((241_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 2_000 - .saturating_add((118_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((111_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32, ) -> Weight { - (23_077_000 as Weight) + (22_849_000 as Weight) // Standard Error: 2_000 - .saturating_add((159_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((140_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32, ) -> Weight { - (19_919_000 as Weight) + (19_350_000 as Weight) // Standard Error: 2_000 - .saturating_add((155_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((147_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32, ) -> Weight { - (19_625_000 as Weight) + (18_878_000 as Weight) // Standard Error: 2_000 - .saturating_add((120_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((112_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) fn anonymous(p: u32, ) -> Weight { - (26_066_000 as Weight) + (25_743_000 as Weight) // Standard Error: 2_000 - .saturating_add((37_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((25_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_anonymous(p: u32, ) -> Weight { - (21_294_000 as Weight) + (20_484_000 as Weight) // Standard Error: 2_000 - .saturating_add((112_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((105_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -161,42 +161,42 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32, ) -> Weight { - (13_623_000 as Weight) - // Standard Error: 2_000 - .saturating_add((121_000 as Weight).saturating_mul(p as Weight)) + (13_323_000 as Weight) + // Standard Error: 1_000 + .saturating_add((114_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32, ) -> Weight { - (29_560_000 as Weight) - // Standard Error: 2_000 - .saturating_add((259_000 as Weight).saturating_mul(a as Weight)) + (28_825_000 as Weight) + // Standard Error: 1_000 + .saturating_add((254_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 2_000 - .saturating_add((121_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((120_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_announcement(a: u32, p: u32, ) -> Weight { - (21_004_000 as Weight) + (20_594_000 as Weight) // Standard Error: 1_000 - .saturating_add((266_000 as Weight).saturating_mul(a as Weight)) + .saturating_add((259_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 1_000 - .saturating_add((13_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((15_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_announcement(a: u32, p: u32, ) -> Weight { - (20_992_000 as Weight) + (20_316_000 as Weight) // Standard Error: 1_000 - .saturating_add((266_000 as Weight).saturating_mul(a as Weight)) + .saturating_add((265_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 1_000 - .saturating_add((14_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((18_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -204,52 +204,52 @@ impl WeightInfo for () { // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn announce(a: u32, p: u32, ) -> Weight { - (28_118_000 as Weight) + (27_696_000 as Weight) // Standard Error: 2_000 - .saturating_add((250_000 as Weight).saturating_mul(a as Weight)) + .saturating_add((241_000 as Weight).saturating_mul(a as Weight)) // Standard Error: 2_000 - .saturating_add((118_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((111_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32, ) -> Weight { - (23_077_000 as Weight) + (22_849_000 as Weight) // Standard Error: 2_000 - .saturating_add((159_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((140_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32, ) -> Weight { - (19_919_000 as Weight) + (19_350_000 as Weight) // Standard Error: 2_000 - .saturating_add((155_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((147_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32, ) -> Weight { - (19_625_000 as Weight) + (18_878_000 as Weight) // Standard Error: 2_000 - .saturating_add((120_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((112_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) fn anonymous(p: u32, ) -> Weight { - (26_066_000 as Weight) + (25_743_000 as Weight) // Standard Error: 2_000 - .saturating_add((37_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((25_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_anonymous(p: u32, ) -> Weight { - (21_294_000 as Weight) + (20_484_000 as Weight) // Standard Error: 2_000 - .saturating_add((112_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((105_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/randomness-collective-flip/Cargo.toml b/frame/randomness-collective-flip/Cargo.toml index a29e7ac7b3265..a93585700f2b0 100644 --- a/frame/randomness-collective-flip/Cargo.toml +++ b/frame/randomness-collective-flip/Cargo.toml @@ -16,15 +16,15 @@ targets = ["x86_64-unknown-linux-gnu"] safe-mix = { version = "1.0", default-features = false } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } [features] default = ["std"] diff --git a/frame/recovery/Cargo.toml b/frame/recovery/Cargo.toml index 53fe6851564dd..88da65327e2f0 100644 --- a/frame/recovery/Cargo.toml +++ b/frame/recovery/Cargo.toml @@ -16,13 +16,13 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/scheduler/Cargo.toml b/frame/scheduler/Cargo.toml index 424c3852862ec..d88063d69c5bb 100644 --- a/frame/scheduler/Cargo.toml +++ b/frame/scheduler/Cargo.toml @@ -14,15 +14,15 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } substrate-test-utils = { version = "4.0.0-dev", path = "../../test-utils" } pallet-preimage = { version = "4.0.0-dev", path = "../preimage" } diff --git a/frame/scheduler/src/lib.rs b/frame/scheduler/src/lib.rs index 7ecd9024e9f96..f9077d4c8c8fa 100644 --- a/frame/scheduler/src/lib.rs +++ b/frame/scheduler/src/lib.rs @@ -63,7 +63,7 @@ use frame_support::{ dispatch::{DispatchError, DispatchResult, Dispatchable, Parameter}, traits::{ schedule::{self, DispatchTime, MaybeHashed}, - EnsureOrigin, Get, IsType, OriginTrait, PrivilegeCmp, + EnsureOrigin, Get, IsType, OriginTrait, PalletInfoAccess, PrivilegeCmp, StorageVersion, }, weights::{GetDispatchInfo, Weight}, }; @@ -132,22 +132,6 @@ pub type ScheduledOf = ScheduledV3Of; pub type Scheduled = ScheduledV2; -// A value placed in storage that represents the current version of the Scheduler storage. -// This value is used by the `on_runtime_upgrade` logic to determine whether we run -// storage migration logic. -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, RuntimeDebug, TypeInfo)] -enum Releases { - V1, - V2, - V3, -} - -impl Default for Releases { - fn default() -> Self { - Releases::V1 - } -} - #[cfg(feature = "runtime-benchmarks")] mod preimage_provider { use frame_support::traits::PreimageRecipient; @@ -201,8 +185,12 @@ pub mod pallet { }; use frame_system::pallet_prelude::*; + /// The current storage version. + const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); + #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] + #[pallet::storage_version(STORAGE_VERSION)] #[pallet::without_storage_info] pub struct Pallet(_); @@ -268,12 +256,6 @@ pub mod pallet { pub(crate) type Lookup = StorageMap<_, Twox64Concat, Vec, TaskAddress>; - /// Storage version of the pallet. - /// - /// New networks start with last version. - #[pallet::storage] - pub(crate) type StorageVersion = StorageValue<_, Releases, ValueQuery>; - /// Events type. #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -308,23 +290,6 @@ pub mod pallet { RescheduleNoChange, } - #[pallet::genesis_config] - pub struct GenesisConfig; - - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self - } - } - - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { - fn build(&self) { - StorageVersion::::put(Releases::V3); - } - } - #[pallet::hooks] impl Hooks> for Pallet { /// Execute the scheduled calls @@ -573,19 +538,19 @@ pub mod pallet { impl Pallet { /// Migrate storage format from V1 to V3. - /// Return true if migration is performed. - pub fn migrate_v1_to_v3() -> bool { - if StorageVersion::::get() == Releases::V1 { - StorageVersion::::put(Releases::V3); - - Agenda::::translate::< - Vec::Call, T::BlockNumber>>>, - _, - >(|_, agenda| { + /// + /// Returns the weight consumed by this migration. + pub fn migrate_v1_to_v3() -> Weight { + let mut weight = T::DbWeight::get().reads_writes(1, 1); + + Agenda::::translate::::Call, T::BlockNumber>>>, _>( + |_, agenda| { Some( agenda .into_iter() .map(|schedule| { + weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + schedule.map(|schedule| ScheduledV3 { maybe_id: schedule.maybe_id, priority: schedule.priority, @@ -597,56 +562,66 @@ impl Pallet { }) .collect::>(), ) - }); + }, + ); - true - } else { - false - } + frame_support::storage::migration::remove_storage_prefix( + Self::name().as_bytes(), + b"StorageVersion", + &[], + ); + + StorageVersion::new(3).put::(); + + weight + T::DbWeight::get().writes(2) } /// Migrate storage format from V2 to V3. - /// Return true if migration is performed. + /// + /// Returns the weight consumed by this migration. pub fn migrate_v2_to_v3() -> Weight { - if StorageVersion::::get() == Releases::V2 { - StorageVersion::::put(Releases::V3); - - let mut weight = T::DbWeight::get().reads_writes(1, 1); + let mut weight = T::DbWeight::get().reads_writes(1, 1); - Agenda::::translate::>>, _>(|_, agenda| { - Some( - agenda - .into_iter() - .map(|schedule| { - weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); - schedule.map(|schedule| ScheduledV3 { - maybe_id: schedule.maybe_id, - priority: schedule.priority, - call: schedule.call.into(), - maybe_periodic: schedule.maybe_periodic, - origin: system::RawOrigin::Root.into(), - _phantom: Default::default(), - }) + Agenda::::translate::>>, _>(|_, agenda| { + Some( + agenda + .into_iter() + .map(|schedule| { + weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + schedule.map(|schedule| ScheduledV3 { + maybe_id: schedule.maybe_id, + priority: schedule.priority, + call: schedule.call.into(), + maybe_periodic: schedule.maybe_periodic, + origin: schedule.origin, + _phantom: Default::default(), }) - .collect::>(), - ) - }); + }) + .collect::>(), + ) + }); - weight - } else { - 0 - } + frame_support::storage::migration::remove_storage_prefix( + Self::name().as_bytes(), + b"StorageVersion", + &[], + ); + + StorageVersion::new(3).put::(); + + weight + T::DbWeight::get().writes(2) } #[cfg(feature = "try-runtime")] pub fn pre_migrate_to_v3() -> Result<(), &'static str> { - assert!(StorageVersion::::get() < Releases::V3); Ok(()) } #[cfg(feature = "try-runtime")] pub fn post_migrate_to_v3() -> Result<(), &'static str> { - assert!(StorageVersion::::get() == Releases::V3); + use frame_support::dispatch::GetStorageVersion; + + assert!(Self::current_storage_version() == 3); for k in Agenda::::iter_keys() { let _ = Agenda::::try_get(k).map_err(|()| "Invalid item in Agenda")?; } diff --git a/frame/scheduler/src/tests.rs b/frame/scheduler/src/tests.rs index 7681ede136d97..d2a795cb19fa4 100644 --- a/frame/scheduler/src/tests.rs +++ b/frame/scheduler/src/tests.rs @@ -21,7 +21,7 @@ use super::*; use crate::mock::{logger, new_test_ext, root, run_to_block, Call, LoggerCall, Scheduler, Test, *}; use frame_support::{ assert_err, assert_noop, assert_ok, - traits::{Contains, OnInitialize, PreimageProvider}, + traits::{Contains, GetStorageVersion, OnInitialize, PreimageProvider}, Hashable, }; use sp_runtime::traits::Hash; @@ -707,9 +707,7 @@ fn migration_to_v3_works() { frame_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old); } - assert_eq!(StorageVersion::::get(), Releases::V1); - - assert!(Scheduler::migrate_v1_to_v3()); + Scheduler::migrate_v1_to_v3(); assert_eq_uvec!( Agenda::::iter().collect::>(), @@ -783,7 +781,7 @@ fn migration_to_v3_works() { ] ); - assert_eq!(StorageVersion::::get(), Releases::V3); + assert_eq!(Scheduler::current_storage_version(), 3); }); } diff --git a/frame/scheduler/src/weights.rs b/frame/scheduler/src/weights.rs index 281b25977cf49..dd00b8dfe6cd6 100644 --- a/frame/scheduler/src/weights.rs +++ b/frame/scheduler/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/scheduler/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -70,9 +70,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - (10_798_000 as Weight) - // Standard Error: 13_000 - .saturating_add((17_708_000 as Weight).saturating_mul(s as Weight)) + (11_587_000 as Weight) + // Standard Error: 17_000 + .saturating_add((17_428_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -83,9 +83,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32, ) -> Weight { - (8_722_000 as Weight) - // Standard Error: 10_000 - .saturating_add((13_706_000 as Weight).saturating_mul(s as Weight)) + (8_965_000 as Weight) + // Standard Error: 11_000 + .saturating_add((13_410_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -95,9 +95,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - (9_414_000 as Weight) - // Standard Error: 9_000 - .saturating_add((15_176_000 as Weight).saturating_mul(s as Weight)) + (8_654_000 as Weight) + // Standard Error: 17_000 + .saturating_add((14_990_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -107,9 +107,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_resolved(s: u32, ) -> Weight { - (9_572_000 as Weight) - // Standard Error: 12_000 - .saturating_add((12_505_000 as Weight).saturating_mul(s as Weight)) + (9_303_000 as Weight) + // Standard Error: 10_000 + .saturating_add((12_244_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -119,9 +119,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Preimage PreimageFor (r:1 w:0) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32, ) -> Weight { - (6_900_000 as Weight) - // Standard Error: 4_000 - .saturating_add((5_486_000 as Weight).saturating_mul(s as Weight)) + (7_506_000 as Weight) + // Standard Error: 3_000 + .saturating_add((5_208_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -130,9 +130,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Preimage PreimageFor (r:1 w:0) fn on_initialize_aborted(s: u32, ) -> Weight { - (8_346_000 as Weight) + (8_046_000 as Weight) // Standard Error: 3_000 - .saturating_add((3_079_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_914_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -140,9 +140,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named(s: u32, ) -> Weight { - (13_462_000 as Weight) - // Standard Error: 5_000 - .saturating_add((8_230_000 as Weight).saturating_mul(s as Weight)) + (13_704_000 as Weight) + // Standard Error: 4_000 + .saturating_add((8_186_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -150,9 +150,9 @@ impl WeightInfo for SubstrateWeight { } // Storage: Scheduler Agenda (r:2 w:2) fn on_initialize_periodic(s: u32, ) -> Weight { - (13_046_000 as Weight) - // Standard Error: 4_000 - .saturating_add((5_782_000 as Weight).saturating_mul(s as Weight)) + (12_668_000 as Weight) + // Standard Error: 5_000 + .saturating_add((5_868_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -161,53 +161,53 @@ impl WeightInfo for SubstrateWeight { // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32, ) -> Weight { - (13_481_000 as Weight) - // Standard Error: 3_000 - .saturating_add((4_385_000 as Weight).saturating_mul(s as Weight)) + (13_946_000 as Weight) + // Standard Error: 4_000 + .saturating_add((4_367_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Scheduler Agenda (r:1 w:1) fn on_initialize(s: u32, ) -> Weight { - (13_081_000 as Weight) + (13_151_000 as Weight) // Standard Error: 4_000 - .saturating_add((3_434_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((3_455_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Scheduler Agenda (r:1 w:1) fn schedule(s: u32, ) -> Weight { - (13_863_000 as Weight) + (14_040_000 as Weight) // Standard Error: 1_000 - .saturating_add((87_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((89_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn cancel(s: u32, ) -> Weight { - (13_695_000 as Weight) + (14_376_000 as Weight) // Standard Error: 1_000 - .saturating_add((594_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((576_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32, ) -> Weight { - (16_506_000 as Weight) + (16_806_000 as Weight) // Standard Error: 1_000 - .saturating_add((99_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((102_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32, ) -> Weight { - (15_685_000 as Weight) + (15_852_000 as Weight) // Standard Error: 2_000 - .saturating_add((604_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((590_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -220,9 +220,9 @@ impl WeightInfo for () { // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - (10_798_000 as Weight) - // Standard Error: 13_000 - .saturating_add((17_708_000 as Weight).saturating_mul(s as Weight)) + (11_587_000 as Weight) + // Standard Error: 17_000 + .saturating_add((17_428_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -233,9 +233,9 @@ impl WeightInfo for () { // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32, ) -> Weight { - (8_722_000 as Weight) - // Standard Error: 10_000 - .saturating_add((13_706_000 as Weight).saturating_mul(s as Weight)) + (8_965_000 as Weight) + // Standard Error: 11_000 + .saturating_add((13_410_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -245,9 +245,9 @@ impl WeightInfo for () { // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - (9_414_000 as Weight) - // Standard Error: 9_000 - .saturating_add((15_176_000 as Weight).saturating_mul(s as Weight)) + (8_654_000 as Weight) + // Standard Error: 17_000 + .saturating_add((14_990_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -257,9 +257,9 @@ impl WeightInfo for () { // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_resolved(s: u32, ) -> Weight { - (9_572_000 as Weight) - // Standard Error: 12_000 - .saturating_add((12_505_000 as Weight).saturating_mul(s as Weight)) + (9_303_000 as Weight) + // Standard Error: 10_000 + .saturating_add((12_244_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -269,9 +269,9 @@ impl WeightInfo for () { // Storage: Preimage PreimageFor (r:1 w:0) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32, ) -> Weight { - (6_900_000 as Weight) - // Standard Error: 4_000 - .saturating_add((5_486_000 as Weight).saturating_mul(s as Weight)) + (7_506_000 as Weight) + // Standard Error: 3_000 + .saturating_add((5_208_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -280,9 +280,9 @@ impl WeightInfo for () { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Preimage PreimageFor (r:1 w:0) fn on_initialize_aborted(s: u32, ) -> Weight { - (8_346_000 as Weight) + (8_046_000 as Weight) // Standard Error: 3_000 - .saturating_add((3_079_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((2_914_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -290,9 +290,9 @@ impl WeightInfo for () { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named(s: u32, ) -> Weight { - (13_462_000 as Weight) - // Standard Error: 5_000 - .saturating_add((8_230_000 as Weight).saturating_mul(s as Weight)) + (13_704_000 as Weight) + // Standard Error: 4_000 + .saturating_add((8_186_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -300,9 +300,9 @@ impl WeightInfo for () { } // Storage: Scheduler Agenda (r:2 w:2) fn on_initialize_periodic(s: u32, ) -> Weight { - (13_046_000 as Weight) - // Standard Error: 4_000 - .saturating_add((5_782_000 as Weight).saturating_mul(s as Weight)) + (12_668_000 as Weight) + // Standard Error: 5_000 + .saturating_add((5_868_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -311,53 +311,53 @@ impl WeightInfo for () { // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32, ) -> Weight { - (13_481_000 as Weight) - // Standard Error: 3_000 - .saturating_add((4_385_000 as Weight).saturating_mul(s as Weight)) + (13_946_000 as Weight) + // Standard Error: 4_000 + .saturating_add((4_367_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Scheduler Agenda (r:1 w:1) fn on_initialize(s: u32, ) -> Weight { - (13_081_000 as Weight) + (13_151_000 as Weight) // Standard Error: 4_000 - .saturating_add((3_434_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((3_455_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Scheduler Agenda (r:1 w:1) fn schedule(s: u32, ) -> Weight { - (13_863_000 as Weight) + (14_040_000 as Weight) // Standard Error: 1_000 - .saturating_add((87_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((89_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn cancel(s: u32, ) -> Weight { - (13_695_000 as Weight) + (14_376_000 as Weight) // Standard Error: 1_000 - .saturating_add((594_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((576_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32, ) -> Weight { - (16_506_000 as Weight) + (16_806_000 as Weight) // Standard Error: 1_000 - .saturating_add((99_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((102_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32, ) -> Weight { - (15_685_000 as Weight) + (15_852_000 as Weight) // Standard Error: 2_000 - .saturating_add((604_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((590_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/frame/scored-pool/Cargo.toml b/frame/scored-pool/Cargo.toml index b97a7e3664903..af8b0f6aa2643 100644 --- a/frame/scored-pool/Cargo.toml +++ b/frame/scored-pool/Cargo.toml @@ -15,15 +15,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", path = "../balances" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } [features] default = ["std"] diff --git a/frame/session/Cargo.toml b/frame/session/Cargo.toml index db6f10c728883..a342865615d91 100644 --- a/frame/session/Cargo.toml +++ b/frame/session/Cargo.toml @@ -20,12 +20,12 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } -sp-trie = { version = "4.0.0", default-features = false, path = "../../primitives/trie", optional = true } +sp-trie = { version = "5.0.0", default-features = false, path = "../../primitives/trie", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } diff --git a/frame/session/benchmarking/Cargo.toml b/frame/session/benchmarking/Cargo.toml index 10a430d52b0a5..cd33c5b186490 100644 --- a/frame/session/benchmarking/Cargo.toml +++ b/frame/session/benchmarking/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] rand = { version = "0.7.2", default-features = false } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/session" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../benchmarking" } @@ -28,8 +28,8 @@ pallet-staking = { version = "4.0.0-dev", default-features = false, features = [ [dev-dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } scale-info = "1.0" -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } pallet-balances = { version = "4.0.0-dev", path = "../../balances" } pallet-timestamp = { version = "4.0.0-dev", path = "../../timestamp" } pallet-staking-reward-curve = { version = "4.0.0-dev", path = "../../staking/reward-curve" } diff --git a/frame/session/src/weights.rs b/frame/session/src/weights.rs index 2cf5cd9c41929..39276fb0b17ee 100644 --- a/frame/session/src/weights.rs +++ b/frame/session/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_session //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/session/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -57,7 +57,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:4 w:4) fn set_keys() -> Weight { - (42_449_000 as Weight) + (42_131_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -65,7 +65,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:4) fn purge_keys() -> Weight { - (32_778_000 as Weight) + (32_374_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -77,7 +77,7 @@ impl WeightInfo for () { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:4 w:4) fn set_keys() -> Weight { - (42_449_000 as Weight) + (42_131_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -85,7 +85,7 @@ impl WeightInfo for () { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:4) fn purge_keys() -> Weight { - (32_778_000 as Weight) + (32_374_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } diff --git a/frame/society/Cargo.toml b/frame/society/Cargo.toml index fa3f981f19d48..2787453d49d3e 100644 --- a/frame/society/Cargo.toml +++ b/frame/society/Cargo.toml @@ -15,15 +15,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } rand_chacha = { version = "0.2", default-features = false } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io ={ version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io ={ version = "5.0.0", path = "../../primitives/io" } frame-support-test = { version = "3.0.0", path = "../support/test" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } diff --git a/frame/staking/Cargo.toml b/frame/staking/Cargo.toml index e0d5dabaa8927..cd1e238dbd019 100644 --- a/frame/staking/Cargo.toml +++ b/frame/staking/Cargo.toml @@ -19,8 +19,8 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } @@ -28,7 +28,7 @@ pallet-session = { version = "4.0.0-dev", default-features = false, features = [ "historical", ], path = "../session" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../election-provider-support" } log = { version = "0.4.14", default-features = false } @@ -38,7 +38,7 @@ rand_chacha = { version = "0.2", default-features = false, optional = true } [dev-dependencies] sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } sp-npos-elections = { version = "4.0.0-dev", path = "../../primitives/npos-elections" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-timestamp = { version = "4.0.0-dev", path = "../timestamp" } diff --git a/frame/staking/reward-curve/Cargo.toml b/frame/staking/reward-curve/Cargo.toml index 4c1d2b922f6d6..86fdd09076e5d 100644 --- a/frame/staking/reward-curve/Cargo.toml +++ b/frame/staking/reward-curve/Cargo.toml @@ -21,4 +21,4 @@ proc-macro2 = "1.0.36" proc-macro-crate = "1.1.0" [dev-dependencies] -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } diff --git a/frame/staking/src/weights.rs b/frame/staking/src/weights.rs index 7721fbbd23714..42f762c721e4c 100644 --- a/frame/staking/src/weights.rs +++ b/frame/staking/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/staking/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -86,7 +86,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (38_457_000 as Weight) + (37_688_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -96,7 +96,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (65_678_000 as Weight) + (63_507_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -110,7 +110,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (71_544_000 as Weight) + (70_634_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -119,9 +119,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn withdraw_unbonded_update(s: u32, ) -> Weight { - (30_127_000 as Weight) + (30_002_000 as Weight) // Standard Error: 0 - .saturating_add((59_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((55_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -139,7 +139,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (59_131_000 as Weight) + (58_077_000 as Weight) .saturating_add(T::DbWeight::get().reads(13 as Weight)) .saturating_add(T::DbWeight::get().writes(11 as Weight)) } @@ -155,16 +155,16 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (45_519_000 as Weight) + (44_603_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) fn kick(k: u32, ) -> Weight { - (16_645_000 as Weight) - // Standard Error: 12_000 - .saturating_add((8_194_000 as Weight).saturating_mul(k as Weight)) + (14_580_000 as Weight) + // Standard Error: 13_000 + .saturating_add((8_076_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -181,9 +181,9 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForNominators (r:1 w:1) fn nominate(n: u32, ) -> Weight { - (50_227_000 as Weight) - // Standard Error: 12_000 - .saturating_add((3_546_000 as Weight).saturating_mul(n as Weight)) + (49_856_000 as Weight) + // Standard Error: 8_000 + .saturating_add((3_430_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) @@ -196,49 +196,49 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (44_294_000 as Weight) + (43_815_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (7_556_000 as Weight) + (7_553_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (15_826_000 as Weight) + (15_177_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (1_141_000 as Weight) + (1_090_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (1_152_000 as Weight) + (1_169_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (1_169_000 as Weight) + (1_089_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (1_134_000 as Weight) + (1_144_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) fn set_invulnerables(v: u32, ) -> Weight { - (1_641_000 as Weight) + (1_612_000 as Weight) // Standard Error: 0 - .saturating_add((52_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((50_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -255,18 +255,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) fn force_unstake(s: u32, ) -> Weight { - (57_227_000 as Weight) + (56_103_000 as Weight) // Standard Error: 1_000 - .saturating_add((817_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((798_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) fn cancel_deferred_slash(s: u32, ) -> Weight { - (950_241_000 as Weight) - // Standard Error: 56_000 - .saturating_add((4_960_000 as Weight).saturating_mul(s as Weight)) + (942_911_000 as Weight) + // Standard Error: 55_000 + .saturating_add((4_973_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -281,9 +281,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (73_561_000 as Weight) + (77_948_000 as Weight) // Standard Error: 13_000 - .saturating_add((24_039_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((23_507_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -301,9 +301,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (105_296_000 as Weight) - // Standard Error: 18_000 - .saturating_add((33_989_000 as Weight).saturating_mul(n as Weight)) + (94_386_000 as Weight) + // Standard Error: 19_000 + .saturating_add((32_763_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -316,9 +316,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn rebond(l: u32, ) -> Weight { - (65_108_000 as Weight) - // Standard Error: 3_000 - .saturating_add((72_000 as Weight).saturating_mul(l as Weight)) + (63_577_000 as Weight) + // Standard Error: 2_000 + .saturating_add((47_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -333,8 +333,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn set_history_depth(e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 54_000 - .saturating_add((19_731_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 57_000 + .saturating_add((19_691_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) @@ -353,9 +353,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) fn reap_stash(s: u32, ) -> Weight { - (63_115_000 as Weight) + (61_871_000 as Weight) // Standard Error: 0 - .saturating_add((812_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((796_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -380,10 +380,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 800_000 - .saturating_add((219_877_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 40_000 - .saturating_add((31_701_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 823_000 + .saturating_add((218_725_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 41_000 + .saturating_add((31_349_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(208 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -401,10 +401,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Nominators (r:1000 w:0) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 88_000 - .saturating_add((18_183_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 88_000 - .saturating_add((21_345_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 86_000 + .saturating_add((18_168_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 86_000 + .saturating_add((21_061_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 2_951_000 + .saturating_add((8_164_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(204 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -413,8 +415,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking Validators (r:501 w:0) fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 25_000 - .saturating_add((7_691_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 29_000 + .saturating_add((7_761_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) } @@ -425,12 +427,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (3_324_000 as Weight) + (3_586_000 as Weight) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) - // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking MaxNominatorsCount (r:1 w:0) // Storage: Staking CounterForNominators (r:1 w:1) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -439,7 +441,7 @@ impl WeightInfo for SubstrateWeight { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (54_254_000 as Weight) + (54_681_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -454,7 +456,7 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (38_457_000 as Weight) + (37_688_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -464,7 +466,7 @@ impl WeightInfo for () { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (65_678_000 as Weight) + (63_507_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } @@ -478,7 +480,7 @@ impl WeightInfo for () { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (71_544_000 as Weight) + (70_634_000 as Weight) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -487,9 +489,9 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn withdraw_unbonded_update(s: u32, ) -> Weight { - (30_127_000 as Weight) + (30_002_000 as Weight) // Standard Error: 0 - .saturating_add((59_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((55_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -507,7 +509,7 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (59_131_000 as Weight) + (58_077_000 as Weight) .saturating_add(RocksDbWeight::get().reads(13 as Weight)) .saturating_add(RocksDbWeight::get().writes(11 as Weight)) } @@ -523,16 +525,16 @@ impl WeightInfo for () { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (45_519_000 as Weight) + (44_603_000 as Weight) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) fn kick(k: u32, ) -> Weight { - (16_645_000 as Weight) - // Standard Error: 12_000 - .saturating_add((8_194_000 as Weight).saturating_mul(k as Weight)) + (14_580_000 as Weight) + // Standard Error: 13_000 + .saturating_add((8_076_000 as Weight).saturating_mul(k as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -549,9 +551,9 @@ impl WeightInfo for () { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForNominators (r:1 w:1) fn nominate(n: u32, ) -> Weight { - (50_227_000 as Weight) - // Standard Error: 12_000 - .saturating_add((3_546_000 as Weight).saturating_mul(n as Weight)) + (49_856_000 as Weight) + // Standard Error: 8_000 + .saturating_add((3_430_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) @@ -564,49 +566,49 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (44_294_000 as Weight) + (43_815_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (7_556_000 as Weight) + (7_553_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (15_826_000 as Weight) + (15_177_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (1_141_000 as Weight) + (1_090_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (1_152_000 as Weight) + (1_169_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (1_169_000 as Weight) + (1_089_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (1_134_000 as Weight) + (1_144_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) fn set_invulnerables(v: u32, ) -> Weight { - (1_641_000 as Weight) + (1_612_000 as Weight) // Standard Error: 0 - .saturating_add((52_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((50_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -623,18 +625,18 @@ impl WeightInfo for () { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) fn force_unstake(s: u32, ) -> Weight { - (57_227_000 as Weight) + (56_103_000 as Weight) // Standard Error: 1_000 - .saturating_add((817_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((798_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().writes(12 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) fn cancel_deferred_slash(s: u32, ) -> Weight { - (950_241_000 as Weight) - // Standard Error: 56_000 - .saturating_add((4_960_000 as Weight).saturating_mul(s as Weight)) + (942_911_000 as Weight) + // Standard Error: 55_000 + .saturating_add((4_973_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -649,9 +651,9 @@ impl WeightInfo for () { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (73_561_000 as Weight) + (77_948_000 as Weight) // Standard Error: 13_000 - .saturating_add((24_039_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((23_507_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(10 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -669,9 +671,9 @@ impl WeightInfo for () { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (105_296_000 as Weight) - // Standard Error: 18_000 - .saturating_add((33_989_000 as Weight).saturating_mul(n as Weight)) + (94_386_000 as Weight) + // Standard Error: 19_000 + .saturating_add((32_763_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -684,9 +686,9 @@ impl WeightInfo for () { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn rebond(l: u32, ) -> Weight { - (65_108_000 as Weight) - // Standard Error: 3_000 - .saturating_add((72_000 as Weight).saturating_mul(l as Weight)) + (63_577_000 as Weight) + // Standard Error: 2_000 + .saturating_add((47_000 as Weight).saturating_mul(l as Weight)) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -701,8 +703,8 @@ impl WeightInfo for () { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn set_history_depth(e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 54_000 - .saturating_add((19_731_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 57_000 + .saturating_add((19_691_000 as Weight).saturating_mul(e as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) .saturating_add(RocksDbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) @@ -721,9 +723,9 @@ impl WeightInfo for () { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) fn reap_stash(s: u32, ) -> Weight { - (63_115_000 as Weight) + (61_871_000 as Weight) // Standard Error: 0 - .saturating_add((812_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((796_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(12 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -748,10 +750,10 @@ impl WeightInfo for () { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 800_000 - .saturating_add((219_877_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 40_000 - .saturating_add((31_701_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 823_000 + .saturating_add((218_725_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 41_000 + .saturating_add((31_349_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(208 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -769,10 +771,12 @@ impl WeightInfo for () { // Storage: Staking Nominators (r:1000 w:0) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 88_000 - .saturating_add((18_183_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 88_000 - .saturating_add((21_345_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 86_000 + .saturating_add((18_168_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 86_000 + .saturating_add((21_061_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 2_951_000 + .saturating_add((8_164_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(204 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -781,8 +785,8 @@ impl WeightInfo for () { // Storage: Staking Validators (r:501 w:0) fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 25_000 - .saturating_add((7_691_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 29_000 + .saturating_add((7_761_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) } @@ -793,12 +797,12 @@ impl WeightInfo for () { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (3_324_000 as Weight) + (3_586_000 as Weight) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) - // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking MaxNominatorsCount (r:1 w:0) // Storage: Staking CounterForNominators (r:1 w:1) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -807,7 +811,7 @@ impl WeightInfo for () { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (54_254_000 as Weight) + (54_681_000 as Weight) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } diff --git a/frame/sudo/Cargo.toml b/frame/sudo/Cargo.toml index 504eb37b8d009..063ea52d5b8b5 100644 --- a/frame/sudo/Cargo.toml +++ b/frame/sudo/Cargo.toml @@ -16,13 +16,13 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } [features] default = ["std"] diff --git a/frame/support/Cargo.toml b/frame/support/Cargo.toml index d652e5ea43445..5e8c26b6ae540 100644 --- a/frame/support/Cargo.toml +++ b/frame/support/Cargo.toml @@ -18,10 +18,10 @@ codec = { package = "parity-scale-codec", version = "2.2.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-metadata = { version = "14.2.0", default-features = false, features = ["v14"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-tracing = { version = "4.0.0", default-features = false, path = "../../primitives/tracing" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../../primitives/arithmetic" } sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../primitives/inherents" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } @@ -29,7 +29,7 @@ tt-call = "1.0.8" frame-support-procedural = { version = "4.0.0-dev", default-features = false, path = "./procedural" } paste = "1.0" once_cell = { version = "1", default-features = false, optional = true } -sp-state-machine = { version = "0.10.0", optional = true, path = "../../primitives/state-machine" } +sp-state-machine = { version = "0.11.0", optional = true, path = "../../primitives/state-machine" } bitflags = "1.3" impl-trait-for-tuples = "0.2.1" smallvec = "1.7.0" diff --git a/frame/support/test/Cargo.toml b/frame/support/test/Cargo.toml index 257cca3218dab..5a27f4f46e10d 100644 --- a/frame/support/test/Cargo.toml +++ b/frame/support/test/Cargo.toml @@ -16,11 +16,11 @@ serde = { version = "1.0.132", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../../../primitives/arithmetic" } -sp-io = { version = "4.0.0", path = "../../../primitives/io", default-features = false } -sp-state-machine = { version = "0.10.0", optional = true, path = "../../../primitives/state-machine" } +sp-io = { version = "5.0.0", path = "../../../primitives/io", default-features = false } +sp-state-machine = { version = "0.11.0", optional = true, path = "../../../primitives/state-machine" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } sp-version = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/version" } trybuild = "1.0.53" diff --git a/frame/support/test/compile_pass/Cargo.toml b/frame/support/test/compile_pass/Cargo.toml index 93443e33503ca..aaa080f84f1a4 100644 --- a/frame/support/test/compile_pass/Cargo.toml +++ b/frame/support/test/compile_pass/Cargo.toml @@ -14,8 +14,8 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../../primitives/runtime" } sp-version = { version = "4.0.0-dev", default-features = false, path = "../../../../primitives/version" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../../" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../system" } diff --git a/frame/system/Cargo.toml b/frame/system/Cargo.toml index ae9242087f1a8..f1e7e4e207552 100644 --- a/frame/system/Cargo.toml +++ b/frame/system/Cargo.toml @@ -16,17 +16,17 @@ targets = ["x86_64-unknown-linux-gnu"] serde = { version = "1.0.132", optional = true, features = ["derive"] } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", path = "../../primitives/io", default-features = false } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", path = "../../primitives/io", default-features = false } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-version = { version = "4.0.0-dev", default-features = false, path = "../../primitives/version" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } log = { version = "0.4.14", default-features = false } [dev-dependencies] criterion = "0.3.3" -sp-externalities = { version = "0.10.0", path = "../../primitives/externalities" } +sp-externalities = { version = "0.11.0", path = "../../primitives/externalities" } substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } [features] diff --git a/frame/system/benchmarking/Cargo.toml b/frame/system/benchmarking/Cargo.toml index 4ca250fa0ec7e..fa86250c199e5 100644 --- a/frame/system/benchmarking/Cargo.toml +++ b/frame/system/benchmarking/Cargo.toml @@ -16,14 +16,14 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../benchmarking" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } [dev-dependencies] -sp-io = { version = "4.0.0", path = "../../../primitives/io" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } [features] default = ["std"] diff --git a/frame/system/src/weights.rs b/frame/system/src/weights.rs index 1fc35a41752a8..a016fe6e7d037 100644 --- a/frame/system/src/weights.rs +++ b/frame/system/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/system/src//weights.rs +// --output=./frame/system/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -68,7 +68,7 @@ impl WeightInfo for SubstrateWeight { // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (2_821_000 as Weight) + (2_864_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -76,21 +76,21 @@ impl WeightInfo for SubstrateWeight { fn set_storage(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((385_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((389_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_storage(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((286_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((285_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_prefix(p: u32, ) -> Weight { - (1_292_000 as Weight) + (753_000 as Weight) // Standard Error: 0 - .saturating_add((633_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((630_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) } } @@ -108,7 +108,7 @@ impl WeightInfo for () { // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (2_821_000 as Weight) + (2_864_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -116,21 +116,21 @@ impl WeightInfo for () { fn set_storage(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((385_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((389_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_storage(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((286_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((285_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_prefix(p: u32, ) -> Weight { - (1_292_000 as Weight) + (753_000 as Weight) // Standard Error: 0 - .saturating_add((633_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((630_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) } } diff --git a/frame/timestamp/Cargo.toml b/frame/timestamp/Cargo.toml index b66a91acebaa0..f42a95010587a 100644 --- a/frame/timestamp/Cargo.toml +++ b/frame/timestamp/Cargo.toml @@ -18,8 +18,8 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io", optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io", optional = true } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../primitives/inherents" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } @@ -28,8 +28,8 @@ sp-timestamp = { version = "4.0.0-dev", default-features = false, path = "../../ log = { version = "0.4.14", default-features = false } [dev-dependencies] -sp-io ={ version = "4.0.0-dev", path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io ={ version = "5.0.0", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } [features] default = ["std"] diff --git a/frame/timestamp/src/weights.rs b/frame/timestamp/src/weights.rs index b0f4b9d30588d..33d7d6a4b9e37 100644 --- a/frame/timestamp/src/weights.rs +++ b/frame/timestamp/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/timestamp/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -56,12 +56,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:1) // Storage: Babe CurrentSlot (r:1 w:0) fn set() -> Weight { - (5_191_000 as Weight) + (5_247_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn on_finalize() -> Weight { - (2_563_000 as Weight) + (2_604_000 as Weight) } } @@ -70,11 +70,11 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:1) // Storage: Babe CurrentSlot (r:1 w:0) fn set() -> Weight { - (5_191_000 as Weight) + (5_247_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn on_finalize() -> Weight { - (2_563_000 as Weight) + (2_604_000 as Weight) } } diff --git a/frame/tips/Cargo.toml b/frame/tips/Cargo.toml index bbe78fd30a56b..182a87048d353 100644 --- a/frame/tips/Cargo.toml +++ b/frame/tips/Cargo.toml @@ -18,9 +18,9 @@ log = { version = "0.4.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0.132", features = ["derive"], optional = true } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } @@ -30,7 +30,7 @@ pallet-treasury = { version = "4.0.0-dev", default-features = false, path = "../ frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-storage = { version = "4.0.0", path = "../../primitives/storage" } +sp-storage = { version = "5.0.0", path = "../../primitives/storage" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/tips/src/weights.rs b/frame/tips/src/weights.rs index 154b6a67d8541..2ba15a0c2fcc0 100644 --- a/frame/tips/src/weights.rs +++ b/frame/tips/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_tips //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/tips/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -60,7 +60,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Tips Reasons (r:1 w:1) // Storage: Tips Tips (r:1 w:1) fn report_awesome(r: u32, ) -> Weight { - (26_318_000 as Weight) + (25_262_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) @@ -69,7 +69,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Tips Tips (r:1 w:1) // Storage: Tips Reasons (r:0 w:1) fn retract_tip() -> Weight { - (24_688_000 as Weight) + (24_162_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -77,20 +77,20 @@ impl WeightInfo for SubstrateWeight { // Storage: Tips Reasons (r:1 w:1) // Storage: Tips Tips (r:0 w:1) fn tip_new(r: u32, t: u32, ) -> Weight { - (17_395_000 as Weight) + (16_435_000 as Weight) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 4_000 - .saturating_add((197_000 as Weight).saturating_mul(t as Weight)) + .saturating_add((231_000 as Weight).saturating_mul(t as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Elections Members (r:1 w:0) // Storage: Tips Tips (r:1 w:1) fn tip(t: u32, ) -> Weight { - (10_783_000 as Weight) - // Standard Error: 6_000 - .saturating_add((568_000 as Weight).saturating_mul(t as Weight)) + (10_427_000 as Weight) + // Standard Error: 7_000 + .saturating_add((507_000 as Weight).saturating_mul(t as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -99,18 +99,18 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Tips Reasons (r:0 w:1) fn close_tip(t: u32, ) -> Weight { - (41_658_000 as Weight) - // Standard Error: 13_000 - .saturating_add((391_000 as Weight).saturating_mul(t as Weight)) + (40_901_000 as Weight) + // Standard Error: 10_000 + .saturating_add((281_000 as Weight).saturating_mul(t as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Tips Tips (r:1 w:1) // Storage: Tips Reasons (r:0 w:1) fn slash_tip(t: u32, ) -> Weight { - (14_935_000 as Weight) - // Standard Error: 6_000 - .saturating_add((40_000 as Weight).saturating_mul(t as Weight)) + (14_636_000 as Weight) + // Standard Error: 4_000 + .saturating_add((29_000 as Weight).saturating_mul(t as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -121,7 +121,7 @@ impl WeightInfo for () { // Storage: Tips Reasons (r:1 w:1) // Storage: Tips Tips (r:1 w:1) fn report_awesome(r: u32, ) -> Weight { - (26_318_000 as Weight) + (25_262_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) @@ -130,7 +130,7 @@ impl WeightInfo for () { // Storage: Tips Tips (r:1 w:1) // Storage: Tips Reasons (r:0 w:1) fn retract_tip() -> Weight { - (24_688_000 as Weight) + (24_162_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -138,20 +138,20 @@ impl WeightInfo for () { // Storage: Tips Reasons (r:1 w:1) // Storage: Tips Tips (r:0 w:1) fn tip_new(r: u32, t: u32, ) -> Weight { - (17_395_000 as Weight) + (16_435_000 as Weight) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) // Standard Error: 4_000 - .saturating_add((197_000 as Weight).saturating_mul(t as Weight)) + .saturating_add((231_000 as Weight).saturating_mul(t as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Elections Members (r:1 w:0) // Storage: Tips Tips (r:1 w:1) fn tip(t: u32, ) -> Weight { - (10_783_000 as Weight) - // Standard Error: 6_000 - .saturating_add((568_000 as Weight).saturating_mul(t as Weight)) + (10_427_000 as Weight) + // Standard Error: 7_000 + .saturating_add((507_000 as Weight).saturating_mul(t as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -160,18 +160,18 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Tips Reasons (r:0 w:1) fn close_tip(t: u32, ) -> Weight { - (41_658_000 as Weight) - // Standard Error: 13_000 - .saturating_add((391_000 as Weight).saturating_mul(t as Weight)) + (40_901_000 as Weight) + // Standard Error: 10_000 + .saturating_add((281_000 as Weight).saturating_mul(t as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Tips Tips (r:1 w:1) // Storage: Tips Reasons (r:0 w:1) fn slash_tip(t: u32, ) -> Weight { - (14_935_000 as Weight) - // Standard Error: 6_000 - .saturating_add((40_000 as Weight).saturating_mul(t as Weight)) + (14_636_000 as Weight) + // Standard Error: 4_000 + .saturating_add((29_000 as Weight).saturating_mul(t as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/frame/transaction-payment/Cargo.toml b/frame/transaction-payment/Cargo.toml index 8cb544159dd70..b9b46380a3864 100644 --- a/frame/transaction-payment/Cargo.toml +++ b/frame/transaction-payment/Cargo.toml @@ -20,9 +20,9 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"] serde = { version = "1.0.132", optional = true } smallvec = "1.7.0" -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io", default-features = false } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } +sp-io = { version = "5.0.0", path = "../../primitives/io", default-features = false } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } diff --git a/frame/transaction-payment/asset-tx-payment/Cargo.toml b/frame/transaction-payment/asset-tx-payment/Cargo.toml index ab2d3302f95b0..300d05d0ed9a3 100644 --- a/frame/transaction-payment/asset-tx-payment/Cargo.toml +++ b/frame/transaction-payment/asset-tx-payment/Cargo.toml @@ -14,9 +14,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # Substrate dependencies -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/core" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/io" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../../primitives/io" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../../primitives/std" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } @@ -32,7 +32,7 @@ serde = { version = "1.0.132", optional = true } smallvec = "1.7.0" serde_json = "1.0.74" -sp-storage = { version = "4.0.0", default-features = false, path = "../../../primitives/storage" } +sp-storage = { version = "5.0.0", default-features = false, path = "../../../primitives/storage" } pallet-assets = { version = "4.0.0-dev", path = "../../assets" } pallet-authorship = { version = "4.0.0-dev", path = "../../authorship" } diff --git a/frame/transaction-payment/rpc/Cargo.toml b/frame/transaction-payment/rpc/Cargo.toml index 2486654404aef..844e898ed867f 100644 --- a/frame/transaction-payment/rpc/Cargo.toml +++ b/frame/transaction-payment/rpc/Cargo.toml @@ -20,7 +20,7 @@ jsonrpc-derive = "18.0.0" sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-rpc = { version = "4.0.0-dev", path = "../../../primitives/rpc" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-rpc = { version = "5.0.0", path = "../../../primitives/rpc" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", path = "./runtime-api" } diff --git a/frame/transaction-payment/rpc/runtime-api/Cargo.toml b/frame/transaction-payment/rpc/runtime-api/Cargo.toml index 1ad56280ac082..fed57eb5bf736 100644 --- a/frame/transaction-payment/rpc/runtime-api/Cargo.toml +++ b/frame/transaction-payment/rpc/runtime-api/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../../primitives/api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../../../primitives/runtime" } pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = "../../../transaction-payment" } [features] diff --git a/frame/transaction-storage/Cargo.toml b/frame/transaction-storage/Cargo.toml index e4351438811f2..5adf5fd2c1f0d 100644 --- a/frame/transaction-storage/Cargo.toml +++ b/frame/transaction-storage/Cargo.toml @@ -20,16 +20,16 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"] frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../balances" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../primitives/inherents" } sp-transaction-storage-proof = { version = "4.0.0-dev", default-features = false, path = "../../primitives/transaction-storage-proof" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] sp-transaction-storage-proof = { version = "4.0.0-dev", default-features = true, path = "../../primitives/transaction-storage-proof" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core", default-features = false } +sp-core = { version = "5.0.0", path = "../../primitives/core", default-features = false } [features] default = ["std"] diff --git a/frame/transaction-storage/src/weights.rs b/frame/transaction-storage/src/weights.rs index bdf4d2cf62221..a7033da7b80ce 100644 --- a/frame/transaction-storage/src/weights.rs +++ b/frame/transaction-storage/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_transaction_storage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/optimized/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./weights-optimized/frame/transaction-storage/src//weights.rs +// --output=./frame/transaction-storage/src/weights.rs // --template=.maintain/frame-weight-template.hbs // --header=HEADER-APACHE2 // --raw @@ -74,7 +74,7 @@ impl WeightInfo for SubstrateWeight { // Storage: TransactionStorage BlockTransactions (r:1 w:1) // Storage: TransactionStorage MaxBlockTransactions (r:1 w:0) fn renew() -> Weight { - (43_773_000 as Weight) + (41_286_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -84,7 +84,7 @@ impl WeightInfo for SubstrateWeight { // Storage: System ParentHash (r:1 w:0) // Storage: TransactionStorage Transactions (r:1 w:0) fn check_proof_max() -> Weight { - (139_490_000 as Weight) + (136_957_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -112,7 +112,7 @@ impl WeightInfo for () { // Storage: TransactionStorage BlockTransactions (r:1 w:1) // Storage: TransactionStorage MaxBlockTransactions (r:1 w:0) fn renew() -> Weight { - (43_773_000 as Weight) + (41_286_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -122,7 +122,7 @@ impl WeightInfo for () { // Storage: System ParentHash (r:1 w:0) // Storage: TransactionStorage Transactions (r:1 w:0) fn check_proof_max() -> Weight { - (139_490_000 as Weight) + (136_957_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/treasury/Cargo.toml b/frame/treasury/Cargo.toml index 0a2dab417e348..d126d0ffa34b9 100644 --- a/frame/treasury/Cargo.toml +++ b/frame/treasury/Cargo.toml @@ -22,7 +22,7 @@ serde = { version = "1.0.132", features = ["derive"], optional = true } impl-trait-for-tuples = "0.2.1" sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } @@ -31,8 +31,8 @@ pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../ [dev-dependencies] -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } [features] default = ["std"] diff --git a/frame/treasury/src/weights.rs b/frame/treasury/src/weights.rs index ebe823ddb8cef..dcbf5983fa65c 100644 --- a/frame/treasury/src/weights.rs +++ b/frame/treasury/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_treasury //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/treasury/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -58,23 +58,23 @@ impl WeightInfo for SubstrateWeight { // Storage: Treasury ProposalCount (r:1 w:1) // Storage: Treasury Proposals (r:0 w:1) fn propose_spend() -> Weight { - (21_666_000 as Weight) + (21_673_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Treasury Proposals (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_proposal() -> Weight { - (25_008_000 as Weight) + (25_353_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Treasury Proposals (r:1 w:0) // Storage: Treasury Approvals (r:1 w:1) fn approve_proposal(p: u32, ) -> Weight { - (8_032_000 as Weight) + (8_164_000 as Weight) // Standard Error: 1_000 - .saturating_add((66_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((57_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -83,9 +83,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Treasury Proposals (r:2 w:2) // Storage: System Account (r:4 w:4) fn on_initialize_proposals(p: u32, ) -> Weight { - (25_541_000 as Weight) - // Standard Error: 19_000 - .saturating_add((27_399_000 as Weight).saturating_mul(p as Weight)) + (20_762_000 as Weight) + // Standard Error: 21_000 + .saturating_add((26_835_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -98,23 +98,23 @@ impl WeightInfo for () { // Storage: Treasury ProposalCount (r:1 w:1) // Storage: Treasury Proposals (r:0 w:1) fn propose_spend() -> Weight { - (21_666_000 as Weight) + (21_673_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Treasury Proposals (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_proposal() -> Weight { - (25_008_000 as Weight) + (25_353_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Treasury Proposals (r:1 w:0) // Storage: Treasury Approvals (r:1 w:1) fn approve_proposal(p: u32, ) -> Weight { - (8_032_000 as Weight) + (8_164_000 as Weight) // Standard Error: 1_000 - .saturating_add((66_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((57_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -123,9 +123,9 @@ impl WeightInfo for () { // Storage: Treasury Proposals (r:2 w:2) // Storage: System Account (r:4 w:4) fn on_initialize_proposals(p: u32, ) -> Weight { - (25_541_000 as Weight) - // Standard Error: 19_000 - .saturating_add((27_399_000 as Weight).saturating_mul(p as Weight)) + (20_762_000 as Weight) + // Standard Error: 21_000 + .saturating_add((26_835_000 as Weight).saturating_mul(p as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) diff --git a/frame/try-runtime/Cargo.toml b/frame/try-runtime/Cargo.toml index 905c58ab00bed..0546c0a898fb2 100644 --- a/frame/try-runtime/Cargo.toml +++ b/frame/try-runtime/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-api = { version = "4.0.0-dev", path = "../../primitives/api", default-features = false } sp-std = { version = "4.0.0", path = "../../primitives/std" , default-features = false } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" , default-features = false } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" , default-features = false } frame-support = { version = "4.0.0-dev", path = "../support", default-features = false } diff --git a/frame/uniques/Cargo.toml b/frame/uniques/Cargo.toml index 38c519f801674..4e0194b17acbc 100644 --- a/frame/uniques/Cargo.toml +++ b/frame/uniques/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } @@ -24,8 +24,8 @@ log = { version = "0.4.14", default-features = false } [dev-dependencies] sp-std = { version = "4.0.0", path = "../../primitives/std" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../primitives/io" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/uniques/src/weights.rs b/frame/uniques/src/weights.rs index 190ce74bbaa57..1df8fe0ff6650 100644 --- a/frame/uniques/src/weights.rs +++ b/frame/uniques/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_uniques //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/uniques/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -76,14 +76,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn create() -> Weight { - (23_715_000 as Weight) + (24_063_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_create() -> Weight { - (12_854_000 as Weight) + (13_017_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -96,12 +96,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Account (r:0 w:20) fn destroy(n: u32, m: u32, a: u32, ) -> Weight { (0 as Weight) - // Standard Error: 13_000 - .saturating_add((9_291_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 13_000 - .saturating_add((957_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 13_000 - .saturating_add((862_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 14_000 + .saturating_add((9_248_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 14_000 + .saturating_add((854_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 14_000 + .saturating_add((758_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -113,7 +113,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Account (r:0 w:1) fn mint() -> Weight { - (29_659_000 as Weight) + (29_865_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -121,7 +121,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:1) fn burn() -> Weight { - (31_363_000 as Weight) + (31_603_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -129,7 +129,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:2) fn transfer() -> Weight { - (23_596_000 as Weight) + (23_331_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -137,8 +137,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Asset (r:100 w:100) fn redeposit(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 11_000 - .saturating_add((11_793_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 12_000 + .saturating_add((11_527_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -147,26 +147,26 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn freeze() -> Weight { - (17_708_000 as Weight) + (18_617_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn thaw() -> Weight { - (17_959_000 as Weight) + (18_618_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:1) fn freeze_class() -> Weight { - (14_034_000 as Weight) + (13_570_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:1) fn thaw_class() -> Weight { - (13_751_000 as Weight) + (13_937_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -174,20 +174,20 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:2) fn transfer_ownership() -> Weight { - (31_328_000 as Weight) + (31_021_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Uniques Class (r:1 w:1) fn set_team() -> Weight { - (14_586_000 as Weight) + (14_739_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_asset_status() -> Weight { - (16_374_000 as Weight) + (16_826_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -195,7 +195,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn set_attribute() -> Weight { - (36_952_000 as Weight) + (37_010_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -203,49 +203,49 @@ impl WeightInfo for SubstrateWeight { // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn clear_attribute() -> Weight { - (35_230_000 as Weight) + (34_432_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn set_metadata() -> Weight { - (28_148_000 as Weight) + (28_575_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn clear_metadata() -> Weight { - (29_027_000 as Weight) + (28_730_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn set_class_metadata() -> Weight { - (27_535_000 as Weight) + (28_225_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn clear_class_metadata() -> Weight { - (26_707_000 as Weight) + (26_455_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn approve_transfer() -> Weight { - (19_108_000 as Weight) + (19_587_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn cancel_approval() -> Weight { - (19_779_000 as Weight) + (19_417_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -256,14 +256,14 @@ impl WeightInfo for () { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn create() -> Weight { - (23_715_000 as Weight) + (24_063_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_create() -> Weight { - (12_854_000 as Weight) + (13_017_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -276,12 +276,12 @@ impl WeightInfo for () { // Storage: Uniques Account (r:0 w:20) fn destroy(n: u32, m: u32, a: u32, ) -> Weight { (0 as Weight) - // Standard Error: 13_000 - .saturating_add((9_291_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 13_000 - .saturating_add((957_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 13_000 - .saturating_add((862_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 14_000 + .saturating_add((9_248_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 14_000 + .saturating_add((854_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 14_000 + .saturating_add((758_000 as Weight).saturating_mul(a as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -293,7 +293,7 @@ impl WeightInfo for () { // Storage: Uniques Class (r:1 w:1) // Storage: Uniques Account (r:0 w:1) fn mint() -> Weight { - (29_659_000 as Weight) + (29_865_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -301,7 +301,7 @@ impl WeightInfo for () { // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:1) fn burn() -> Weight { - (31_363_000 as Weight) + (31_603_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -309,7 +309,7 @@ impl WeightInfo for () { // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Account (r:0 w:2) fn transfer() -> Weight { - (23_596_000 as Weight) + (23_331_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -317,8 +317,8 @@ impl WeightInfo for () { // Storage: Uniques Asset (r:100 w:100) fn redeposit(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 11_000 - .saturating_add((11_793_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 12_000 + .saturating_add((11_527_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -327,26 +327,26 @@ impl WeightInfo for () { // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn freeze() -> Weight { - (17_708_000 as Weight) + (18_617_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Uniques Asset (r:1 w:1) // Storage: Uniques Class (r:1 w:0) fn thaw() -> Weight { - (17_959_000 as Weight) + (18_618_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:1) fn freeze_class() -> Weight { - (14_034_000 as Weight) + (13_570_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:1) fn thaw_class() -> Weight { - (13_751_000 as Weight) + (13_937_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -354,20 +354,20 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:2) fn transfer_ownership() -> Weight { - (31_328_000 as Weight) + (31_021_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Uniques Class (r:1 w:1) fn set_team() -> Weight { - (14_586_000 as Weight) + (14_739_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassAccount (r:0 w:1) fn force_asset_status() -> Weight { - (16_374_000 as Weight) + (16_826_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -375,7 +375,7 @@ impl WeightInfo for () { // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn set_attribute() -> Weight { - (36_952_000 as Weight) + (37_010_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -383,49 +383,49 @@ impl WeightInfo for () { // Storage: Uniques InstanceMetadataOf (r:1 w:0) // Storage: Uniques Attribute (r:1 w:1) fn clear_attribute() -> Weight { - (35_230_000 as Weight) + (34_432_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn set_metadata() -> Weight { - (28_148_000 as Weight) + (28_575_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques InstanceMetadataOf (r:1 w:1) fn clear_metadata() -> Weight { - (29_027_000 as Weight) + (28_730_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:1) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn set_class_metadata() -> Weight { - (27_535_000 as Weight) + (28_225_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques ClassMetadataOf (r:1 w:1) fn clear_class_metadata() -> Weight { - (26_707_000 as Weight) + (26_455_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn approve_transfer() -> Weight { - (19_108_000 as Weight) + (19_587_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Uniques Class (r:1 w:0) // Storage: Uniques Asset (r:1 w:1) fn cancel_approval() -> Weight { - (19_779_000 as Weight) + (19_417_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/frame/utility/Cargo.toml b/frame/utility/Cargo.toml index 85f522975dbbc..ea3977c1b8b29 100644 --- a/frame/utility/Cargo.toml +++ b/frame/utility/Cargo.toml @@ -17,15 +17,15 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } [dev-dependencies] -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/utility/src/weights.rs b/frame/utility/src/weights.rs index 3d80691210de0..e5f3cb0f58fd4 100644 --- a/frame/utility/src/weights.rs +++ b/frame/utility/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/utility/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -56,39 +56,39 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn batch(c: u32, ) -> Weight { - (15_877_000 as Weight) + (18_598_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_341_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((2_374_000 as Weight).saturating_mul(c as Weight)) } fn as_derivative() -> Weight { - (1_754_000 as Weight) + (1_650_000 as Weight) } fn batch_all(c: u32, ) -> Weight { - (16_581_000 as Weight) + (13_988_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_476_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((2_481_000 as Weight).saturating_mul(c as Weight)) } fn dispatch_as() -> Weight { - (8_294_000 as Weight) + (8_463_000 as Weight) } } // For backwards compatibility and tests impl WeightInfo for () { fn batch(c: u32, ) -> Weight { - (15_877_000 as Weight) + (18_598_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_341_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((2_374_000 as Weight).saturating_mul(c as Weight)) } fn as_derivative() -> Weight { - (1_754_000 as Weight) + (1_650_000 as Weight) } fn batch_all(c: u32, ) -> Weight { - (16_581_000 as Weight) + (13_988_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_476_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((2_481_000 as Weight).saturating_mul(c as Weight)) } fn dispatch_as() -> Weight { - (8_294_000 as Weight) + (8_463_000 as Weight) } } diff --git a/frame/vesting/Cargo.toml b/frame/vesting/Cargo.toml index e488e282cd459..f7dcfd9fa442f 100644 --- a/frame/vesting/Cargo.toml +++ b/frame/vesting/Cargo.toml @@ -18,15 +18,15 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = ] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true } log = { version = "0.4.0", default-features = false } [dev-dependencies] -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } pallet-balances = { version = "4.0.0-dev", path = "../balances" } [features] diff --git a/frame/vesting/src/weights.rs b/frame/vesting/src/weights.rs index caf1880daefda..140c1889d6e54 100644 --- a/frame/vesting/src/weights.rs +++ b/frame/vesting/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/lto-fat-cg1/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -34,7 +34,7 @@ // --heap-pages=4096 // --output=./frame/vesting/src/weights.rs // --template=.maintain/frame-weight-template.hbs -// --header=LICENSE-APACHE2 +// --header=HEADER-APACHE2 // --raw #![cfg_attr(rustfmt, rustfmt_skip)] @@ -62,22 +62,22 @@ impl WeightInfo for SubstrateWeight { // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_locked(l: u32, s: u32, ) -> Weight { - (27_545_000 as Weight) + (27_037_000 as Weight) // Standard Error: 1_000 - .saturating_add((111_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((88_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((78_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((69_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_unlocked(l: u32, s: u32, ) -> Weight { - (27_638_000 as Weight) + (26_627_000 as Weight) // Standard Error: 1_000 - .saturating_add((102_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((82_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((41_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((53_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -85,11 +85,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn vest_other_locked(l: u32, s: u32, ) -> Weight { - (27_571_000 as Weight) + (26_672_000 as Weight) // Standard Error: 1_000 - .saturating_add((105_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((85_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((76_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((77_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -97,11 +97,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { - (27_470_000 as Weight) + (26_682_000 as Weight) // Standard Error: 1_000 - .saturating_add((99_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((74_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((48_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((51_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -109,11 +109,11 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vested_transfer(l: u32, s: u32, ) -> Weight { - (42_886_000 as Weight) + (42_066_000 as Weight) // Standard Error: 1_000 - .saturating_add((100_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((83_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 3_000 - .saturating_add((49_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((43_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -121,9 +121,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:1 w:1) fn force_vested_transfer(l: u32, s: u32, ) -> Weight { - (42_528_000 as Weight) + (41_672_000 as Weight) // Standard Error: 1_000 - .saturating_add((104_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((84_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 3_000 .saturating_add((46_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) @@ -133,11 +133,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - (28_372_000 as Weight) - // Standard Error: 1_000 - .saturating_add((110_000 as Weight).saturating_mul(l as Weight)) + (27_627_000 as Weight) + // Standard Error: 0 + .saturating_add((86_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((71_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((68_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -145,11 +145,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - (28_117_000 as Weight) + (27_143_000 as Weight) + // Standard Error: 0 + .saturating_add((88_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 1_000 - .saturating_add((108_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 2_000 - .saturating_add((76_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((72_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -160,22 +160,22 @@ impl WeightInfo for () { // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_locked(l: u32, s: u32, ) -> Weight { - (27_545_000 as Weight) + (27_037_000 as Weight) // Standard Error: 1_000 - .saturating_add((111_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((88_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((78_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((69_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_unlocked(l: u32, s: u32, ) -> Weight { - (27_638_000 as Weight) + (26_627_000 as Weight) // Standard Error: 1_000 - .saturating_add((102_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((82_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((41_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((53_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -183,11 +183,11 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn vest_other_locked(l: u32, s: u32, ) -> Weight { - (27_571_000 as Weight) + (26_672_000 as Weight) // Standard Error: 1_000 - .saturating_add((105_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((85_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((76_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((77_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -195,11 +195,11 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { - (27_470_000 as Weight) + (26_682_000 as Weight) // Standard Error: 1_000 - .saturating_add((99_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((74_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((48_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((51_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -207,11 +207,11 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vested_transfer(l: u32, s: u32, ) -> Weight { - (42_886_000 as Weight) + (42_066_000 as Weight) // Standard Error: 1_000 - .saturating_add((100_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((83_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 3_000 - .saturating_add((49_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((43_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -219,9 +219,9 @@ impl WeightInfo for () { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:1 w:1) fn force_vested_transfer(l: u32, s: u32, ) -> Weight { - (42_528_000 as Weight) + (41_672_000 as Weight) // Standard Error: 1_000 - .saturating_add((104_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((84_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 3_000 .saturating_add((46_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) @@ -231,11 +231,11 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - (28_372_000 as Weight) - // Standard Error: 1_000 - .saturating_add((110_000 as Weight).saturating_mul(l as Weight)) + (27_627_000 as Weight) + // Standard Error: 0 + .saturating_add((86_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 2_000 - .saturating_add((71_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((68_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -243,11 +243,11 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - (28_117_000 as Weight) + (27_143_000 as Weight) + // Standard Error: 0 + .saturating_add((88_000 as Weight).saturating_mul(l as Weight)) // Standard Error: 1_000 - .saturating_add((108_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 2_000 - .saturating_add((76_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((72_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } diff --git a/primitives/api/Cargo.toml b/primitives/api/Cargo.toml index f2c3e67800dc4..ab81ed85f188d 100644 --- a/primitives/api/Cargo.toml +++ b/primitives/api/Cargo.toml @@ -15,11 +15,11 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } sp-api-proc-macro = { version = "4.0.0-dev", path = "proc-macro" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-version = { version = "4.0.0-dev", default-features = false, path = "../version" } -sp-state-machine = { version = "0.10.0", optional = true, path = "../state-machine" } +sp-state-machine = { version = "0.11.0", optional = true, path = "../state-machine" } hash-db = { version = "0.15.2", optional = true } thiserror = { version = "1.0.30", optional = true } diff --git a/primitives/api/test/Cargo.toml b/primitives/api/test/Cargo.toml index 79e302c4c065d..064e6a6c98181 100644 --- a/primitives/api/test/Cargo.toml +++ b/primitives/api/test/Cargo.toml @@ -16,11 +16,11 @@ sp-api = { version = "4.0.0-dev", path = "../" } substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" } sp-version = { version = "4.0.0-dev", path = "../../version" } sp-tracing = { version = "4.0.0", path = "../../tracing" } -sp-runtime = { version = "4.1.0-dev", path = "../../runtime" } +sp-runtime = { version = "5.0.0", path = "../../runtime" } sp-consensus = { version = "0.10.0-dev", path = "../../consensus/common" } sc-block-builder = { version = "0.10.0-dev", path = "../../../client/block-builder" } codec = { package = "parity-scale-codec", version = "2.0.0" } -sp-state-machine = { version = "0.10.0", path = "../../state-machine" } +sp-state-machine = { version = "0.11.0", path = "../../state-machine" } trybuild = "1.0.53" rustversion = "1.0.6" @@ -28,7 +28,7 @@ rustversion = "1.0.6" criterion = "0.3.0" futures = "0.3.9" log = "0.4.14" -sp-core = { version = "4.1.0-dev", path = "../../core" } +sp-core = { version = "5.0.0", path = "../../core" } [[bench]] name = "bench" diff --git a/primitives/application-crypto/Cargo.toml b/primitives/application-crypto/Cargo.toml index 75766905d14f7..a3dfa8646e793 100644 --- a/primitives/application-crypto/Cargo.toml +++ b/primitives/application-crypto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-application-crypto" -version = "4.0.0" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" description = "Provides facilities for generating application specific crypto wrapper types." @@ -15,12 +15,12 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0.132", optional = true, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-io = { version = "4.0.0", default-features = false, path = "../io" } +sp-io = { version = "5.0.0", default-features = false, path = "../io" } [features] default = [ "std" ] diff --git a/primitives/application-crypto/test/Cargo.toml b/primitives/application-crypto/test/Cargo.toml index 178932869611f..515be41be3d2e 100644 --- a/primitives/application-crypto/test/Cargo.toml +++ b/primitives/application-crypto/test/Cargo.toml @@ -13,9 +13,9 @@ repository = "https://github.com/paritytech/substrate/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../core" } -sp-keystore = { version = "0.10.0", path = "../../keystore", default-features = false } +sp-core = { version = "5.0.0", default-features = false, path = "../../core" } +sp-keystore = { version = "0.11.0", path = "../../keystore", default-features = false } substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" } -sp-runtime = { version = "4.1.0-dev", path = "../../runtime" } +sp-runtime = { version = "5.0.0", path = "../../runtime" } sp-api = { version = "4.0.0-dev", path = "../../api" } -sp-application-crypto = { version = "4.0.0", path = "../" } +sp-application-crypto = { version = "5.0.0", path = "../" } diff --git a/primitives/arithmetic/src/fixed_point.rs b/primitives/arithmetic/src/fixed_point.rs index 206e63af95b1f..1c61d6c3806ae 100644 --- a/primitives/arithmetic/src/fixed_point.rs +++ b/primitives/arithmetic/src/fixed_point.rs @@ -369,6 +369,7 @@ macro_rules! implement_fixed { Default, Copy, Clone, + codec::MaxEncodedLen, PartialEq, Eq, PartialOrd, @@ -667,6 +668,15 @@ macro_rules! implement_fixed { assert!($name::DIV > 0); } + #[test] + fn has_max_encoded_len() { + struct AsMaxEncodedLen { + _data: T, + } + + let _ = AsMaxEncodedLen { _data: $name::min_value() }; + } + #[test] fn from_i129_works() { let a = I129 { value: 1, negative: true }; diff --git a/primitives/authority-discovery/Cargo.toml b/primitives/authority-discovery/Cargo.toml index 2fd2c48476920..7c6aa7a6ea002 100644 --- a/primitives/authority-discovery/Cargo.toml +++ b/primitives/authority-discovery/Cargo.toml @@ -13,12 +13,12 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../application-crypto" } codec = { package = "parity-scale-codec", default-features = false, version = "2.0.0" } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../std" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } [features] default = ["std"] diff --git a/primitives/authorship/Cargo.toml b/primitives/authorship/Cargo.toml index 8e97942499aad..4cf8e6e9522d1 100644 --- a/primitives/authorship/Cargo.toml +++ b/primitives/authorship/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../inherents" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } async-trait = { version = "0.1.50", optional = true } diff --git a/primitives/beefy/Cargo.toml b/primitives/beefy/Cargo.toml index edcb2244e58fb..9d8ec2a653ea0 100644 --- a/primitives/beefy/Cargo.toml +++ b/primitives/beefy/Cargo.toml @@ -12,15 +12,15 @@ codec = { version = "2.2.0", package = "parity-scale-codec", default-features = scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", path = "../api", default-features = false } -sp-application-crypto = { version = "4.0.0", path = "../application-crypto", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../core", default-features = false } -sp-runtime = { version = "4.1.0-dev", path = "../runtime", default-features = false } +sp-application-crypto = { version = "5.0.0", path = "../application-crypto", default-features = false } +sp-core = { version = "5.0.0", path = "../core", default-features = false } +sp-runtime = { version = "5.0.0", path = "../runtime", default-features = false } sp-std = { version = "4.0.0", path = "../std", default-features = false } [dev-dependencies] hex = "0.4.3" hex-literal = "0.3" -sp-keystore = { version = "0.10.0", path = "../keystore" } +sp-keystore = { version = "0.11.0", path = "../keystore" } [features] default = ["std"] diff --git a/primitives/block-builder/Cargo.toml b/primitives/block-builder/Cargo.toml index 5009207a3f5c3..28f76343c7e98 100644 --- a/primitives/block-builder/Cargo.toml +++ b/primitives/block-builder/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } diff --git a/primitives/blockchain/Cargo.toml b/primitives/blockchain/Cargo.toml index 366d0f3c373e2..89737dbac0c6b 100644 --- a/primitives/blockchain/Cargo.toml +++ b/primitives/blockchain/Cargo.toml @@ -21,7 +21,7 @@ thiserror = "1.0.30" futures = "0.3.9" codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } sp-consensus = { version = "0.10.0-dev", path = "../consensus/common" } -sp-runtime = { version = "4.1.0-dev", path = "../runtime" } -sp-state-machine = { version = "0.10.0", path = "../state-machine" } +sp-runtime = { version = "5.0.0", path = "../runtime" } +sp-state-machine = { version = "0.11.0", path = "../state-machine" } sp-database = { version = "4.0.0-dev", path = "../database" } sp-api = { version = "4.0.0-dev", path = "../api" } diff --git a/primitives/consensus/aura/Cargo.toml b/primitives/consensus/aura/Cargo.toml index f15f0008164d6..e78de2db17b39 100644 --- a/primitives/consensus/aura/Cargo.toml +++ b/primitives/consensus/aura/Cargo.toml @@ -13,12 +13,12 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../application-crypto" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../../std" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../runtime" } sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../inherents" } sp-timestamp = { version = "4.0.0-dev", default-features = false, path = "../../timestamp" } sp-consensus-slots = { version = "0.10.0-dev", default-features = false, path = "../slots" } diff --git a/primitives/consensus/babe/Cargo.toml b/primitives/consensus/babe/Cargo.toml index 1471ca05f591e..b114d182c730d 100644 --- a/primitives/consensus/babe/Cargo.toml +++ b/primitives/consensus/babe/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../application-crypto" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } merlin = { version = "2.0", default-features = false } @@ -22,10 +22,10 @@ sp-api = { version = "4.0.0-dev", default-features = false, path = "../../api" } sp-consensus = { version = "0.10.0-dev", optional = true, path = "../common" } sp-consensus-slots = { version = "0.10.0-dev", default-features = false, path = "../slots" } sp-consensus-vrf = { version = "0.10.0-dev", path = "../vrf", default-features = false } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../core" } sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../inherents" } -sp-keystore = { version = "0.10.0", default-features = false, path = "../../keystore", optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../runtime" } +sp-keystore = { version = "0.11.0", default-features = false, path = "../../keystore", optional = true } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../runtime" } sp-timestamp = { version = "4.0.0-dev", path = "../../timestamp", optional = true } serde = { version = "1.0.132", features = ["derive"], optional = true } async-trait = { version = "0.1.50", optional = true } diff --git a/primitives/consensus/common/Cargo.toml b/primitives/consensus/common/Cargo.toml index 93338d62cfc02..2717de72d1e31 100644 --- a/primitives/consensus/common/Cargo.toml +++ b/primitives/consensus/common/Cargo.toml @@ -20,13 +20,13 @@ codec = { package = "parity-scale-codec", version = "2.0.0", features = [ ] } futures = { version = "0.3.1", features = ["thread-pool"] } log = "0.4.8" -sp-core = { path = "../../core", version = "4.1.0-dev" } +sp-core = { path = "../../core", version = "5.0.0"} sp-inherents = { version = "4.0.0-dev", path = "../../inherents" } -sp-state-machine = { version = "0.10.0", path = "../../state-machine" } +sp-state-machine = { version = "0.11.0", path = "../../state-machine" } futures-timer = "3.0.1" sp-std = { version = "4.0.0", path = "../../std" } sp-version = { version = "4.0.0-dev", path = "../../version" } -sp-runtime = { version = "4.1.0-dev", path = "../../runtime" } +sp-runtime = { version = "5.0.0", path = "../../runtime" } thiserror = "1.0.30" [dev-dependencies] diff --git a/primitives/consensus/pow/Cargo.toml b/primitives/consensus/pow/Cargo.toml index 810e9c23a6599..f70af90afd6d3 100644 --- a/primitives/consensus/pow/Cargo.toml +++ b/primitives/consensus/pow/Cargo.toml @@ -15,8 +15,8 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-api = { version = "4.0.0-dev", default-features = false, path = "../../api" } sp-std = { version = "4.0.0", default-features = false, path = "../../std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../runtime" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../core" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../runtime" } +sp-core = { version = "5.0.0", default-features = false, path = "../../core" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } [features] diff --git a/primitives/consensus/slots/Cargo.toml b/primitives/consensus/slots/Cargo.toml index ea2a862189826..18506980ae85d 100644 --- a/primitives/consensus/slots/Cargo.toml +++ b/primitives/consensus/slots/Cargo.toml @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0", features = ["derive"], optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../runtime" } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../../arithmetic" } [features] diff --git a/primitives/consensus/vrf/Cargo.toml b/primitives/consensus/vrf/Cargo.toml index 7504a159a3db7..3277a3ff96916 100644 --- a/primitives/consensus/vrf/Cargo.toml +++ b/primitives/consensus/vrf/Cargo.toml @@ -16,8 +16,8 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { version = "2.0.0", package = "parity-scale-codec", default-features = false } schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated", "u64_backend"], default-features = false } sp-std = { version = "4.0.0", path = "../../std", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../../core", default-features = false } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../runtime" } +sp-core = { version = "5.0.0", path = "../../core", default-features = false } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../runtime" } [features] default = ["std"] diff --git a/primitives/core/Cargo.toml b/primitives/core/Cargo.toml index 43f2b54044c9b..90138ded4cb19 100644 --- a/primitives/core/Cargo.toml +++ b/primitives/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-core" -version = "4.1.0-dev" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -38,8 +38,8 @@ lazy_static = { version = "1.4.0", default-features = false, optional = true } parking_lot = { version = "0.11.2", optional = true } sp-std = { version = "4.0.0", default-features = false, path = "../std" } sp-debug-derive = { version = "4.0.0", default-features = false, path = "../debug-derive" } -sp-storage = { version = "4.0.0", default-features = false, path = "../storage" } -sp-externalities = { version = "0.10.0", optional = true, path = "../externalities" } +sp-storage = { version = "5.0.0", default-features = false, path = "../storage" } +sp-externalities = { version = "0.11.0", optional = true, path = "../externalities" } parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } futures = { version = "0.3.1", optional = true } dyn-clonable = { version = "0.9.0", optional = true } @@ -61,7 +61,7 @@ libsecp256k1 = { version = "0.7", default-features = false, features = ["hmac", merlin = { version = "2.0", default-features = false, optional = true } ss58-registry = { version = "1.11.0", default-features = false } sp-core-hashing = { version = "4.0.0", path = "./hashing", default-features = false, optional = true } -sp-runtime-interface = { version = "4.1.0-dev", default-features = false, path = "../runtime-interface" } +sp-runtime-interface = { version = "5.0.0", default-features = false, path = "../runtime-interface" } [dev-dependencies] sp-serializer = { version = "4.0.0-dev", path = "../serializer" } diff --git a/primitives/core/src/ecdsa.rs b/primitives/core/src/ecdsa.rs index c5e53c7029e66..4d2cae97ef14a 100644 --- a/primitives/core/src/ecdsa.rs +++ b/primitives/core/src/ecdsa.rs @@ -187,7 +187,7 @@ impl<'de> Deserialize<'de> for Public { /// A signature (a 512-bit value, plus 8 bits for recovery ID). #[cfg_attr(feature = "full_crypto", derive(Hash))] -#[derive(Encode, Decode, PassByInner, TypeInfo, PartialEq, Eq)] +#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)] pub struct Signature(pub [u8; 65]); impl sp_std::convert::TryFrom<&[u8]> for Signature { diff --git a/primitives/core/src/ed25519.rs b/primitives/core/src/ed25519.rs index bb99a4ae02006..be7547201e84d 100644 --- a/primitives/core/src/ed25519.rs +++ b/primitives/core/src/ed25519.rs @@ -212,7 +212,7 @@ impl<'de> Deserialize<'de> for Public { /// A signature (a 512-bit value). #[cfg_attr(feature = "full_crypto", derive(Hash))] -#[derive(Encode, Decode, PassByInner, TypeInfo, PartialEq, Eq)] +#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)] pub struct Signature(pub [u8; 64]); impl sp_std::convert::TryFrom<&[u8]> for Signature { diff --git a/primitives/core/src/sr25519.rs b/primitives/core/src/sr25519.rs index 4094c4d1b4405..5e18e02c0ffd8 100644 --- a/primitives/core/src/sr25519.rs +++ b/primitives/core/src/sr25519.rs @@ -212,7 +212,7 @@ impl<'de> Deserialize<'de> for Public { /// /// Instead of importing it for the local module, alias it to be available as a public type #[cfg_attr(feature = "full_crypto", derive(Hash))] -#[derive(Encode, Decode, PassByInner, TypeInfo, PartialEq, Eq)] +#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)] pub struct Signature(pub [u8; 64]); impl sp_std::convert::TryFrom<&[u8]> for Signature { diff --git a/primitives/externalities/Cargo.toml b/primitives/externalities/Cargo.toml index 6c26b436796ee..7b7beb51e7809 100644 --- a/primitives/externalities/Cargo.toml +++ b/primitives/externalities/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-externalities" -version = "0.10.0" +version = "0.11.0" license = "Apache-2.0" authors = ["Parity Technologies "] edition = "2021" @@ -14,7 +14,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-storage = { version = "4.0.0", path = "../storage", default-features = false } +sp-storage = { version = "5.0.0", path = "../storage", default-features = false } sp-std = { version = "4.0.0", path = "../std", default-features = false } environmental = { version = "1.1.3", default-features = false } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } diff --git a/primitives/finality-grandpa/Cargo.toml b/primitives/finality-grandpa/Cargo.toml index e36c088c35838..bb0b8b8509aca 100644 --- a/primitives/finality-grandpa/Cargo.toml +++ b/primitives/finality-grandpa/Cargo.toml @@ -21,10 +21,10 @@ grandpa = { package = "finality-grandpa", version = "0.14.1", default-features = log = { version = "0.4.8", optional = true } serde = { version = "1.0.132", optional = true, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../application-crypto" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } -sp-keystore = { version = "0.10.0", default-features = false, path = "../keystore", optional = true } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../application-crypto" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } +sp-keystore = { version = "0.11.0", default-features = false, path = "../keystore", optional = true } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } [features] diff --git a/primitives/inherents/Cargo.toml b/primitives/inherents/Cargo.toml index 02f084b6e6342..f78f4aea14e47 100644 --- a/primitives/inherents/Cargo.toml +++ b/primitives/inherents/Cargo.toml @@ -16,8 +16,8 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } -sp-runtime = { version = "4.1.0-dev", path = "../runtime", optional = true } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } +sp-runtime = { version = "5.0.0", path = "../runtime", optional = true } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } thiserror = { version = "1.0.30", optional = true } impl-trait-for-tuples = "0.2.0" diff --git a/primitives/io/Cargo.toml b/primitives/io/Cargo.toml index ee3c9e8945eb2..207a1a23e81d9 100644 --- a/primitives/io/Cargo.toml +++ b/primitives/io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-io" -version = "4.0.0" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -17,15 +17,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } hash-db = { version = "0.15.2", default-features = false } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } -sp-keystore = { version = "0.10.0", default-features = false, optional = true, path = "../keystore" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } +sp-keystore = { version = "0.11.0", default-features = false, optional = true, path = "../keystore" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } libsecp256k1 = { version = "0.7", optional = true } -sp-state-machine = { version = "0.10.0", optional = true, path = "../state-machine" } -sp-wasm-interface = { version = "4.1.0-dev", path = "../wasm-interface", default-features = false } -sp-runtime-interface = { version = "4.1.0-dev", default-features = false, path = "../runtime-interface" } -sp-trie = { version = "4.0.0", optional = true, path = "../trie" } -sp-externalities = { version = "0.10.0", optional = true, path = "../externalities" } +sp-state-machine = { version = "0.11.0", optional = true, path = "../state-machine" } +sp-wasm-interface = { version = "5.0.0", path = "../wasm-interface", default-features = false } +sp-runtime-interface = { version = "5.0.0", default-features = false, path = "../runtime-interface" } +sp-trie = { version = "5.0.0", optional = true, path = "../trie" } +sp-externalities = { version = "0.11.0", optional = true, path = "../externalities" } sp-tracing = { version = "4.0.0", default-features = false, path = "../tracing" } log = { version = "0.4.8", optional = true } futures = { version = "0.3.1", features = ["thread-pool"], optional = true } diff --git a/primitives/keyring/Cargo.toml b/primitives/keyring/Cargo.toml index a457f4983c163..2f8e935b2457f 100644 --- a/primitives/keyring/Cargo.toml +++ b/primitives/keyring/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-core = { version = "4.1.0-dev", path = "../core" } -sp-runtime = { version = "4.1.0-dev", path = "../runtime" } +sp-core = { version = "5.0.0", path = "../core" } +sp-runtime = { version = "5.0.0", path = "../runtime" } lazy_static = "1.4.0" -strum = { version = "0.22.0", features = ["derive"] } +strum = { version = "0.23.0", features = ["derive"] } diff --git a/primitives/keystore/Cargo.toml b/primitives/keystore/Cargo.toml index 28802cbec35e7..26748d3227d6f 100644 --- a/primitives/keystore/Cargo.toml +++ b/primitives/keystore/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-keystore" -version = "0.10.0" +version = "0.11.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -22,8 +22,8 @@ thiserror = "1.0" codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated", "u64_backend"], default-features = false } merlin = { version = "2.0", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../core" } -sp-externalities = { version = "0.10.0", path = "../externalities", default-features = false } +sp-core = { version = "5.0.0", path = "../core" } +sp-externalities = { version = "0.11.0", path = "../externalities", default-features = false } [dev-dependencies] rand = "0.7.2" diff --git a/primitives/npos-elections/Cargo.toml b/primitives/npos-elections/Cargo.toml index 062f786aaef1c..f392895a945ee 100644 --- a/primitives/npos-elections/Cargo.toml +++ b/primitives/npos-elections/Cargo.toml @@ -19,8 +19,8 @@ serde = { version = "1.0.132", optional = true, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../std" } sp-npos-elections-solution-type = { version = "4.0.0-dev", path = "./solution-type" } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../arithmetic" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } -sp-runtime = { version = "4.1.0-dev", path = "../runtime", default-features = false } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } +sp-runtime = { version = "5.0.0", path = "../runtime", default-features = false } [dev-dependencies] substrate-test-utils = { version = "4.0.0-dev", path = "../../test-utils" } diff --git a/primitives/npos-elections/fuzzer/Cargo.toml b/primitives/npos-elections/fuzzer/Cargo.toml index 3b6103552e214..335195e9bf5b1 100644 --- a/primitives/npos-elections/fuzzer/Cargo.toml +++ b/primitives/npos-elections/fuzzer/Cargo.toml @@ -21,7 +21,7 @@ rand = { version = "0.8", features = ["std", "small_rng"] } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-npos-elections = { version = "4.0.0-dev", path = ".." } -sp-runtime = { version = "4.1.0-dev", path = "../../runtime" } +sp-runtime = { version = "5.0.0", path = "../../runtime" } [[bin]] name = "reduce" diff --git a/primitives/offchain/Cargo.toml b/primitives/offchain/Cargo.toml index 7e0ce31d5d0c4..a96cd852bf24d 100644 --- a/primitives/offchain/Cargo.toml +++ b/primitives/offchain/Cargo.toml @@ -13,9 +13,9 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } [features] default = ["std"] diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 52fe09b2c7894..137be2c6eee2c 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-rpc" -version = "4.0.0-dev" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] serde = { version = "1.0.132", features = ["derive"] } -sp-core = { version = "4.1.0-dev", path = "../core" } +sp-core = { version = "5.0.0", path = "../core" } rustc-hash = "1.1.0" [dev-dependencies] diff --git a/primitives/runtime-interface/Cargo.toml b/primitives/runtime-interface/Cargo.toml index 137780c3c91e8..89805a9db36dd 100644 --- a/primitives/runtime-interface/Cargo.toml +++ b/primitives/runtime-interface/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-runtime-interface" -version = "4.1.0-dev" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -14,22 +14,22 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-wasm-interface = { version = "4.1.0-dev", path = "../wasm-interface", default-features = false } +sp-wasm-interface = { version = "5.0.0", path = "../wasm-interface", default-features = false } sp-std = { version = "4.0.0", default-features = false, path = "../std" } sp-tracing = { version = "4.0.0", default-features = false, path = "../tracing" } sp-runtime-interface-proc-macro = { version = "4.0.0", path = "proc-macro" } -sp-externalities = { version = "0.10.0", optional = true, path = "../externalities" } +sp-externalities = { version = "0.11.0", optional = true, path = "../externalities" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } static_assertions = "1.0.0" primitive-types = { version = "0.10.1", default-features = false } -sp-storage = { version = "4.0.0", default-features = false, path = "../storage" } +sp-storage = { version = "5.0.0", default-features = false, path = "../storage" } impl-trait-for-tuples = "0.2.1" [dev-dependencies] sp-runtime-interface-test-wasm = { version = "2.0.0", path = "test-wasm" } -sp-state-machine = { version = "0.10.0", path = "../state-machine" } -sp-core = { version = "4.1.0-dev", path = "../core" } -sp-io = { version = "4.0.0-dev", path = "../io" } +sp-state-machine = { version = "0.11.0", path = "../state-machine" } +sp-core = { version = "5.0.0", path = "../core" } +sp-io = { version = "5.0.0", path = "../io" } rustversion = "1.0.6" trybuild = "1.0.53" diff --git a/primitives/runtime-interface/test-wasm-deprecated/Cargo.toml b/primitives/runtime-interface/test-wasm-deprecated/Cargo.toml index 032de1d215f25..18046626f6508 100644 --- a/primitives/runtime-interface/test-wasm-deprecated/Cargo.toml +++ b/primitives/runtime-interface/test-wasm-deprecated/Cargo.toml @@ -13,10 +13,10 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-runtime-interface = { version = "4.1.0-dev", default-features = false, path = "../" } +sp-runtime-interface = { version = "5.0.0", default-features = false, path = "../" } sp-std = { version = "4.0.0", default-features = false, path = "../../std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../io" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../io" } +sp-core = { version = "5.0.0", default-features = false, path = "../../core" } [build-dependencies] substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder" } diff --git a/primitives/runtime-interface/test-wasm/Cargo.toml b/primitives/runtime-interface/test-wasm/Cargo.toml index 80ad44569e999..9b6bdf39eb4c0 100644 --- a/primitives/runtime-interface/test-wasm/Cargo.toml +++ b/primitives/runtime-interface/test-wasm/Cargo.toml @@ -13,10 +13,10 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-runtime-interface = { version = "4.1.0-dev", default-features = false, path = "../" } +sp-runtime-interface = { version = "5.0.0", default-features = false, path = "../" } sp-std = { version = "4.0.0", default-features = false, path = "../../std" } -sp-io = { version = "4.0.0-dev", default-features = false, path = "../../io" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../core" } +sp-io = { version = "5.0.0", default-features = false, path = "../../io" } +sp-core = { version = "5.0.0", default-features = false, path = "../../core" } [build-dependencies] substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder" } diff --git a/primitives/runtime-interface/test/Cargo.toml b/primitives/runtime-interface/test/Cargo.toml index 82c6a21b995cc..107a8fcc7f2a4 100644 --- a/primitives/runtime-interface/test/Cargo.toml +++ b/primitives/runtime-interface/test/Cargo.toml @@ -12,13 +12,13 @@ repository = "https://github.com/paritytech/substrate/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-runtime-interface = { version = "4.1.0-dev", path = "../" } +sp-runtime-interface = { version = "5.0.0", path = "../" } sc-executor = { version = "0.10.0-dev", path = "../../../client/executor" } sc-executor-common = { version = "0.10.0-dev", path = "../../../client/executor/common" } sp-runtime-interface-test-wasm = { version = "2.0.0", path = "../test-wasm" } sp-runtime-interface-test-wasm-deprecated = { version = "2.0.0", path = "../test-wasm-deprecated" } -sp-state-machine = { version = "0.10.0", path = "../../state-machine" } -sp-runtime = { version = "4.1.0-dev", path = "../../runtime" } -sp-io = { version = "4.0.0", path = "../../io" } +sp-state-machine = { version = "0.11.0", path = "../../state-machine" } +sp-runtime = { version = "5.0.0", path = "../../runtime" } +sp-io = { version = "5.0.0", path = "../../io" } tracing = "0.1.29" tracing-core = "0.1.17" diff --git a/primitives/runtime/Cargo.toml b/primitives/runtime/Cargo.toml index e6bb5a1c842e5..4f793c8faa947 100644 --- a/primitives/runtime/Cargo.toml +++ b/primitives/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-runtime" -version = "4.1.0-dev" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" @@ -18,11 +18,11 @@ targets = ["x86_64-unknown-linux-gnu"] serde = { version = "1.0.132", optional = true, features = ["derive"] } codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../application-crypto" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../application-crypto" } sp-arithmetic = { version = "4.0.0", default-features = false, path = "../arithmetic" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-io = { version = "4.0.0", default-features = false, path = "../io" } +sp-io = { version = "5.0.0", default-features = false, path = "../io" } log = { version = "0.4.14", default-features = false } paste = "1.0" rand = { version = "0.7.2", optional = true } @@ -34,7 +34,7 @@ either = { version = "1.5", default-features = false } [dev-dependencies] serde_json = "1.0.74" rand = "0.7.2" -sp-state-machine = { version = "0.10.0", path = "../state-machine" } +sp-state-machine = { version = "0.11.0", path = "../state-machine" } sp-api = { version = "4.0.0-dev", path = "../api" } substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" } diff --git a/primitives/runtime/src/lib.rs b/primitives/runtime/src/lib.rs index cb9ba9ff297fb..84817a6be5d71 100644 --- a/primitives/runtime/src/lib.rs +++ b/primitives/runtime/src/lib.rs @@ -52,7 +52,7 @@ use sp_core::{ }; use sp_std::{convert::TryFrom, prelude::*}; -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; pub mod curve; @@ -224,7 +224,7 @@ pub type ConsensusEngineId = [u8; 4]; /// Signature verify that can work with any known signature types.. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[derive(Eq, PartialEq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Eq, PartialEq, Clone, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub enum MultiSignature { /// An Ed25519 signature. Ed25519(ed25519::Signature), diff --git a/primitives/sandbox/Cargo.toml b/primitives/sandbox/Cargo.toml index 59941c9648ddd..a72786807330d 100644 --- a/primitives/sandbox/Cargo.toml +++ b/primitives/sandbox/Cargo.toml @@ -20,10 +20,10 @@ wasmi = "0.9.0" [dependencies] wasmi = { version = "0.9.0", optional = true } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-io = { version = "4.0.0", default-features = false, path = "../io" } -sp-wasm-interface = { version = "4.1.0-dev", default-features = false, path = "../wasm-interface" } +sp-io = { version = "5.0.0", default-features = false, path = "../io" } +sp-wasm-interface = { version = "5.0.0", default-features = false, path = "../wasm-interface" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } log = { version = "0.4", default-features = false } diff --git a/primitives/session/Cargo.toml b/primitives/session/Cargo.toml index 293f3642b7f33..4138ecb519df6 100644 --- a/primitives/session/Cargo.toml +++ b/primitives/session/Cargo.toml @@ -16,10 +16,10 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } sp-staking = { version = "4.0.0-dev", default-features = false, path = "../staking" } -sp-runtime = { version = "4.1.0-dev", optional = true, path = "../runtime" } +sp-runtime = { version = "5.0.0", optional = true, path = "../runtime" } [features] default = [ "std" ] diff --git a/primitives/staking/Cargo.toml b/primitives/staking/Cargo.toml index 6ae972f1814be..54e556dfae122 100644 --- a/primitives/staking/Cargo.toml +++ b/primitives/staking/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } [features] diff --git a/primitives/state-machine/Cargo.toml b/primitives/state-machine/Cargo.toml index c885f99fdb839..15720688c0585 100644 --- a/primitives/state-machine/Cargo.toml +++ b/primitives/state-machine/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-state-machine" -version = "0.10.0" +version = "0.11.0" authors = ["Parity Technologies "] description = "Substrate State Machine" edition = "2021" @@ -20,20 +20,20 @@ parking_lot = { version = "0.11.2", optional = true } hash-db = { version = "0.15.2", default-features = false } trie-db = { version = "0.23.0", default-features = false } trie-root = { version = "0.17.0", default-features = false } -sp-trie = { version = "4.0.0", path = "../trie", default-features = false } -sp-core = { version = "4.1.0-dev", path = "../core", default-features = false } +sp-trie = { version = "5.0.0", path = "../trie", default-features = false } +sp-core = { version = "5.0.0", path = "../core", default-features = false } sp-panic-handler = { version = "4.0.0", path = "../panic-handler", optional = true } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } num-traits = { version = "0.2.8", default-features = false } rand = { version = "0.7.2", optional = true } -sp-externalities = { version = "0.10.0", path = "../externalities", default-features = false } +sp-externalities = { version = "0.11.0", path = "../externalities", default-features = false } smallvec = "1.7.0" sp-std = { version = "4.0.0", default-features = false, path = "../std" } tracing = { version = "0.1.29", optional = true } [dev-dependencies] hex-literal = "0.3.4" -sp-runtime = { version = "4.1.0-dev", path = "../runtime" } +sp-runtime = { version = "5.0.0", path = "../runtime" } pretty_assertions = "1.0.0" rand = "0.7.2" diff --git a/primitives/storage/Cargo.toml b/primitives/storage/Cargo.toml index 81e4140bbd36f..d3c22ce70651d 100644 --- a/primitives/storage/Cargo.toml +++ b/primitives/storage/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-storage" -version = "4.0.0" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" description = "Storage related primitives" diff --git a/primitives/tasks/Cargo.toml b/primitives/tasks/Cargo.toml index 6ac6c6aa98bec..00943e8657205 100644 --- a/primitives/tasks/Cargo.toml +++ b/primitives/tasks/Cargo.toml @@ -15,10 +15,10 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] log = { version = "0.4.8", optional = true } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } -sp-externalities = { version = "0.10.0", optional = true, path = "../externalities" } -sp-io = { version = "4.0.0", default-features = false, path = "../io" } -sp-runtime-interface = { version = "4.1.0-dev", default-features = false, path = "../runtime-interface" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } +sp-externalities = { version = "0.11.0", optional = true, path = "../externalities" } +sp-io = { version = "5.0.0", default-features = false, path = "../io" } +sp-runtime-interface = { version = "5.0.0", default-features = false, path = "../runtime-interface" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } [dev-dependencies] diff --git a/primitives/test-primitives/Cargo.toml b/primitives/test-primitives/Cargo.toml index ab2ef0d54ca4b..41fd6173cd8a5 100644 --- a/primitives/test-primitives/Cargo.toml +++ b/primitives/test-primitives/Cargo.toml @@ -12,11 +12,11 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../application-crypto" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } serde = { version = "1.0.132", optional = true, features = ["derive"] } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } [features] diff --git a/primitives/timestamp/Cargo.toml b/primitives/timestamp/Cargo.toml index e42ca738cd55e..f7ac2e663e397 100644 --- a/primitives/timestamp/Cargo.toml +++ b/primitives/timestamp/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../inherents" } thiserror = { version = "1.0.30", optional = true } diff --git a/primitives/transaction-pool/Cargo.toml b/primitives/transaction-pool/Cargo.toml index fab5f90ffffc0..c8f70bdce9de2 100644 --- a/primitives/transaction-pool/Cargo.toml +++ b/primitives/transaction-pool/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } [features] default = [ "std" ] diff --git a/primitives/transaction-storage-proof/Cargo.toml b/primitives/transaction-storage-proof/Cargo.toml index 87f7f81cd5868..9e2898fe267e1 100644 --- a/primitives/transaction-storage-proof/Cargo.toml +++ b/primitives/transaction-storage-proof/Cargo.toml @@ -14,10 +14,10 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../inherents" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-trie = { version = "4.0.0", optional = true, path = "../trie" } -sp-core = { version = "4.1.0-dev", path = "../core", optional = true } +sp-trie = { version = "5.0.0", optional = true, path = "../trie" } +sp-core = { version = "5.0.0", path = "../core", optional = true } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } log = { version = "0.4.8", optional = true } diff --git a/primitives/trie/Cargo.toml b/primitives/trie/Cargo.toml index 4564fa86ced95..e79f2ffb7f845 100644 --- a/primitives/trie/Cargo.toml +++ b/primitives/trie/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-trie" -version = "4.0.0" +version = "5.0.0" authors = ["Parity Technologies "] description = "Patricia trie stuff using a parity-scale-codec node format" repository = "https://github.com/paritytech/substrate/" @@ -25,14 +25,14 @@ hash-db = { version = "0.15.2", default-features = false } trie-db = { version = "0.23.0", default-features = false } trie-root = { version = "0.17.0", default-features = false } memory-db = { version = "0.28.0", default-features = false } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../core" } +sp-core = { version = "5.0.0", default-features = false, path = "../core" } [dev-dependencies] trie-bench = "0.29.0" trie-standardmap = "0.15.2" criterion = "0.3.3" hex-literal = "0.3.4" -sp-runtime = { version = "4.1.0-dev", path = "../runtime" } +sp-runtime = { version = "5.0.0", path = "../runtime" } [features] default = ["std"] diff --git a/primitives/version/Cargo.toml b/primitives/version/Cargo.toml index 1bb39eca13640..48091ba709cb0 100644 --- a/primitives/version/Cargo.toml +++ b/primitives/version/Cargo.toml @@ -19,7 +19,7 @@ serde = { version = "1.0.132", optional = true, features = ["derive"] } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0", default-features = false, path = "../std" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../runtime" } sp-version-proc-macro = { version = "4.0.0-dev", default-features = false, path = "proc-macro" } parity-wasm = { version = "0.42.2", optional = true } sp-core-hashing-proc-macro = { version = "4.0.0-dev", path = "../core/hashing/proc-macro" } diff --git a/primitives/wasm-interface/Cargo.toml b/primitives/wasm-interface/Cargo.toml index 200c686243e02..bb82629ba01e8 100644 --- a/primitives/wasm-interface/Cargo.toml +++ b/primitives/wasm-interface/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp-wasm-interface" -version = "4.1.0-dev" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" license = "Apache-2.0" diff --git a/test-utils/client/Cargo.toml b/test-utils/client/Cargo.toml index 902a14b1b3bdf..5f687b24896d2 100644 --- a/test-utils/client/Cargo.toml +++ b/test-utils/client/Cargo.toml @@ -29,9 +29,9 @@ sc-service = { version = "0.10.0-dev", default-features = false, features = [ ], path = "../../client/service" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } -sp-core = { version = "4.1.0-dev", path = "../../primitives/core" } -sp-keystore = { version = "0.10.0", path = "../../primitives/keystore" } +sp-core = { version = "5.0.0", path = "../../primitives/core" } +sp-keystore = { version = "0.11.0", path = "../../primitives/keystore" } sp-keyring = { version = "4.1.0-dev", path = "../../primitives/keyring" } -sp-runtime = { version = "4.1.0-dev", path = "../../primitives/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../primitives/state-machine" } async-trait = "0.1.50" diff --git a/test-utils/runtime/Cargo.toml b/test-utils/runtime/Cargo.toml index e88f571366020..f1b06d3b3ec2b 100644 --- a/test-utils/runtime/Cargo.toml +++ b/test-utils/runtime/Cargo.toml @@ -13,7 +13,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -sp-application-crypto = { version = "4.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "5.0.0", default-features = false, path = "../../primitives/application-crypto" } sp-consensus-aura = { version = "0.10.0-dev", default-features = false, path = "../../primitives/consensus/aura" } sp-consensus-babe = { version = "0.10.0-dev", default-features = false, path = "../../primitives/consensus/babe" } sp-block-builder = { version = "4.0.0-dev", default-features = false, path = "../../primitives/block-builder" } @@ -23,27 +23,27 @@ sp-inherents = { version = "4.0.0-dev", default-features = false, path = "../../ sp-keyring = { version = "4.1.0-dev", optional = true, path = "../../primitives/keyring" } memory-db = { version = "0.27.0", default-features = false } sp-offchain = { version = "4.0.0-dev", default-features = false, path = "../../primitives/offchain" } -sp-core = { version = "4.1.0-dev", default-features = false, path = "../../primitives/core" } +sp-core = { version = "5.0.0", default-features = false, path = "../../primitives/core" } sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" } -sp-runtime-interface = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime-interface" } -sp-io = { version = "4.0.0", default-features = false, path = "../../primitives/io" } +sp-runtime-interface = { version = "5.0.0", default-features = false, path = "../../primitives/runtime-interface" } +sp-io = { version = "5.0.0", default-features = false, path = "../../primitives/io" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../../frame/support" } sp-version = { version = "4.0.0-dev", default-features = false, path = "../../primitives/version" } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" } -sp-runtime = { version = "4.1.0-dev", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "5.0.0", default-features = false, path = "../../primitives/runtime" } pallet-babe = { version = "4.0.0-dev", default-features = false, path = "../../frame/babe" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../../frame/system" } frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, path = "../../frame/system/rpc/runtime-api" } pallet-timestamp = { version = "4.0.0-dev", default-features = false, path = "../../frame/timestamp" } sp-finality-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../primitives/finality-grandpa" } -sp-trie = { version = "4.0.0", default-features = false, path = "../../primitives/trie" } +sp-trie = { version = "5.0.0", default-features = false, path = "../../primitives/trie" } sp-transaction-pool = { version = "4.0.0-dev", default-features = false, path = "../../primitives/transaction-pool" } trie-db = { version = "0.23.0", default-features = false } parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } sc-service = { version = "0.10.0-dev", default-features = false, optional = true, features = ["test-helpers"], path = "../../client/service" } -sp-state-machine = { version = "0.10.0", default-features = false, path = "../../primitives/state-machine" } -sp-externalities = { version = "0.10.0", default-features = false, path = "../../primitives/externalities" } +sp-state-machine = { version = "0.11.0", default-features = false, path = "../../primitives/state-machine" } +sp-externalities = { version = "0.11.0", default-features = false, path = "../../primitives/externalities" } # 3rd party cfg-if = "1.0" diff --git a/test-utils/runtime/client/Cargo.toml b/test-utils/runtime/client/Cargo.toml index ba0f01cfced99..fd260453ca181 100644 --- a/test-utils/runtime/client/Cargo.toml +++ b/test-utils/runtime/client/Cargo.toml @@ -16,9 +16,9 @@ sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/c sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" } sc-block-builder = { version = "0.10.0-dev", path = "../../../client/block-builder" } substrate-test-client = { version = "2.0.0", path = "../../client" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } substrate-test-runtime = { version = "2.0.0", path = "../../runtime" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } codec = { package = "parity-scale-codec", version = "2.0.0" } diff --git a/test-utils/runtime/transaction-pool/Cargo.toml b/test-utils/runtime/transaction-pool/Cargo.toml index 2a94f24845871..ef2ebd64fb225 100644 --- a/test-utils/runtime/transaction-pool/Cargo.toml +++ b/test-utils/runtime/transaction-pool/Cargo.toml @@ -16,7 +16,7 @@ substrate-test-runtime-client = { version = "2.0.0", path = "../client" } parking_lot = "0.11.2" codec = { package = "parity-scale-codec", version = "2.0.0" } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sc-transaction-pool = { version = "4.0.0-dev", path = "../../../client/transaction-pool" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../client/transaction-pool/api" } futures = "0.3.16" diff --git a/utils/frame/benchmarking-cli/Cargo.toml b/utils/frame/benchmarking-cli/Cargo.toml index a7e5b76ad97ac..03a625a155dc9 100644 --- a/utils/frame/benchmarking-cli/Cargo.toml +++ b/utils/frame/benchmarking-cli/Cargo.toml @@ -15,19 +15,20 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] frame-benchmarking = { version = "4.0.0-dev", path = "../../../frame/benchmarking" } frame-support = { version = "4.0.0-dev", path = "../../../frame/support" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-service = { version = "0.10.0-dev", default-features = false, path = "../../../client/service" } sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" } sc-client-db = { version = "0.10.0-dev", path = "../../../client/db" } sc-executor = { version = "0.10.0-dev", path = "../../../client/executor" } -sp-externalities = { version = "0.10.0", path = "../../../primitives/externalities" } -sp-keystore = { version = "0.10.0", path = "../../../primitives/keystore" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } -sp-state-machine = { version = "0.10.0", path = "../../../primitives/state-machine" } +sp-externalities = { version = "0.11.0", path = "../../../primitives/externalities" } +sp-keystore = { version = "0.11.0", path = "../../../primitives/keystore" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } +sp-state-machine = { version = "0.11.0", path = "../../../primitives/state-machine" } codec = { version = "2.0.0", package = "parity-scale-codec" } clap = { version = "3.0", features = ["derive"] } chrono = "0.4" serde = "1.0.132" +serde_json = "1.0.74" handlebars = "4.1.6" Inflector = "0.11.4" linked-hash-map = "0.5.4" diff --git a/utils/frame/benchmarking-cli/src/command.rs b/utils/frame/benchmarking-cli/src/command.rs index a5046dbaad2ac..a5b53bcf99c76 100644 --- a/utils/frame/benchmarking-cli/src/command.rs +++ b/utils/frame/benchmarking-cli/src/command.rs @@ -35,7 +35,7 @@ use sp_externalities::Extensions; use sp_keystore::{testing::KeyStore, KeystoreExt, SyncCryptoStorePtr}; use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; use sp_state_machine::StateMachine; -use std::{fmt::Debug, sync::Arc, time}; +use std::{fmt::Debug, fs, sync::Arc, time}; // This takes multiple benchmark batches and combines all the results where the pallet, instance, // and benchmark are the same. @@ -357,55 +357,61 @@ impl BenchmarkCmd { // are together. let batches: Vec = combine_batches(batches, batches_db); + // Create the weights.rs file. if let Some(output_path) = &self.output { crate::writer::write_results(&batches, &storage_info, output_path, self)?; } + // Jsonify the result and write it to a file or stdout if desired. + if !self.jsonify(&batches)? { + // Print the summary only if `jsonify` did not write to stdout. + self.print_summary(&batches, &storage_info) + } + Ok(()) + } + + /// Jsonifies the passed batches and writes them to stdout or into a file. + /// Can be configured via `--json` and `--json-file`. + /// Returns whether it wrote to stdout. + fn jsonify(&self, batches: &Vec) -> Result { + if self.json_output || self.json_file.is_some() { + let json = serde_json::to_string_pretty(&batches) + .map_err(|e| format!("Serializing into JSON: {:?}", e))?; + + if let Some(path) = &self.json_file { + fs::write(path, json)?; + } else { + println!("{}", json); + return Ok(true) + } + } + + Ok(false) + } + + /// Prints the results as human-readable summary without raw timing data. + fn print_summary( + &self, + batches: &Vec, + storage_info: &Vec, + ) { for batch in batches.into_iter() { // Print benchmark metadata println!( - "Pallet: {:?}, Extrinsic: {:?}, Lowest values: {:?}, Highest values: {:?}, Steps: {:?}, Repeat: {:?}", - String::from_utf8(batch.pallet).expect("Encoded from String; qed"), - String::from_utf8(batch.benchmark).expect("Encoded from String; qed"), - self.lowest_range_values, - self.highest_range_values, - self.steps, - self.repeat, - ); + "Pallet: {:?}, Extrinsic: {:?}, Lowest values: {:?}, Highest values: {:?}, Steps: {:?}, Repeat: {:?}", + String::from_utf8(batch.pallet.clone()).expect("Encoded from String; qed"), + String::from_utf8(batch.benchmark.clone()).expect("Encoded from String; qed"), + self.lowest_range_values, + self.highest_range_values, + self.steps, + self.repeat, + ); // Skip raw data + analysis if there are no results if batch.time_results.is_empty() { continue } - if self.raw_data { - // Print the table header - batch.time_results[0] - .components - .iter() - .for_each(|param| print!("{:?},", param.0)); - - print!("extrinsic_time_ns,storage_root_time_ns,reads,repeat_reads,writes,repeat_writes,proof_size_bytes\n"); - // Print the values - batch.time_results.iter().for_each(|result| { - let parameters = &result.components; - parameters.iter().for_each(|param| print!("{:?},", param.1)); - // Print extrinsic time and storage root time - print!( - "{:?},{:?},{:?},{:?},{:?},{:?},{:?}\n", - result.extrinsic_time, - result.storage_root_time, - result.reads, - result.repeat_reads, - result.writes, - result.repeat_writes, - result.proof_size, - ); - }); - - println!(); - } - if !self.no_storage_info { let mut comments: Vec = Default::default(); crate::writer::add_storage_comments( @@ -460,8 +466,6 @@ impl BenchmarkCmd { println!(""); } } - - Ok(()) } } diff --git a/utils/frame/benchmarking-cli/src/lib.rs b/utils/frame/benchmarking-cli/src/lib.rs index 6afaa2b249fcf..3b0f4843d2065 100644 --- a/utils/frame/benchmarking-cli/src/lib.rs +++ b/utils/frame/benchmarking-cli/src/lib.rs @@ -19,7 +19,7 @@ mod command; mod writer; use sc_cli::{ExecutionStrategy, WasmExecutionMethod}; -use std::fmt::Debug; +use std::{fmt::Debug, path::PathBuf}; // Add a more relaxed parsing for pallet names by allowing pallet directory names with `-` to be // used like crate names with `_` @@ -60,9 +60,13 @@ pub struct BenchmarkCmd { #[clap(long, default_value = "1")] pub external_repeat: u32, - /// Print the raw results. - #[clap(long = "raw")] - pub raw_data: bool, + /// Print the raw results in JSON format. + #[clap(long = "json")] + pub json_output: bool, + + /// Write the raw results in JSON format into the give file. + #[clap(long, conflicts_with = "json-output")] + pub json_file: Option, /// Don't print the median-slopes linear regression analysis. #[clap(long)] @@ -74,15 +78,15 @@ pub struct BenchmarkCmd { /// Output the benchmarks to a Rust file at the given path. #[clap(long)] - pub output: Option, + pub output: Option, /// Add a header file to your outputted benchmarks #[clap(long)] - pub header: Option, + pub header: Option, /// Path to Handlebars template file used for outputting benchmark results. (Optional) #[clap(long)] - pub template: Option, + pub template: Option, /// Which analysis function to use when outputting benchmarks: /// * min-squares (default) diff --git a/utils/frame/frame-utilities-cli/Cargo.toml b/utils/frame/frame-utilities-cli/Cargo.toml index f330b205ea27f..50a00db1d4d38 100644 --- a/utils/frame/frame-utilities-cli/Cargo.toml +++ b/utils/frame/frame-utilities-cli/Cargo.toml @@ -13,9 +13,9 @@ readme = "README.md" [dependencies] clap = { version = "3.0", features = ["derive"] } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } frame-system = { version = "4.0.0-dev", path = "../../../frame/system" } frame-support = { version = "4.0.0-dev", path = "../../../frame/support" } diff --git a/utils/frame/generate-bags/Cargo.toml b/utils/frame/generate-bags/Cargo.toml index 55670c96f792c..5bda705a581a9 100644 --- a/utils/frame/generate-bags/Cargo.toml +++ b/utils/frame/generate-bags/Cargo.toml @@ -17,7 +17,7 @@ frame-system = { version = "4.0.0-dev", path = "../../../frame/system" } pallet-staking = { version = "4.0.0-dev", path = "../../../frame/staking" } # primitives -sp-io = { version = "4.0.0", path = "../../../primitives/io" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } # third party chrono = { version = "0.4.19" } diff --git a/utils/frame/remote-externalities/Cargo.toml b/utils/frame/remote-externalities/Cargo.toml index 6d926846b4a36..c1d6f1b1c5f54 100644 --- a/utils/frame/remote-externalities/Cargo.toml +++ b/utils/frame/remote-externalities/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -jsonrpsee = { version = "0.4.1", features = ["ws-client", "macros"] } +jsonrpsee = { version = "0.8", features = ["ws-client", "macros"] } env_logger = "0.9" frame-support = { path = "../../../frame/support", optional = true, version = "4.0.0-dev" } @@ -22,9 +22,9 @@ codec = { package = "parity-scale-codec", version = "2.0.0" } serde_json = "1.0" serde = "1.0.132" -sp-io = { version = "4.0.0-dev", path = "../../../primitives/io" } -sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" } -sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" } +sp-io = { version = "5.0.0", path = "../../../primitives/io" } +sp-core = { version = "5.0.0", path = "../../../primitives/core" } +sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" } sp-version = { version = "4.0.0-dev", path = "../../../primitives/version" } [dev-dependencies] diff --git a/utils/frame/remote-externalities/src/lib.rs b/utils/frame/remote-externalities/src/lib.rs index 16aa60db1841c..d6dfd1c59d4ee 100644 --- a/utils/frame/remote-externalities/src/lib.rs +++ b/utils/frame/remote-externalities/src/lib.rs @@ -23,9 +23,9 @@ use codec::{Decode, Encode}; use jsonrpsee::{ + core::{client::ClientT, Error as RpcError}, proc_macros::rpc, rpc_params, - types::{traits::Client, Error as RpcError}, ws_client::{WsClient, WsClientBuilder}, }; @@ -44,6 +44,7 @@ use sp_runtime::traits::Block as BlockT; use std::{ fs, path::{Path, PathBuf}, + sync::Arc, }; pub mod rpc_api; @@ -123,21 +124,52 @@ impl> From

for SnapshotConfig { } /// Description of the transport protocol (for online execution). -#[derive(Debug)] -pub struct Transport { - uri: String, - client: Option, +#[derive(Debug, Clone)] +pub enum Transport { + /// Use the `URI` to open a new WebSocket connection. + Uri(String), + /// Use existing WebSocket connection. + RemoteClient(Arc), } -impl Clone for Transport { - fn clone(&self) -> Self { - Self { uri: self.uri.clone(), client: None } +impl Transport { + fn as_client(&self) -> Option<&WsClient> { + match self { + Self::RemoteClient(client) => Some(&*client), + _ => None, + } + } + + // Open a new WebSocket connection if it's not connected. + async fn map_uri(&mut self) -> Result<(), &'static str> { + if let Self::Uri(uri) = self { + log::debug!(target: LOG_TARGET, "initializing remote client to {:?}", uri); + + let ws_client = WsClientBuilder::default() + .max_request_body_size(u32::MAX) + .build(&uri) + .await + .map_err(|e| { + log::error!(target: LOG_TARGET, "error: {:?}", e); + "failed to build ws client" + })?; + + *self = Self::RemoteClient(Arc::new(ws_client)) + } + + Ok(()) } } impl From for Transport { - fn from(t: String) -> Self { - Self { uri: t, client: None } + fn from(uri: String) -> Self { + Transport::Uri(uri) + } +} + +impl From> for Transport { + fn from(client: Arc) -> Self { + Transport::RemoteClient(client) } } @@ -161,8 +193,7 @@ impl OnlineConfig { /// Return rpc (ws) client. fn rpc_client(&self) -> &WsClient { self.transport - .client - .as_ref() + .as_client() .expect("ws client must have been initialized by now; qed.") } } @@ -170,7 +201,7 @@ impl OnlineConfig { impl Default for OnlineConfig { fn default() -> Self { Self { - transport: Transport { uri: DEFAULT_TARGET.to_owned(), client: None }, + transport: Transport::Uri(DEFAULT_TARGET.to_owned()), at: None, state_snapshot: None, pallets: vec![], @@ -629,19 +660,8 @@ impl Builder { } pub(crate) async fn init_remote_client(&mut self) -> Result<(), &'static str> { - let mut online = self.as_online_mut(); - log::debug!(target: LOG_TARGET, "initializing remote client to {:?}", online.transport.uri); - // First, initialize the ws client. - let ws_client = WsClientBuilder::default() - .max_request_body_size(u32::MAX) - .build(&online.transport.uri) - .await - .map_err(|e| { - log::error!(target: LOG_TARGET, "error: {:?}", e); - "failed to build ws client" - })?; - online.transport.client = Some(ws_client); + self.as_online_mut().transport.map_uri().await?; // Then, if `at` is not set, set it. if self.as_online().at.is_none() { diff --git a/utils/frame/remote-externalities/src/rpc_api.rs b/utils/frame/remote-externalities/src/rpc_api.rs index 13254741c1acb..37555de480d4c 100644 --- a/utils/frame/remote-externalities/src/rpc_api.rs +++ b/utils/frame/remote-externalities/src/rpc_api.rs @@ -19,8 +19,8 @@ // TODO: Consolidate one off RPC calls https://github.com/paritytech/substrate/issues/8988 use jsonrpsee::{ + core::client::ClientT, rpc_params, - types::traits::Client, ws_client::{WsClient, WsClientBuilder}, }; use sp_runtime::{ @@ -73,7 +73,7 @@ where Ok(signed_block.block) } -/// Build a website client that connects to `from`. +/// Build a websocket client that connects to `from`. async fn build_client>(from: S) -> Result { WsClientBuilder::default() .max_request_body_size(u32::MAX) diff --git a/utils/frame/rpc/support/Cargo.toml b/utils/frame/rpc/support/Cargo.toml index 6ecaabd720595..fcb5a4367386d 100644 --- a/utils/frame/rpc/support/Cargo.toml +++ b/utils/frame/rpc/support/Cargo.toml @@ -20,7 +20,7 @@ jsonrpc-client-transports = { version = "18.0.0", features = ["http"] } codec = { package = "parity-scale-codec", version = "2.0.0" } serde = "1" frame-support = { version = "4.0.0-dev", path = "../../../../frame/support" } -sp-storage = { version = "4.0.0", path = "../../../../primitives/storage" } +sp-storage = { version = "5.0.0", path = "../../../../primitives/storage" } sc-rpc-api = { version = "0.10.0-dev", path = "../../../../client/rpc-api" } [dev-dependencies] diff --git a/utils/frame/rpc/system/Cargo.toml b/utils/frame/rpc/system/Cargo.toml index cb801c6cbf275..8ce72416dac2a 100644 --- a/utils/frame/rpc/system/Cargo.toml +++ b/utils/frame/rpc/system/Cargo.toml @@ -20,10 +20,10 @@ jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" jsonrpc-derive = "18.0.0" log = "0.4.8" -sp-runtime = { version = "4.1.0-dev", path = "../../../../primitives/runtime" } +sp-runtime = { version = "5.0.0", path = "../../../../primitives/runtime" } sp-api = { version = "4.0.0-dev", path = "../../../../primitives/api" } frame-system-rpc-runtime-api = { version = "4.0.0-dev", path = "../../../../frame/system/rpc/runtime-api" } -sp-core = { version = "4.1.0-dev", path = "../../../../primitives/core" } +sp-core = { version = "5.0.0", path = "../../../../primitives/core" } sp-blockchain = { version = "4.0.0-dev", path = "../../../../primitives/blockchain" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../../client/transaction-pool/api" } sp-block-builder = { version = "4.0.0-dev", path = "../../../../primitives/block-builder" } diff --git a/utils/frame/try-runtime/cli/Cargo.toml b/utils/frame/try-runtime/cli/Cargo.toml index 812310ff17d26..541706257ba1c 100644 --- a/utils/frame/try-runtime/cli/Cargo.toml +++ b/utils/frame/try-runtime/cli/Cargo.toml @@ -23,12 +23,12 @@ sc-service = { version = "0.10.0-dev", default-features = false, path = "../../. sc-cli = { version = "0.10.0-dev", path = "../../../../client/cli" } sc-executor = { version = "0.10.0-dev", path = "../../../../client/executor" } sc-chain-spec = { version = "4.0.0-dev", path = "../../../../client/chain-spec" } -sp-state-machine = { version = "0.10.0", path = "../../../../primitives/state-machine" } -sp-runtime = { version = "4.1.0-dev", path = "../../../../primitives/runtime" } -sp-core = { version = "4.1.0-dev", path = "../../../../primitives/core" } -sp-io = { version = "4.0.0-dev", path = "../../../../primitives/io" } -sp-keystore = { version = "0.10.0", path = "../../../../primitives/keystore" } -sp-externalities = { version = "0.10.0", path = "../../../../primitives/externalities" } +sp-state-machine = { version = "0.11.0", path = "../../../../primitives/state-machine" } +sp-runtime = { version = "5.0.0", path = "../../../../primitives/runtime" } +sp-core = { version = "5.0.0", path = "../../../../primitives/core" } +sp-io = { version = "5.0.0", path = "../../../../primitives/io" } +sp-keystore = { version = "0.11.0", path = "../../../../primitives/keystore" } +sp-externalities = { version = "0.11.0", path = "../../../../primitives/externalities" } sp-version = { version = "4.0.0-dev", path = "../../../../primitives/version" } remote-externalities = { version = "0.10.0-dev", path = "../../remote-externalities" } diff --git a/utils/wasm-builder/Cargo.toml b/utils/wasm-builder/Cargo.toml index a2a56a5bf22cf..ce9687f9ae0ef 100644 --- a/utils/wasm-builder/Cargo.toml +++ b/utils/wasm-builder/Cargo.toml @@ -21,3 +21,4 @@ walkdir = "2.3.2" wasm-gc-api = "0.1.11" ansi_term = "0.12.1" sp-maybe-compressed-blob = { version = "4.1.0-dev", path = "../../primitives/maybe-compressed-blob" } +strum = { version = "0.23.0", features = ["derive"] } diff --git a/utils/wasm-builder/src/lib.rs b/utils/wasm-builder/src/lib.rs index f5e04dd7d774b..6a7f0d7ca3cd5 100644 --- a/utils/wasm-builder/src/lib.rs +++ b/utils/wasm-builder/src/lib.rs @@ -120,9 +120,11 @@ pub use builder::{WasmBuilder, WasmBuilderSelectProject}; const SKIP_BUILD_ENV: &str = "SKIP_WASM_BUILD"; /// Environment variable to force a certain build type when building the wasm binary. -/// Expects "debug" or "release" as value. +/// Expects "debug", "release" or "production" as value. /// -/// By default the WASM binary uses the same build type as the main cargo build. +/// When unset the WASM binary uses the same build type as the main cargo build with +/// the exception of a debug build: In this case the wasm build defaults to `release` in +/// order to avoid a slowdown when not explicitly requested. const WASM_BUILD_TYPE_ENV: &str = "WASM_BUILD_TYPE"; /// Environment variable to extend the `RUSTFLAGS` variable given to the wasm build. diff --git a/utils/wasm-builder/src/wasm_project.rs b/utils/wasm-builder/src/wasm_project.rs index 9b5a33b6a6238..20e176444c621 100644 --- a/utils/wasm-builder/src/wasm_project.rs +++ b/utils/wasm-builder/src/wasm_project.rs @@ -17,6 +17,8 @@ use crate::{write_file_if_changed, CargoCommandVersioned}; +use build_helper::rerun_if_changed; +use cargo_metadata::{CargoOpt, Metadata, MetadataCommand}; use std::{ borrow::ToOwned, collections::HashSet, @@ -26,13 +28,8 @@ use std::{ path::{Path, PathBuf}, process, }; - +use strum::{EnumIter, IntoEnumIterator}; use toml::value::Table; - -use build_helper::rerun_if_changed; - -use cargo_metadata::{CargoOpt, Metadata, MetadataCommand}; - use walkdir::WalkDir; /// Colorize an info message. @@ -128,9 +125,9 @@ pub(crate) fn create_and_compile( features_to_enable, ); - build_project(&project, default_rustflags, cargo_cmd); + let profile = build_project(&project, default_rustflags, cargo_cmd); let (wasm_binary, wasm_binary_compressed, bloaty) = - compact_wasm_file(&project, project_cargo_toml, wasm_binary_name); + compact_wasm_file(&project, profile, project_cargo_toml, wasm_binary_name); wasm_binary .as_ref() @@ -246,16 +243,22 @@ fn create_project_cargo_toml( let mut wasm_workspace_toml = Table::new(); - // Add `profile` with release and dev + // Add different profiles which are selected by setting `WASM_BUILD_TYPE`. let mut release_profile = Table::new(); release_profile.insert("panic".into(), "abort".into()); - release_profile.insert("lto".into(), true.into()); + release_profile.insert("lto".into(), "thin".into()); + + let mut production_profile = Table::new(); + production_profile.insert("inherits".into(), "release".into()); + production_profile.insert("lto".into(), "fat".into()); + production_profile.insert("codegen-units".into(), 1.into()); let mut dev_profile = Table::new(); dev_profile.insert("panic".into(), "abort".into()); let mut profile = Table::new(); profile.insert("release".into(), release_profile.into()); + profile.insert("production".into(), production_profile.into()); profile.insert("dev".into(), dev_profile.into()); wasm_workspace_toml.insert("profile".into(), profile.into()); @@ -420,25 +423,119 @@ fn create_project( wasm_project_folder } -/// Returns if the project should be built as a release. -fn is_release_build() -> bool { - if let Ok(var) = env::var(crate::WASM_BUILD_TYPE_ENV) { - match var.as_str() { - "release" => true, - "debug" => false, - var => panic!( - "Unexpected value for `{}` env variable: {}\nOne of the following are expected: `debug` or `release`.", - crate::WASM_BUILD_TYPE_ENV, - var, - ), +/// The cargo profile that is used to build the wasm project. +#[derive(Debug, EnumIter)] +enum Profile { + /// The `--profile dev` profile. + Debug, + /// The `--profile release` profile. + Release, + /// The `--profile production` profile. + Production, +} + +impl Profile { + /// Create a profile by detecting which profile is used for the main build. + /// + /// We cannot easily determine the profile that is used by the main cargo invocation + /// because the `PROFILE` environment variable won't contain any custom profiles like + /// "production". It would only contain the builtin profile where the custom profile + /// inherits from. This is why we inspect the build path to learn which profile is used. + /// + /// # Note + /// + /// Can be overriden by setting [`crate::WASM_BUILD_TYPE_ENV`]. + fn detect(wasm_project: &Path) -> Profile { + let (name, overriden) = if let Ok(name) = env::var(crate::WASM_BUILD_TYPE_ENV) { + (name, true) + } else { + // First go backwards to the beginning of the target directory. + // Then go forwards to find the "wbuild" directory. + // We need to go backwards first because when starting from the root there + // might be a chance that someone has a "wbuild" directory somewhere in the path. + let name = wasm_project + .components() + .rev() + .take_while(|c| c.as_os_str() != "target") + .collect::>() + .iter() + .rev() + .take_while(|c| c.as_os_str() != "wbuild") + .last() + .expect("We put the wasm project within a `target/.../wbuild` path; qed") + .as_os_str() + .to_str() + .expect("All our profile directory names are ascii; qed") + .to_string(); + (name, false) + }; + match (Profile::iter().find(|p| p.directory() == name), overriden) { + // When not overriden by a env variable we default to using the `Release` profile + // for the wasm build even when the main build uses the debug build. This + // is because the `Debug` profile is too slow for normal development activities. + (Some(Profile::Debug), false) => Profile::Release, + // For any other profile or when overriden we take it at face value. + (Some(profile), _) => profile, + // For non overriden unknown profiles we fall back to `Release`. + // This allows us to continue building when a custom profile is used for the + // main builds cargo. When explicitly passing a profile via env variable we are + // not doing a fallback. + (None, false) => { + let profile = Profile::Release; + build_helper::warning!( + "Unknown cargo profile `{}`. Defaulted to `{:?}` for the runtime build.", + name, + profile, + ); + profile + }, + // Invalid profile specified. + (None, true) => { + // We use println! + exit instead of a panic in order to have a cleaner output. + println!( + "Unexpected profile name: `{}`. One of the following is expected: {:?}", + name, + Profile::iter().map(|p| p.directory()).collect::>(), + ); + process::exit(1); + }, } - } else { - true + } + + /// The name of the profile as supplied to the cargo `--profile` cli option. + fn name(&self) -> &'static str { + match self { + Self::Debug => "dev", + Self::Release => "release", + Self::Production => "production", + } + } + + /// The sub directory within `target` where cargo places the build output. + /// + /// # Note + /// + /// Usually this is the same as [`Self::name`] with the exception of the debug + /// profile which is called `dev`. + fn directory(&self) -> &'static str { + match self { + Self::Debug => "debug", + _ => self.name(), + } + } + + /// Whether the resulting binary should be compacted and compressed. + fn wants_compact(&self) -> bool { + !matches!(self, Self::Debug) } } /// Build the project to create the WASM binary. -fn build_project(project: &Path, default_rustflags: &str, cargo_cmd: CargoCommandVersioned) { +fn build_project( + project: &Path, + default_rustflags: &str, + cargo_cmd: CargoCommandVersioned, +) -> Profile { let manifest_path = project.join("Cargo.toml"); let mut build_cmd = cargo_cmd.command(); @@ -467,16 +564,16 @@ fn build_project(project: &Path, default_rustflags: &str, cargo_cmd: CargoComman build_cmd.arg("--color=always"); } - if is_release_build() { - build_cmd.arg("--release"); - }; + let profile = Profile::detect(project); + build_cmd.arg("--profile"); + build_cmd.arg(profile.name()); println!("{}", colorize_info_message("Information that should be included in a bug report.")); println!("{} {:?}", colorize_info_message("Executing build command:"), build_cmd); println!("{} {}", colorize_info_message("Using rustc version:"), cargo_cmd.rustc_version()); match build_cmd.status().map(|s| s.success()) { - Ok(true) => {}, + Ok(true) => profile, // Use `process.exit(1)` to have a clean error output. _ => process::exit(1), } @@ -485,18 +582,17 @@ fn build_project(project: &Path, default_rustflags: &str, cargo_cmd: CargoComman /// Compact the WASM binary using `wasm-gc` and compress it using zstd. fn compact_wasm_file( project: &Path, + profile: Profile, cargo_manifest: &Path, wasm_binary_name: Option, ) -> (Option, Option, WasmBinaryBloaty) { - let is_release_build = is_release_build(); - let target = if is_release_build { "release" } else { "debug" }; let default_wasm_binary_name = get_wasm_binary_name(cargo_manifest); let wasm_file = project .join("target/wasm32-unknown-unknown") - .join(target) + .join(profile.directory()) .join(format!("{}.wasm", default_wasm_binary_name)); - let wasm_compact_file = if is_release_build { + let wasm_compact_file = if profile.wants_compact() { let wasm_compact_file = project.join(format!( "{}.compact.wasm", wasm_binary_name.clone().unwrap_or_else(|| default_wasm_binary_name.clone()), @@ -544,8 +640,8 @@ fn compress_wasm(wasm_binary_path: &Path, compressed_binary_out_path: &Path) -> true } else { - println!( - "cargo:warning=Writing uncompressed wasm. Exceeded maximum size {}", + build_helper::warning!( + "Writing uncompressed wasm. Exceeded maximum size {}", CODE_BLOB_BOMB_LIMIT, ); @@ -687,11 +783,13 @@ fn copy_wasm_to_target_directory(cargo_manifest: &Path, wasm_binary: &WasmBinary }; if !target_dir.is_absolute() { - panic!( + // We use println! + exit instead of a panic in order to have a cleaner output. + println!( "Environment variable `{}` with `{}` is not an absolute path!", crate::WASM_TARGET_DIRECTORY, target_dir.display(), ); + process::exit(1); } fs::create_dir_all(&target_dir).expect("Creates `WASM_TARGET_DIRECTORY`.");