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
13 changes: 13 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", rev =
pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
pallet-skip-feeless-payment = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "b2bcb74b13f1a1e082f701e3e05ce1be44d16790", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions pallets/transaction-storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ pub mod pallet {
/// O(n*log(n)) of data size, as all data is pushed to an in-memory trie.
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::store(data.len() as u32))]
#[pallet::feeless_if(|origin: &OriginFor<T>, data: &Vec<u8>| -> bool { /*TODO: add here correct validation */ true })]
pub fn store(_origin: OriginFor<T>, data: Vec<u8>) -> DispatchResult {
// In the case of a regular unsigned transaction, this should have been checked by
// pre_dispatch. In the case of a regular signed transaction, this should have been
Expand Down
2 changes: 2 additions & 0 deletions runtimes/bulletin-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pallet-authorship = { workspace = true }
pallet-balances = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-session = { workspace = true }
pallet-skip-feeless-payment = { workspace = true }
pallet-sudo = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
Expand Down Expand Up @@ -114,6 +115,7 @@ std = [
"pallet-collator-selection/std",
"pallet-message-queue/std",
"pallet-session/std",
"pallet-skip-feeless-payment/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
Expand Down
21 changes: 13 additions & 8 deletions runtimes/bulletin-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use parachains_common::{
impls::DealWithFees,
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO,
AVERAGE_ON_INITIALIZE_RATIO,
};
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
use sp_api::impl_runtime_apis;
Expand Down Expand Up @@ -113,7 +113,10 @@ pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
pallet_skip_feeless_payment::SkipCheckIfFeeless<
Runtime,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
>,
ValidateSigned,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
),
Expand Down Expand Up @@ -191,10 +194,14 @@ pub fn native_version() -> NativeVersion {
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
}

/// We allow for 90% of the block to be consumed by normal transactions.
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(90);

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
/// 10 MiB (allows 9 MiB for normal transactions with 90% NORMAL_DISPATCH_RATIO)
pub RuntimeBlockLength: BlockLength =
BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
BlockLength::max_with_normal_ratio(10 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()
.base_block(BlockExecutionWeight::get())
.for_class(DispatchClass::all(), |weights| {
Expand Down Expand Up @@ -550,11 +557,8 @@ impl pallet_collator_selection::Config for Runtime {
type WeightInfo = weights::pallet_collator_selection::WeightInfo<Runtime>;
}

parameter_types! {
/// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
/// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
impl pallet_skip_feeless_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}

impl pallet_sudo::Config for Runtime {
Expand All @@ -577,6 +581,7 @@ construct_runtime!(
// Monetary stuff.
Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment = 11,
SkipFeelessPayment: pallet_skip_feeless_payment = 12,

// Storage
TransactionStorage: pallet_transaction_storage = 40,
Expand Down
Loading