Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node-cli"
version = "0.8.1"
version = "0.8.2"
authors = ["Liebi Technologies <bifrost@liebi.com>"]
description = "Bifrost Parachain Node"
build = "build.rs"
Expand Down
2 changes: 2 additions & 0 deletions pallets/vesting/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ fn add_vesting_schedule<T: Config>(who: &T::AccountId) -> Result<(), &'static st

System::<T>::set_block_number(0u32.into());

Vesting::<T>::init_vesting_start_at(RawOrigin::Root.into(), 0u32.into())?;

// Add schedule to avoid `NotVesting` error.
Vesting::<T>::add_vesting_schedule(
&who,
Expand Down
12 changes: 5 additions & 7 deletions runtime/asgard/src/weights/bifrost_salp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for bifrost_salp
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-08-11, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-08-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asgard-local"), DB CACHE: 128

// Executed Command:
Expand All @@ -46,19 +46,17 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> bifrost_salp::WeightInfo for WeightInfo<T> {
fn create() -> Weight {
(60_954_000 as Weight)
(38_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn contribute() -> Weight {
(64_140_000 as Weight)
(48_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn on_finalize(n: u32) -> Weight {
(9_002_000 as Weight)
// Standard Error: 0
.saturating_add((235_000 as Weight).saturating_mul(n as Weight))
fn on_finalize(_n: u32) -> Weight {
(8_405_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
1 change: 1 addition & 0 deletions runtime/bifrost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ runtime-benchmarks = [
"pallet-timestamp/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
Expand Down
48 changes: 34 additions & 14 deletions runtime/bifrost/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime, match_type, parameter_types,
traits::{All, Filter, IsInVec, Randomness},
traits::{All, Contains, Filter, IsInVec, Randomness},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
DispatchClass, IdentityFee, Weight,
Expand All @@ -46,7 +46,7 @@ use sp_core::OpaqueMetadata;
pub use sp_runtime::BuildStorage;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{BlakeTwo256, Block as BlockT, Zero},
traits::{AccountIdConversion, BlakeTwo256, Block as BlockT},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
};
Expand Down Expand Up @@ -95,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bifrost"),
impl_name: create_runtime_str!("bifrost"),
authoring_version: 1,
spec_version: 801,
spec_version: 802,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -156,11 +156,19 @@ impl Filter<Call> for CallFilter {
}

parameter_types! {
pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG);
pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC);
pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM);
pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD);
}

parameter_types! {
pub const TreasuryPalletId: PalletId = PalletId(*b"bf/trsry");
}

pub fn get_all_pallet_accounts() -> Vec<AccountId> {
vec![TreasuryPalletId::get().into_account()]
}

impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
/// The identifier used to distinguish between accounts.
Expand Down Expand Up @@ -512,34 +520,46 @@ impl pallet_vesting::Config for Runtime {

// orml runtime start

pub type BifrostToken = BasicCurrencyAdapter<Runtime, Balances, Amount, BlockNumber>;

impl orml_currencies::Config for Runtime {
type Event = Event;
type GetNativeCurrencyId = NativeCurrencyId;
type MultiCurrency = Tokens;
type NativeCurrency = BifrostToken;
type NativeCurrency = BasicCurrencyAdapter<Runtime, Balances, Amount, BlockNumber>;
type WeightInfo = ();
}

orml_traits::parameter_type_with_key! {
pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance {
match currency_id {
&CurrencyId::Native(TokenSymbol::ASG) => 1 * CENTS,
_ => Zero::zero(),
&CurrencyId::Native(TokenSymbol::BNC) => 10 * MILLIBNC,
&CurrencyId::Token(TokenSymbol::KSM) => 10 * MILLICENTS,
&CurrencyId::VSToken(TokenSymbol::KSM) => 10 * MILLICENTS,
&CurrencyId::VSBond(TokenSymbol::BNC, ..) => 10 * MILLICENTS,
_ => Balance::max_value() // unsupported
}
};
}

pub struct DustRemovalWhitelist;
impl Contains<AccountId> for DustRemovalWhitelist {
fn contains(a: &AccountId) -> bool {
get_all_pallet_accounts().contains(a)
}
}

parameter_types! {
pub BifrostTreasuryAccount: AccountId = TreasuryPalletId::get().into_account();
}

impl orml_tokens::Config for Runtime {
type Amount = Amount;
type Balance = Balance;
type CurrencyId = CurrencyId;
type DustRemovalWhitelist = ();
type DustRemovalWhitelist = DustRemovalWhitelist;
type Event = Event;
type ExistentialDeposits = ExistentialDeposits;
type MaxLocks = MaxLocks;
type OnDust = ();
type OnDust = orml_tokens::TransferDust<Runtime, BifrostTreasuryAccount>;
type WeightInfo = ();
}

Expand All @@ -550,7 +570,6 @@ impl orml_tokens::Config for Runtime {
// pub const ProposalBondMinimum: Balance = 50 * DOLLARS;
// pub const SpendPeriod: BlockNumber = 6 * DAYS;
// pub const Burn: Permill = Permill::from_perthousand(2);
// pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
//
// pub const TipCountdown: BlockNumber = 1 * DAYS;
// pub const TipFindersFee: Percent = Percent::from_percent(20);
Expand Down Expand Up @@ -815,12 +834,13 @@ impl_runtime_apis! {

// Adding the pallet you will perform thee benchmarking
add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_bounties, Bounties);
// add_benchmark!(params, batches, pallet_bounties, Bounties);
add_benchmark!(params, batches, pallet_indices, Indices);
add_benchmark!(params, batches, pallet_scheduler, Scheduler);
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
add_benchmark!(params, batches, pallet_treasury, Treasury);
// add_benchmark!(params, batches, pallet_treasury, Treasury);
add_benchmark!(params, batches, pallet_utility, Utility);
add_benchmark!(params, batches, pallet_vesting, Vesting);

if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches)
Expand Down
14 changes: 7 additions & 7 deletions runtime/bifrost/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for pallet_balances
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-08-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128

// Executed Command:
Expand All @@ -46,32 +46,32 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
fn transfer() -> Weight {
(248_276_000 as Weight)
(186_397_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn transfer_keep_alive() -> Weight {
(184_967_000 as Weight)
(149_209_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn set_balance_creating() -> Weight {
(95_890_000 as Weight)
(91_298_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn set_balance_killing() -> Weight {
(115_106_000 as Weight)
(102_324_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn force_transfer() -> Weight {
(246_112_000 as Weight)
(185_362_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
fn transfer_all() -> Weight {
(226_555_000 as Weight)
(168_296_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/bifrost/src/weights/pallet_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for pallet_indices
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-08-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128

// Executed Command:
Expand All @@ -46,27 +46,27 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_indices::WeightInfo for WeightInfo<T> {
fn claim() -> Weight {
(130_555_000 as Weight)
(110_804_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn transfer() -> Weight {
(164_299_000 as Weight)
(143_279_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn free() -> Weight {
(132_599_000 as Weight)
(112_222_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_transfer() -> Weight {
(134_983_000 as Weight)
(114_400_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn freeze() -> Weight {
(120_396_000 as Weight)
(112_784_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/bifrost/src/weights/pallet_timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for pallet_timestamp
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-08-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128

// Executed Command:
Expand All @@ -46,11 +46,11 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_timestamp::WeightInfo for WeightInfo<T> {
fn set() -> Weight {
(24_637_000 as Weight)
(19_335_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn on_finalize() -> Weight {
(11_001_000 as Weight)
(10_593_000 as Weight)
}
}
16 changes: 8 additions & 8 deletions runtime/bifrost/src/weights/pallet_utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for pallet_utility
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-08-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128

// Executed Command:
Expand All @@ -46,19 +46,19 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_utility::WeightInfo for WeightInfo<T> {
fn batch(c: u32) -> Weight {
(44_360_000 as Weight)
// Standard Error: 7_000
.saturating_add((6_778_000 as Weight).saturating_mul(c as Weight))
(41_767_000 as Weight)
// Standard Error: 1_000
.saturating_add((4_248_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn as_derivative() -> Weight {
(19_316_000 as Weight)
(11_279_000 as Weight)
}
fn batch_all(c: u32) -> Weight {
(638_011_000 as Weight)
// Standard Error: 79_000
.saturating_add((6_251_000 as Weight).saturating_mul(c as Weight))
(47_341_000 as Weight)
// Standard Error: 1_000
.saturating_add((5_234_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
Expand Down
Loading