Skip to content

Commit

Permalink
last William iteration review
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Jun 3, 2024
1 parent f83d95f commit fb52bc4
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 110 deletions.
5 changes: 0 additions & 5 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch
sp-panic-handler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
sp-core-hashing-proc-macro = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
sp-version-proc-macro = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
staging-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
Expand Down
2 changes: 1 addition & 1 deletion ci/run-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cargo --version

case $TARGET in
cargo-build)
#cargo build -p centrifuge-chain --release "$@"
cargo build -p centrifuge-chain --release "$@"
;;

test-general)
Expand Down
2 changes: 1 addition & 1 deletion pallets/restricted-tokens/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ benchmarks! {
reserve_balance::<T>(currency, &recv, reserved + reserved);
}:set_balance(RawOrigin::Root, recv_loopup, currency.clone(), free, reserved)
verify {
assert!(<pallet_balances::Pallet<T> as fungible::InspectHold<T::AccountId>>::total_balance_on_hold(&recv) == reserved);
assert!(<orml_tokens::Pallet<T> as fungibles::InspectHold<T::AccountId>>::total_balance_on_hold(currency, &recv) == reserved);
assert!(<orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::reducible_balance(currency, &recv, Preservation::Protect, Fortitude::Polite) == free - <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::minimum_balance(currency));
assert!(<orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::balance(currency, &recv) == (free));
}
Expand Down
5 changes: 3 additions & 2 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ parameter_types! {
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const BasicDeposit: Balance = 100 * AIR;
pub const ByteDeposit: Balance = deposit(0, 1); //TODO-1.7
pub const ByteDeposit: Balance = deposit(0, 1);
pub const SubAccountDeposit: Balance = 20 * AIR;
pub const MaxRegistrars: u32 = 20;
}
Expand Down Expand Up @@ -937,6 +937,7 @@ parameter_types! {

// periods between treasury spends
pub const SpendPeriod: BlockNumber = 6 * DAYS;
pub const PayoutPeriod: BlockNumber = 30 * DAYS;

// percentage of treasury we burn per Spend period if there is a surplus
// If the treasury is able to spend on all the approved proposals and didn't miss any
Expand Down Expand Up @@ -966,7 +967,7 @@ impl pallet_treasury::Config for Runtime {
type OnSlash = Treasury;
type PalletId = TreasuryPalletId;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type PayoutPeriod = ConstU32<10>;
type PayoutPeriod = PayoutPeriod;
type ProposalBond = ProposalBond;
type ProposalBondMaximum = ProposalBondMaximum;
type ProposalBondMinimum = ProposalBondMinimum;
Expand Down
33 changes: 1 addition & 32 deletions runtime/altair/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,6 @@ use super::{
RuntimeCall, RuntimeEvent, RuntimeOrigin, Tokens, XcmpQueue,
};

/// A call filter for the XCM Transact instruction. This is a temporary
/// measure until we properly account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call
/// parameters.
///
/// NOTE: Defensive configuration for now, inspired by filter of
/// SystemParachains and Polkadot, can be extended if desired.
pub struct SafeCallFilter;
impl frame_support::traits::Contains<RuntimeCall> for SafeCallFilter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
call,
RuntimeCall::Timestamp(..)
| RuntimeCall::Balances(..)
| RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. })
| RuntimeCall::PolkadotXcm(
pallet_xcm::Call::limited_reserve_transfer_assets { .. }
) | RuntimeCall::XcmpQueue(..)
| RuntimeCall::MessageQueue(..)
| RuntimeCall::Proxy(..)
| RuntimeCall::LiquidityPoolsGateway(
pallet_liquidity_pools_gateway::Call::process_msg { .. }
) | RuntimeCall::OrderBook(..)
)
}
}

/// The main XCM config
/// This is where we configure the core of our XCM integrations: how tokens are
/// transferred, how fees are calculated, what barriers we impose on incoming
Expand All @@ -104,7 +73,7 @@ impl staging_xcm_executor::Config for XcmConfig {
type PalletInstancesInfo = crate::AllPalletsWithSystem;
type ResponseHandler = PolkadotXcm;
type RuntimeCall = RuntimeCall;
type SafeCallFilter = SafeCallFilter;
type SafeCallFilter = Everything;
type SubscriptionService = PolkadotXcm;
type Trader = Trader;
type TransactionalProcessor = FrameTransactionalProcessor;
Expand Down
5 changes: 3 additions & 2 deletions runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ parameter_types! {
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const BasicDeposit: Balance = 100 * CFG;
pub const ByteDeposit: Balance = deposit(0, 1); //TODO-1.7
pub const ByteDeposit: Balance = deposit(0, 1);
pub const SubAccountDeposit: Balance = 20 * CFG;
pub const MaxRegistrars: u32 = 20;
}
Expand Down Expand Up @@ -1054,6 +1054,7 @@ parameter_types! {

// periods between treasury spends
pub const SpendPeriod: BlockNumber = 14 * DAYS;
pub const PayoutPeriod: BlockNumber = 30 * DAYS;

// percentage of treasury we burn per Spend period if there is a surplus
// If the treasury is able to spend on all the approved proposals and didn't miss any
Expand Down Expand Up @@ -1083,7 +1084,7 @@ impl pallet_treasury::Config for Runtime {
type OnSlash = Treasury;
type PalletId = TreasuryPalletId;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type PayoutPeriod = ConstU32<10>;
type PayoutPeriod = PayoutPeriod;
type ProposalBond = ProposalBond;
type ProposalBondMaximum = ProposalBondMaximum;
type ProposalBondMinimum = ProposalBondMinimum;
Expand Down
33 changes: 1 addition & 32 deletions runtime/centrifuge/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,6 @@ use super::{
RuntimeCall, RuntimeEvent, RuntimeOrigin, Tokens, XcmpQueue,
};

/// A call filter for the XCM Transact instruction. This is a temporary
/// measure until we properly account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call
/// parameters.
///
/// NOTE: Defensive configuration for now, inspired by filter of
/// SystemParachains and Polkadot, can be extended if desired.
pub struct SafeCallFilter;
impl frame_support::traits::Contains<RuntimeCall> for SafeCallFilter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
call,
RuntimeCall::Timestamp(..)
| RuntimeCall::Balances(..)
| RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. })
| RuntimeCall::PolkadotXcm(
pallet_xcm::Call::limited_reserve_transfer_assets { .. }
) | RuntimeCall::XcmpQueue(..)
| RuntimeCall::MessageQueue(..)
| RuntimeCall::Proxy(..)
| RuntimeCall::LiquidityPoolsGateway(
pallet_liquidity_pools_gateway::Call::process_msg { .. }
) | RuntimeCall::OrderBook(..)
)
}
}

