Skip to content
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
0c61581
Added host function `TransactionIndex` for Bulletin parachain support…
bkontur Nov 19, 2025
b5d4f88
Add noop storage_index_transaction/storage_renew_transaction_index
bkontur Nov 20, 2025
65b54b7
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Nov 20, 2025
e186010
Update prdoc/pr_10370.prdoc
bkontur Nov 20, 2025
7cdfdab
Merge branch 'master' into bko-bulletin-para-support
bkontur Nov 20, 2025
65f8ca1
Merge branch 'master' into bko-bulletin-para-support
bkontur Nov 20, 2025
b595296
Merge branch 'master' into bko-bulletin-para-support
bkontur Nov 20, 2025
a87b4d6
Merge branch 'master' into bko-bulletin-para-support
bkontur Nov 20, 2025
e01b7b9
Merge remote-tracking branch 'origin/master' into bko-bulletin-para-s…
bkontur Nov 24, 2025
7665768
Move NO-OP transaction index host function to the correct place
bkontur Nov 24, 2025
58e4908
Update prdoc/pr_10370.prdoc
bkontur Nov 24, 2025
69e5abd
Merge branch 'master' into bko-bulletin-para-support
bkontur Nov 24, 2025
376af21
Merge remote-tracking branch 'origin/master' into bko-bulletin-para-s…
bkontur Nov 27, 2025
0f4c666
Put it behind a feature gate
bkontur Nov 27, 2025
4bdf004
Update cumulus/pallets/parachain-system/Cargo.toml
bkontur Nov 27, 2025
8ad87e0
Fix unused
bkontur Nov 28, 2025
5ccde08
Merge remote-tracking branch 'origin/bko-bulletin-para-support' into …
bkontur Nov 28, 2025
5b4c819
Merge branch 'master' into bko-bulletin-para-support
bkontur Dec 1, 2025
6ea1a29
sp-inherents: impl CreateInherentDataProvider for Vec<T>
iulianbarbu Dec 1, 2025
31dfc85
cumulus(wip): flag guarded enablement of tx storage idp
iulianbarbu Dec 1, 2025
aea846e
cumulus: fix polkadot-omni-node-lib compilation
iulianbarbu Dec 2, 2025
00b63c7
Merge branch 'master' into ib-add-tx-storage-inherent
iulianbarbu Dec 2, 2025
6697edc
Merge branch 'master' into bko-bulletin-para-support
bkontur Dec 3, 2025
e1af1dc
add prdoc
iulianbarbu Dec 3, 2025
bc26436
Update cumulus/polkadot-omni-node/lib/src/common/spec.rs
iulianbarbu Dec 3, 2025
38fea5e
fix prdoc
iulianbarbu Dec 3, 2025
c3ac2ae
Merge branch 'master' into bko-bulletin-para-support
bkontur Dec 3, 2025
8a64394
Merge branch 'master' into bko-bulletin-para-support
bkontur Dec 5, 2025
8339f99
Update cumulus/polkadot-omni-node/lib/src/common/spec.rs
iulianbarbu Dec 12, 2025
1ff66b6
polkadot-omni-node-lib: remove the extra ipfs_server flag
iulianbarbu Dec 12, 2025
d61002a
Merge branch 'master' into ib-add-tx-storage-inherent
iulianbarbu Dec 12, 2025
5db2223
Add `TransactionStorageApi` definition
bkontur Dec 15, 2025
8a53165
Add pub getter `storage_period` to transaction-storage pallet
bkontur Dec 15, 2025
3c1e637
Add TransactionStorageApi to the kithchensink
bkontur Dec 16, 2025
26214fe
Move `DEFAULT_STORAGE_PERIOD`
bkontur Dec 16, 2025
e4bb2e5
Call runtime API to get the storage_period for inherent data provider…
bkontur Dec 16, 2025
432f85b
Licence
bkontur Dec 16, 2025
7c5931c
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Dec 16, 2025
5dc9364
Update substrate/frame/transaction-storage/src/lib.rs
bkontur Dec 16, 2025
14cf3f1
Update prdoc/pr_10656.prdoc
bkontur Dec 16, 2025
8511105
Merge branch 'master' into ib-add-tx-storage-inherent
bkontur Dec 16, 2025
4c6a7b1
Merge branch 'master' into bko-bulletin-para-support
bkontur Dec 16, 2025
6f32290
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Dec 16, 2025
1806e30
Update prdoc/pr_10656.prdoc
bkontur Dec 16, 2025
27c42ba
Fix indentation in the prdoc
EgorPopelyaev Dec 16, 2025
58113e4
Fix CI?
bkontur Dec 16, 2025
3e2b9ea
Update prdoc/pr_10656.prdoc
bkontur Dec 16, 2025
25868a0
Merge branch 'master' into ib-add-tx-storage-inherent
bkontur Dec 16, 2025
1de55ee
Merge branch 'master' into bko-bulletin-para-support
bkontur Dec 16, 2025
041d5e3
Merge branch 'master' into bko-tx-pallet-storage-period
bkontur Dec 16, 2025
3df454a
Merge remote-tracking branch 'origin/bko-bulletin-para-support' into …
bkontur Dec 16, 2025
07a3095
Merge remote-tracking branch 'iulianbarbu/ib-add-tx-storage-inherent'…
bkontur Dec 16, 2025
5e57aec
Fix for polkadot-omni-node-lib with `storage_period`
bkontur Dec 16, 2025
5dec290
Update cumulus/polkadot-omni-node/lib/src/common/spec.rs
bkontur Dec 16, 2025
ad89400
Update cumulus/polkadot-omni-node/lib/src/common/spec.rs
bkontur Dec 16, 2025
fc00032
Merge remote-tracking branch 'iulianbarbu/ib-add-tx-storage-inherent'…
bkontur Dec 16, 2025
4ac1ac2
Merge three partial prdocs from sub-PRs to the one
bkontur Dec 16, 2025
be2493d
Fix import
bkontur Dec 16, 2025
c7cb58f
Update spec.rs - fix import
bkontur Dec 16, 2025
d67fbf7
Add more docs for `transaction-index` feature
bkontur Dec 16, 2025
57a8b1b
Merge remote-tracking branch 'iulianbarbu/ib-add-tx-storage-inherent'…
bkontur Dec 16, 2025
d0e55e8
Removed transaction_storage_runtime_api_call_works
bkontur Dec 16, 2025
ed13621
Merge remote-tracking branch 'origin/bko-tx-pallet-storage-period' in…
bkontur Dec 16, 2025
4315eef
Fix prdoc
EgorPopelyaev Dec 16, 2025
ae24e58
Update cumulus/polkadot-omni-node/lib/src/cli.rs
bkontur Dec 17, 2025
f28a2e2
Merge remote-tracking branch 'iulianbarbu/ib-add-tx-storage-inherent'…
bkontur Dec 17, 2025
b725081
Use directly runtime API, no need for "hacky" workaround `client.call…
bkontur Dec 17, 2025
9f77401
Rename `StoragePeriod` to `RetentionPeriod`
bkontur Dec 17, 2025
f477751
Merge remote-tracking branch 'origin/bko-tx-pallet-storage-period' in…
bkontur Dec 17, 2025
863492f
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Dec 17, 2025
d21fcea
Add TransactionStorageApi to fake_runtime_api for omni node
bkontur Dec 17, 2025
c92a3fd
Update prdoc/pr_10656.prdoc
bkontur Dec 17, 2025
e1943b6
Merge remote-tracking branch 'origin/bko-tx-pallet-storage-period' in…
bkontur Dec 17, 2025
23a5fe2
Merge remote-tracking branch 'origin/master' into bko-bulletin-support
bkontur Dec 17, 2025
9f84180
Merge branch 'master' into bko-bulletin-support
bkontur Dec 17, 2025
811bab2
Merge branch 'master' into bko-bulletin-support
bkontur Dec 17, 2025
f62c9da
Merge branch 'master' into bko-bulletin-support
bkontur Dec 18, 2025
1f53391
Merge branch 'master' into bko-bulletin-support
bkontur Dec 19, 2025
2773a62
Merge branch 'master' into bko-tx-pallet-storage-period
bkontur Dec 19, 2025
10d8ad3
Merge remote-tracking branch 'origin/bko-tx-pallet-storage-period' in…
bkontur Dec 19, 2025
3b575f9
Implement my proposed changes
bkchr Dec 19, 2025
559c93e
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Dec 19, 2025
ba5164f
Merge branch 'master' into bko-bulletin-support
bkchr Dec 22, 2025
518fc65
Fix tests
bkchr Dec 24, 2025
4561e75
Merge branch 'master' into bko-bulletin-support
bkchr Dec 24, 2025
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: 2 additions & 0 deletions Cargo.lock

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

10 changes: 10 additions & 0 deletions cumulus/pallets/parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,13 @@ try-runtime = [
"polkadot-runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
]

# Enables `TransactionIndex` host functions for parachain validation
# without requiring maintenance of a transaction index.
# However, the host environment (polkadot-prepare/execute-worker) still expects these functions to exist,
# so we provide a replacement no-op implementation gated by this feature.
#
# Used by: `validate_block::implementation::validate_block`.
#
# Note: The parachain collator software is expected to use/include `transaction_index::HostFunctions`.
transaction-index = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to be enabled in the omni node.

Also please some docs on what this does would be nice.

Copy link
Contributor Author

@bkontur bkontur Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs added here: d67fbf7

Need to be enabled in the omni node.

The omni node or polkadot-parachain already includes sp_io::SubstrateHostFunctions which contains transaction_index::HostFunctions,, so the collator binaries are ok. The polkadot-prepare/execute workers have problem when validating parachain and calling with the executor "validate_block".

So, now we need to activate this feature just for the bulletin runtimes with:

- cumulus-pallet-parachain-system = { workspace = true }
+ cumulus-pallet-parachain-system = { features = ["transaction-index"], workspace = true }

Please, see desc here: #10370

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, now we need to activate this feature just for the bulletin runtimes with:

Yeah, I'm an idiot 😄

Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ where
sp_io::offchain_index::host_clear.replace_implementation(host_offchain_index_clear),
cumulus_primitives_proof_size_hostfunction::storage_proof_size::host_storage_proof_size
.replace_implementation(host_storage_proof_size),
#[cfg(feature = "transaction-index")]
sp_io::transaction_index::host_index.replace_implementation(host_transaction_index_index),
#[cfg(feature = "transaction-index")]
sp_io::transaction_index::host_renew.replace_implementation(host_transaction_index_renew),
);

let block_data = codec::decode_from_bytes::<ParachainBlockData<B::LazyBlock>>(block_data)
Expand Down Expand Up @@ -230,7 +234,6 @@ where
if overlay.storage(well_known_keys::CODE).is_some() && num_blocks > 1 {
panic!("When applying a runtime upgrade, only one block per PoV is allowed. Received {num_blocks}.")
}

run_with_externalities_and_recorder::<B, _, _>(
&backend,
&mut Default::default(),
Expand Down Expand Up @@ -548,3 +551,21 @@ fn host_default_child_storage_next_key(storage_key: &[u8], key: &[u8]) -> Option
fn host_offchain_index_set(_key: &[u8], _value: &[u8]) {}

fn host_offchain_index_clear(_key: &[u8]) {}

/// Parachain validation does not require maintaining a transaction index,
/// and indexing transactions does **not** contribute to the parachain state.
/// However, the host environment still expects this function to exist,
/// so we provide a no-op implementation.
#[cfg(feature = "transaction-index")]
fn host_transaction_index_index(_extrinsic: u32, _size: u32, _context_hash: [u8; 32]) {
// No-op host function used during parachain validation.
}

/// Parachain validation does not require maintaining a transaction index,
/// and indexing transactions does **not** contribute to the parachain state.
/// However, the host environment still expects this function to exist,
/// so we provide a no-op implementation.
#[cfg(feature = "transaction-index")]
fn host_transaction_index_renew(_extrinsic: u32, _context_hash: [u8; 32]) {
// No-op host function used during parachain validation.
}
1 change: 1 addition & 0 deletions cumulus/polkadot-omni-node/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ sp-statement-store = { workspace = true, default-features = true }
sp-storage = { workspace = true, default-features = true }
sp-timestamp = { workspace = true, default-features = true }
sp-transaction-pool = { workspace = true, default-features = true }
sp-transaction-storage-proof = { workspace = true, default-features = true }
sp-version = { workspace = true, default-features = true }
sp-weights = { workspace = true, default-features = true }
substrate-frame-rpc-system = { workspace = true, default-features = true }
Expand Down
8 changes: 8 additions & 0 deletions cumulus/polkadot-omni-node/lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ pub struct Cli<Config: CliConfig> {
#[arg(long)]
pub enable_statement_store: bool,

/// Enable the transaction storage inherent data provider, which adds
/// proofs of previous transactions to the new blocks.
///
/// This is required for chains that use `pallet-transaction-storage`.
#[arg(long)]
pub enable_tx_storage_idp: bool,

#[arg(skip)]
pub(crate) _phantom: PhantomData<Config>,
}
Expand Down Expand Up @@ -269,6 +276,7 @@ impl<Config: CliConfig> Cli<Config> {
max_pov_percentage: self.run.experimental_max_pov_percentage,
enable_statement_store: self.enable_statement_store,
storage_monitor: self.storage_monitor.clone(),
enable_tx_storage_idp: self.enable_tx_storage_idp,
}
}

Expand Down
6 changes: 6 additions & 0 deletions cumulus/polkadot-omni-node/lib/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use sp_runtime::{
use sp_session::SessionKeys;
use sp_statement_store::runtime_api::ValidateStatement;
use sp_transaction_pool::runtime_api::TaggedTransactionQueue;
use sp_transaction_storage_proof::runtime_api::TransactionStorageApi;
use std::{fmt::Debug, path::PathBuf, str::FromStr};

pub trait NodeBlock:
Expand Down Expand Up @@ -74,6 +75,7 @@ pub trait NodeRuntimeApi<Block: BlockT>:
+ CollectCollationInfo<Block>
+ ValidateStatement<Block>
+ GetParachainInfo<Block>
+ TransactionStorageApi<Block>
+ RelayParentOffsetApi<Block>
+ Sized
{
Expand All @@ -90,6 +92,7 @@ impl<T, Block: BlockT> NodeRuntimeApi<Block> for T where
+ CollectCollationInfo<Block>
+ ValidateStatement<Block>
+ GetParachainInfo<Block>
+ TransactionStorageApi<Block>
{
}

Expand Down Expand Up @@ -129,4 +132,7 @@ pub struct NodeExtraArgs {

/// Parameters for storage monitoring.
pub storage_monitor: sc_storage_monitor::StorageMonitorParams,

/// Enable transaction storage inherent data provider.
pub enable_tx_storage_idp: bool,
}
20 changes: 18 additions & 2 deletions cumulus/polkadot-omni-node/lib/src/common/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use cumulus_client_service::{
use cumulus_primitives_core::{BlockT, GetParachainInfo, ParaId};
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use futures::FutureExt;
use log::info;
use log::{debug, info};
use parachains_common_types::Hash;
use polkadot_primitives::CollatorPair;
use prometheus_endpoint::Registry;
Expand All @@ -61,6 +61,13 @@ use sp_keystore::KeystorePtr;
use sp_runtime::traits::AccountIdConversion;
use std::{future::Future, pin::Pin, sync::Arc, time::Duration};

// Override default idle connection timeout of 10 seconds to give IPFS clients more
// time to query data over Bitswap. This is needed when manually adding our node
// to a swarm of an IPFS node, because the IPFS node doesn't keep any active
// substreams with us and our node closes a connection after
// `idle_connection_timeout`.
const IPFS_WORKAROUND_TIMEOUT: Duration = Duration::from_secs(3600);

pub(crate) trait BuildImportQueue<
Block: BlockT,
RuntimeApi,
Expand Down Expand Up @@ -326,7 +333,16 @@ pub(crate) trait NodeSpec: BaseNodeSpec {
Net: NetworkBackend<Self::Block, Hash>,
{
let fut = async move {
let parachain_config = prepare_node_config(parachain_config);
let mut parachain_config = prepare_node_config(parachain_config);

// Some additional customization in relation to starting the node as an ipfs server.
if parachain_config.network.idle_connection_timeout < IPFS_WORKAROUND_TIMEOUT &&
parachain_config.network.ipfs_server
{
debug!("Overriding `config.network.idle_connection_timeout` to allow long-lived connections with IPFS nodes. The old value: {:?} is replaced by: {:?}.", parachain_config.network.idle_connection_timeout, IPFS_WORKAROUND_TIMEOUT);
parachain_config.network.idle_connection_timeout = IPFS_WORKAROUND_TIMEOUT;
}

let parachain_public_addresses = parachain_config.network.public_addresses.clone();
let parachain_fork_id = parachain_config.chain_spec.fork_id().map(ToString::to_string);
let advertise_non_global_ips = parachain_config.network.allow_non_globals_in_dht;
Expand Down
6 changes: 6 additions & 0 deletions cumulus/polkadot-omni-node/lib/src/fake_runtime_api/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ macro_rules! impl_node_runtime_apis {
unimplemented!()
}
}

impl sp_transaction_storage_proof::runtime_api::TransactionStorageApi<$block> for $runtime {
fn retention_period() -> sp_runtime::traits::NumberFor<$block> {
unimplemented!()
}
}
}
};
}
Expand Down
40 changes: 37 additions & 3 deletions cumulus/polkadot-omni-node/lib/src/nodes/aura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ use sp_runtime::{
app_crypto::AppCrypto,
traits::{Block as BlockT, Header as HeaderT, UniqueSaturatedInto},
};
use sp_transaction_storage_proof::runtime_api::TransactionStorageApi;
use std::{marker::PhantomData, sync::Arc, time::Duration};

struct Verifier<Block, Client, AuraId> {
Expand Down Expand Up @@ -596,8 +597,25 @@ where
);

let client_for_aura = client.clone();
let enable_tx_storage_idp = node_extra_args.enable_tx_storage_idp;
let client_clone = client.clone();
let params = SlotBasedParams {
create_inherent_data_providers: move |_, ()| async move { Ok(()) },
create_inherent_data_providers: move |parent, ()| {
let client_clone = client_clone.clone();
async move {
if enable_tx_storage_idp {
let storage_proof =
sp_transaction_storage_proof::registration::new_data_provider(
&*client_clone,
&parent,
client_clone.runtime_api().retention_period(parent)?,
)?;
Ok(vec![storage_proof])
} else {
Ok(vec![])
}
}
},
block_import,
para_client: client.clone(),
para_backend: backend.clone(),
Expand All @@ -623,7 +641,6 @@ where

// We have a separate function only to be able to use `docify::export` on this piece of
// code.

Self::launch_slot_based_collator(params);

Ok(())
Expand Down Expand Up @@ -721,10 +738,27 @@ where
client.clone(),
);

let enable_tx_storage_idp = node_extra_args.enable_tx_storage_idp;
let client_clone = client.clone();
let params = aura::ParamsWithExport {
export_pov: node_extra_args.export_pov,
params: AuraParams {
create_inherent_data_providers: move |_, ()| async move { Ok(()) },
create_inherent_data_providers: move |parent, ()| {
let client_clone = client_clone.clone();
async move {
if enable_tx_storage_idp {
let storage_proof =
sp_transaction_storage_proof::registration::new_data_provider(
&*client_clone,
&parent,
client_clone.runtime_api().retention_period(parent)?,
)?;
Ok(vec![storage_proof])
} else {
Ok(vec![])
}
}
},
block_import,
para_client: client.clone(),
para_backend: backend,
Expand Down
29 changes: 29 additions & 0 deletions prdoc/pr_10662.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
title: "Bulletin as parachain missing features"
doc:
- audience: Runtime Dev
description: |-
This PR adds the required support and features for running Bulletin as a parachain. It is a top-level PR that merges three partial features:

1. Add transaction_index::HostFunctions with NO-OP impl to the cumulus ParachainSystem validate_block for polkadot-prepare/execute-worker
2. Add custom inherent provider for pallet-transaction-storage to omni node
3. Configurable RetentionPeriod feeded to the inherent provider over runtime API

This PR also refactors `pallet-transaction-storage` and `sp-transaction-storage-proof` (the `new_data_provider` inherent provider), both of which rely on a hard-coded `DEFAULT_RETENTION_PERIOD`. This PR:
- adds a new configurable argument `retention_period` to the `new_data_provider`
- introduces the `TransactionStorageApi::retention_period` runtime API, which the runtime can specify arbitrary
- provides an example of using `new_data_provider`, with the node client calling the runtime API when constructing inherent provider data
- audience: [ Node Dev, Node Operator ]
description: |
* Node developers/operators could enable the transaction storage inherent data provider setup by using --enable-tx-storage-idp flag. This is especially useful in the context of bulletin chain.
* Node developers will set up the network `idle_connection_timeout` to 1h when using `--ipfs-server` flag, again, useful in the context of bulletin chain.
crates:
- name: cumulus-pallet-parachain-system
bump: patch
- name: polkadot-omni-node-lib
bump: major
- name: sp-inherents
bump: minor
- name: sp-transaction-storage-proof
bump: major
- name: pallet-transaction-storage
bump: major
2 changes: 2 additions & 0 deletions substrate/bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_api::ProvideRuntimeApi;
use sp_core::crypto::Pair;
use sp_runtime::{generic, traits::Block as BlockT, SaturatedConversion};
use sp_transaction_storage_proof::runtime_api::TransactionStorageApi;
use std::{path::Path, sync::Arc};

/// Host functions required for kitchensink runtime and Substrate node.
Expand Down Expand Up @@ -631,6 +632,7 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
sp_transaction_storage_proof::registration::new_data_provider(
&*client_clone,
&parent,
client_clone.runtime_api().retention_period(parent)?,
)?;

Ok((slot, timestamp, storage_proof))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"transactionStorage": {
"byteFee": 10,
"entryFee": 1000,
"storagePeriod": 100800
"retentionPeriod": 100800
},
"allianceMotion": {
"members": []
Expand Down
6 changes: 6 additions & 0 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3776,6 +3776,12 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
}
}

impl sp_transaction_storage_proof::runtime_api::TransactionStorageApi<Block> for Runtime {
fn retention_period() -> NumberFor<Block> {
TransactionStorage::retention_period()
}
}

#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/transaction-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ std = [
"sp-inherents/std",
"sp-io/std",
"sp-runtime/std",
"sp-transaction-storage-proof/std",
"tracing/std",
]
runtime-benchmarks = [
Expand Down
10 changes: 5 additions & 5 deletions substrate/frame/transaction-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Indexes transactions and manages storage proofs.

Allows storing arbitrary data on the chain. Data is automatically removed after `StoragePeriod` blocks, unless the
storage is renewed. Validators must submit proof of storing a random chunk of data for block `N - StoragePeriod` when
Allows storing arbitrary data on the chain. Data is automatically removed after `RetentionPeriod` blocks, unless the
storage is renewed. Validators must submit proof of storing a random chunk of data for block `N - RetentionPeriod` when
producing block `N`.

# Running a chain
Expand All @@ -17,7 +17,7 @@ cargo run --release -- build-spec --chain=local > sc_init.json
```

