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

Commit

Permalink
Squashed 'bridges/' changes from d5f95c14a..b39cb0dea
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bkontur committed Feb 8, 2023
1 parent 791cf61 commit 591a68f
Show file tree
Hide file tree
Showing 106 changed files with 17,817 additions and 2,193 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ updates:
- dependency-name: polkadot-*
versions:
- ">= 0"
- dependency-name: xcm-*
- dependency-name: xcm*
versions:
- ">= 0"
# Cumulus dependencies
Expand Down
41 changes: 22 additions & 19 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ stages:
- build
- publish

workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH

variables: &default-vars
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 100
CARGO_INCREMENTAL: 0
ARCH: "x86_64"
CI_IMAGE: "paritytech/bridges-ci:production"
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27"
RUST_BACKTRACE: full

default:
cache: {}
interruptible: true
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure

.collect-artifacts: &collect-artifacts
artifacts:
Expand All @@ -32,7 +35,6 @@ default:
.kubernetes-build: &kubernetes-build
tags:
- kubernetes-parity-build
interruptible: true

.docker-env: &docker-env
image: "${CI_IMAGE}"
Expand All @@ -41,16 +43,8 @@ default:
- cargo --version
- rustup +nightly show
- cargo +nightly --version
- sccache -s
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- linux-docker
- linux-docker-vm-c2

.test-refs: &test-refs
rules:
Expand Down Expand Up @@ -112,7 +106,7 @@ spellcheck:
<<: *docker-env
<<: *test-refs
script:
- cargo spellcheck check --cfg=.config/spellcheck.toml --checkers hunspell -m 1
- 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')

#### stage: check

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

partial-repo-build-test:
stage: test
<<: *docker-env
<<: *nightly-test
script:
- ./scripts/verify-pallets-build.sh --no-revert
# we may live with failing partial repo build, it is just a signal for us
allow_failure: true

#### stage: build

build:
Expand Down Expand Up @@ -237,7 +240,7 @@ build-nightly:

.build-push-image: &build-push-image
<<: *kubernetes-build
image: quay.io/buildah/stable:v1.27
image: $BUILDAH_IMAGE
<<: *build-refs
variables: &image-variables
GIT_STRATEGY: none
Expand All @@ -248,7 +251,7 @@ build-nightly:
needs:
- job: build
artifacts: true
before_script: &check-versions
before_script:
- echo "Starting docker image build/push with name '${IMAGE_NAME}' for '${BRIDGES_PROJECT}' with Dockerfile = '${DOCKERFILE}'"
- if [[ "${CI_COMMIT_TAG}" ]]; then
VERSION=${CI_COMMIT_TAG};
Expand Down
132 changes: 86 additions & 46 deletions .maintain/millau-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

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

// Executed Command:
{{#each args as |arg|~}}
{{#each args as |arg|}}
// {{arg}}
{{/each}}

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

/// Weight functions needed for `{{pallet}}`.
/// Weight functions needed for {{pallet}}.
pub trait WeightInfo {
{{~#each benchmarks as |benchmark|}}
{{#each benchmarks as |benchmark|}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{c.name}}: u32, {{/each~}}
) -> Weight;
{{~/each}}
{{/each}}
}

/// Weights for `{{pallet}}` that are generated using one of the Bridge testnets.
///
/// Those weights are test only and must never be used in production.
/// Those weights are test only and must never be used in production.
pub struct BridgeWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
{{~#each benchmarks as |benchmark|}}
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
/// {{comment}}
///
{{/each}}
{{#each benchmark.component_ranges as |range|}}
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
///
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
{{~#each benchmark.component_weight as |cw|}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
{{~/each}}
{{~#if (ne benchmark.base_reads "0")}}
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64))
{{~/if}}
{{~#each benchmark.component_reads as |cr|}}
.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
{{~/each}}
{{~#if (ne benchmark.base_writes "0")}}
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64))
{{~/if}}
{{~#each benchmark.component_writes as |cw|}}
.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
{{~/each}}
// Proof Size summary in bytes:
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
{{#if (ne benchmark.base_calculated_proof_size "0")}}
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
{{else}}
Weight::from_ref_time({{underscore benchmark.base_weight}})
{{/if}}
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64))
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
{{/each}}
{{#each benchmark.component_calculated_proof_size as |cp|}}
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into()))
{{/each}}
}
{{~/each}}
{{/each}}
}

// For backwards compatibility and tests
impl WeightInfo for () {
{{~#each benchmarks as |benchmark|}}
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
/// {{comment}}
///
{{/each}}
{{#each benchmark.component_ranges as |range|}}
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
///
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
{{~#each benchmark.component_weight as |cw|}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
{{~/each}}
{{~#if (ne benchmark.base_reads "0")}}
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as u64))
{{~/if}}
{{~#each benchmark.component_reads as |cr|}}
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
{{~/each}}
{{~#if (ne benchmark.base_writes "0")}}
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as u64))
{{~/if}}
{{~#each benchmark.component_writes as |cw|}}
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
{{~/each}}
// Proof Size summary in bytes:
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
{{#if (ne benchmark.base_calculated_proof_size "0")}}
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
{{else}}
Weight::from_ref_time({{underscore benchmark.base_weight}})
{{/if}}
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64))
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64))
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
{{/each}}
{{#each benchmark.component_calculated_proof_size as |cp|}}
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into()))
{{/each}}
}
{{~/each}}
{{/each}}
}
Loading

0 comments on commit 591a68f

Please sign in to comment.