/// The main XCM config
/// This is where we configure the core of our XCM integrations: how tokens are
/// transferred, how fees are calculated, what barriers we impose on incoming
Expand All @@ -105,7 +74,7 @@ impl staging_xcm_executor::Config for XcmConfig {
type PalletInstancesInfo = crate::AllPalletsWithSystem;
type ResponseHandler = PolkadotXcm;
type RuntimeCall = RuntimeCall;
type SafeCallFilter = SafeCallFilter;
type SafeCallFilter = Everything;
type SubscriptionService = PolkadotXcm;
type Trader = Trader;
type TransactionalProcessor = FrameTransactionalProcessor;
Expand Down
5 changes: 3 additions & 2 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ parameter_types! {
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const BasicDeposit: Balance = 100 * CFG;
pub const ByteDeposit: Balance = deposit(0, 1); //TODO-1.7
pub const ByteDeposit: Balance = deposit(0, 1);
pub const SubAccountDeposit: Balance = 20 * CFG;
pub const MaxRegistrars: u32 = 20;
}
Expand Down Expand Up @@ -987,6 +987,7 @@ parameter_types! {

// periods between treasury spends
pub const SpendPeriod: BlockNumber = 30 * DAYS;
pub const PayoutPeriod: BlockNumber = 30 * DAYS;

// percentage of treasury we burn per Spend period if there is a surplus
// If the treasury is able to spend on all the approved proposals and didn't miss any
Expand Down Expand Up @@ -1018,7 +1019,7 @@ impl pallet_treasury::Config for Runtime {
type OnSlash = Treasury;
type PalletId = TreasuryPalletId;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type PayoutPeriod = ConstU32<10>;
type PayoutPeriod = PayoutPeriod;
type ProposalBond = ProposalBond;
type ProposalBondMaximum = ProposalBondMaximum;
type ProposalBondMinimum = ProposalBondMinimum;
Expand Down
33 changes: 1 addition & 32 deletions runtime/development/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,6 @@ use super::{
RuntimeCall, RuntimeEvent, RuntimeOrigin, Tokens, XcmpQueue,
};

/// A call filter for the XCM Transact instruction. This is a temporary
/// measure until we properly account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call
/// parameters.
///
/// NOTE: Defensive configuration for now, inspired by filter of
/// SystemParachains and Polkadot, can be extended if desired.
pub struct SafeCallFilter;
impl frame_support::traits::Contains<RuntimeCall> for SafeCallFilter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
call,
RuntimeCall::Timestamp(..)
| RuntimeCall::Balances(..)
| RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. })
| RuntimeCall::PolkadotXcm(
pallet_xcm::Call::limited_reserve_transfer_assets { .. }
) | RuntimeCall::XcmpQueue(..)
| RuntimeCall::MessageQueue(..)
| RuntimeCall::Proxy(..)
| RuntimeCall::LiquidityPoolsGateway(
pallet_liquidity_pools_gateway::Call::process_msg { .. }
) | RuntimeCall::OrderBook(..)
)
}
}

/// The main XCM config
/// This is where we configure the core of our XCM integrations: how tokens are
/// transferred, how fees are calculated, what barriers we impose on incoming
Expand All @@ -104,7 +73,7 @@ impl staging_xcm_executor::Config for XcmConfig {
type PalletInstancesInfo = crate::AllPalletsWithSystem;
type ResponseHandler = PolkadotXcm;
type RuntimeCall = RuntimeCall;
type SafeCallFilter = SafeCallFilter;
type SafeCallFilter = Everything;
type SubscriptionService = PolkadotXcm;
type Trader = Trader;
type TransactionalProcessor = FrameTransactionalProcessor;
Expand Down

0 comments on commit fb52bc4

Please sign in to comment.