Skip to content

Commit

Permalink
[Manta] Integrate v0.9.13 upstream changes (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzlatarev authored Dec 22, 2021
1 parent 2a503ec commit 826686a
Show file tree
Hide file tree
Showing 45 changed files with 2,044 additions and 1,841 deletions.
5 changes: 2 additions & 3 deletions .github/resources/config-for-integration-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"genesis": {
"runtime": {
"runtime_genesis_config": {
"parachainsConfiguration": {
"configuration": {
"config": {
"validation_upgrade_frequency": 1,
"validation_upgrade_delay": 1
"validation_upgrade_delay": 10
}
}
}
Expand All @@ -46,7 +46,6 @@
},
"parachains": [
{
"id": "2084",
"nodes": [
{
"name": "alice",
Expand Down
23 changes: 11 additions & 12 deletions .github/resources/config-for-runtime-upgrade-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@
}
],
"genesis": {
"runtime": {
"runtime_genesis_config": {
"parachainsConfiguration": {
"config": {
"validation_upgrade_frequency": 1,
"validation_upgrade_delay": 1
}
}
}
}
}
"runtime": {
"runtime_genesis_config": {
"configuration": {
"config": {
"validation_upgrade_frequency": 1,
"validation_upgrade_delay": 10
}
}
}
}
}
},
"parachains": [
{
"id": "2084",
"nodes": [
{
"wsPort": 9921,
Expand Down
72 changes: 36 additions & 36 deletions .github/resources/frame-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! 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 @@ -34,80 +34,80 @@ use sp_std::marker::PhantomData;

/// 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}} using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
{{~#if (eq pallet "frame_system")}}
impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
{{~else}}
impl<T: frame_system::Config> {{pallet}}::WeightInfo for SubstrateWeight<T> {
{{~/if}}
{{~#each benchmarks as |benchmark|}}
{{~#each benchmark.comments as |comment|}}
{{#if (eq pallet "frame_system")}}
impl<T: crate::Config> {{pallet}}::WeightInfo for SubstrateWeight<T> {
{{else}}
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
{{/if}}
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
// {{comment}}
{{~/each}}
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
({{underscore benchmark.base_weight}} as Weight)
{{~#each benchmark.component_weight as |cw|}}
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
{{~/each}}
{{~#if (ne benchmark.base_reads "0")}}
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight))
{{~/if}}
{{~#each benchmark.component_reads as |cr|}}
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))
{{~/each}}
{{~#if (ne benchmark.base_writes "0")}}
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight))
{{~/if}}
{{~#each benchmark.component_writes as |cw|}}
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))
{{~/each}}
{{/each}}
}
{{~/each}}
{{/each}}
}

// For backwards compatibility and tests
impl WeightInfo for () {
{{~#each benchmarks as |benchmark|}}
{{~#each benchmark.comments as |comment|}}
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
// {{comment}}
{{~/each}}
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
({{underscore benchmark.base_weight}} as Weight)
{{~#each benchmark.component_weight as |cw|}}
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
{{~/each}}
{{~#if (ne benchmark.base_reads "0")}}
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as Weight))
{{~/if}}
{{~#each benchmark.component_reads as |cr|}}
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))
{{~/each}}
{{~#if (ne benchmark.base_writes "0")}}
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as Weight))
{{~/if}}
{{~#each benchmark.component_writes as |cw|}}
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))
{{~/each}}
{{/each}}
}
{{~/each}}
{{/each}}
}
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
name: run docker image
run: |
sudo docker run -d mantanetwork/${{ matrix.runtime.name }}:latest > docker_id.log
sleep 30
-
name: check syncing
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_calamari_weights_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# yamllint disable rule:line-length

name: Benchmark Clamari Runtime & Generate Weights Files
name: Benchmark Calamari Runtime & Generate Weights Files

# yamllint disable-line rule:truthy
on:
Expand Down
Loading

0 comments on commit 826686a

Please sign in to comment.