mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +00:00
* Fix types Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix import * ".git/.scripts/commands/fmt/fmt.sh" * Fix more Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Actually fix stuff Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update glutton genesis script * Update Substrate and Polkadot Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: NachoPal <ignacio.palacios.santos@gmail.com> Co-authored-by: command-bot <>
This commit is contained in:
committed by
GitHub
parent
49815cee3c
commit
6a4063917d
Generated
+385
-351
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,11 @@
|
|||||||
# - Use the `polkadot-parachain` binary;
|
# - Use the `polkadot-parachain` binary;
|
||||||
# - Use `rococo` as the parent Relay Chain;
|
# - Use `rococo` as the parent Relay Chain;
|
||||||
# - Generate `ParaId`s from 1,300 to 1,370, inclusive;
|
# - Generate `ParaId`s from 1,300 to 1,370, inclusive;
|
||||||
# - Set the Sudo key to `G7Z5mTmTQsjEGBVqVGDZyR9m7RoHNZJk6JeykyfKQ3vmBiR`;
|
# - Set the Sudo key to `GZ9YSgtib4kEMxWcpWfnXa1cnrumspTCTZSaNWWmMkJbWqW`;
|
||||||
# - Set `compute`, `storage`, and `trash_data_count` set to 50%, 50%, and 5,120, respectively;
|
# - Set `compute`, `storage`, and `trash_data_count` set to 50%, 131%, and 5,120, respectively;
|
||||||
# - And save the results in `output-dir`.
|
# - And save the results in `output-dir`.
|
||||||
#
|
#
|
||||||
# ./scripts/create_glutton_spec.sh ./target/release/polkadot-parachain rococo 1300 1370 G7Z5mTmTQsjEGBVqVGDZyR9m7RoHNZJk6JeykyfKQ3vmBiR 500000000 500000000 5120 output-dir
|
# ./scripts/create_glutton_spec.sh ./target/release/polkadot-parachain rococo 1300 1370 GZ9YSgtib4kEMxWcpWfnXa1cnrumspTCTZSaNWWmMkJbWqW 500000000 1310000000 5120 output-dir
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo Usage:
|
echo Usage:
|
||||||
@@ -68,8 +68,8 @@ for (( para_id=$from_para_id; para_id<=$to_para_id; para_id++ )); do
|
|||||||
| jq --argjson para_id $para_id '.para_id = $para_id' \
|
| jq --argjson para_id $para_id '.para_id = $para_id' \
|
||||||
| jq --arg sudo $sudo '.genesis.runtime.sudo.key = $sudo' \
|
| jq --arg sudo $sudo '.genesis.runtime.sudo.key = $sudo' \
|
||||||
| jq --argjson para_id $para_id '.genesis.runtime.parachainInfo.parachainId = $para_id' \
|
| jq --argjson para_id $para_id '.genesis.runtime.parachainInfo.parachainId = $para_id' \
|
||||||
| jq --argjson compute $compute '.genesis.runtime.glutton.compute = $compute' \
|
| jq --arg compute $compute '.genesis.runtime.glutton.compute = $compute' \
|
||||||
| jq --argjson storage $storage '.genesis.runtime.glutton.storage = $storage' \
|
| jq --arg storage $storage '.genesis.runtime.glutton.storage = $storage' \
|
||||||
| jq --argjson trash_data_count $trash_data_count '.genesis.runtime.glutton.trashDataCount = $trash_data_count' \
|
| jq --argjson trash_data_count $trash_data_count '.genesis.runtime.glutton.trashDataCount = $trash_data_count' \
|
||||||
> $output_para_dir/glutton-$relay_chain-$para_id-spec.json
|
> $output_para_dir/glutton-$relay_chain-$para_id-spec.json
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
|||||||
|
|
||||||
use sc_client_api::UsageProvider;
|
use sc_client_api::UsageProvider;
|
||||||
use sp_api::{Core, ProvideRuntimeApi};
|
use sp_api::{Core, ProvideRuntimeApi};
|
||||||
use sp_arithmetic::Perbill;
|
use sp_arithmetic::{
|
||||||
|
traits::{One, Zero},
|
||||||
|
FixedPointNumber,
|
||||||
|
};
|
||||||
|
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
use cumulus_primitives_core::ParaId;
|
use cumulus_primitives_core::ParaId;
|
||||||
@@ -46,15 +49,12 @@ fn benchmark_block_import(c: &mut Criterion) {
|
|||||||
group.measurement_time(Duration::from_secs(120));
|
group.measurement_time(Duration::from_secs(120));
|
||||||
|
|
||||||
let mut initialize_glutton_pallet = true;
|
let mut initialize_glutton_pallet = true;
|
||||||
for (compute_percent, storage_percent) in &[
|
for (compute_ratio, storage_ratio) in &[(One::one(), Zero::zero()), (One::one(), One::one())] {
|
||||||
(Perbill::from_percent(100), Perbill::from_percent(0)),
|
|
||||||
(Perbill::from_percent(100), Perbill::from_percent(100)),
|
|
||||||
] {
|
|
||||||
let block = utils::set_glutton_parameters(
|
let block = utils::set_glutton_parameters(
|
||||||
&client,
|
&client,
|
||||||
initialize_glutton_pallet,
|
initialize_glutton_pallet,
|
||||||
compute_percent,
|
compute_ratio,
|
||||||
storage_percent,
|
storage_ratio,
|
||||||
);
|
);
|
||||||
initialize_glutton_pallet = false;
|
initialize_glutton_pallet = false;
|
||||||
|
|
||||||
@@ -73,8 +73,9 @@ fn benchmark_block_import(c: &mut Criterion) {
|
|||||||
|
|
||||||
group.bench_function(
|
group.bench_function(
|
||||||
format!(
|
format!(
|
||||||
"(compute = {:?}, storage = {:?}) block import",
|
"(compute = {:?} %, storage = {:?} %) block import",
|
||||||
compute_percent, storage_percent
|
compute_ratio.saturating_mul_int(100),
|
||||||
|
storage_ratio.saturating_mul_int(100)
|
||||||
),
|
),
|
||||||
|b| {
|
|b| {
|
||||||
b.iter_batched(
|
b.iter_batched(
|
||||||
|
|||||||
@@ -18,7 +18,10 @@
|
|||||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
||||||
|
|
||||||
use sc_client_api::UsageProvider;
|
use sc_client_api::UsageProvider;
|
||||||
use sp_arithmetic::Perbill;
|
use sp_arithmetic::{
|
||||||
|
traits::{One, Zero},
|
||||||
|
FixedPointNumber,
|
||||||
|
};
|
||||||
|
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
use cumulus_primitives_core::ParaId;
|
use cumulus_primitives_core::ParaId;
|
||||||
@@ -47,15 +50,12 @@ fn benchmark_block_production_compute(c: &mut Criterion) {
|
|||||||
group.measurement_time(Duration::from_secs(120));
|
group.measurement_time(Duration::from_secs(120));
|
||||||
|
|
||||||
let mut initialize_glutton_pallet = true;
|
let mut initialize_glutton_pallet = true;
|
||||||
for (compute_level, storage_level) in &[
|
for (compute_ratio, storage_ratio) in &[(One::one(), Zero::zero()), (One::one(), One::one())] {
|
||||||
(Perbill::from_percent(100), Perbill::from_percent(0)),
|
|
||||||
(Perbill::from_percent(100), Perbill::from_percent(100)),
|
|
||||||
] {
|
|
||||||
let block = utils::set_glutton_parameters(
|
let block = utils::set_glutton_parameters(
|
||||||
&client,
|
&client,
|
||||||
initialize_glutton_pallet,
|
initialize_glutton_pallet,
|
||||||
compute_level,
|
compute_ratio,
|
||||||
storage_level,
|
storage_ratio,
|
||||||
);
|
);
|
||||||
runtime.block_on(utils::import_block(&client, &block, false));
|
runtime.block_on(utils::import_block(&client, &block, false));
|
||||||
initialize_glutton_pallet = false;
|
initialize_glutton_pallet = false;
|
||||||
@@ -68,8 +68,9 @@ fn benchmark_block_production_compute(c: &mut Criterion) {
|
|||||||
|
|
||||||
group.bench_function(
|
group.bench_function(
|
||||||
format!(
|
format!(
|
||||||
"(compute = {:?}, storage = {:?}, proof = true) block production",
|
"(compute = {:?} %, storage = {:?} %) block import",
|
||||||
compute_level, storage_level
|
compute_ratio.saturating_mul_int(100),
|
||||||
|
storage_ratio.saturating_mul_int(100)
|
||||||
),
|
),
|
||||||
|b| {
|
|b| {
|
||||||
b.iter_batched(
|
b.iter_batched(
|
||||||
@@ -89,8 +90,9 @@ fn benchmark_block_production_compute(c: &mut Criterion) {
|
|||||||
|
|
||||||
group.bench_function(
|
group.bench_function(
|
||||||
format!(
|
format!(
|
||||||
"(compute = {:?}, storage = {:?}, proof = false) block production",
|
"(compute = {:?} %, storage = {:?} %) block import",
|
||||||
compute_level, storage_level
|
compute_ratio.saturating_mul_int(100),
|
||||||
|
storage_ratio.saturating_mul_int(100)
|
||||||
),
|
),
|
||||||
|b| {
|
|b| {
|
||||||
b.iter_batched(
|
b.iter_batched(
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ use sc_executor_common::wasm_runtime::WasmModule;
|
|||||||
use sp_api::ProvideRuntimeApi;
|
use sp_api::ProvideRuntimeApi;
|
||||||
|
|
||||||
use frame_system_rpc_runtime_api::AccountNonceApi;
|
use frame_system_rpc_runtime_api::AccountNonceApi;
|
||||||
use sp_arithmetic::Perbill;
|
use sp_arithmetic::{
|
||||||
|
traits::{One, Zero},
|
||||||
|
FixedU64,
|
||||||
|
};
|
||||||
use sp_consensus::BlockOrigin;
|
use sp_consensus::BlockOrigin;
|
||||||
use sp_keyring::Sr25519Keyring::Alice;
|
use sp_keyring::Sr25519Keyring::Alice;
|
||||||
use sp_runtime::traits::Header as HeaderT;
|
use sp_runtime::traits::Header as HeaderT;
|
||||||
@@ -69,14 +72,11 @@ fn benchmark_block_validation(c: &mut Criterion) {
|
|||||||
group.sample_size(20);
|
group.sample_size(20);
|
||||||
group.measurement_time(Duration::from_secs(120));
|
group.measurement_time(Duration::from_secs(120));
|
||||||
|
|
||||||
// In the first iteration we want to initialie the glutton pallet
|
// In the first iteration we want to initialize the glutton pallet.
|
||||||
let mut is_first = true;
|
let mut is_first = true;
|
||||||
for (compute_percent, storage_percent) in &[
|
for (compute_ratio, storage_ratio) in &[(One::one(), Zero::zero()), (One::one(), One::one())] {
|
||||||
(Perbill::from_percent(100), Perbill::from_percent(0)),
|
|
||||||
(Perbill::from_percent(100), Perbill::from_percent(100)),
|
|
||||||
] {
|
|
||||||
let parachain_block =
|
let parachain_block =
|
||||||
set_glutton_parameters(&client, is_first, compute_percent, storage_percent);
|
set_glutton_parameters(&client, is_first, compute_ratio, storage_ratio);
|
||||||
is_first = false;
|
is_first = false;
|
||||||
|
|
||||||
runtime.block_on(import_block(&client, parachain_block.clone().into_block(), false));
|
runtime.block_on(import_block(&client, parachain_block.clone().into_block(), false));
|
||||||
@@ -114,7 +114,7 @@ fn benchmark_block_validation(c: &mut Criterion) {
|
|||||||
group.bench_function(
|
group.bench_function(
|
||||||
format!(
|
format!(
|
||||||
"(compute = {:?}, storage = {:?}, proof_size = {}kb) block validation",
|
"(compute = {:?}, storage = {:?}, proof_size = {}kb) block validation",
|
||||||
compute_percent, storage_percent, proof_size_in_kb
|
compute_ratio, storage_ratio, proof_size_in_kb
|
||||||
),
|
),
|
||||||
|b| {
|
|b| {
|
||||||
b.iter_batched(
|
b.iter_batched(
|
||||||
@@ -145,8 +145,8 @@ fn verify_expected_result(runtime: &Box<dyn WasmModule>, encoded_params: &[u8],
|
|||||||
fn set_glutton_parameters(
|
fn set_glutton_parameters(
|
||||||
client: &Client,
|
client: &Client,
|
||||||
initialize: bool,
|
initialize: bool,
|
||||||
compute_percent: &Perbill,
|
compute_ratio: &FixedU64,
|
||||||
storage_percent: &Perbill,
|
storage_ratio: &FixedU64,
|
||||||
) -> ParachainBlockData {
|
) -> ParachainBlockData {
|
||||||
let parent_hash = client.usage_info().chain.best_hash;
|
let parent_hash = client.usage_info().chain.best_hash;
|
||||||
let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap();
|
let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap();
|
||||||
@@ -181,7 +181,7 @@ fn set_glutton_parameters(
|
|||||||
client,
|
client,
|
||||||
Alice.into(),
|
Alice.into(),
|
||||||
SudoCall::sudo {
|
SudoCall::sudo {
|
||||||
call: Box::new(GluttonCall::set_compute { compute: *compute_percent }.into()),
|
call: Box::new(GluttonCall::set_compute { compute: *compute_ratio }.into()),
|
||||||
},
|
},
|
||||||
Some(last_nonce),
|
Some(last_nonce),
|
||||||
);
|
);
|
||||||
@@ -192,7 +192,7 @@ fn set_glutton_parameters(
|
|||||||
client,
|
client,
|
||||||
Alice.into(),
|
Alice.into(),
|
||||||
SudoCall::sudo {
|
SudoCall::sudo {
|
||||||
call: Box::new(GluttonCall::set_storage { storage: *storage_percent }.into()),
|
call: Box::new(GluttonCall::set_storage { storage: *storage_ratio }.into()),
|
||||||
},
|
},
|
||||||
Some(last_nonce),
|
Some(last_nonce),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -35,14 +35,13 @@ use sc_consensus::{
|
|||||||
use sc_executor::DEFAULT_HEAP_ALLOC_STRATEGY;
|
use sc_executor::DEFAULT_HEAP_ALLOC_STRATEGY;
|
||||||
use sc_executor_common::runtime_blob::RuntimeBlob;
|
use sc_executor_common::runtime_blob::RuntimeBlob;
|
||||||
use sp_api::ProvideRuntimeApi;
|
use sp_api::ProvideRuntimeApi;
|
||||||
use sp_arithmetic::Perbill;
|
|
||||||
use sp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed};
|
use sp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed};
|
||||||
use sp_consensus::BlockOrigin;
|
use sp_consensus::BlockOrigin;
|
||||||
use sp_core::{sr25519, Pair};
|
use sp_core::{sr25519, Pair};
|
||||||
use sp_keyring::Sr25519Keyring::Alice;
|
use sp_keyring::Sr25519Keyring::Alice;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
transaction_validity::{InvalidTransaction, TransactionValidityError},
|
transaction_validity::{InvalidTransaction, TransactionValidityError},
|
||||||
AccountId32, OpaqueExtrinsic,
|
AccountId32, FixedU64, OpaqueExtrinsic,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Accounts to use for transfer transactions. Enough for 5000 transactions.
|
/// Accounts to use for transfer transactions. Enough for 5000 transactions.
|
||||||
@@ -127,7 +126,7 @@ pub fn create_benchmarking_transfer_extrinsics(
|
|||||||
src_accounts: &[sr25519::Pair],
|
src_accounts: &[sr25519::Pair],
|
||||||
dst_accounts: &[sr25519::Pair],
|
dst_accounts: &[sr25519::Pair],
|
||||||
) -> (usize, Vec<OpaqueExtrinsic>) {
|
) -> (usize, Vec<OpaqueExtrinsic>) {
|
||||||
// Add as many tranfer extrinsics as possible into a single block.
|
// Add as many transfer extrinsics as possible into a single block.
|
||||||
let mut block_builder = client.new_block(Default::default()).unwrap();
|
let mut block_builder = client.new_block(Default::default()).unwrap();
|
||||||
let mut max_transfer_count = 0;
|
let mut max_transfer_count = 0;
|
||||||
let mut extrinsics = Vec::new();
|
let mut extrinsics = Vec::new();
|
||||||
@@ -200,8 +199,8 @@ pub fn get_wasm_module() -> Box<dyn sc_executor_common::wasm_runtime::WasmModule
|
|||||||
pub fn set_glutton_parameters(
|
pub fn set_glutton_parameters(
|
||||||
client: &TestClient,
|
client: &TestClient,
|
||||||
initialize: bool,
|
initialize: bool,
|
||||||
compute_percent: &Perbill,
|
compute_ratio: &FixedU64,
|
||||||
storage_percent: &Perbill,
|
storage_ratio: &FixedU64,
|
||||||
) -> NodeBlock {
|
) -> NodeBlock {
|
||||||
let parent_hash = client.usage_info().chain.best_hash;
|
let parent_hash = client.usage_info().chain.best_hash;
|
||||||
let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap();
|
let parent_header = client.header(parent_hash).expect("Just fetched this hash.").unwrap();
|
||||||
@@ -231,7 +230,7 @@ pub fn set_glutton_parameters(
|
|||||||
let set_compute = construct_extrinsic(
|
let set_compute = construct_extrinsic(
|
||||||
client,
|
client,
|
||||||
SudoCall::sudo {
|
SudoCall::sudo {
|
||||||
call: Box::new(GluttonCall::set_compute { compute: *compute_percent }.into()),
|
call: Box::new(GluttonCall::set_compute { compute: *compute_ratio }.into()),
|
||||||
},
|
},
|
||||||
Alice.into(),
|
Alice.into(),
|
||||||
Some(last_nonce),
|
Some(last_nonce),
|
||||||
@@ -243,7 +242,7 @@ pub fn set_glutton_parameters(
|
|||||||
let set_storage = construct_extrinsic(
|
let set_storage = construct_extrinsic(
|
||||||
client,
|
client,
|
||||||
SudoCall::sudo {
|
SudoCall::sudo {
|
||||||
call: Box::new(GluttonCall::set_storage { storage: *storage_percent }.into()),
|
call: Box::new(GluttonCall::set_storage { storage: *storage_ratio }.into()),
|
||||||
},
|
},
|
||||||
Alice.into(),
|
Alice.into(),
|
||||||
Some(last_nonce),
|
Some(last_nonce),
|
||||||
|
|||||||
Reference in New Issue
Block a user