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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ cargo-update:

.PHONY: build-wasm-mandala
build-wasm-mandala:
./scripts/build-only-wasm.sh -p mandala-runtime --features=with-ethereum-compatibility
./scripts/build-only-wasm.sh -p mandala-runtime --features=on-chain-release-build

.PHONY: build-wasm-karura
build-wasm-karura:
Expand All @@ -151,7 +151,7 @@ build-wasm-acala:

.PHONY: srtool-build-wasm-mandala
srtool-build-wasm-mandala:
PACKAGE=mandala-runtime BUILD_OPTS="--features with-ethereum-compatibility" ./scripts/srtool-build.sh
PACKAGE=mandala-runtime BUILD_OPTS="--features on-chain-release-build" ./scripts/srtool-build.sh

.PHONY: srtool-build-wasm-karura
srtool-build-wasm-karura:
Expand Down
3 changes: 1 addition & 2 deletions node/service/src/chain_spec/acala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ pub fn latest_acala_config() -> Result<ChainSpec, String> {
general_councils,
)
},
// TODO: update
vec![
"/dns/karura-rpc-0.aca-api.network/tcp/30333/p2p/12D3KooWDVQHcjsM5UkWKhfpxiNhWofmX5bvJd5Wn9qPFZk1C8t8"
"/dns/acala-rpc-0.aca-api.network/tcp/30333/p2p/12D3KooWASu892sCwPezdcqRbmS7HVYJcAfeMKQdewiRywYLeKL9"
.parse()
.unwrap(),
],
Expand Down
53,556 changes: 13,714 additions & 39,842 deletions resources/acala-dist.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions runtime/acala/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub mod time {
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;

pub fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 2 * dollar(ACA) + (bytes as Balance) * 30 * millicent(ACA)
items as Balance * 4 * dollar(ACA) + (bytes as Balance) * 60 * millicent(ACA)
}
}

Expand All @@ -45,7 +45,7 @@ pub mod fee {
WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
};
use primitives::Balance;
use runtime_common::{cent, ACA};
use runtime_common::{cent, dollar, ACA, DOT};
use smallvec::smallvec;
use sp_runtime::Perbill;

Expand Down Expand Up @@ -84,10 +84,10 @@ pub mod fee {
}

pub fn dot_per_second() -> u128 {
// TODO: recheck this
let base_weight = Balance::from(ExtrinsicBaseWeight::get());
let base_tx_per_second = (WEIGHT_PER_SECOND as u128) / base_weight;
let aca_per_second = base_tx_per_second * base_tx_in_aca();
aca_per_second / 100
// TODO: recheck this https://github.com/AcalaNetwork/Acala/issues/1562
aca_per_second / 50 * dollar(DOT) / dollar(ACA)
}
}
45 changes: 26 additions & 19 deletions runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,21 @@ impl Contains<Call> for BaseCallFilter {
return true;
}

let is_paused = module_transaction_pause::PausedTransactionFilter::<Runtime>::contains(call);
if is_paused {
// no paused call
return false;
}

let is_whitelisted = matches!(
call,
Call::Sudo(_) | // sudo
Call::Scheduler(_) | Call::Utility(_) | Call::Multisig(_) | Call::Proxy(_) | // utility
Call::TransactionPause(_) | // transaction pause
Call::Treasury(_) | Call::Bounties(_) | Call::Tips(_) | // treasury
// Call::CollatorSelection(_) | Call::Session(_) | Call::SessionManager(_) | // collator
Call::DmpQueue(_) | Call::OrmlXcm(_) | // xcm
// Call::PolkadotXcm(_) | Call::XTokens | // not allow user to make xcm call
// Call::PolkadotXcm(_) | Call::XTokens(_) | // not allow user to make xcm call
Call::Authority(_) |
Call::GeneralCouncil(_) | Call::GeneralCouncilMembership(_) |
Call::FinancialCouncil(_) | Call::FinancialCouncilMembership(_) |
Expand Down Expand Up @@ -276,7 +283,6 @@ impl pallet_authorship::Config for Runtime {
}

parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
pub const SessionDuration: BlockNumber = 2 * HOURS; // used in SessionManagerConfig of genesis
}

Expand All @@ -295,7 +301,7 @@ impl pallet_session::Config for Runtime {
}

