Skip to content

Commit 008fbdb

Browse files
Add storage migration on template pallet (#297)
Updates to polkadot v0.9.33 Adds a template to run the migrations on the template pallet Fixes some issues with found admin pallet Add storage version on all pallets * Add schedule pallet and add storage version on the template * remove schedualer * Update to polkadot polkadot-v0.9.28 * Update cargo lock and remove old function un fruniques * update cargo lock * update cargo lock * WIP update to polkadot v0.9.28 * Bumping versions - v0.9.33 * wip missingn to update chain spects * update chain specs * Bumping versions - v0.9.33 - Fixes * [v0.9.33] Fix BlockWeights and removig #[transactional] * switch runtime version * update migrations for the template * Update mock * Update migrations and fix tests for marketplace * update pallet to latest version * fix types * fix digest items * udpate mock * Update check action * Add weights template and fix github actions * Update extrinsic to latest version * Start adding benchmarks to pallet tempalte add header for licence adds a script to run the benchmarks updates the runtime * Add currency call and update benchmark script * comment unused line * Add storage versions to all pallets * Remove duplicate extrincit command * Fix bad validation * update chain spec fix validation in fund admin * Update validation for reset drawdowns in eb5 Co-authored-by: Artur Gontijo <arturgontijo@gmail.com>
1 parent 6c44b97 commit 008fbdb

Some content is hidden

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

66 files changed

+3878
-3084
lines changed

.github/workflows/check.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Check Set-Up & Build
44
on:
55
# Triggers the workflow on push or pull request events but only for the master branch
66
push:
7-
branches: [ master, develop ]
7+
branches: [main, develop]
88
pull_request:
9-
branches: [ master, develop ]
9+
branches: [main, develop]
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
@@ -15,29 +15,27 @@ on:
1515
jobs:
1616
check:
1717
# The type of runner that the job will run on
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-22.04
1919

2020
# Steps represent a sequence of tasks that will be executed as part of the job
2121
steps:
2222
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2323
- uses: actions/checkout@v2
2424

2525
- name: Set-Up
26-
run: sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
26+
run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler
2727

2828
- name: Install Rustup
2929
run: |
30-
curl https://sh.rustup.rs -sSf | sh -s -- -y
30+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
3131
source ~/.cargo/env
3232
rustup default stable
3333
rustup update nightly
3434
rustup update stable
3535
rustup target add wasm32-unknown-unknown --toolchain nightly
36-
3736
- name: Check Build
3837
run: |
3938
SKIP_WASM_BUILD=1 cargo check --release
40-
4139
# - name: Check Build for Benchmarking
4240
# run: >
4341
# pushd node &&

.maintain/frame-weight-template.hbs

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{{header}}
2+
//! Autogenerated weights for {{pallet}}
3+
//!
4+
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
5+
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
6+
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`
7+
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
8+
9+
// Executed Command:
10+
{{#each args as |arg|}}
11+
// {{arg}}
12+
{{/each}}
13+
14+
#![cfg_attr(rustfmt, rustfmt_skip)]
15+
#![allow(unused_parens)]
16+
#![allow(unused_imports)]
17+
18+
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
19+
use sp_std::marker::PhantomData;
20+
21+
/// Weight functions needed for {{pallet}}.
22+
pub trait WeightInfo {
23+
{{#each benchmarks as |benchmark|}}
24+
fn {{benchmark.name~}}
25+
(
26+
{{~#each benchmark.components as |c| ~}}
27+
{{c.name}}: u32, {{/each~}}
28+
) -> Weight;
29+
{{/each}}
30+
}
31+
32+
/// Weights for {{pallet}} using the Substrate node and recommended hardware.
33+
pub struct SubstrateWeight<T>(PhantomData<T>);
34+
{{#if (eq pallet "frame_system")}}
35+
impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
36+
{{else}}
37+
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
38+
{{/if}}
39+
{{#each benchmarks as |benchmark|}}
40+
{{#each benchmark.comments as |comment|}}
41+
// {{comment}}
42+
{{/each}}
43+
{{#each benchmark.component_ranges as |range|}}
44+
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
45+
{{/each}}
46+
fn {{benchmark.name~}}
47+
(
48+
{{~#each benchmark.components as |c| ~}}
49+
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
50+
) -> Weight {
51+
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
52+
Weight::from_ref_time({{underscore benchmark.base_weight}})
53+
{{#each benchmark.component_weight as |cw|}}
54+
// Standard Error: {{underscore cw.error}}
55+
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
56+
{{/each}}
57+
{{#if (ne benchmark.base_reads "0")}}
58+
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}))
59+
{{/if}}
60+
{{#each benchmark.component_reads as |cr|}}
61+
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
62+
{{/each}}
63+
{{#if (ne benchmark.base_writes "0")}}
64+
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}))
65+
{{/if}}
66+
{{#each benchmark.component_writes as |cw|}}
67+
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
68+
{{/each}}
69+
}
70+
{{/each}}
71+
}
72+
73+
// For backwards compatibility and tests
74+
impl WeightInfo for () {
75+
{{#each benchmarks as |benchmark|}}
76+
{{#each benchmark.comments as |comment|}}
77+
// {{comment}}
78+
{{/each}}
79+
{{#each benchmark.component_ranges as |range|}}
80+
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
81+
{{/each}}
82+
fn {{benchmark.name~}}
83+
(
84+
{{~#each benchmark.components as |c| ~}}
85+
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
86+
) -> Weight {
87+
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
88+
Weight::from_ref_time({{underscore benchmark.base_weight}})
89+
{{#each benchmark.component_weight as |cw|}}
90+
// Standard Error: {{underscore cw.error}}
91+
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
92+
{{/each}}
93+
{{#if (ne benchmark.base_reads "0")}}
94+
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}))
95+
{{/if}}
96+
{{#each benchmark.component_reads as |cr|}}
97+
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
98+
{{/each}}
99+
{{#if (ne benchmark.base_writes "0")}}
100+
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}))
101+
{{/if}}
102+
{{#each benchmark.component_writes as |cw|}}
103+
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
104+
{{/each}}
105+
}
106+
{{/each}}
107+
}

0 commit comments

Comments
 (0)