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

Commit 591a68f

Browse files
committed
Squashed 'bridges/' changes from d5f95c14a..b39cb0dea
b39cb0dea MaxValues limit for storage maps in the pallet-bridge-grandpa (#1861) 11b3a611d fixed TODOs for weights v2 (#1860) 5a44f9fea Message delivery transaction is not free!!! (#1859) 59a42bd58 fixed BEEFY genesis (#1858) ab7c7ad0f Use parity-util-mem 0.12.0 (#1856) 8fd346e5a changed some tests for weights v2 (#1855) c438b9f74 Add separate Cargo.lock for `tools/runtime-codegen` (#1854) fc55a97d7 Fix `HeadersToKeep` and `MaxBridgedAuthorities` in Millau benchmarks (#1851) 72e64a3d7 Decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2_048 (#1852) d60a331ed Update Substrate/Polkadot/Cumulus dependencies + weights v2 (#1850) 61b229b65 Bump async-trait from 0.1.63 to 0.1.64 366333108 Bump serde_json from 1.0.91 to 1.0.92 (#1845) 4d917bb3a Bump trie-db from 0.24.0 to 0.25.0 8d919eac9 Bump anyhow from 1.0.68 to 1.0.69 ef9364dd0 Bump proc-macro2 from 1.0.49 to 1.0.51 9ddeebed5 Bump futures from 0.3.25 to 0.3.26 e02eb7573 connect using wss under flag condition (#1843) 99754a07f remove extra tracing on test deployments (#1842) bdb84cea6 Add tool for auto generating runtime code from metadata (#1812) 86662f263 fix bridge-runtime-common build (#1839) f656ac77d Change some macro names (#1837) 50f2980e9 Verify partial repo build on CI (#1832) f70f8231b fix bridge hubs blocks interval (#1836) ddbe5cddf [ci] change runners (#1833) 45a68ad39 Fix on demand parachains relay when no parachain head at target (#1834) 6dbce7258 Use GitLab env vars to get git commit (#1831) b1a8161e8 bump bridge hub versions (#1830) e909595e0 Use specific error for case when para head is missing from the bridge pallet (#1829) d517da8a2 Do not read parachain heads from ancient relay headers (#1827) 217bc72f5 Reconnect source client (#1826) 47bf5f693 Bump tokio from 1.24.2 to 1.25.0 6b307b48a Bump clap from 4.1.3 to 4.1.4 90bc29a17 Use named parameters for indirect calls (#1823) 986eeb556 Fix: typos (#1822) 450823b01 docs: fix broken link and minor nits (#1821) 3ed01ae31 do not call best_finalized_para_block_at_source for ancient block (#1819) 001956290 Functions to benchmark messages pallet with linked to parachain (#1817) e9b0a1c48 Remove InboundPayload check (#1816) 873ea4e40 Bump clap from 4.1.1 to 4.1.3 97eccaa8b also ignore the base xcm crate (#1798) 2d3dcd00b Update bundled runtime version for bridge hub r/wococo (#1814) 7167c0067 Bump bumpalo from 3.10.0 to 3.12.0 in /fuzz/storage-proof 067687520 Bump async-trait from 0.1.62 to 0.1.63 (#1811) git-subtree-dir: bridges git-subtree-split: b39cb0dea5751847ea73ab9946667003625eaf1a
1 parent 791cf61 commit 591a68f

File tree

106 files changed

+17817
-2193
lines changed

Some content is hidden

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

106 files changed

+17817
-2193
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ updates:
4646
- dependency-name: polkadot-*
4747
versions:
4848
- ">= 0"
49-
- dependency-name: xcm-*
49+
- dependency-name: xcm*
5050
versions:
5151
- ">= 0"
5252
# Cumulus dependencies

.gitlab-ci.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@ stages:
55
- build
66
- publish
77

8-
workflow:
9-
rules:
10-
- if: $CI_COMMIT_TAG
11-
- if: $CI_COMMIT_BRANCH
12-
13-
variables: &default-vars
8+
variables:
149
GIT_STRATEGY: fetch
1510
GIT_DEPTH: 100
1611
CARGO_INCREMENTAL: 0
1712
ARCH: "x86_64"
1813
CI_IMAGE: "paritytech/bridges-ci:production"
14+
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27"
1915
RUST_BACKTRACE: full
2016

2117
default:
2218
cache: {}
19+
interruptible: true
20+
retry:
21+
max: 2
22+
when:
23+
- runner_system_failure
24+
- unknown_failure
25+
- api_failure
2326

2427
.collect-artifacts: &collect-artifacts
2528
artifacts:
@@ -32,7 +35,6 @@ default:
3235
.kubernetes-build: &kubernetes-build
3336
tags:
3437
- kubernetes-parity-build
35-
interruptible: true
3638

3739
.docker-env: &docker-env
3840
image: "${CI_IMAGE}"
@@ -41,16 +43,8 @@ default:
4143
- cargo --version
4244
- rustup +nightly show
4345
- cargo +nightly --version
44-
- sccache -s
45-
retry:
46-
max: 2
47-
when:
48-
- runner_system_failure
49-
- unknown_failure
50-
- api_failure
51-
interruptible: true
5246
tags:
53-
- linux-docker
47+
- linux-docker-vm-c2
5448

5549
.test-refs: &test-refs
5650
rules:
@@ -112,7 +106,7 @@ spellcheck:
112106
<<: *docker-env
113107
<<: *test-refs
114108
script:
115-
- cargo spellcheck check --cfg=.config/spellcheck.toml --checkers hunspell -m 1
109+
- cargo spellcheck check --cfg=.config/spellcheck.toml --checkers hunspell -m 1 $(find . -type f -name '*.rs' ! -path "./target/*" ! -name 'codegen_runtime.rs' ! -name 'weights.rs')
116110

117111
#### stage: check
118112

@@ -197,6 +191,15 @@ benchmarks-test:
197191
# we may live with failing benchmarks, it is just a signal for us
198192
allow_failure: true
199193

194+
partial-repo-build-test:
195+
stage: test
196+
<<: *docker-env
197+
<<: *nightly-test
198+
script:
199+
- ./scripts/verify-pallets-build.sh --no-revert
200+
# we may live with failing partial repo build, it is just a signal for us
201+
allow_failure: true
202+
200203
#### stage: build
201204

202205
build:
@@ -237,7 +240,7 @@ build-nightly:
237240

238241
.build-push-image: &build-push-image
239242
<<: *kubernetes-build
240-
image: quay.io/buildah/stable:v1.27
243+
image: $BUILDAH_IMAGE
241244
<<: *build-refs
242245
variables: &image-variables
243246
GIT_STRATEGY: none
@@ -248,7 +251,7 @@ build-nightly:
248251
needs:
249252
- job: build
250253
artifacts: true
251-
before_script: &check-versions
254+
before_script:
252255
- echo "Starting docker image build/push with name '${IMAGE_NAME}' for '${BRIDGES_PROJECT}' with Dockerfile = '${DOCKERFILE}'"
253256
- if [[ "${CI_COMMIT_TAG}" ]]; then
254257
VERSION=${CI_COMMIT_TAG};

.maintain/millau-weight-template.hbs

Lines changed: 86 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//! Autogenerated weights for `{{pallet}}`
17+
//! Autogenerated weights for {{pallet}}
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
20-
//! DATE: {{date}}, STEPS: {{cmd.steps}}, REPEAT: {{cmd.repeat}}
21-
//! LOW RANGE: {{cmd.lowest_range_values}}, HIGH RANGE: {{cmd.highest_range_values}}
22-
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}
23-
//! CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
20+
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
21+
//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}`
22+
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`
23+
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
2424

2525
// Executed Command:
26-
{{#each args as |arg|~}}
26+
{{#each args as |arg|}}
2727
// {{arg}}
2828
{{/each}}
2929

@@ -35,72 +35,112 @@
3535
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
3636
use sp_std::marker::PhantomData;
3737

38-
/// Weight functions needed for `{{pallet}}`.
38+
/// Weight functions needed for {{pallet}}.
3939
pub trait WeightInfo {
40-
{{~#each benchmarks as |benchmark|}}
40+
{{#each benchmarks as |benchmark|}}
4141
fn {{benchmark.name~}}
4242
(
4343
{{~#each benchmark.components as |c| ~}}
4444
{{c.name}}: u32, {{/each~}}
4545
) -> Weight;
46-
{{~/each}}
46+
{{/each}}
4747
}
4848

4949
/// Weights for `{{pallet}}` that are generated using one of the Bridge testnets.
5050
///
51-
/// Those weights are test only and must never be used in production.
51+
/// Those weights are test only and must never be used in production.
5252
pub struct BridgeWeight<T>(PhantomData<T>);
5353
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
54-
{{~#each benchmarks as |benchmark|}}
54+
{{#each benchmarks as |benchmark|}}
55+
{{#each benchmark.comments as |comment|}}
56+
/// {{comment}}
57+
///
58+
{{/each}}
59+
{{#each benchmark.component_ranges as |range|}}
60+
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
61+
///
62+
{{/each}}
5563
fn {{benchmark.name~}}
5664
(
5765
{{~#each benchmark.components as |c| ~}}
5866
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
5967
) -> Weight {
60-
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
61-
{{~#each benchmark.component_weight as |cw|}}
62-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
63-
{{~/each}}
64-
{{~#if (ne benchmark.base_reads "0")}}
65-
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64))
66-
{{~/if}}
67-
{{~#each benchmark.component_reads as |cr|}}
68-
.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
69-
{{~/each}}
70-
{{~#if (ne benchmark.base_writes "0")}}
71-
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64))
72-
{{~/if}}
73-
{{~#each benchmark.component_writes as |cw|}}
74-
.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
75-
{{~/each}}
68+
// Proof Size summary in bytes:
69+
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
70+
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
71+
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
72+
{{#if (ne benchmark.base_calculated_proof_size "0")}}
73+
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
74+
{{else}}
75+
Weight::from_ref_time({{underscore benchmark.base_weight}})
76+
{{/if}}
77+
{{#each benchmark.component_weight as |cw|}}
78+
// Standard Error: {{underscore cw.error}}
79+
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
80+
{{/each}}
81+
{{#if (ne benchmark.base_reads "0")}}
82+
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))
83+
{{/if}}
84+
{{#each benchmark.component_reads as |cr|}}
85+
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
86+
{{/each}}
87+
{{#if (ne benchmark.base_writes "0")}}
88+
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64))
89+
{{/if}}
90+
{{#each benchmark.component_writes as |cw|}}
91+
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
92+
{{/each}}
93+
{{#each benchmark.component_calculated_proof_size as |cp|}}
94+
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into()))
95+
{{/each}}
7696
}
77-
{{~/each}}
97+
{{/each}}
7898
}
7999

80100
// For backwards compatibility and tests
81101
impl WeightInfo for () {
82-
{{~#each benchmarks as |benchmark|}}
102+
{{#each benchmarks as |benchmark|}}
103+
{{#each benchmark.comments as |comment|}}
104+
/// {{comment}}
105+
///
106+
{{/each}}
107+
{{#each benchmark.component_ranges as |range|}}
108+
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
109+
///
110+
{{/each}}
83111
fn {{benchmark.name~}}
84112
(
85113
{{~#each benchmark.components as |c| ~}}
86114
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
87115
) -> Weight {
88-
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
89-
{{~#each benchmark.component_weight as |cw|}}
90-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
91-
{{~/each}}
92-
{{~#if (ne benchmark.base_reads "0")}}
93-
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as u64))
94-
{{~/if}}
95-
{{~#each benchmark.component_reads as |cr|}}
96-
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
97-
{{~/each}}
98-
{{~#if (ne benchmark.base_writes "0")}}
99-
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as u64))
100-
{{~/if}}
101-
{{~#each benchmark.component_writes as |cw|}}
102-
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
103-
{{~/each}}
116+
// Proof Size summary in bytes:
117+
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
118+
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
119+
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
120+
{{#if (ne benchmark.base_calculated_proof_size "0")}}
121+
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
122+
{{else}}
123+
Weight::from_ref_time({{underscore benchmark.base_weight}})
124+
{{/if}}
125+
{{#each benchmark.component_weight as |cw|}}
126+
// Standard Error: {{underscore cw.error}}
127+
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
128+
{{/each}}
129+
{{#if (ne benchmark.base_reads "0")}}
130+
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64))
131+
{{/if}}
132+
{{#each benchmark.component_reads as |cr|}}
133+
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
134+
{{/each}}
135+
{{#if (ne benchmark.base_writes "0")}}
136+
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64))
137+
{{/if}}
138+
{{#each benchmark.component_writes as |cw|}}
139+
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
140+
{{/each}}
141+
{{#each benchmark.component_calculated_proof_size as |cp|}}
142+
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into()))
143+
{{/each}}
104144
}
105-
{{~/each}}
145+
{{/each}}
106146
}

0 commit comments

Comments
 (0)