parameter_types! {
pub const MinCandidates: u32 = 3;
pub const MinCandidates: u32 = 1;
pub const MaxCandidates: u32 = 50;
pub const MaxInvulnerables: u32 = 10;
pub const KickPenaltySessionLength: u32 = 8;
Expand Down Expand Up @@ -371,7 +377,7 @@ impl pallet_sudo::Config for Runtime {
}

parameter_types! {
pub const GeneralCouncilMotionDuration: BlockNumber = 7 * DAYS;
pub const GeneralCouncilMotionDuration: BlockNumber = 3 * DAYS;
pub const GeneralCouncilMaxProposals: u32 = 20;
pub const GeneralCouncilMaxMembers: u32 = 30;
}
Expand Down Expand Up @@ -401,7 +407,7 @@ impl pallet_membership::Config<GeneralCouncilMembershipInstance> for Runtime {
}

parameter_types! {
pub const FinancialCouncilMotionDuration: BlockNumber = 7 * DAYS;
pub const FinancialCouncilMotionDuration: BlockNumber = 3 * DAYS;
pub const FinancialCouncilMaxProposals: u32 = 20;
pub const FinancialCouncilMaxMembers: u32 = 30;
}
Expand Down Expand Up @@ -431,7 +437,7 @@ impl pallet_membership::Config<FinancialCouncilMembershipInstance> for Runtime {
}

parameter_types! {
pub const HomaCouncilMotionDuration: BlockNumber = 7 * DAYS;
pub const HomaCouncilMotionDuration: BlockNumber = 3 * DAYS;
pub const HomaCouncilMaxProposals: u32 = 20;
pub const HomaCouncilMaxMembers: u32 = 30;
}
Expand Down Expand Up @@ -461,7 +467,7 @@ impl pallet_membership::Config<HomaCouncilMembershipInstance> for Runtime {
}

parameter_types! {
pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * DAYS;
pub const TechnicalCommitteeMotionDuration: BlockNumber = 3 * DAYS;
pub const TechnicalCommitteeMaxProposals: u32 = 20;
pub const TechnicalCouncilMaxMembers: u32 = 30;
}
Expand Down Expand Up @@ -617,11 +623,12 @@ impl pallet_tips::Config for Runtime {
}

parameter_types! {
pub const LaunchPeriod: BlockNumber = 7 * DAYS;
pub const VotingPeriod: BlockNumber = 7 * DAYS;
pub const LaunchPeriod: BlockNumber = 5 * DAYS;
pub const VotingPeriod: BlockNumber = 5 * DAYS;
pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS;
pub MinimumDeposit: Balance = 100 * dollar(ACA);
pub const EnactmentPeriod: BlockNumber = 7 * DAYS;
pub MinimumDeposit: Balance = 200 * dollar(ACA);
pub const EnactmentPeriod: BlockNumber = 2 * DAYS;
pub const VoteLockingPeriod: BlockNumber = 14 * DAYS;
pub const CooloffPeriod: BlockNumber = 7 * DAYS;
pub PreimageByteDeposit: Balance = deposit(0, 1);
pub const InstantAllowed: bool = true;
Expand All @@ -636,7 +643,7 @@ impl pallet_democracy::Config for Runtime {
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type VoteLockingPeriod = EnactmentPeriod; // Same as EnactmentPeriod
type VoteLockingPeriod = VoteLockingPeriod;
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin = EnsureRootOrHalfGeneralCouncil;
Expand Down Expand Up @@ -729,9 +736,9 @@ parameter_type_with_key! {
pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance {
match currency_id {
CurrencyId::Token(symbol) => match symbol {
TokenSymbol::AUSD => cent(*currency_id),
TokenSymbol::DOT => 10 * millicent(*currency_id),
TokenSymbol::LDOT => 50 * millicent(*currency_id),
TokenSymbol::AUSD => 10 * cent(*currency_id),
TokenSymbol::DOT => cent(*currency_id),
TokenSymbol::LDOT => 5 * cent(*currency_id),

TokenSymbol::KAR |
TokenSymbol::KUSD |
Expand Down Expand Up @@ -1469,7 +1476,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNet
/// queues.
pub type XcmRouter = (
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
Expand Down Expand Up @@ -1500,7 +1507,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type Event = Event;
type XcmExecutor = XcmExecutor<XcmConfig>;
type ChannelInfo = ParachainSystem;
type VersionWrapper = ();
type VersionWrapper = PolkadotXcm;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down Expand Up @@ -1538,7 +1545,7 @@ parameter_types! {
pub MaxScheduledUnbonds: u32 = 14;
pub ParachainAccount: AccountId = ParachainInfo::get().into_account();
pub SubAccountIndex: u16 = RelayChainSubAccountId::HomaLite as u16;
pub const XcmUnbondFee: Balance = 600_000_000; // TODO identify unbon fee
pub const XcmUnbondFee: Balance = 600_000_000; // TODO identify unbond fee
}
impl module_homa_lite::Config for Runtime {
type Event = Event;
Expand Down Expand Up @@ -1611,7 +1618,7 @@ impl Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert {
if let Ok(currency_id) = CurrencyId::decode(&mut &*key) {
// check `currency_id` is cross-chain asset
match currency_id {
Token(ACA) | Token(AUSD) | Token(LDOT) | Token(RENBTC) => Some(currency_id),
Token(ACA) | Token(AUSD) | Token(LDOT) => Some(currency_id),
_ => None,
}
} else {
Expand Down
10 changes: 5 additions & 5 deletions runtime/acala/src/weights/module_auction_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
//! Autogenerated weights for module_auction_manager
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("karura-dev"), DB CACHE: 128
//! DATE: 2021-10-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("acala-latest"), DB CACHE: 128

// Executed Command:
// target/release/acala
// benchmark
// --chain=karura-dev
// --chain=acala-latest
// --steps=50
// --repeat=20
// --pallet=*
Expand All @@ -34,7 +34,7 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/karura/src/weights/
// --output=./runtime/acala/src/weights/


#![cfg_attr(rustfmt, rustfmt_skip)]
Expand All @@ -48,7 +48,7 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_auction_manager::WeightInfo for WeightInfo<T> {
fn cancel_collateral_auction() -> Weight {
(148_427_000 as Weight)
(141_596_000 as Weight)
.saturating_add(T::DbWeight::get().reads(11 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
}
Expand Down
32 changes: 16 additions & 16 deletions runtime/acala/src/weights/module_cdp_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
//! Autogenerated weights for module_cdp_engine
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("karura-dev"), DB CACHE: 128
//! DATE: 2021-10-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("acala-latest"), DB CACHE: 128

// Executed Command:
// target/release/acala
// benchmark
// --chain=karura-dev
// --chain=acala-latest
// --steps=50
// --repeat=20
// --pallet=*
Expand All @@ -34,7 +34,7 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/karura/src/weights/
// --output=./runtime/acala/src/weights/


#![cfg_attr(rustfmt, rustfmt_skip)]
Expand All @@ -48,33 +48,33 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_cdp_engine::WeightInfo for WeightInfo<T> {
fn on_initialize(c: u32, ) -> Weight {
(33_217_000 as Weight)
// Standard Error: 66_000
.saturating_add((4_523_000 as Weight).saturating_mul(c as Weight))
(32_905_000 as Weight)
// Standard Error: 64_000
.saturating_add((5_373_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_collateral_params() -> Weight {
(63_093_000 as Weight)
(55_056_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_global_params() -> Weight {
(20_645_000 as Weight)
(19_309_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn liquidate_by_auction() -> Weight {
(315_153_000 as Weight)
.saturating_add(T::DbWeight::get().reads(24 as Weight))
.saturating_add(T::DbWeight::get().writes(17 as Weight))
(275_178_000 as Weight)
.saturating_add(T::DbWeight::get().reads(22 as Weight))
.saturating_add(T::DbWeight::get().writes(16 as Weight))
}
fn liquidate_by_dex() -> Weight {
(422_276_000 as Weight)
.saturating_add(T::DbWeight::get().reads(27 as Weight))
.saturating_add(T::DbWeight::get().writes(16 as Weight))
(374_192_000 as Weight)
.saturating_add(T::DbWeight::get().reads(25 as Weight))
.saturating_add(T::DbWeight::get().writes(15 as Weight))
}
fn settle() -> Weight {
(173_378_000 as Weight)
(165_420_000 as Weight)
.saturating_add(T::DbWeight::get().reads(13 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/acala/src/weights/module_cdp_treasury.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
//! Autogenerated weights for module_cdp_treasury
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("karura-dev"), DB CACHE: 128
//! DATE: 2021-10-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("acala-latest"), DB CACHE: 128

// Executed Command:
// target/release/acala
// benchmark
// --chain=karura-dev
// --chain=acala-latest
// --steps=50
// --repeat=20
// --pallet=*
Expand All @@ -34,7 +34,7 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/karura/src/weights/
// --output=./runtime/acala/src/weights/


#![cfg_attr(rustfmt, rustfmt_skip)]
Expand All @@ -48,16 +48,16 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_cdp_treasury::WeightInfo for WeightInfo<T> {
fn auction_collateral() -> Weight {
(67_951_000 as Weight)
(66_209_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
fn set_expected_collateral_auction_size() -> Weight {
(21_573_000 as Weight)
(20_575_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn extract_surplus_to_treasury() -> Weight {
(76_413_000 as Weight)
(68_325_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
Expand Down
Loading