Edit the json chain spec file to customise the chain. The storage chain genesis params are configured in the
`transactionStorage` section. Note that `storagePeriod` is specified in blocks and changing it also requires code
`transactionStorage` section. Note that `retentionPeriod` is specified in blocks and changing it also requires code
changes at the moment.

Build a raw spec from the init spec.
Expand All @@ -34,7 +34,7 @@ cargo run --release -- --chain=sc.json -d /tmp/bob --storage-chain --keep-blocks
```

`--storage-chain` enables transaction indexing. `--keep-blocks=100800` enables block pruning. The value here should be
greater or equal than the storage period. `--ipfs-server` enables serving stored content over IPFS.
greater or equal than the retention period. `--ipfs-server` enables serving stored content over IPFS.

Once the network is started, any other joining nodes need to sync with `--sync=fast`. Regular sync will fail because
block pruning removes old blocks. The chain does not keep full block history.
Expand Down Expand Up @@ -78,7 +78,7 @@ ipfs swarm connect <substrate peer address>
ipfs block get /ipfs/<CID> > kitten.jpeg
```

To renew data and prevent it from being disposed after the storage period, use `transactionStorage.renew(block, index)`
To renew data and prevent it from being disposed after the retention period, use `transactionStorage.renew(block, index)`
where `block` is the block number of the previous store or renew transaction, and index is the index of that transaction
in the block.

Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/transaction-storage/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mod benchmarks {
vec![0u8; T::MaxTransactionSize::get() as usize],
)?;
}
run_to_block::<T>(StoragePeriod::<T>::get() + BlockNumberFor::<T>::one());
run_to_block::<T>(crate::Pallet::<T>::retention_period() + BlockNumberFor::<T>::one());
let encoded_proof = proof();
let proof = TransactionStorageProof::decode(&mut &*encoded_proof).unwrap();

Expand Down
Loading
Loading