This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds minimal config for snowbase. (paritytech#701)
* Adds minimal config for snowbase. * Formatting * Removes space. * Adds runtime benchmarks for eth beacon client for snowbase * Adds generated weights for snowbase and updates template path comments in weights files. * Fix formatting.
- Loading branch information
1 parent
a259a80
commit 54b479c
Showing
14 changed files
with
178 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
parachain/runtime/snowbase/src/weights/ethereum_beacon_client.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//! Autogenerated weights for ethereum_beacon_client | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2022-10-25, STEPS: `10`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("/tmp/snowbridge/spec.json"), DB CACHE: 1024 | ||
|
||
// Executed Command: | ||
// ./target/release/snowbridge | ||
// benchmark | ||
// pallet | ||
// --chain | ||
// /tmp/snowbridge/spec.json | ||
// --execution=wasm | ||
// --pallet | ||
// ethereum_beacon_client | ||
// --extrinsic | ||
// * | ||
// --steps | ||
// 10 | ||
// --repeat | ||
// 10 | ||
// --output | ||
// runtime/snowbase/src/weights/ethereum_beacon_client.rs | ||
// --template | ||
// templates/runtime-weight-template.hbs | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
|
||
use frame_support::{traits::Get, weights::Weight}; | ||
use sp_std::marker::PhantomData; | ||
|
||
/// Weight functions for ethereum_beacon_client. | ||
pub struct SnowbridgeWeight<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> ethereum_beacon_client::WeightInfo for SnowbridgeWeight<T> { | ||
fn sync_committee_period_update() -> Weight { | ||
(48_609_506_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(4 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(2 as Weight)) | ||
} | ||
fn import_finalized_header() -> Weight { | ||
(48_328_434_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(3 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
fn import_execution_header() -> Weight { | ||
(48_505_068_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(3 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod ethereum_beacon_client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//! 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}} | ||
|
||
// Executed Command: | ||
{{#each args as |arg|}} | ||
// {{arg}} | ||
{{/each}} | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
|
||
use frame_support::{traits::Get, weights::Weight}; | ||
use sp_std::marker::PhantomData; | ||
|
||
/// Weight functions for {{pallet}}. | ||
pub struct SnowbridgeWeight<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> {{pallet}}::WeightInfo for SnowbridgeWeight<T> { | ||
{{#each benchmarks as |benchmark|}} | ||
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|}} | ||
// 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")}} | ||
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) | ||
{{/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")}} | ||
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) | ||
{{/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}} | ||
} |