Skip to content

Commit efa09ef

Browse files
committed
More compile
1 parent 898eec5 commit efa09ef

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

node/src/fake_runtime_api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ sp_api::impl_runtime_apis! {
210210
}
211211
}
212212

213+
impl sp_transaction_storage_proof::runtime_api::TransactionStorageApi<Block> for Runtime {
214+
fn retention_period() -> sp_runtime::traits::NumberFor<Block> {
215+
unimplemented!()
216+
}
217+
}
218+
213219
#[cfg(feature = "try-runtime")]
214220
impl frame_try_runtime::TryRuntime<Block> for Runtime {
215221
fn on_runtime_upgrade(_: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {

node/src/service.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use sc_consensus_grandpa::SharedVoterState;
77
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
88
use sc_telemetry::{Telemetry, TelemetryWorker};
99
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
10+
use sp_api::ProvideRuntimeApi;
1011
use sp_consensus_babe::inherents::BabeCreateInherentDataProviders;
12+
use sp_transaction_storage_proof::runtime_api::TransactionStorageApi;
1113
use std::{sync::Arc, time::Duration};
1214

1315
pub(crate) type FullClient = sc_service::TFullClient<
@@ -310,6 +312,7 @@ pub fn new_full<
310312
sp_transaction_storage_proof::registration::new_data_provider(
311313
&*client_clone,
312314
&parent,
315+
client_clone.runtime_api().retention_period(parent)?,
313316
)?;
314317

315318
Ok((slot, timestamp, storage_proof))

pallets/transaction-storage/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ pub use weights::WeightInfo;
5454

5555
const LOG_TARGET: &str = "runtime::transaction-storage";
5656

57+
/// Default retention period for data (in blocks).
58+
pub const DEFAULT_RETENTION_PERIOD: u32 = 100800;
59+
5760
/// Maximum bytes that can be stored in one transaction.
5861
// TODO: find out what is "allocator" and "allocator limit"
5962
// Setting higher limit also requires raising the allocator limit.

runtime/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ parameter_types! {
193193
EquivocationReportPeriodInEpochs::get() * (EPOCH_DURATION_IN_BLOCKS as u64);
194194

195195

196-
// This currently _must_ be set to DEFAULT_STORAGE_PERIOD
197-
pub const StoragePeriod: BlockNumber = sp_transaction_storage_proof::DEFAULT_STORAGE_PERIOD;
196+
// This currently _must_ be set to DEFAULT_RETENTION_PERIOD
197+
pub const StoragePeriod: BlockNumber = pallet_transaction_storage::DEFAULT_RETENTION_PERIOD;
198198
pub const AuthorizationPeriod: BlockNumber = 7 * DAYS;
199199
pub const StoreRenewPriority: TransactionPriority = RemoveExpiredAuthorizationPriority::get() - 1;
200200
pub const StoreRenewLongevity: TransactionLongevity = DAYS as TransactionLongevity;

runtimes/bulletin-polkadot/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ parameter_types! {
194194
EquivocationReportPeriodInEpochs::get() * (EPOCH_DURATION_IN_BLOCKS as u64);
195195

196196

197-
// This currently _must_ be set to DEFAULT_STORAGE_PERIOD
198-
pub const StoragePeriod: BlockNumber = sp_transaction_storage_proof::DEFAULT_STORAGE_PERIOD;
197+
// This currently _must_ be set to DEFAULT_RETENTION_PERIOD
198+
pub const StoragePeriod: BlockNumber = pallet_transaction_storage::DEFAULT_RETENTION_PERIOD;
199199
pub const AuthorizationPeriod: BlockNumber = 7 * DAYS;
200200
pub const StoreRenewPriority: TransactionPriority = RemoveExpiredAuthorizationPriority::get() - 1;
201201
pub const StoreRenewLongevity: TransactionLongevity = DAYS as TransactionLongevity;

runtimes/bulletin-westend/src/storage.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use sp_runtime::transaction_validity::{TransactionLongevity, TransactionPriority
2727
use testnet_parachains_constants::westend::locations::PeopleLocation;
2828

2929
parameter_types! {
30-
// This currently _must_ be set to DEFAULT_STORAGE_PERIOD
31-
pub const StoragePeriod: crate::BlockNumber = sp_transaction_storage_proof::DEFAULT_STORAGE_PERIOD;
30+
// This currently _must_ be set to DEFAULT_RETENTION_PERIOD
31+
pub const StoragePeriod: crate::BlockNumber = pallet_transaction_storage::DEFAULT_RETENTION_PERIOD;
3232
pub const AuthorizationPeriod: crate::BlockNumber = 7 * crate::DAYS;
3333
// Priorities and longevities used by the transaction storage pallet extrinsics.
3434
pub const SudoPriority: TransactionPriority = TransactionPriority::MAX;

0 commit comments

Comments
 (0)