Skip to content

Commit d28315c

Browse files
authored
Merge pull request #645 from galacticcouncil/polkadot-v1.1.0
chore: upgrade to polkadot-v1.1.0
2 parents 32ce263 + 10ff31e commit d28315c

File tree

115 files changed

+11071
-31452
lines changed

Some content is hidden

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

115 files changed

+11071
-31452
lines changed

.github/workflows/workflow.yml

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,17 @@ jobs:
2222
- run: git describe --tags --abbrev=0 --always
2323
- name: Setup cmake
2424
uses: jwlawson/[email protected]
25-
- name: Install misc dependencies
26-
run: sudo rm /var/lib/dpkg/lock-frontend && sudo rm /var/lib/dpkg/lock && sudo apt-get install -y protobuf-compiler m4
2725
- name: Install Rust
2826
uses: codota/toolchain@00a8bf2bdcfe93aefd70422d3dec07337959d3a4
2927
with:
3028
profile: minimal
31-
- name: Install clippy
32-
run: rustup component add clippy
33-
- name: Run clippy
34-
run: make clippy
35-
continue-on-error: false
36-
- name: Install tarpaulin
37-
run: cargo install cargo-tarpaulin
38-
- name: Test && Generate code coverage
39-
run: make coverage
40-
- name: Upload to codecov.io
41-
uses: codecov/codecov-action@v1
42-
with:
43-
fail_ci_if_error: false
29+
- name: Test
30+
run: make test-release
4431
- name: Build runtime
4532
run: cargo build --release --locked
4633
working-directory: runtime/basilisk
47-
- name: Build node
48-
run: cargo build --release --locked
34+
- name: Release
35+
run: make release
4936
- name: Version info
5037
run: ./target/release/basilisk --version
5138
- name: Upload release binary
@@ -57,45 +44,16 @@ jobs:
5744
uses: actions/upload-artifact@v2
5845
with:
5946
name: basilisk_runtime.compact.compressed.wasm
60-
path: target/release/wbuild/basilisk-runtime/basilisk_runtime.compact.compressed.wasm
61-
62-
test-inclusion:
63-
needs: build
64-
runs-on: ubuntu-latest
65-
steps:
66-
- uses: actions/checkout@v2
67-
with:
68-
fetch-depth: 0
69-
ref: ${{ github.event.pull_request.head.sha }}
70-
- uses: actions/download-artifact@v2
71-
name: Download basilisk binary
72-
with:
73-
name: basilisk
74-
path: target/release
75-
- uses: robinraju/release-downloader@v1
76-
name: Download relay chain binary
77-
with:
78-
repository: paritytech/polkadot
79-
tag: ${{ env.RELAY_CHAIN_VERSION }}
80-
fileName: polkadot
81-
out-file-path: ../polkadot/target/release
82-
- run: chmod +x ./basilisk && ./basilisk --version
83-
name: Basilisk version
84-
working-directory: target/release
85-
- run: chmod +x ./polkadot && ./polkadot --version
86-
name: Polkadot version
87-
working-directory: ../polkadot/target/release
88-
- uses: actions/setup-node@v2
89-
name: Setup node.js
90-
with:
91-
node-version: '14'
92-
check-latest: true
93-
- run: npm install && npm start
94-
name: Launch rococo local & wait for inclusion
95-
working-directory: scripts/wait-for-inclusion
47+
path: target/release/basilisk_runtime.compact.compressed.wasm
48+
- name: Clippy
49+
run: make clippy-all
50+
- name: Test benchmarks
51+
run: make test-benchmarks
9652

9753
version-check:
9854
runs-on: ubuntu-latest
55+
permissions:
56+
pull-requests: write
9957
outputs:
10058
runtime-upgraded: ${{ steps.check-runtime.outputs.upgraded }}
10159
steps:

.maintain/pallet-weight-template-no-back.hbs

Lines changed: 61 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,82 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

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

2427
// Executed Command:
25-
{{#each args as |arg|~}}
28+
{{#each args as |arg|}}
2629
// {{arg}}
2730
{{/each}}
2831

32+
#![cfg_attr(rustfmt, rustfmt_skip)]
2933
#![allow(unused_parens)]
3034
#![allow(unused_imports)]
31-
#![allow(clippy::unnecessary_cast)]
35+
#![allow(missing_docs)]
3236

33-
use frame_support::{
34-
traits::Get,
35-
weights::{constants::RocksDbWeight, Weight},
36-
};
37-
use sp_std::marker::PhantomData;
37+
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
38+
use core::marker::PhantomData;
3839

39-
use {{pallet}}::weights::WeightInfo;
40+
/// Weight functions needed for `{{pallet}}`.
41+
pub trait WeightInfo {
42+
{{#each benchmarks as |benchmark|}}
43+
fn {{benchmark.name~}}
44+
(
45+
{{~#each benchmark.components as |c| ~}}
46+
{{c.name}}: u32, {{/each~}}
47+
) -> Weight;
48+
{{/each}}
49+
}
4050

51+
/// Weights for `{{pallet}}` using the Basilisk node and recommended hardware.
4152
pub struct BasiliskWeight<T>(PhantomData<T>);
42-
53+
{{#if (eq pallet "frame_system")}}
54+
impl<T: crate::Config> WeightInfo for BasiliskWeight<T> {
55+
{{else}}
4356
impl<T: frame_system::Config> WeightInfo for BasiliskWeight<T> {
44-
{{#each benchmarks as |benchmark|}}
45-
{{#each benchmark.comments as |comment|}}
46-
// {{comment}}
57+
{{/if}}
58+
{{#each benchmarks as |benchmark|}}
59+
{{#each benchmark.comments as |comment|}}
60+
/// {{comment}}
4761
{{/each}}
4862
{{#each benchmark.component_ranges as |range|}}
4963
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
5064
{{/each}}
51-
fn {{benchmark.name~}}
52-
(
53-
{{~#each benchmark.components as |c| ~}}
54-
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
55-
) -> Weight {
56-
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
57-
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
58-
{{~#each benchmark.component_weight as |cw|}}
59-
// Standard Error: {{underscore cw.error}}
60-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64))
61-
{{/each}}
62-
{{#if (ne benchmark.base_reads "0")}}
63-
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64))
64-
{{/if}}
65-
{{#each benchmark.component_reads as |cr|}}
66-
.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64)))
67-
{{/each}}
68-
{{#if (ne benchmark.base_writes "0")}}
69-
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64))
70-
{{/if}}
71-
{{~#each benchmark.component_writes as |cw|}}
72-
.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64)))
73-
{{/each}}
74-
}
75-
{{/each}}
76-
}
65+
fn {{benchmark.name~}}
66+
(
67+
{{~#each benchmark.components as |c| ~}}
68+
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
69+
) -> Weight {
70+
// Proof Size summary in bytes:
71+
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
72+
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
73+
// Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds.
74+
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
75+
{{#each benchmark.component_weight as |cw|}}
76+
// Standard Error: {{underscore cw.error}}
77+
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))
78+
{{/each}}
79+
{{#if (ne benchmark.base_reads "0")}}
80+
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))
81+
{{/if}}
82+
{{#each benchmark.component_reads as |cr|}}
83+
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
84+
{{/each}}
85+
{{#if (ne benchmark.base_writes "0")}}
86+
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64))
87+
{{/if}}
88+
{{#each benchmark.component_writes as |cw|}}
89+
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
90+
{{/each}}
91+
{{#each benchmark.component_calculated_proof_size as |cp|}}
92+
.saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into()))
93+
{{/each}}
94+
}
95+
{{/each}}
96+
}

0 commit comments

Comments
 (0)