Skip to content

Conversation

@bkontur
Copy link
Contributor

@bkontur bkontur commented Dec 16, 2025

Relates to: paritytech/polkadot-bulletin-chain#60

Context/Problem

This PR refactors pallet-transaction-storage and sp-transaction-storage-proof (the new_data_provider inherent provider), both of which rely on a hard-coded DEFAULT_STORAGE_PERIOD.

The new_data_provider uses a hard-coded pub const DEFAULT_STORAGE_PERIOD: u32 = 100800;, which forces the runtime to use the same value. This value corresponds to 7 days for 6-second blocks. We want to make this constant configurable and driven by the runtime — exposed via a runtime API. For example, if we switch to 2-second blocks but still want to keep the 7-day period, we won’t need to coordinate and restart the collators with a new hard-coded constant and so on. Basically, we want to have possibility to set this constant with arbitrary value without affecting the collators or anything.

Solution

This PR:

  • adds a new argument storage_period to the new_data_provider
  • introduces the TransactionStorageApi::storage_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
    • I didn't want to complicate the node client traits, so retrieve_storage_period uses just direct call_api_at("TransactionStorageApi_storage_period", at_block)
      • Potentially, we could extend pub trait IndexedBody, but anyway at some point we need to call the runtime API.

TODO

Follow-up

It will be used for Bulletin setup here: #10494

@bkontur bkontur requested a review from a team as a code owner December 16, 2025 01:21
@bkontur bkontur added T0-node This PR/Issue is related to the topic “node”. T1-FRAME This PR/Issue is related to core FRAME, the framework. labels Dec 16, 2025
@bkontur bkontur requested a review from bkchr December 16, 2025 01:21
@bkontur
Copy link
Contributor Author

bkontur commented Dec 16, 2025

/cmd prdoc --audience runtime_dev node_dev --bump patch

@bkontur
Copy link
Contributor Author

bkontur commented Dec 16, 2025

/cmd fmt

@bkontur bkontur changed the title [pallet-transaction-storage] Configurable StoragePeriod [pallet-transaction-storage] Configurable RetentionPeriod Dec 17, 2025
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/20301782832
Failed job name: fmt

@bkontur
Copy link
Contributor Author

bkontur commented Dec 17, 2025

/cmd fmt

github-merge-queue bot pushed a commit that referenced this pull request Dec 24, 2025
Relates to:
paritytech/polkadot-bulletin-chain#74

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/PRs,
which can also be reviewed/merged separately:

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

---------

Signed-off-by: Iulian Barbu <[email protected]>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Iulian Barbu <[email protected]>
Co-authored-by: Iulian Barbu <[email protected]>
Co-authored-by: EgorPopelyaev <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T0-node This PR/Issue is related to the topic “node”. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants