Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 10629aa

Browse files
committed
Merge branch 'bkchr-storage-read' of github.com:paritytech/substrate into bkchr-storage-read
2 parents 005101d + a0302c5 commit 10629aa

File tree

557 files changed

+23684
-17756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

557 files changed

+23684
-17756
lines changed

.gitlab-ci.yml

Lines changed: 65 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stages:
3333
- test
3434
- build
3535
- publish
36+
- zombienet
3637
- deploy
3738
- notify
3839

@@ -47,10 +48,12 @@ variables:
4748
CARGO_INCREMENTAL: 0
4849
DOCKER_OS: "debian:stretch"
4950
ARCH: "x86_64"
50-
CI_IMAGE: "paritytech/ci-linux:production"
51+
# staging image with rust 1.65 and nightly-2022-11-16
52+
CI_IMAGE: "paritytech/ci-linux@sha256:786869e731963b3cc0a4aa9deb83367ed9e87a6ae48b6eb029d62b0cab4d87c1"
5153
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27"
5254
RUSTY_CACHIER_SINGLE_BRANCH: master
5355
RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true"
56+
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.22"
5457

5558
default:
5659
retry:
@@ -78,8 +81,24 @@ default:
7881
paths:
7982
- artifacts/
8083

84+
.prepare-env:
85+
before_script:
86+
# TODO: remove unset invocation when we'll be free from 'ENV RUSTC_WRAPPER=sccache' & sccache
87+
# itself in all images
88+
- unset RUSTC_WRAPPER
89+
# $WASM_BUILD_WORKSPACE_HINT enables wasm-builder to find the Cargo.lock from within generated
90+
# packages
91+
- export WASM_BUILD_WORKSPACE_HINT="$PWD"
92+
93+
.job-switcher:
94+
before_script:
95+
- if echo "$CI_DISABLED_JOBS" | grep -xF "$CI_JOB_NAME"; then echo "The job has been cancelled in CI settings"; exit 0; fi
96+
8197
.kubernetes-env:
8298
image: "${CI_IMAGE}"
99+
before_script:
100+
- !reference [.job-switcher, before_script]
101+
- !reference [.prepare-env, before_script]
83102
tags:
84103
- kubernetes-parity-build
85104

@@ -92,6 +111,7 @@ default:
92111

93112
.pipeline-stopper-vars:
94113
script:
114+
- !reference [.job-switcher, before_script]
95115
- echo "Collecting env variables for the cancel-pipeline job"
96116
- echo "FAILED_JOB_URL=${CI_JOB_URL}" > pipeline-stopper.env
97117
- echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
@@ -105,6 +125,8 @@ default:
105125
.docker-env:
106126
image: "${CI_IMAGE}"
107127
before_script:
128+
- !reference [.job-switcher, before_script]
129+
- !reference [.prepare-env, before_script]
108130
- !reference [.rust-info-script, script]
109131
- !reference [.rusty-cachier, before_script]
110132
- !reference [.pipeline-stopper-vars, script]
@@ -136,7 +158,7 @@ default:
136158
# exclude cargo-check-benches from such runs
137159
.test-refs-check-benches:
138160
rules:
139-
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $CI_IMAGE =~ /staging$/
161+
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $CI_IMAGE =~ /staging$/
140162
when: never
141163
- if: $CI_PIPELINE_SOURCE == "web"
142164
- if: $CI_PIPELINE_SOURCE == "schedule"
@@ -163,40 +185,53 @@ default:
163185
- if: $CI_PIPELINE_SOURCE == "schedule"
164186
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
165187

166-
.test-refs-wasmer-sandbox:
188+
.publish-refs:
167189
rules:
190+
- if: $CI_PIPELINE_SOURCE == "pipeline"
191+
when: never
168192
- if: $CI_PIPELINE_SOURCE == "web"
169193
- if: $CI_PIPELINE_SOURCE == "schedule"
170194
- if: $CI_COMMIT_REF_NAME == "master"
171-
changes:
172-
- client/executor/**/*
173-
- frame/contracts/**/*
174-
- primitives/sandbox/**/*
175-
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
176-
changes:
177-
- client/executor/**/*
178-
- frame/contracts/**/*
179-
- primitives/sandbox/**/*
180195
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
181-
changes:
182-
- client/executor/**/*
183-
- frame/contracts/**/*
184-
- primitives/sandbox/**/*
185196

186197
.build-refs:
198+
# publish-refs + PRs
187199
rules:
188200
- if: $CI_PIPELINE_SOURCE == "pipeline"
189201
when: never
190202
- if: $CI_PIPELINE_SOURCE == "web"
191203
- if: $CI_PIPELINE_SOURCE == "schedule"
192204
- if: $CI_COMMIT_REF_NAME == "master"
193205
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
206+
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
207+
208+
.zombienet-refs:
209+
extends: .build-refs
194210

195211
.nightly-pipeline:
196212
rules:
197213
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
198214
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
199215

216+
.crates-publishing-template:
217+
stage: test
218+
extends: .docker-env
219+
# collect artifacts even on failure so that we know how the crates were generated (they'll be
220+
# generated to the artifacts folder according to SPUB_TMP further down)
221+
artifacts:
222+
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
223+
when: always
224+
expire_in: 7 days
225+
paths:
226+
- artifacts/
227+
variables:
228+
CRATESIO_API: https://crates.io/api
229+
CRATESIO_CRATES_OWNER: parity-crate-owner
230+
GH_API: https://api.github.com
231+
REPO: substrate
232+
REPO_OWNER: paritytech
233+
SPUB_TMP: artifacts
234+
200235
#### stage: .pre
201236

202237
skip-if-draft:
@@ -222,6 +257,8 @@ include:
222257
- scripts/ci/gitlab/pipeline/build.yml
223258
# publish jobs
224259
- scripts/ci/gitlab/pipeline/publish.yml
260+
# zombienet jobs
261+
- scripts/ci/gitlab/pipeline/zombienet.yml
225262

226263
#### stage: deploy
227264

@@ -280,7 +317,6 @@ rusty-cachier-notify:
280317
PR_NUM: "${PR_NUM}"
281318
trigger:
282319
project: "parity/infrastructure/ci_cd/pipeline-stopper"
283-
branch: "as-improve"
284320

285321
remove-cancel-pipeline-message:
286322
stage: .post
@@ -329,10 +365,20 @@ cancel-pipeline-test-linux-stable-int:
329365
needs:
330366
- job: test-linux-stable-int
331367

332-
cancel-pipeline-cargo-check-subkey:
368+
cancel-pipeline-cargo-check-each-crate-1:
369+
extends: .cancel-pipeline-template
370+
needs:
371+
- job: "cargo-check-each-crate 1/2"
372+
373+
cancel-pipeline-cargo-check-each-crate-2:
374+
extends: .cancel-pipeline-template
375+
needs:
376+
- job: "cargo-check-each-crate 2/2"
377+
378+
cancel-pipeline-cargo-check-each-crate-macos:
333379
extends: .cancel-pipeline-template
334380
needs:
335-
- job: cargo-check-subkey
381+
- job: cargo-check-each-crate-macos
336382

337383
cancel-pipeline-check-tracing:
338384
extends: .cancel-pipeline-template

.maintain/frame-weight-template.hbs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,22 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
4949
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
5050
) -> Weight {
5151
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
52-
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
52+
Weight::from_ref_time({{underscore benchmark.base_weight}})
5353
{{#each benchmark.component_weight as |cw|}}
5454
// Standard Error: {{underscore cw.error}}
55-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
55+
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
5656
{{/each}}
5757
{{#if (ne benchmark.base_reads "0")}}
58-
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64))
58+
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}))
5959
{{/if}}
6060
{{#each benchmark.component_reads as |cr|}}
61-
.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
61+
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
6262
{{/each}}
6363
{{#if (ne benchmark.base_writes "0")}}
64-
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64))
64+
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}))
6565
{{/if}}
6666
{{#each benchmark.component_writes as |cw|}}
67-
.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
67+
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
6868
{{/each}}
6969
}
7070
{{/each}}
@@ -85,22 +85,22 @@ impl WeightInfo for () {
8585
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
8686
) -> Weight {
8787
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
88-
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
88+
Weight::from_ref_time({{underscore benchmark.base_weight}})
8989
{{#each benchmark.component_weight as |cw|}}
9090
// Standard Error: {{underscore cw.error}}
91-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
91+
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
9292
{{/each}}
9393
{{#if (ne benchmark.base_reads "0")}}
94-
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as u64))
94+
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}))
9595
{{/if}}
9696
{{#each benchmark.component_reads as |cr|}}
97-
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
97+
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
9898
{{/each}}
9999
{{#if (ne benchmark.base_writes "0")}}
100-
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as u64))
100+
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}))
101101
{{/if}}
102102
{{#each benchmark.component_writes as |cw|}}
103-
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
103+
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
104104
{{/each}}
105105
}
106106
{{/each}}

0 commit comments

Comments
 (0)