From c8d48ffd4499bf901da18264e4fbe871bd60de3d Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 24 Mar 2026 09:51:01 +0100 Subject: [PATCH 1/9] Rename crates for crates.io publishing Rename `pallet-transaction-storage` to `pallet-bulletin-transaction-storage` and `transaction-storage-primitives` to `bulletin-transaction-storage-primitives` to prepare for publishing to crates.io. Uses workspace `package` aliases so all internal consumers continue referencing the old dependency keys unchanged. --- Cargo.lock | 60 +++++++++---------- Cargo.toml | 4 +- pallets/transaction-storage/Cargo.toml | 4 +- .../transaction-storage/primitives/Cargo.toml | 2 +- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8584ab2f1..447cb95f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2069,6 +2069,7 @@ dependencies = [ "bp-runtime", "bp-test-utils", "bridge-runtime-common", + "bulletin-transaction-storage-primitives", "frame-benchmarking", "frame-executive", "frame-support", @@ -2084,6 +2085,7 @@ dependencies = [ "pallet-bridge-messages", "pallet-bridge-parachains", "pallet-bridge-relayers", + "pallet-bulletin-transaction-storage", "pallet-grandpa", "pallet-offences", "pallet-proxy", @@ -2094,7 +2096,6 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "pallet-transaction-storage", "pallet-utility", "pallet-validator-set", "pallet-xcm", @@ -2128,7 +2129,17 @@ dependencies = [ "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", - "transaction-storage-primitives", +] + +[[package]] +name = "bulletin-transaction-storage-primitives" +version = "0.1.0" +dependencies = [ + "cid", + "parity-scale-codec", + "scale-info", + "sp-io", + "tracing", ] [[package]] @@ -2156,6 +2167,7 @@ dependencies = [ name = "bulletin-westend-runtime" version = "0.1.0" dependencies = [ + "bulletin-transaction-storage-primitives", "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", @@ -2176,6 +2188,7 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-bulletin-transaction-storage", "pallet-collator-selection", "pallet-message-queue", "pallet-session", @@ -2184,7 +2197,6 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "pallet-transaction-storage", "pallet-utility", "pallet-xcm", "pallet-xcm-benchmarks", @@ -2219,7 +2231,6 @@ dependencies = [ "substrate-wasm-builder", "testnet-parachains-constants", "tracing", - "transaction-storage-primitives", "westend-runtime-constants", "xcm-runtime-apis", ] @@ -8214,6 +8225,20 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-bulletin-transaction-storage" +version = "0.1.0" +dependencies = [ + "array-bytes 6.2.3", + "bulletin-transaction-storage-primitives", + "pallets-common", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", + "sp-transaction-storage-proof", + "tracing", +] + [[package]] name = "pallet-collator-selection" version = "9.0.0" @@ -9099,20 +9124,6 @@ dependencies = [ "sp-weights", ] -[[package]] -name = "pallet-transaction-storage" -version = "4.0.0-dev" -dependencies = [ - "array-bytes 6.2.3", - "pallets-common", - "parity-scale-codec", - "polkadot-sdk-frame", - "scale-info", - "sp-transaction-storage-proof", - "tracing", - "transaction-storage-primitives", -] - [[package]] name = "pallet-treasury" version = "27.0.0" @@ -9766,9 +9777,9 @@ dependencies = [ "frame-try-runtime", "futures", "jsonrpsee", + "pallet-bulletin-transaction-storage", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "pallet-transaction-storage", "polkadot-primitives", "sc-basic-authorship", "sc-chain-spec", @@ -15760,17 +15771,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "transaction-storage-primitives" -version = "0.1.0" -dependencies = [ - "cid", - "parity-scale-codec", - "scale-info", - "sp-io", - "tracing", -] - [[package]] name = "trie-db" version = "0.31.0" diff --git a/Cargo.toml b/Cargo.toml index a92fc60dd..cd08705f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,10 +37,10 @@ westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk. bulletin-polkadot-runtime = { path = "runtimes/bulletin-polkadot" } bulletin-westend-runtime = { path = "runtimes/bulletin-westend" } pallet-relayer-set = { path = "pallets/relayer-set", default-features = false } -pallet-transaction-storage = { path = "pallets/transaction-storage", default-features = false } +pallet-transaction-storage = { package = "pallet-bulletin-transaction-storage", path = "pallets/transaction-storage", default-features = false } pallet-validator-set = { path = "pallets/validator-set", default-features = false } pallets-common = { path = "pallets/common", default-features = false } -transaction-storage-primitives = { path = "pallets/transaction-storage/primitives", default-features = false } +transaction-storage-primitives = { package = "bulletin-transaction-storage-primitives", path = "pallets/transaction-storage/primitives", default-features = false } # Polkadot SDK crates (shared git revision) frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } diff --git a/pallets/transaction-storage/Cargo.toml b/pallets/transaction-storage/Cargo.toml index 2c355d0db..f921c3293 100644 --- a/pallets/transaction-storage/Cargo.toml +++ b/pallets/transaction-storage/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "pallet-transaction-storage" -version = "4.0.0-dev" +name = "pallet-bulletin-transaction-storage" +version = "0.1.0" authors = ["Parity Technologies "] edition.workspace = true license = "Apache-2.0" diff --git a/pallets/transaction-storage/primitives/Cargo.toml b/pallets/transaction-storage/primitives/Cargo.toml index 187614591..00bdbfee3 100644 --- a/pallets/transaction-storage/primitives/Cargo.toml +++ b/pallets/transaction-storage/primitives/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "transaction-storage-primitives" +name = "bulletin-transaction-storage-primitives" version = "0.1.0" authors.workspace = true edition.workspace = true From 8f258e7ca2c5a75e9136ce01e2cb4d350665c8cc Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 24 Mar 2026 09:53:33 +0100 Subject: [PATCH 2/9] Update homepage to point to this repo Add `homepage` to workspace package metadata and use `homepage.workspace = true` in pallet-bulletin-transaction-storage, replacing the old substrate.io link. --- Cargo.toml | 1 + pallets/transaction-storage/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cd08705f1..e75b2e668 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace.package] authors = ["Parity Technologies "] edition = "2021" +homepage = "https://github.com/paritytech/polkadot-bulletin-chain" repository = "https://github.com/paritytech/polkadot-bulletin-chain.git" [workspace.dependencies] diff --git a/pallets/transaction-storage/Cargo.toml b/pallets/transaction-storage/Cargo.toml index f921c3293..e1ed1e0ac 100644 --- a/pallets/transaction-storage/Cargo.toml +++ b/pallets/transaction-storage/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] edition.workspace = true license = "Apache-2.0" -homepage = "https://substrate.io" +homepage.workspace = true repository.workspace = true description = "Storage chain pallet" readme = "README.md" From b41301da8d6be0e3e6ae97a60ebb4e2af3f9e14a Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 24 Mar 2026 10:27:30 +0100 Subject: [PATCH 3/9] Fix CI to use renamed pallet-bulletin-transaction-storage crate --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4a73bdb7a..a756ee289 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -131,9 +131,9 @@ jobs: cargo test -p pallet-relayer-set --features=runtime-benchmarks cargo test -p pallet-validator-set cargo test -p pallet-validator-set --features=runtime-benchmarks - cargo test -p pallet-transaction-storage + cargo test -p pallet-bulletin-transaction-storage # Bench test is skipped intentionally (running too long and anyway, we are doing fresh weights) - cargo test -p pallet-transaction-storage --features=runtime-benchmarks -- --skip bench_check_proof + cargo test -p pallet-bulletin-transaction-storage --features=runtime-benchmarks -- --skip bench_check_proof - name: Run (Polkadot) runtime tests run: | From 66ebfee656a88f6d043160b5267568b2257eeafd Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 26 Mar 2026 10:54:32 +0100 Subject: [PATCH 4/9] Inline westend/asset-hub emulated chain definitions Remove `westend-emulated-chain` and `asset-hub-westend-emulated-chain` dependencies since they are not published to crates.io. Instead, define the emulated chain configurations locally in the integration tests under `src/chains/`, with simplified genesis configs containing only what the Bulletin XCM tests need. --- Cargo.lock | 47 +------ Cargo.toml | 4 +- .../integration-tests/Cargo.toml | 17 ++- .../src/chains/asset_hub_westend.rs | 101 +++++++++++++++ .../integration-tests/src/chains/mod.rs | 28 ++++ .../integration-tests/src/chains/westend.rs | 120 ++++++++++++++++++ .../integration-tests/src/lib.rs | 5 +- .../src/tests/reserve_transfers.rs | 6 +- 8 files changed, 277 insertions(+), 51 deletions(-) create mode 100644 runtimes/bulletin-westend/integration-tests/src/chains/asset_hub_westend.rs create mode 100644 runtimes/bulletin-westend/integration-tests/src/chains/mod.rs create mode 100644 runtimes/bulletin-westend/integration-tests/src/chains/westend.rs diff --git a/Cargo.lock b/Cargo.lock index 447cb95f3..d7d4cd2ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1005,25 +1005,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" -[[package]] -name = "asset-hub-westend-emulated-chain" -version = "0.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?rev=f9df32360c6c22747f60b3ff58243890eecafc8e#f9df32360c6c22747f60b3ff58243890eecafc8e" -dependencies = [ - "asset-hub-westend-runtime", - "bp-bridge-hub-westend", - "cumulus-primitives-core", - "emulated-integration-tests-common", - "frame-support", - "parachains-common", - "sp-core", - "sp-keyring", - "staging-xcm", - "staging-xcm-builder", - "testnet-parachains-constants", - "westend-emulated-chain", -] - [[package]] name = "asset-hub-westend-runtime" version = "0.15.0" @@ -2146,20 +2127,25 @@ dependencies = [ name = "bulletin-westend-integration-tests" version = "0.1.0" dependencies = [ - "asset-hub-westend-emulated-chain", "asset-hub-westend-runtime", "bulletin-westend-runtime", "cumulus-primitives-core", "emulated-integration-tests-common", "frame-support", "parachains-common", + "polkadot-primitives", + "sc-consensus-grandpa", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-keyring", "sp-runtime", "staging-xcm", "staging-xcm-executor", - "westend-emulated-chain", + "testnet-parachains-constants", "westend-runtime", + "westend-runtime-constants", "xcm-emulator", ] @@ -16671,25 +16657,6 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" -[[package]] -name = "westend-emulated-chain" -version = "0.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?rev=f9df32360c6c22747f60b3ff58243890eecafc8e#f9df32360c6c22747f60b3ff58243890eecafc8e" -dependencies = [ - "emulated-integration-tests-common", - "pallet-staking", - "parachains-common", - "polkadot-primitives", - "sc-consensus-grandpa", - "sp-authority-discovery", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-core", - "sp-runtime", - "westend-runtime", - "westend-runtime-constants", -] - [[package]] name = "westend-runtime" version = "7.0.0" diff --git a/Cargo.toml b/Cargo.toml index e75b2e668..22797aa1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,10 +74,12 @@ sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e" } sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } +sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } @@ -139,10 +141,8 @@ xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = " parachains-common = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } # XCM emulator framework for integration tests -asset-hub-westend-emulated-chain = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = true } asset-hub-westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = true } emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = true } -westend-emulated-chain = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = true } westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = true } xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = true } diff --git a/runtimes/bulletin-westend/integration-tests/Cargo.toml b/runtimes/bulletin-westend/integration-tests/Cargo.toml index 045c1e84d..2d60ef854 100644 --- a/runtimes/bulletin-westend/integration-tests/Cargo.toml +++ b/runtimes/bulletin-westend/integration-tests/Cargo.toml @@ -19,16 +19,23 @@ xcm-executor = { workspace = true, default-features = true } xcm-emulator = { workspace = true } emulated-integration-tests-common = { workspace = true } -# Emulated chains from Polkadot SDK -westend-emulated-chain = { workspace = true } +# Runtimes used in emulated chains (defined locally in src/chains/) westend-runtime = { workspace = true } -asset-hub-westend-emulated-chain = { workspace = true } asset-hub-westend-runtime = { workspace = true } +# Dependencies for local chain definitions +sc-consensus-grandpa = { workspace = true } +sp-consensus-babe = { workspace = true, default-features = true } +sp-consensus-beefy = { workspace = true, default-features = true } +sp-authority-discovery = { workspace = true, default-features = true } +polkadot-primitives = { workspace = true, default-features = true } +westend-runtime-constants = { workspace = true, default-features = true } +testnet-parachains-constants = { workspace = true, default-features = true } +parachains-common = { workspace = true, default-features = true } + # Local runtime bulletin-westend-runtime = { workspace = true, default-features = true } cumulus-primitives-core = { workspace = true, default-features = true } -parachains-common = { workspace = true, default-features = true } [features] runtime-benchmarks = [ @@ -37,7 +44,9 @@ runtime-benchmarks = [ "cumulus-primitives-core/runtime-benchmarks", "frame-support/runtime-benchmarks", "parachains-common/runtime-benchmarks", + "polkadot-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "westend-runtime-constants/runtime-benchmarks", "westend-runtime/runtime-benchmarks", "xcm-executor/runtime-benchmarks", "xcm/runtime-benchmarks", diff --git a/runtimes/bulletin-westend/integration-tests/src/chains/asset_hub_westend.rs b/runtimes/bulletin-westend/integration-tests/src/chains/asset_hub_westend.rs new file mode 100644 index 000000000..0d3dbe02c --- /dev/null +++ b/runtimes/bulletin-westend/integration-tests/src/chains/asset_hub_westend.rs @@ -0,0 +1,101 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Emulated Asset Hub Westend parachain definition. +//! +//! Based on upstream `asset-hub-westend-emulated-chain` from polkadot-sdk, +//! simplified for Bulletin chain integration tests (no foreign assets, no +//! Snowbridge, no Penpal configs). + +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, collators, impl_accounts_helpers_for_parachain, + impl_assert_events_helpers_for_parachain, impl_xcm_helpers_for_parachain, impls::Parachain, + xcm_emulator::decl_test_parachains, SAFE_XCM_VERSION, +}; +use frame_support::traits::OnInitialize; +use parachains_common::Balance; +use sp_core::storage::Storage; + +pub const PARA_ID: u32 = 1000; +pub const ED: Balance = testnet_parachains_constants::westend::currency::EXISTENTIAL_DEPOSIT; + +fn genesis() -> Storage { + let genesis_config = asset_hub_westend_runtime::RuntimeGenesisConfig { + system: asset_hub_westend_runtime::SystemConfig::default(), + balances: asset_hub_westend_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), + ..Default::default() + }, + parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { + parachain_id: PARA_ID.into(), + ..Default::default() + }, + collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig { + invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: ED * 16, + ..Default::default() + }, + session: asset_hub_westend_runtime::SessionConfig { + keys: collators::invulnerables() + .into_iter() + .map(|(acc, aura)| { + (acc.clone(), acc, asset_hub_westend_runtime::SessionKeys { aura }) + }) + .collect(), + ..Default::default() + }, + polkadot_xcm: asset_hub_westend_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + ..Default::default() + }; + + build_genesis_storage( + &genesis_config, + asset_hub_westend_runtime::WASM_BINARY + .expect("WASM binary was not built, please build it!"), + ) +} + +// AssetHubWestend parachain declaration +decl_test_parachains! { + pub struct AssetHubWestend { + genesis = genesis(), + on_init = { + asset_hub_westend_runtime::AuraExt::on_initialize(1); + }, + runtime = asset_hub_westend_runtime, + core = { + XcmpMessageHandler: asset_hub_westend_runtime::XcmpQueue, + LocationToAccountId: asset_hub_westend_runtime::xcm_config::LocationToAccountId, + ParachainInfo: asset_hub_westend_runtime::ParachainInfo, + MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, + AdditionalInherentCode: (), + }, + pallets = { + PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm, + Balances: asset_hub_westend_runtime::Balances, + Assets: asset_hub_westend_runtime::Assets, + ForeignAssets: asset_hub_westend_runtime::ForeignAssets, + PoolAssets: asset_hub_westend_runtime::PoolAssets, + AssetConversion: asset_hub_westend_runtime::AssetConversion, + } + }, +} + +impl_accounts_helpers_for_parachain!(AssetHubWestend); +impl_assert_events_helpers_for_parachain!(AssetHubWestend); +impl_xcm_helpers_for_parachain!(AssetHubWestend); diff --git a/runtimes/bulletin-westend/integration-tests/src/chains/mod.rs b/runtimes/bulletin-westend/integration-tests/src/chains/mod.rs new file mode 100644 index 000000000..566446852 --- /dev/null +++ b/runtimes/bulletin-westend/integration-tests/src/chains/mod.rs @@ -0,0 +1,28 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Emulated chain definitions for XCM integration tests. +//! +//! These modules define the Westend relay chain and Asset Hub Westend parachain +//! for use with the xcm-emulator framework. They are inlined here (rather than +//! depending on the upstream `westend-emulated-chain` and +//! `asset-hub-westend-emulated-chain` crates) because those crates are not +//! published to crates.io. + +pub mod asset_hub_westend; +pub mod westend; + +pub use asset_hub_westend::AssetHubWestend; +pub use westend::Westend; diff --git a/runtimes/bulletin-westend/integration-tests/src/chains/westend.rs b/runtimes/bulletin-westend/integration-tests/src/chains/westend.rs new file mode 100644 index 000000000..78c87738c --- /dev/null +++ b/runtimes/bulletin-westend/integration-tests/src/chains/westend.rs @@ -0,0 +1,120 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Emulated Westend relay chain definition. +//! +//! Based on upstream `westend-emulated-chain` from polkadot-sdk, simplified for +//! Bulletin chain integration tests. + +use emulated_integration_tests_common::{ + accounts, build_genesis_storage, get_host_config, impl_accounts_helpers_for_relay_chain, + impl_assert_events_helpers_for_relay_chain, impl_hrmp_channels_helpers_for_relay_chain, + impl_send_transact_helpers_for_relay_chain, validators, xcm_emulator::decl_test_relay_chains, +}; +use parachains_common::Balance; +use polkadot_primitives::{AssignmentId, ValidatorId}; +use sc_consensus_grandpa::AuthorityId as GrandpaId; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_babe::AuthorityId as BabeId; +use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; +use sp_core::storage::Storage; +use westend_runtime_constants::currency::UNITS as WND; + +const ENDOWMENT: Balance = 1_000_000 * WND; + +fn session_keys( + babe: BabeId, + grandpa: GrandpaId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, +) -> westend_runtime::SessionKeys { + westend_runtime::SessionKeys { + babe, + grandpa, + para_validator, + para_assignment, + authority_discovery, + beefy, + } +} + +fn genesis() -> Storage { + let genesis_config = westend_runtime::RuntimeGenesisConfig { + system: westend_runtime::SystemConfig::default(), + balances: westend_runtime::BalancesConfig { + balances: accounts::init_balances().iter().cloned().map(|k| (k, ENDOWMENT)).collect(), + ..Default::default() + }, + session: westend_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + ), + ) + }) + .collect::>(), + ..Default::default() + }, + babe: westend_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: westend_runtime::BABE_GENESIS_EPOCH_CONFIG, + ..Default::default() + }, + configuration: westend_runtime::ConfigurationConfig { config: get_host_config() }, + ..Default::default() + }; + + build_genesis_storage(&genesis_config, westend_runtime::WASM_BINARY.unwrap()) +} + +// Westend relay chain declaration +decl_test_relay_chains! { + #[api_version(15)] + pub struct Westend { + genesis = genesis(), + on_init = (), + runtime = westend_runtime, + core = { + SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, + }, + pallets = { + XcmPallet: westend_runtime::XcmPallet, + Sudo: westend_runtime::Sudo, + Balances: westend_runtime::Balances, + Treasury: westend_runtime::Treasury, + AssetRate: westend_runtime::AssetRate, + Hrmp: westend_runtime::Hrmp, + Identity: westend_runtime::Identity, + IdentityMigrator: westend_runtime::IdentityMigrator, + } + }, +} + +impl_accounts_helpers_for_relay_chain!(Westend); +impl_assert_events_helpers_for_relay_chain!(Westend); +impl_hrmp_channels_helpers_for_relay_chain!(Westend); +impl_send_transact_helpers_for_relay_chain!(Westend); diff --git a/runtimes/bulletin-westend/integration-tests/src/lib.rs b/runtimes/bulletin-westend/integration-tests/src/lib.rs index 358dd9da1..d2f30d70f 100644 --- a/runtimes/bulletin-westend/integration-tests/src/lib.rs +++ b/runtimes/bulletin-westend/integration-tests/src/lib.rs @@ -21,8 +21,10 @@ #[cfg(test)] mod tests; -use asset_hub_westend_emulated_chain::AssetHubWestend; +mod chains; + use bulletin_westend_runtime::SessionKeys; +use chains::{AssetHubWestend, Westend}; use cumulus_primitives_core::ParaId; use emulated_integration_tests_common::{ accounts::{self, ALICE, BOB}, @@ -34,7 +36,6 @@ use frame_support::traits::OnInitialize; use parachains_common::{AuraId, Balance}; use sp_core::sr25519; use sp_keyring::Sr25519Keyring; -use westend_emulated_chain::Westend; use xcm_emulator::{ decl_test_networks, decl_test_sender_receiver_accounts_parameter_types, Parachain, }; diff --git a/runtimes/bulletin-westend/integration-tests/src/tests/reserve_transfers.rs b/runtimes/bulletin-westend/integration-tests/src/tests/reserve_transfers.rs index ed0406349..d4799bdcc 100644 --- a/runtimes/bulletin-westend/integration-tests/src/tests/reserve_transfers.rs +++ b/runtimes/bulletin-westend/integration-tests/src/tests/reserve_transfers.rs @@ -20,10 +20,10 @@ //! 2. WND reserve transfers from Bulletin back to Asset Hub (DestinationReserve) use crate::{ - AssetHubWestendParaReceiver, AssetHubWestendParaSender, BulletinWestend, - BulletinWestendParaReceiver, BulletinWestendParaSender, WestendMockNet, BULLETIN_PARA_ID, + chains::AssetHubWestend, AssetHubWestendParaReceiver, AssetHubWestendParaSender, + BulletinWestend, BulletinWestendParaReceiver, BulletinWestendParaSender, WestendMockNet, + BULLETIN_PARA_ID, }; -use asset_hub_westend_emulated_chain::AssetHubWestend; use frame_support::{ assert_ok, traits::fungible::{Inspect, Mutate}, From f689f6d2a1035eeaa065f2f25567c97b714f7435 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 26 Mar 2026 11:05:28 +0100 Subject: [PATCH 5/9] Rename local crates to use bulletin- prefix without package aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use full crate names directly instead of package aliases: - pallets-common → bulletin-pallets-common - pallet-transaction-storage → pallet-bulletin-transaction-storage - transaction-storage-primitives → bulletin-transaction-storage-primitives Rename weight files and update all Cargo.toml and Rust source references accordingly. --- Cargo.lock | 32 +++++++++---------- Cargo.toml | 6 ++-- node/Cargo.toml | 6 ++-- node/src/service.rs | 4 +-- pallets/common/Cargo.toml | 2 +- pallets/transaction-storage/Cargo.toml | 12 +++---- pallets/transaction-storage/src/lib.rs | 2 +- pallets/transaction-storage/src/migrations.rs | 2 +- pallets/transaction-storage/src/mock.rs | 10 +++--- pallets/transaction-storage/src/tests.rs | 2 +- pallets/transaction-storage/src/weights.rs | 8 ++--- pallets/validator-set/Cargo.toml | 8 ++--- pallets/validator-set/src/mock.rs | 2 +- runtimes/bulletin-polkadot/Cargo.toml | 20 ++++++------ runtimes/bulletin-polkadot/src/lib.rs | 32 +++++++++---------- runtimes/bulletin-polkadot/src/weights/mod.rs | 2 +- ...=> pallet_bulletin_transaction_storage.rs} | 8 ++--- runtimes/bulletin-polkadot/src/xcm_config.rs | 8 ++--- runtimes/bulletin-polkadot/tests/tests.rs | 14 ++++---- runtimes/bulletin-westend/Cargo.toml | 20 ++++++------ runtimes/bulletin-westend/src/lib.rs | 12 +++---- runtimes/bulletin-westend/src/storage.rs | 12 +++---- runtimes/bulletin-westend/src/weights/mod.rs | 2 +- ...=> pallet_bulletin_transaction_storage.rs} | 8 ++--- runtimes/bulletin-westend/tests/tests.rs | 24 +++++++------- 25 files changed, 129 insertions(+), 129 deletions(-) rename runtimes/bulletin-polkadot/src/weights/{pallet_transaction_storage.rs => pallet_bulletin_transaction_storage.rs} (97%) rename runtimes/bulletin-westend/src/weights/{pallet_transaction_storage.rs => pallet_bulletin_transaction_storage.rs} (97%) diff --git a/Cargo.lock b/Cargo.lock index d7d4cd2ba..500cf174c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2037,6 +2037,18 @@ dependencies = [ "semver 0.6.0", ] +[[package]] +name = "bulletin-pallets-common" +version = "0.1.0" +dependencies = [ + "pallet-proxy", + "pallet-sudo", + "pallet-utility", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + [[package]] name = "bulletin-polkadot-runtime" version = "1.0.0" @@ -2050,6 +2062,7 @@ dependencies = [ "bp-runtime", "bp-test-utils", "bridge-runtime-common", + "bulletin-pallets-common", "bulletin-transaction-storage-primitives", "frame-benchmarking", "frame-executive", @@ -2081,7 +2094,6 @@ dependencies = [ "pallet-validator-set", "pallet-xcm", "pallet-xcm-bridge-hub", - "pallets-common", "parachains-common", "parity-scale-codec", "scale-info", @@ -2153,6 +2165,7 @@ dependencies = [ name = "bulletin-westend-runtime" version = "0.1.0" dependencies = [ + "bulletin-pallets-common", "bulletin-transaction-storage-primitives", "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -2186,7 +2199,6 @@ dependencies = [ "pallet-utility", "pallet-xcm", "pallet-xcm-benchmarks", - "pallets-common", "parachains-common", "parachains-runtimes-test-utils", "parity-scale-codec", @@ -8216,8 +8228,8 @@ name = "pallet-bulletin-transaction-storage" version = "0.1.0" dependencies = [ "array-bytes 6.2.3", + "bulletin-pallets-common", "bulletin-transaction-storage-primitives", - "pallets-common", "parity-scale-codec", "polkadot-sdk-frame", "scale-info", @@ -9162,9 +9174,9 @@ dependencies = [ name = "pallet-validator-set" version = "1.0.0" dependencies = [ + "bulletin-pallets-common", "log", "pallet-session", - "pallets-common", "parity-scale-codec", "polkadot-sdk-frame", "scale-info", @@ -9308,18 +9320,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "pallets-common" -version = "0.1.0" -dependencies = [ - "pallet-proxy", - "pallet-sudo", - "pallet-utility", - "parity-scale-codec", - "polkadot-sdk-frame", - "scale-info", -] - [[package]] name = "parachains-common" version = "7.0.0" diff --git a/Cargo.toml b/Cargo.toml index 22797aa1d..a5cd5d21f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,10 +38,10 @@ westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk. bulletin-polkadot-runtime = { path = "runtimes/bulletin-polkadot" } bulletin-westend-runtime = { path = "runtimes/bulletin-westend" } pallet-relayer-set = { path = "pallets/relayer-set", default-features = false } -pallet-transaction-storage = { package = "pallet-bulletin-transaction-storage", path = "pallets/transaction-storage", default-features = false } +pallet-bulletin-transaction-storage = { path = "pallets/transaction-storage", default-features = false } pallet-validator-set = { path = "pallets/validator-set", default-features = false } -pallets-common = { path = "pallets/common", default-features = false } -transaction-storage-primitives = { package = "bulletin-transaction-storage-primitives", path = "pallets/transaction-storage/primitives", default-features = false } +bulletin-pallets-common = { path = "pallets/common", default-features = false } +bulletin-transaction-storage-primitives = { path = "pallets/transaction-storage/primitives", default-features = false } # Polkadot SDK crates (shared git revision) frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index 0b730808f..fcd8aa385 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -77,7 +77,7 @@ frame-benchmarking = { optional = true, workspace = true, default-features = tru bulletin-polkadot-runtime = { workspace = true } # TODO: remove when bulletin-polkadot is upgraded live with TX storage runtime API -pallet-transaction-storage = { workspace = true } +pallet-bulletin-transaction-storage = { workspace = true } [build-dependencies] substrate-build-script-utils = { workspace = true } @@ -90,7 +90,7 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", - "pallet-transaction-storage/runtime-benchmarks", + "pallet-bulletin-transaction-storage/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", @@ -102,6 +102,6 @@ try-runtime = [ "frame-support/try-runtime", "frame-try-runtime/try-runtime", "pallet-transaction-payment/try-runtime", - "pallet-transaction-storage/try-runtime", + "pallet-bulletin-transaction-storage/try-runtime", "sp-runtime/try-runtime", ] diff --git a/node/src/service.rs b/node/src/service.rs index a9332f229..49bef1722 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -322,8 +322,8 @@ pub fn new_full< // Fallback for solochain runtimes that do not yet have the transaction // storage API. TODO: remove once bulletin-polkadot is upgraded // with the TX storage runtime API. TODO: also remove the - // pallet_transaction_storage dependency. - pallet_transaction_storage::DEFAULT_RETENTION_PERIOD + // pallet_bulletin_transaction_storage dependency. + pallet_bulletin_transaction_storage::DEFAULT_RETENTION_PERIOD } }; let storage_proof = diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 0121a3e4d..d70db7d55 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pallets-common" +name = "bulletin-pallets-common" version = "0.1.0" authors = ["Parity Technologies "] edition.workspace = true diff --git a/pallets/transaction-storage/Cargo.toml b/pallets/transaction-storage/Cargo.toml index e1ed1e0ac..ae0f05bb0 100644 --- a/pallets/transaction-storage/Cargo.toml +++ b/pallets/transaction-storage/Cargo.toml @@ -17,7 +17,7 @@ array-bytes = { optional = true, workspace = true } codec = { workspace = true } scale-info = { features = ["derive"], workspace = true } tracing = { workspace = true } -transaction-storage-primitives = { workspace = true } +bulletin-transaction-storage-primitives = { workspace = true } polkadot-sdk-frame = { workspace = true, default-features = false, features = [ "runtime", @@ -25,25 +25,25 @@ polkadot-sdk-frame = { workspace = true, default-features = false, features = [ sp-transaction-storage-proof = { workspace = true, default-features = false } [dev-dependencies] -pallets-common = { workspace = true } +bulletin-pallets-common = { workspace = true } [features] default = ["std"] runtime-benchmarks = [ "array-bytes", - "pallets-common/runtime-benchmarks", + "bulletin-pallets-common/runtime-benchmarks", "polkadot-sdk-frame/runtime-benchmarks", ] std = [ "codec/std", - "pallets-common/std", + "bulletin-pallets-common/std", "polkadot-sdk-frame/std", "scale-info/std", "sp-transaction-storage-proof/std", "tracing/std", - "transaction-storage-primitives/std", + "bulletin-transaction-storage-primitives/std", ] try-runtime = [ - "pallets-common/try-runtime", + "bulletin-pallets-common/try-runtime", "polkadot-sdk-frame/try-runtime", ] diff --git a/pallets/transaction-storage/src/lib.rs b/pallets/transaction-storage/src/lib.rs index 2acee6c9b..a1f17d875 100644 --- a/pallets/transaction-storage/src/lib.rs +++ b/pallets/transaction-storage/src/lib.rs @@ -51,7 +51,7 @@ use sp_transaction_storage_proof::{ encode_index, num_chunks, random_chunk, ChunkIndex, InherentError, TransactionStorageProof, CHUNK_SIZE, INHERENT_IDENTIFIER, }; -use transaction_storage_primitives::{ +use bulletin_transaction_storage_primitives::{ cids::{calculate_cid, Cid, CidCodec, CidConfig, HashingAlgorithm, RAW_CODEC}, ContentHash, }; diff --git a/pallets/transaction-storage/src/migrations.rs b/pallets/transaction-storage/src/migrations.rs index 6127ca800..01eaa86c4 100644 --- a/pallets/transaction-storage/src/migrations.rs +++ b/pallets/transaction-storage/src/migrations.rs @@ -87,7 +87,7 @@ pub mod v1 { sp_runtime::traits::{BlakeTwo256, Hash}, }; use sp_transaction_storage_proof::ChunkIndex; - use transaction_storage_primitives::{ + use bulletin_transaction_storage_primitives::{ cids::{CidCodec, HashingAlgorithm, RAW_CODEC}, ContentHash, }; diff --git a/pallets/transaction-storage/src/mock.rs b/pallets/transaction-storage/src/mock.rs index 117cbe9b6..876bb39de 100644 --- a/pallets/transaction-storage/src/mock.rs +++ b/pallets/transaction-storage/src/mock.rs @@ -18,10 +18,10 @@ //! Test environment for transaction-storage pallet. use crate::{ - self as pallet_transaction_storage, TransactionStorageProof, DEFAULT_MAX_BLOCK_TRANSACTIONS, + self as pallet_bulletin_transaction_storage, TransactionStorageProof, DEFAULT_MAX_BLOCK_TRANSACTIONS, DEFAULT_MAX_TRANSACTION_SIZE, }; -use pallets_common::NoCurrency; +use bulletin_pallets_common::NoCurrency; use polkadot_sdk_frame::{prelude::*, runtime::prelude::*, testing_prelude::*}; type Block = MockBlock; @@ -31,7 +31,7 @@ construct_runtime!( pub enum Test { System: frame_system, - TransactionStorage: pallet_transaction_storage, + TransactionStorage: pallet_bulletin_transaction_storage, } ); @@ -50,7 +50,7 @@ parameter_types! { pub const RemoveExpiredAuthorizationLongevity: TransactionLongevity = 10; } -impl pallet_transaction_storage::Config for Test { +impl pallet_bulletin_transaction_storage::Config for Test { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type Currency = NoCurrency; @@ -70,7 +70,7 @@ impl pallet_transaction_storage::Config for Test { pub fn new_test_ext() -> TestExternalities { let t = RuntimeGenesisConfig { system: Default::default(), - transaction_storage: pallet_transaction_storage::GenesisConfig:: { + transaction_storage: pallet_bulletin_transaction_storage::GenesisConfig:: { retention_period: 10, byte_fee: 2, entry_fee: 200, diff --git a/pallets/transaction-storage/src/tests.rs b/pallets/transaction-storage/src/tests.rs index 49a899e7d..837ef41f9 100644 --- a/pallets/transaction-storage/src/tests.rs +++ b/pallets/transaction-storage/src/tests.rs @@ -42,7 +42,7 @@ use polkadot_sdk_frame::{ traits::StorageVersion, }; use sp_transaction_storage_proof::{random_chunk, registration::build_proof, CHUNK_SIZE}; -use transaction_storage_primitives::cids::{CidConfig, HashingAlgorithm}; +use bulletin_transaction_storage_primitives::cids::{CidConfig, HashingAlgorithm}; type Call = super::Call; type Error = super::Error; diff --git a/pallets/transaction-storage/src/weights.rs b/pallets/transaction-storage/src/weights.rs index a488e040a..bc143de84 100644 --- a/pallets/transaction-storage/src/weights.rs +++ b/pallets/transaction-storage/src/weights.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for pallet_transaction_storage +//! Autogenerated weights for pallet_bulletin_transaction_storage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2023-06-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -30,7 +30,7 @@ // --chain=dev // --steps=50 // --repeat=20 -// --pallet=pallet_transaction_storage +// --pallet=pallet_bulletin_transaction_storage // --no-storage-info // --no-median-slopes // --no-min-squares @@ -50,7 +50,7 @@ use polkadot_sdk_frame::weights_prelude::*; use core::marker::PhantomData; -/// Weight functions needed for pallet_transaction_storage. +/// Weight functions needed for pallet_bulletin_transaction_storage. pub trait WeightInfo { fn store(l: u32, ) -> Weight; fn renew() -> Weight; @@ -65,7 +65,7 @@ pub trait WeightInfo { fn validate_renew() -> Weight; } -/// Weights for pallet_transaction_storage using the Substrate node and recommended hardware. +/// Weights for pallet_bulletin_transaction_storage using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { /// Storage: TransactionStorage ByteFee (r:1 w:0) diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index 3d6da76b5..a88f888c3 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -21,19 +21,19 @@ pallet-session = { workspace = true, default-features = false, features = [ [dev-dependencies] serde = { features = ["derive"], workspace = true } -pallets-common = { workspace = true, default-features = false } +bulletin-pallets-common = { workspace = true, default-features = false } [features] default = ['std'] runtime-benchmarks = [ "pallet-session/runtime-benchmarks", - "pallets-common/runtime-benchmarks", + "bulletin-pallets-common/runtime-benchmarks", "polkadot-sdk-frame/runtime-benchmarks", "sp-staking/runtime-benchmarks", ] std = [ "log/std", - "pallets-common/std", + "bulletin-pallets-common/std", "sp-staking/std", 'codec/std', 'pallet-session/std', @@ -42,6 +42,6 @@ std = [ ] try-runtime = [ "pallet-session/try-runtime", - "pallets-common/try-runtime", + "bulletin-pallets-common/try-runtime", 'polkadot-sdk-frame/try-runtime', ] diff --git a/pallets/validator-set/src/mock.rs b/pallets/validator-set/src/mock.rs index b7243d9fb..9d8ca350a 100644 --- a/pallets/validator-set/src/mock.rs +++ b/pallets/validator-set/src/mock.rs @@ -144,7 +144,7 @@ impl pallet_session::Config for Test { type Keys = MockSessionKeys; type WeightInfo = (); type RuntimeEvent = RuntimeEvent; - type Currency = pallets_common::NoCurrency; + type Currency = bulletin_pallets_common::NoCurrency; type KeyDeposit = (); type DisablingStrategy = (); } diff --git a/runtimes/bulletin-polkadot/Cargo.toml b/runtimes/bulletin-polkadot/Cargo.toml index 029cad418..b4469e926 100644 --- a/runtimes/bulletin-polkadot/Cargo.toml +++ b/runtimes/bulletin-polkadot/Cargo.toml @@ -55,9 +55,9 @@ frame-system-benchmarking = { workspace = true, optional = true } # Local dependencies pallet-relayer-set = { workspace = true } -pallet-transaction-storage = { workspace = true } +pallet-bulletin-transaction-storage = { workspace = true } pallet-validator-set = { workspace = true } -pallets-common = { workspace = true } +bulletin-pallets-common = { workspace = true } # Bridge dependencies bp-header-chain = { workspace = true } @@ -100,7 +100,7 @@ sp-io = { workspace = true } sp-trie = { workspace = true } static_assertions = { workspace = true } sp-tracing = { workspace = true } -transaction-storage-primitives = { workspace = true } +bulletin-transaction-storage-primitives = { workspace = true } [features] default = ["std"] @@ -147,9 +147,9 @@ std = [ "pallet-relayer-set/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", - "pallet-transaction-storage/std", + "pallet-bulletin-transaction-storage/std", "pallet-validator-set/std", - "pallets-common/std", + "bulletin-pallets-common/std", "bp-header-chain/std", "bp-messages/std", @@ -177,7 +177,7 @@ std = [ "sp-storage?/std", "sp-trie/std", "substrate-wasm-builder", - "transaction-storage-primitives/std", + "bulletin-transaction-storage-primitives/std", ] runtime-benchmarks = [ "frame-support/runtime-benchmarks", @@ -204,11 +204,11 @@ runtime-benchmarks = [ "pallet-relayer-set/runtime-benchmarks", "pallet-session/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", - "pallet-transaction-storage/runtime-benchmarks", + "pallet-bulletin-transaction-storage/runtime-benchmarks", "pallet-validator-set/runtime-benchmarks", "pallet-bridge-relayers/runtime-benchmarks", - "pallets-common/runtime-benchmarks", + "bulletin-pallets-common/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", "xcm/runtime-benchmarks", @@ -242,10 +242,10 @@ try-runtime = [ "pallet-relayer-set/try-runtime", "pallet-staking/try-runtime", "pallet-transaction-payment/try-runtime", - "pallet-transaction-storage/try-runtime", + "pallet-bulletin-transaction-storage/try-runtime", "pallet-validator-set/try-runtime", "pallet-xcm?/try-runtime", - "pallets-common/try-runtime", + "bulletin-pallets-common/try-runtime", "parachains-common?/try-runtime", "sp-runtime/try-runtime", ] diff --git a/runtimes/bulletin-polkadot/src/lib.rs b/runtimes/bulletin-polkadot/src/lib.rs index ac2fb8f05..4c6754ef9 100644 --- a/runtimes/bulletin-polkadot/src/lib.rs +++ b/runtimes/bulletin-polkadot/src/lib.rs @@ -292,7 +292,7 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = opaque::SessionKeys; type WeightInfo = pallet_session::weights::SubstrateWeight; - type Currency = pallets_common::NoCurrency; + type Currency = bulletin_pallets_common::NoCurrency; type KeyDeposit = (); // TODO: nothing for now, maybe in the future. type DisablingStrategy = (); @@ -367,7 +367,7 @@ impl SortedMembers for TestAccounts { } } -/// Tells [`pallet_transaction_storage::extension::ValidateStorageCalls`] how to find storage +/// Tells [`pallet_bulletin_transaction_storage::extension::ValidateStorageCalls`] how to find storage /// calls inside wrapper extrinsics so it can recursively validate and consume authorization. /// /// Also implements [`Contains`] returning `true` for storage-mutating calls @@ -377,7 +377,7 @@ impl SortedMembers for TestAccounts { #[derive(Clone, PartialEq, Eq, Default)] pub struct StorageCallInspector; -impl pallet_transaction_storage::CallInspector for StorageCallInspector { +impl pallet_bulletin_transaction_storage::CallInspector for StorageCallInspector { fn inspect_wrapper(call: &RuntimeCall) -> Option> { match call { RuntimeCall::Utility(c) => inspect_utility_wrapper(c), @@ -397,13 +397,13 @@ impl frame_support::traits::Contains for StorageCallInspector { } } -impl pallet_transaction_storage::Config for Runtime { +impl pallet_bulletin_transaction_storage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type Currency = NoCurrency; type RuntimeHoldReason = RuntimeHoldReason; type FeeDestination = (); - type WeightInfo = weights::pallet_transaction_storage::WeightInfo; + type WeightInfo = weights::pallet_bulletin_transaction_storage::WeightInfo; type MaxBlockTransactions = ConstU32<512>; /// Max transaction size per block needs to be aligned with [`BlockLength`]. type MaxTransactionSize = ConstU32<{ 8 * 1024 * 1024 }>; @@ -468,7 +468,7 @@ impl InstanceFilter for ProxyType { impl pallet_proxy::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type Currency = pallets_common::NoCurrency; + type Currency = bulletin_pallets_common::NoCurrency; type ProxyType = ProxyType; type ProxyDepositBase = (); type ProxyDepositFactor = (); @@ -521,7 +521,7 @@ construct_runtime!( Grandpa: pallet_grandpa = 15, // Storage - TransactionStorage: pallet_transaction_storage = 40, + TransactionStorage: pallet_bulletin_transaction_storage = 40, // Bridge RelayerSet: pallet_relayer_set = 50, @@ -555,8 +555,8 @@ fn validate_purge_keys(who: &AccountId) -> TransactionValidity { } } -use pallet_transaction_storage::{CallInspector, MAX_WRAPPER_DEPTH}; -use pallets_common::{ +use pallet_bulletin_transaction_storage::{CallInspector, MAX_WRAPPER_DEPTH}; +use bulletin_pallets_common::{ inspect_proxy_wrapper, inspect_sudo_wrapper, inspect_utility_wrapper, proxy_inner_calls, utility_inner_calls, }; @@ -571,7 +571,7 @@ fn extract_signer(origin: &RuntimeOrigin) -> Option { } match origin.caller() { OriginCaller::TransactionStorage( - pallet_transaction_storage::pallet::Origin::::Authorized { who, .. }, + pallet_bulletin_transaction_storage::pallet::Origin::::Authorized { who, .. }, ) => Some(who.clone()), _ => None, } @@ -847,7 +847,7 @@ pub type TxExtension = ( frame_system::CheckEra, frame_system::CheckNonce, frame_system::CheckWeight, - pallet_transaction_storage::extension::ValidateStorageCalls, + pallet_bulletin_transaction_storage::extension::ValidateStorageCalls, AllowedSignedCalls, BridgeRejectObsoleteHeadersAndMessages, ); @@ -871,13 +871,13 @@ pub type Executive = frame_executive::Executive< pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = - (pallet_transaction_storage::migrations::v1::MigrateV0ToV1,); + (pallet_bulletin_transaction_storage::migrations::v1::MigrateV0ToV1,); /// Migrations/checks that do not need to be versioned and can run on every update. pub type Permanent = ( - pallet_transaction_storage::migrations::SetRetentionPeriodIfZero< + pallet_bulletin_transaction_storage::migrations::SetRetentionPeriodIfZero< crate::Runtime, - pallet_transaction_storage::DefaultRetentionPeriod, + pallet_bulletin_transaction_storage::DefaultRetentionPeriod, >, ); @@ -897,7 +897,7 @@ mod benches { [frame_system, SystemBench::] [frame_system_extensions, SystemExtensionsBench::] [pallet_timestamp, Timestamp] - [pallet_transaction_storage, TransactionStorage] + [pallet_bulletin_transaction_storage, TransactionStorage] [pallet_validator_set, ValidatorSet] [pallet_relayer_set, RelayerSet] @@ -1017,7 +1017,7 @@ mod benches { #[cfg(feature = "runtime-benchmarks")] use benches::*; -use pallets_common::NoCurrency; +use bulletin_pallets_common::NoCurrency; impl_runtime_apis! { impl sp_api::Core for Runtime { diff --git a/runtimes/bulletin-polkadot/src/weights/mod.rs b/runtimes/bulletin-polkadot/src/weights/mod.rs index 356994099..ec2acd50e 100644 --- a/runtimes/bulletin-polkadot/src/weights/mod.rs +++ b/runtimes/bulletin-polkadot/src/weights/mod.rs @@ -16,7 +16,7 @@ pub mod pallet_proxy; pub mod pallet_relayer_set; pub mod pallet_sudo; pub mod pallet_timestamp; -pub mod pallet_transaction_storage; +pub mod pallet_bulletin_transaction_storage; pub mod pallet_utility; pub mod pallet_validator_set; diff --git a/runtimes/bulletin-polkadot/src/weights/pallet_transaction_storage.rs b/runtimes/bulletin-polkadot/src/weights/pallet_bulletin_transaction_storage.rs similarity index 97% rename from runtimes/bulletin-polkadot/src/weights/pallet_transaction_storage.rs rename to runtimes/bulletin-polkadot/src/weights/pallet_bulletin_transaction_storage.rs index 14812e2d5..d2c901772 100644 --- a/runtimes/bulletin-polkadot/src/weights/pallet_transaction_storage.rs +++ b/runtimes/bulletin-polkadot/src/weights/pallet_bulletin_transaction_storage.rs @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `pallet_transaction_storage` +//! Autogenerated weights for `pallet_bulletin_transaction_storage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 48.0.0 //! DATE: 2025-09-26, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -29,7 +29,7 @@ // pallet // --extrinsic=* // --runtime=target/production/wbuild/bulletin-polkadot-runtime/bulletin_polkadot_runtime.wasm -// --pallet=pallet_transaction_storage +// --pallet=pallet_bulletin_transaction_storage // --header=/home/ubuntu/bkontur/polkadot-bulletin-chain/scripts/cmd/file_header.txt // --output=./runtimes/bulletin-polkadot/src/weights // --wasm-execution=compiled @@ -45,9 +45,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `pallet_transaction_storage`. +/// Weight functions for `pallet_bulletin_transaction_storage`. pub struct WeightInfo(PhantomData); -impl pallet_transaction_storage::WeightInfo for WeightInfo { +impl pallet_bulletin_transaction_storage::WeightInfo for WeightInfo { /// Storage: `TransactionStorage::BlockTransactions` (r:1 w:1) /// Proof: `TransactionStorage::BlockTransactions` (`max_values`: Some(1), `max_size`: Some(36866), added: 37361, mode: `MaxEncodedLen`) /// The range of component `l` is `[1, 8388608]`. diff --git a/runtimes/bulletin-polkadot/src/xcm_config.rs b/runtimes/bulletin-polkadot/src/xcm_config.rs index edff18444..46566b895 100644 --- a/runtimes/bulletin-polkadot/src/xcm_config.rs +++ b/runtimes/bulletin-polkadot/src/xcm_config.rs @@ -407,7 +407,7 @@ pub(crate) mod tests { #[test] fn xcm_transact_store_is_blocked() { run_test(|| { - use pallet_transaction_storage::{AuthorizationExtent, Call as TxStorageCall}; + use pallet_bulletin_transaction_storage::{AuthorizationExtent, Call as TxStorageCall}; let data = vec![42u8; 100]; let content_hash = sp_io::hashing::blake2_256(&data); @@ -460,7 +460,7 @@ pub(crate) mod tests { #[test] fn xcm_transact_wrapped_store_is_blocked() { run_test(|| { - use pallet_transaction_storage::{AuthorizationExtent, Call as TxStorageCall}; + use pallet_bulletin_transaction_storage::{AuthorizationExtent, Call as TxStorageCall}; let data = vec![42u8; 100]; let content_hash = sp_io::hashing::blake2_256(&data); @@ -515,7 +515,7 @@ pub(crate) mod tests { #[test] fn xcm_transact_renew_is_blocked() { run_test(|| { - use pallet_transaction_storage::Call as TxStorageCall; + use pallet_bulletin_transaction_storage::Call as TxStorageCall; let renew_call = RuntimeCall::TransactionStorage(TxStorageCall::::renew { block: 1, @@ -546,7 +546,7 @@ pub(crate) mod tests { #[test] fn xcm_transact_authorize_account_works() { run_test(|| { - use pallet_transaction_storage::{AuthorizationExtent, Call as TxStorageCall}; + use pallet_bulletin_transaction_storage::{AuthorizationExtent, Call as TxStorageCall}; let who = AccountKeyring::Ferdie.to_account_id(); diff --git a/runtimes/bulletin-polkadot/tests/tests.rs b/runtimes/bulletin-polkadot/tests/tests.rs index 68a69cb61..dbc8f11e3 100644 --- a/runtimes/bulletin-polkadot/tests/tests.rs +++ b/runtimes/bulletin-polkadot/tests/tests.rs @@ -21,7 +21,7 @@ use pallet_bridge_messages::{ BridgedChainOf, LaneIdOf, ThisChainOf, }; use pallet_bridge_parachains::ParachainHeaders; -use pallet_transaction_storage::{ +use pallet_bulletin_transaction_storage::{ AuthorizationExtent, Call as TxStorageCall, Config as TxStorageConfig, BAD_DATA_SIZE, }; use runtime::{ @@ -39,7 +39,7 @@ use sp_runtime::{ }; use sp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut}; use std::collections::HashMap; -use transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; +use bulletin_transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; fn advance_block() { let current_number = System::block_number(); @@ -280,7 +280,7 @@ fn construct_extrinsic( frame_system::Pallet::::account(&account_id).nonce, ), frame_system::CheckWeight::::new(), - pallet_transaction_storage::extension::ValidateStorageCalls::< + pallet_bulletin_transaction_storage::extension::ValidateStorageCalls::< Runtime, runtime::StorageCallInspector, >::default(), @@ -1061,10 +1061,10 @@ fn allowed_signed_calls_preserves_storage_priority() { }); } -/// See [`pallet_transaction_storage::ensure_weight_sanity`]. +/// See [`pallet_bulletin_transaction_storage::ensure_weight_sanity`]. #[test] fn transaction_storage_weight_sanity() { - pallet_transaction_storage::ensure_weight_sanity::(None); + pallet_bulletin_transaction_storage::ensure_weight_sanity::(None); } // ============================================================================ @@ -1287,7 +1287,7 @@ fn wrapped_renew_requires_authorization() { pallet_sudo::GenesisConfig:: { key: Some(sudo_relayer_signer().into()) } .assimilate_storage(&mut t) .unwrap(); - pallet_transaction_storage::GenesisConfig:: { + pallet_bulletin_transaction_storage::GenesisConfig:: { retention_period: 100, byte_fee: 0, entry_fee: 0, @@ -1661,7 +1661,7 @@ fn max_recursion_depth_is_enforced() { // Nest store inside MAX_WRAPPER_DEPTH+1 batch wrappers. let mut call: RuntimeCall = RuntimeCall::TransactionStorage(TxStorageCall::::store { data: data.clone() }); - for _ in 0..=pallet_transaction_storage::MAX_WRAPPER_DEPTH { + for _ in 0..=pallet_bulletin_transaction_storage::MAX_WRAPPER_DEPTH { call = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![call] }); } diff --git a/runtimes/bulletin-westend/Cargo.toml b/runtimes/bulletin-westend/Cargo.toml index 3eeb9b27a..0d404feb0 100644 --- a/runtimes/bulletin-westend/Cargo.toml +++ b/runtimes/bulletin-westend/Cargo.toml @@ -38,8 +38,8 @@ pallet-timestamp = { workspace = true } pallet-utility = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } -pallet-transaction-storage = { workspace = true } -pallets-common = { workspace = true } +pallet-bulletin-transaction-storage = { workspace = true } +bulletin-pallets-common = { workspace = true } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } @@ -85,7 +85,7 @@ testnet-parachains-constants = { features = ["westend"], workspace = true } [dev-dependencies] parachains-runtimes-test-utils = { workspace = true, default-features = true } sp-io = { workspace = true } -transaction-storage-primitives = { workspace = true } +bulletin-transaction-storage-primitives = { workspace = true } [build-dependencies] substrate-wasm-builder = { optional = true, workspace = true, default-features = true } @@ -122,11 +122,11 @@ std = [ "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", - "pallet-transaction-storage/std", + "pallet-bulletin-transaction-storage/std", "pallet-utility/std", "pallet-xcm-benchmarks?/std", "pallet-xcm/std", - "pallets-common/std", + "bulletin-pallets-common/std", "parachain-info/std", "parachains-common/std", "polkadot-parachain-primitives/std", @@ -152,7 +152,7 @@ std = [ "substrate-wasm-builder", "testnet-parachains-constants/std", "tracing/std", - "transaction-storage-primitives/std", + "bulletin-transaction-storage-primitives/std", "westend-runtime-constants/std", "xcm-builder/std", "xcm-executor/std", @@ -178,11 +178,11 @@ runtime-benchmarks = [ "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", - "pallet-transaction-storage/runtime-benchmarks", + "pallet-bulletin-transaction-storage/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "pallets-common/runtime-benchmarks", + "bulletin-pallets-common/runtime-benchmarks", "parachains-common/runtime-benchmarks", "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", @@ -213,10 +213,10 @@ try-runtime = [ "pallet-sudo/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", - "pallet-transaction-storage/try-runtime", + "pallet-bulletin-transaction-storage/try-runtime", "pallet-utility/try-runtime", "pallet-xcm/try-runtime", - "pallets-common/try-runtime", + "bulletin-pallets-common/try-runtime", "parachain-info/try-runtime", "parachains-common/try-runtime", "polkadot-runtime-common/try-runtime", diff --git a/runtimes/bulletin-westend/src/lib.rs b/runtimes/bulletin-westend/src/lib.rs index 428b410b8..3170c0e19 100644 --- a/runtimes/bulletin-westend/src/lib.rs +++ b/runtimes/bulletin-westend/src/lib.rs @@ -114,7 +114,7 @@ pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< Runtime, pallet_transaction_payment::ChargeTransactionPayment, >, - pallet_transaction_storage::extension::ValidateStorageCalls< + pallet_bulletin_transaction_storage::extension::ValidateStorageCalls< Runtime, storage::StorageCallInspector, >, @@ -141,15 +141,15 @@ pub mod migrations { pallet_session::migrations::v1::InitOffenceSeverity, >, cumulus_pallet_aura_ext::migration::MigrateV0ToV1, - pallet_transaction_storage::migrations::v1::MigrateV0ToV1, + pallet_bulletin_transaction_storage::migrations::v1::MigrateV0ToV1, ); /// Migrations/checks that do not need to be versioned and can run on every update. pub type Permanent = ( pallet_xcm::migration::MigrateToLatestXcmVersion, - pallet_transaction_storage::migrations::SetRetentionPeriodIfZero< + pallet_bulletin_transaction_storage::migrations::SetRetentionPeriodIfZero< Runtime, - pallet_transaction_storage::DefaultRetentionPeriod, + pallet_bulletin_transaction_storage::DefaultRetentionPeriod, >, ); @@ -521,7 +521,7 @@ construct_runtime!( SkipFeelessPayment: pallet_skip_feeless_payment = 12, // Storage - TransactionStorage: pallet_transaction_storage = 40, + TransactionStorage: pallet_bulletin_transaction_storage = 40, // Collator support. The order of these 5 are important and shall not change. Authorship: pallet_authorship = 20, @@ -551,7 +551,7 @@ mod benches { [pallet_balances, Balances] [pallet_collator_selection, CollatorSelection] [pallet_session, SessionBench::] - [pallet_transaction_storage, TransactionStorage] + [pallet_bulletin_transaction_storage, TransactionStorage] [cumulus_pallet_xcmp_queue, XcmpQueue] [pallet_xcm, PalletXcmExtrinsicsBenchmark::] [pallet_message_queue, MessageQueue] diff --git a/runtimes/bulletin-westend/src/storage.rs b/runtimes/bulletin-westend/src/storage.rs index 0c8bc2b1d..4c9f0c5bf 100644 --- a/runtimes/bulletin-westend/src/storage.rs +++ b/runtimes/bulletin-westend/src/storage.rs @@ -26,9 +26,9 @@ use frame_support::{ traits::{Contains, EitherOfDiverse, SortedMembers}, }; use frame_system::EnsureSignedBy; -use pallet_transaction_storage::CallInspector; +use pallet_bulletin_transaction_storage::CallInspector; use pallet_xcm::EnsureXcm; -use pallets_common::{inspect_utility_wrapper, NoCurrency}; +use bulletin_pallets_common::{inspect_utility_wrapper, NoCurrency}; use sp_keyring::Sr25519Keyring; use sp_runtime::transaction_validity::{TransactionLongevity, TransactionPriority}; /// Provides test accounts for use with `EnsureSignedBy`. @@ -50,7 +50,7 @@ parameter_types! { pub const StoreRenewLongevity: TransactionLongevity = crate::DAYS as TransactionLongevity; } -/// Tells [`pallet_transaction_storage::extension::ValidateStorageCalls`] how to find storage +/// Tells [`pallet_bulletin_transaction_storage::extension::ValidateStorageCalls`] how to find storage /// calls inside wrapper extrinsics so it can recursively validate and consume authorization. /// /// Also implements [`Contains`] returning `true` for storage-mutating calls @@ -60,7 +60,7 @@ parameter_types! { #[derive(Clone, PartialEq, Eq, Default)] pub struct StorageCallInspector; -impl pallet_transaction_storage::CallInspector for StorageCallInspector { +impl pallet_bulletin_transaction_storage::CallInspector for StorageCallInspector { fn inspect_wrapper(call: &RuntimeCall) -> Option> { match call { RuntimeCall::Utility(c) => inspect_utility_wrapper(c), @@ -82,13 +82,13 @@ impl Contains for StorageCallInspector { } /// The main business of the Bulletin chain. -impl pallet_transaction_storage::Config for Runtime { +impl pallet_bulletin_transaction_storage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type Currency = NoCurrency; type RuntimeHoldReason = RuntimeHoldReason; type FeeDestination = (); - type WeightInfo = crate::weights::pallet_transaction_storage::WeightInfo; + type WeightInfo = crate::weights::pallet_bulletin_transaction_storage::WeightInfo; type MaxBlockTransactions = crate::ConstU32<512>; /// Max transaction size per block needs to be aligned with `BlockLength`. type MaxTransactionSize = crate::ConstU32<{ 8 * 1024 * 1024 }>; diff --git a/runtimes/bulletin-westend/src/weights/mod.rs b/runtimes/bulletin-westend/src/weights/mod.rs index 708a694d8..2d3c21128 100644 --- a/runtimes/bulletin-westend/src/weights/mod.rs +++ b/runtimes/bulletin-westend/src/weights/mod.rs @@ -30,7 +30,7 @@ pub mod pallet_message_queue; pub mod pallet_session; pub mod pallet_timestamp; pub mod pallet_transaction_payment; -pub mod pallet_transaction_storage; +pub mod pallet_bulletin_transaction_storage; pub mod pallet_utility; pub mod pallet_xcm; pub mod paritydb_weights; diff --git a/runtimes/bulletin-westend/src/weights/pallet_transaction_storage.rs b/runtimes/bulletin-westend/src/weights/pallet_bulletin_transaction_storage.rs similarity index 97% rename from runtimes/bulletin-westend/src/weights/pallet_transaction_storage.rs rename to runtimes/bulletin-westend/src/weights/pallet_bulletin_transaction_storage.rs index 582d71c51..100de4084 100644 --- a/runtimes/bulletin-westend/src/weights/pallet_transaction_storage.rs +++ b/runtimes/bulletin-westend/src/weights/pallet_bulletin_transaction_storage.rs @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `pallet_transaction_storage` +//! Autogenerated weights for `pallet_bulletin_transaction_storage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 53.0.0 //! DATE: 2026-02-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -29,7 +29,7 @@ // pallet // --extrinsic=* // --runtime=target/production/wbuild/bulletin-westend-runtime/bulletin_westend_runtime.wasm -// --pallet=pallet_transaction_storage +// --pallet=pallet_bulletin_transaction_storage // --header=./scripts/cmd/file_header.txt // --output=./runtimes/bulletin-westend/src/weights // --wasm-execution=compiled @@ -45,9 +45,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `pallet_transaction_storage`. +/// Weight functions for `pallet_bulletin_transaction_storage`. pub struct WeightInfo(PhantomData); -impl pallet_transaction_storage::WeightInfo for WeightInfo { +impl pallet_bulletin_transaction_storage::WeightInfo for WeightInfo { /// Storage: `TransactionStorage::BlockTransactions` (r:1 w:1) /// Proof: `TransactionStorage::BlockTransactions` (`max_values`: Some(1), `max_size`: Some(41474), added: 41969, mode: `MaxEncodedLen`) /// The range of component `l` is `[1, 8388608]`. diff --git a/runtimes/bulletin-westend/tests/tests.rs b/runtimes/bulletin-westend/tests/tests.rs index a16ca34ac..e46eb5e18 100644 --- a/runtimes/bulletin-westend/tests/tests.rs +++ b/runtimes/bulletin-westend/tests/tests.rs @@ -24,7 +24,7 @@ use bulletin_westend_runtime::{ UncheckedExtrinsic, }; use frame_support::{assert_err, assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Hooks}; -use pallet_transaction_storage::{ +use pallet_bulletin_transaction_storage::{ AuthorizationExtent, Call as TxStorageCall, Config as TxStorageConfig, }; use parachains_common::{AccountId, AuraId, Hash as PcHash, Signature as PcSignature}; @@ -38,7 +38,7 @@ use sp_runtime::{ }; use std::collections::HashMap; use testnet_parachains_constants::westend::{fee::WeightToFee, locations::PeopleLocation}; -use transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; +use bulletin_transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; use xcm::latest::prelude::*; use xcm_runtime_apis::conversions::LocationToAccountHelper; @@ -84,7 +84,7 @@ fn construct_extrinsic( pallet_skip_feeless_payment::SkipCheckIfFeeless::from( pallet_transaction_payment::ChargeTransactionPayment::::from(0u128), ), - pallet_transaction_storage::extension::ValidateStorageCalls::< + pallet_bulletin_transaction_storage::extension::ValidateStorageCalls::< Runtime, bulletin_westend_runtime::storage::StorageCallInspector, >::default(), @@ -206,7 +206,7 @@ fn transaction_storage_runtime_sizes() { // On the Westend, very large extrinsics may be rejected earlier for exhausting // resources (block length/weight) before reaching the pallet's BAD_DATA_SIZE check. assert!( - res == Err(pallet_transaction_storage::BAD_DATA_SIZE.into()) || + res == Err(pallet_bulletin_transaction_storage::BAD_DATA_SIZE.into()) || res == Err(InvalidTransaction::ExhaustsResources.into()), "unexpected error: {res:?}" ); @@ -615,7 +615,7 @@ fn non_authorizer_cannot_sign_authorize_account_extrinsic() { fn people_chain_can_authorize_storage_with_transact() { // Prepare call. let account = Sr25519Keyring::Ferdie; - let authorize_call = RuntimeCall::TransactionStorage(pallet_transaction_storage::Call::< + let authorize_call = RuntimeCall::TransactionStorage(pallet_bulletin_transaction_storage::Call::< Runtime, >::authorize_account { who: account.to_account_id(), @@ -643,7 +643,7 @@ fn people_chain_can_authorize_storage_with_transact() { // Check event. System::assert_has_event(RuntimeEvent::TransactionStorage( - pallet_transaction_storage::Event::AccountAuthorized { + pallet_bulletin_transaction_storage::Event::AccountAuthorized { who: account.to_account_id(), transactions: 16, bytes: 1024, @@ -659,7 +659,7 @@ fn people_next_chain_can_authorize_storage_with_transact() { let people_next_location = Location::new(1, [Parachain(5140)]); let account = Sr25519Keyring::Ferdie; - let authorize_call = RuntimeCall::TransactionStorage(pallet_transaction_storage::Call::< + let authorize_call = RuntimeCall::TransactionStorage(pallet_bulletin_transaction_storage::Call::< Runtime, >::authorize_account { who: account.to_account_id(), @@ -686,7 +686,7 @@ fn people_next_chain_can_authorize_storage_with_transact() { // Check event. System::assert_has_event(RuntimeEvent::TransactionStorage( - pallet_transaction_storage::Event::AccountAuthorized { + pallet_bulletin_transaction_storage::Event::AccountAuthorized { who: account.to_account_id(), transactions: 16, bytes: 1024, @@ -695,10 +695,10 @@ fn people_next_chain_can_authorize_storage_with_transact() { }) } -/// See [`pallet_transaction_storage::ensure_weight_sanity`]. +/// See [`pallet_bulletin_transaction_storage::ensure_weight_sanity`]. #[test] fn transaction_storage_weight_sanity() { - pallet_transaction_storage::ensure_weight_sanity::( + pallet_bulletin_transaction_storage::ensure_weight_sanity::( // Collator-side PoV cap: default 85% of max_pov_size. // See cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs Some(85), @@ -1032,7 +1032,7 @@ fn signed_store_prefers_preimage_authorization_over_account() { #[test] fn wrapped_renew_requires_authorization() { let mut t = RuntimeGenesisConfig::default().build_storage().unwrap(); - pallet_transaction_storage::GenesisConfig:: { + pallet_bulletin_transaction_storage::GenesisConfig:: { retention_period: 100, byte_fee: 0, entry_fee: 0, @@ -1316,7 +1316,7 @@ fn max_recursion_depth_is_enforced() { RuntimeCall::TransactionStorage(TxStorageCall::::store { data: data.clone(), }); - for _ in 0..=pallet_transaction_storage::MAX_WRAPPER_DEPTH { + for _ in 0..=pallet_bulletin_transaction_storage::MAX_WRAPPER_DEPTH { call = RuntimeCall::Utility(pallet_utility::Call::batch { calls: vec![call] }); } From 6885e1719409e310506406022557aa7b81fa2b03 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 26 Mar 2026 11:51:22 +0100 Subject: [PATCH 6/9] Prepare publishable crates metadata - Add homepage, readme fields to bulletin-pallets-common and bulletin-transaction-storage-primitives - Add README.md for bulletin-pallets-common and bulletin-transaction-storage-primitives - Update pallet-bulletin-transaction-storage README.md - Mark non-publishable crates with publish = false --- pallets/common/Cargo.toml | 2 + pallets/common/README.md | 5 ++ pallets/relayer-set/Cargo.toml | 1 + pallets/transaction-storage/README.md | 87 +++++-------------- .../transaction-storage/primitives/Cargo.toml | 2 + .../transaction-storage/primitives/README.md | 5 ++ pallets/validator-set/Cargo.toml | 1 + runtimes/bulletin-westend/Cargo.toml | 1 + 8 files changed, 37 insertions(+), 67 deletions(-) create mode 100644 pallets/common/README.md create mode 100644 pallets/transaction-storage/primitives/README.md diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index d70db7d55..38cd79f00 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -5,7 +5,9 @@ authors = ["Parity Technologies "] edition.workspace = true license = "Apache-2.0" description = "Common utilities for pallets and/or runtime" +homepage.workspace = true repository.workspace = true +readme = "README.md" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/common/README.md b/pallets/common/README.md new file mode 100644 index 000000000..4d246023f --- /dev/null +++ b/pallets/common/README.md @@ -0,0 +1,5 @@ +# bulletin-pallets-common + +Common utilities for Polkadot Bulletin Chain pallets and runtime, including shared proxy and governance configuration types. + +License: Apache-2.0 diff --git a/pallets/relayer-set/Cargo.toml b/pallets/relayer-set/Cargo.toml index 1b2bb6f1b..75638bd1f 100644 --- a/pallets/relayer-set/Cargo.toml +++ b/pallets/relayer-set/Cargo.toml @@ -6,6 +6,7 @@ edition.workspace = true repository.workspace = true license = "Apache-2.0" description = "Relayer set pallet" +publish = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/transaction-storage/README.md b/pallets/transaction-storage/README.md index b2b22fe44..1232ec43f 100644 --- a/pallets/transaction-storage/README.md +++ b/pallets/transaction-storage/README.md @@ -1,82 +1,35 @@ -# Transaction Storage Pallet +# pallet-bulletin-transaction-storage -Indexes transactions and manages storage proofs. +Transaction storage pallet for the Polkadot Bulletin Chain. Indexes transactions and manages storage proofs. -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`. +## Overview -# Running a chain +This pallet provides distributed data storage on-chain with proof-of-storage guarantees. It is designed for chains with no transaction fees and data is retrievable via the Bitswap protocol using content-addressed CIDs. -The following describes how to set up a new storage chain. +Key features: +- Store arbitrary data on-chain via the `store` extrinsic +- Automatic data removal after a configurable `RetentionPeriod` (default: 14 days at 6s block time) +- Data renewal to extend retention via `renew` +- Validators submit proofs of storing random data chunks when producing blocks +- CID generation for content-addressed data retrieval via Bitswap -Start with generating a chain spec. +## Usage -```bash -cargo run --release -- build-spec --chain=local > sc_init.json -``` +### Storing data -Edit the json chain spec file to customise the chain. The storage chain genesis params are configured in the `transactionStorage` section. -Note that `retentionPeriod` is specified in blocks and changing it also requires code changes at the moment. +Use the `transactionStorage.store` extrinsic to store data. A CID is generated from the content hash for retrieval via Bitswap. -Build a raw spec from the init spec. +### Renewing data -```bash -cargo run --release build-spec --chain=sc_init.json --raw > sc.json -``` +To prevent data from being removed 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. -Run a few validator nodes. +### Retrieving data -```bash -cargo run --release -- --chain=sc.json -d /tmp/alice --storage-chain --keep-blocks=100800 --ipfs-server --validator --alice -cargo run --release -- --chain=sc.json -d /tmp/bob --storage-chain --keep-blocks=100800 --ipfs-server --validator --bob -``` +Stored data is retrievable via the Bitswap protocol using the CID generated at storage time. -`--storage-chain` enables transaction indexing. -`--keep-blocks=100800` enables block pruning. The value here should be 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. - -```bash -cargo run --release -- --chain=sc.json -d /tmp/charlie --storage-chain --keep-blocks=100800 --ipfs-server --validator --charlie --sync=fast -``` - -# Making transactions - -To store data use the `transactionStorage.store` extrinsic. And IPFS CID can be generated from the Blake2-256 hash of the data. - -```js -const util_crypto = require('@polkadot/util-crypto'); -const keyring_api = require('@polkadot/keyring'); -const polkadot_api = require('@polkadot/api'); -const fs = require('fs'); -const multihash = require('multihashes'); -const CID = require('cids') - -const wsProvider = new polkadot_api.WsProvider(); -const api = await polkadot_api.ApiPromise.create({ provider: wsProvider }); - -const keyring = new keyring_api.Keyring({ type: "sr25519" }); -const alice = keyring.addFromUri("//Alice"); - -const file = fs.readFileSync('cute_kitten.jpeg'); -const hash = util_crypto.blake2AsU8a(file) -const encoded_hash = multihash.encode(hash, 'blake2b-256'); - -const cid = new CID(1, 'blake2b-256', encoded_hash) -console.log(cid.toString()); - -const txHash = await api.tx.transactionStorage.store('0x' + file.toString('hex')).signAndSend(alice); -``` -Data can be queried over IPFS - -```bash -ipfs swarm connect -ipfs block get /ipfs/ > kitten.jpeg -``` - -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 transction, and index is the index of that transaction in the block. +## Dependencies +- [`bulletin-transaction-storage-primitives`](primitives/) — CID utilities and shared types +- `sp-transaction-storage-proof` — Storage proof verification from Polkadot SDK License: Apache-2.0 diff --git a/pallets/transaction-storage/primitives/Cargo.toml b/pallets/transaction-storage/primitives/Cargo.toml index 00bdbfee3..765ae79a9 100644 --- a/pallets/transaction-storage/primitives/Cargo.toml +++ b/pallets/transaction-storage/primitives/Cargo.toml @@ -4,8 +4,10 @@ version = "0.1.0" authors.workspace = true edition.workspace = true license = "Apache-2.0" +homepage.workspace = true repository.workspace = true description = "Primitives for transaction storage pallet" +readme = "README.md" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/transaction-storage/primitives/README.md b/pallets/transaction-storage/primitives/README.md new file mode 100644 index 000000000..bfb15f816 --- /dev/null +++ b/pallets/transaction-storage/primitives/README.md @@ -0,0 +1,5 @@ +# bulletin-transaction-storage-primitives + +Primitive types and CID utilities for the Polkadot Bulletin Chain transaction storage pallet. + +License: Apache-2.0 diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index a88f888c3..51931681c 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -5,6 +5,7 @@ authors = ['Gautam Dhameja ', 'Parity Technologies Date: Thu, 26 Mar 2026 12:15:07 +0100 Subject: [PATCH 7/9] Apply formatting and lint fixes --- Cargo.toml | 6 ++-- node/Cargo.toml | 4 +-- pallets/transaction-storage/Cargo.toml | 4 +-- pallets/transaction-storage/src/lib.rs | 8 ++--- pallets/transaction-storage/src/migrations.rs | 8 ++--- pallets/transaction-storage/src/mock.rs | 4 +-- pallets/transaction-storage/src/tests.rs | 2 +- pallets/validator-set/Cargo.toml | 6 ++-- runtimes/bulletin-polkadot/Cargo.toml | 14 ++++----- runtimes/bulletin-polkadot/src/lib.rs | 16 ++++++---- runtimes/bulletin-polkadot/src/weights/mod.rs | 2 +- runtimes/bulletin-polkadot/tests/tests.rs | 2 +- runtimes/bulletin-westend/Cargo.toml | 14 ++++----- runtimes/bulletin-westend/src/storage.rs | 7 +++-- runtimes/bulletin-westend/src/weights/mod.rs | 2 +- runtimes/bulletin-westend/tests/tests.rs | 30 +++++++++---------- 16 files changed, 68 insertions(+), 61 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a5cd5d21f..b77b7ed0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,13 +35,13 @@ tracing = { version = "0.1.41", default-features = false } westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk.git", package = "westend-runtime-constants", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } # Local workspace members +bulletin-pallets-common = { path = "pallets/common", default-features = false } bulletin-polkadot-runtime = { path = "runtimes/bulletin-polkadot" } +bulletin-transaction-storage-primitives = { path = "pallets/transaction-storage/primitives", default-features = false } bulletin-westend-runtime = { path = "runtimes/bulletin-westend" } -pallet-relayer-set = { path = "pallets/relayer-set", default-features = false } pallet-bulletin-transaction-storage = { path = "pallets/transaction-storage", default-features = false } +pallet-relayer-set = { path = "pallets/relayer-set", default-features = false } pallet-validator-set = { path = "pallets/validator-set", default-features = false } -bulletin-pallets-common = { path = "pallets/common", default-features = false } -bulletin-transaction-storage-primitives = { path = "pallets/transaction-storage/primitives", default-features = false } # Polkadot SDK crates (shared git revision) frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "f9df32360c6c22747f60b3ff58243890eecafc8e", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index fcd8aa385..82791155f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -89,8 +89,8 @@ runtime-benchmarks = [ "frame-benchmarking-cli/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "pallet-transaction-payment/runtime-benchmarks", "pallet-bulletin-transaction-storage/runtime-benchmarks", + "pallet-transaction-payment/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", @@ -101,7 +101,7 @@ try-runtime = [ "bulletin-polkadot-runtime/try-runtime", "frame-support/try-runtime", "frame-try-runtime/try-runtime", - "pallet-transaction-payment/try-runtime", "pallet-bulletin-transaction-storage/try-runtime", + "pallet-transaction-payment/try-runtime", "sp-runtime/try-runtime", ] diff --git a/pallets/transaction-storage/Cargo.toml b/pallets/transaction-storage/Cargo.toml index ae0f05bb0..4518f9aaf 100644 --- a/pallets/transaction-storage/Cargo.toml +++ b/pallets/transaction-storage/Cargo.toml @@ -35,13 +35,13 @@ runtime-benchmarks = [ "polkadot-sdk-frame/runtime-benchmarks", ] std = [ - "codec/std", "bulletin-pallets-common/std", + "bulletin-transaction-storage-primitives/std", + "codec/std", "polkadot-sdk-frame/std", "scale-info/std", "sp-transaction-storage-proof/std", "tracing/std", - "bulletin-transaction-storage-primitives/std", ] try-runtime = [ "bulletin-pallets-common/try-runtime", diff --git a/pallets/transaction-storage/src/lib.rs b/pallets/transaction-storage/src/lib.rs index a1f17d875..198c98294 100644 --- a/pallets/transaction-storage/src/lib.rs +++ b/pallets/transaction-storage/src/lib.rs @@ -37,6 +37,10 @@ mod mock; mod tests; use alloc::vec::Vec; +use bulletin_transaction_storage_primitives::{ + cids::{calculate_cid, Cid, CidCodec, CidConfig, HashingAlgorithm, RAW_CODEC}, + ContentHash, +}; use codec::{Decode, Encode, MaxEncodedLen}; use core::fmt::Debug; use polkadot_sdk_frame::{ @@ -51,10 +55,6 @@ use sp_transaction_storage_proof::{ encode_index, num_chunks, random_chunk, ChunkIndex, InherentError, TransactionStorageProof, CHUNK_SIZE, INHERENT_IDENTIFIER, }; -use bulletin_transaction_storage_primitives::{ - cids::{calculate_cid, Cid, CidCodec, CidConfig, HashingAlgorithm, RAW_CODEC}, - ContentHash, -}; /// A type alias for the balance type from this pallet's point of view. type BalanceOf = diff --git a/pallets/transaction-storage/src/migrations.rs b/pallets/transaction-storage/src/migrations.rs index 01eaa86c4..520ef64af 100644 --- a/pallets/transaction-storage/src/migrations.rs +++ b/pallets/transaction-storage/src/migrations.rs @@ -76,6 +76,10 @@ pub mod v1 { pallet::{Pallet, Transactions}, TransactionInfo, }; + use bulletin_transaction_storage_primitives::{ + cids::{CidCodec, HashingAlgorithm, RAW_CODEC}, + ContentHash, + }; use polkadot_sdk_frame::deps::{ frame_support::{ migrations::VersionedMigration, @@ -87,10 +91,6 @@ pub mod v1 { sp_runtime::traits::{BlakeTwo256, Hash}, }; use sp_transaction_storage_proof::ChunkIndex; - use bulletin_transaction_storage_primitives::{ - cids::{CidCodec, HashingAlgorithm, RAW_CODEC}, - ContentHash, - }; /// `TransactionInfo` layout before v1 (no CID fields). #[derive(Encode, Decode, Clone, Debug, MaxEncodedLen)] diff --git a/pallets/transaction-storage/src/mock.rs b/pallets/transaction-storage/src/mock.rs index 876bb39de..19409e133 100644 --- a/pallets/transaction-storage/src/mock.rs +++ b/pallets/transaction-storage/src/mock.rs @@ -18,8 +18,8 @@ //! Test environment for transaction-storage pallet. use crate::{ - self as pallet_bulletin_transaction_storage, TransactionStorageProof, DEFAULT_MAX_BLOCK_TRANSACTIONS, - DEFAULT_MAX_TRANSACTION_SIZE, + self as pallet_bulletin_transaction_storage, TransactionStorageProof, + DEFAULT_MAX_BLOCK_TRANSACTIONS, DEFAULT_MAX_TRANSACTION_SIZE, }; use bulletin_pallets_common::NoCurrency; use polkadot_sdk_frame::{prelude::*, runtime::prelude::*, testing_prelude::*}; diff --git a/pallets/transaction-storage/src/tests.rs b/pallets/transaction-storage/src/tests.rs index 837ef41f9..ffb5f8314 100644 --- a/pallets/transaction-storage/src/tests.rs +++ b/pallets/transaction-storage/src/tests.rs @@ -29,6 +29,7 @@ use super::{ DEFAULT_MAX_TRANSACTION_SIZE, }; use crate::migrations::v1::OldTransactionInfo; +use bulletin_transaction_storage_primitives::cids::{CidConfig, HashingAlgorithm}; use codec::Encode; use polkadot_sdk_frame::{ deps::frame_support::{ @@ -42,7 +43,6 @@ use polkadot_sdk_frame::{ traits::StorageVersion, }; use sp_transaction_storage_proof::{random_chunk, registration::build_proof, CHUNK_SIZE}; -use bulletin_transaction_storage_primitives::cids::{CidConfig, HashingAlgorithm}; type Call = super::Call; type Error = super::Error; diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index 51931681c..9976a4057 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -27,14 +27,14 @@ bulletin-pallets-common = { workspace = true, default-features = false } [features] default = ['std'] runtime-benchmarks = [ - "pallet-session/runtime-benchmarks", "bulletin-pallets-common/runtime-benchmarks", + "pallet-session/runtime-benchmarks", "polkadot-sdk-frame/runtime-benchmarks", "sp-staking/runtime-benchmarks", ] std = [ - "log/std", "bulletin-pallets-common/std", + "log/std", "sp-staking/std", 'codec/std', 'pallet-session/std', @@ -42,7 +42,7 @@ std = [ 'scale-info/std', ] try-runtime = [ - "pallet-session/try-runtime", "bulletin-pallets-common/try-runtime", + "pallet-session/try-runtime", 'polkadot-sdk-frame/try-runtime', ] diff --git a/runtimes/bulletin-polkadot/Cargo.toml b/runtimes/bulletin-polkadot/Cargo.toml index b4469e926..bbacb85bc 100644 --- a/runtimes/bulletin-polkadot/Cargo.toml +++ b/runtimes/bulletin-polkadot/Cargo.toml @@ -144,12 +144,12 @@ std = [ "frame-benchmarking?/std", "frame-system-benchmarking?/std", + "bulletin-pallets-common/std", + "pallet-bulletin-transaction-storage/std", "pallet-relayer-set/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", - "pallet-bulletin-transaction-storage/std", "pallet-validator-set/std", - "bulletin-pallets-common/std", "bp-header-chain/std", "bp-messages/std", @@ -167,6 +167,7 @@ std = [ "xcm-executor/std", "xcm/std", + "bulletin-transaction-storage-primitives/std", "pallet-bridge-relayers/std", "pallet-staking?/std", "pallet-xcm?/std", @@ -177,7 +178,6 @@ std = [ "sp-storage?/std", "sp-trie/std", "substrate-wasm-builder", - "bulletin-transaction-storage-primitives/std", ] runtime-benchmarks = [ "frame-support/runtime-benchmarks", @@ -201,14 +201,14 @@ runtime-benchmarks = [ "pallet-bridge-parachains/runtime-benchmarks", "pallet-xcm-bridge-hub/runtime-benchmarks", + "pallet-bulletin-transaction-storage/runtime-benchmarks", "pallet-relayer-set/runtime-benchmarks", "pallet-session/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", - "pallet-bulletin-transaction-storage/runtime-benchmarks", "pallet-validator-set/runtime-benchmarks", - "pallet-bridge-relayers/runtime-benchmarks", "bulletin-pallets-common/runtime-benchmarks", + "pallet-bridge-relayers/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", "xcm/runtime-benchmarks", @@ -238,14 +238,14 @@ try-runtime = [ "pallet-bridge-parachains/try-runtime", "pallet-xcm-bridge-hub/try-runtime", + "bulletin-pallets-common/try-runtime", "pallet-bridge-relayers/try-runtime", + "pallet-bulletin-transaction-storage/try-runtime", "pallet-relayer-set/try-runtime", "pallet-staking/try-runtime", "pallet-transaction-payment/try-runtime", - "pallet-bulletin-transaction-storage/try-runtime", "pallet-validator-set/try-runtime", "pallet-xcm?/try-runtime", - "bulletin-pallets-common/try-runtime", "parachains-common?/try-runtime", "sp-runtime/try-runtime", ] diff --git a/runtimes/bulletin-polkadot/src/lib.rs b/runtimes/bulletin-polkadot/src/lib.rs index 4c6754ef9..b41d23279 100644 --- a/runtimes/bulletin-polkadot/src/lib.rs +++ b/runtimes/bulletin-polkadot/src/lib.rs @@ -367,8 +367,9 @@ impl SortedMembers for TestAccounts { } } -/// Tells [`pallet_bulletin_transaction_storage::extension::ValidateStorageCalls`] how to find storage -/// calls inside wrapper extrinsics so it can recursively validate and consume authorization. +/// Tells [`pallet_bulletin_transaction_storage::extension::ValidateStorageCalls`] how to find +/// storage calls inside wrapper extrinsics so it can recursively validate and consume +/// authorization. /// /// Also implements [`Contains`] returning `true` for storage-mutating calls /// (store, store_with_cid_config, renew). Used with `EverythingBut` as the XCM @@ -555,11 +556,11 @@ fn validate_purge_keys(who: &AccountId) -> TransactionValidity { } } -use pallet_bulletin_transaction_storage::{CallInspector, MAX_WRAPPER_DEPTH}; use bulletin_pallets_common::{ inspect_proxy_wrapper, inspect_sudo_wrapper, inspect_utility_wrapper, proxy_inner_calls, utility_inner_calls, }; +use pallet_bulletin_transaction_storage::{CallInspector, MAX_WRAPPER_DEPTH}; /// Extract the signer from an origin that may be either `Signed` or `Authorized`. /// @@ -571,7 +572,9 @@ fn extract_signer(origin: &RuntimeOrigin) -> Option { } match origin.caller() { OriginCaller::TransactionStorage( - pallet_bulletin_transaction_storage::pallet::Origin::::Authorized { who, .. }, + pallet_bulletin_transaction_storage::pallet::Origin::::Authorized { + who, .. + }, ) => Some(who.clone()), _ => None, } @@ -847,7 +850,10 @@ pub type TxExtension = ( frame_system::CheckEra, frame_system::CheckNonce, frame_system::CheckWeight, - pallet_bulletin_transaction_storage::extension::ValidateStorageCalls, + pallet_bulletin_transaction_storage::extension::ValidateStorageCalls< + Runtime, + StorageCallInspector, + >, AllowedSignedCalls, BridgeRejectObsoleteHeadersAndMessages, ); diff --git a/runtimes/bulletin-polkadot/src/weights/mod.rs b/runtimes/bulletin-polkadot/src/weights/mod.rs index ec2acd50e..d086258de 100644 --- a/runtimes/bulletin-polkadot/src/weights/mod.rs +++ b/runtimes/bulletin-polkadot/src/weights/mod.rs @@ -12,11 +12,11 @@ pub mod frame_system_extensions; pub mod pallet_bridge_grandpa; pub mod pallet_bridge_messages; pub mod pallet_bridge_parachains; +pub mod pallet_bulletin_transaction_storage; pub mod pallet_proxy; pub mod pallet_relayer_set; pub mod pallet_sudo; pub mod pallet_timestamp; -pub mod pallet_bulletin_transaction_storage; pub mod pallet_utility; pub mod pallet_validator_set; diff --git a/runtimes/bulletin-polkadot/tests/tests.rs b/runtimes/bulletin-polkadot/tests/tests.rs index dbc8f11e3..2868605c8 100644 --- a/runtimes/bulletin-polkadot/tests/tests.rs +++ b/runtimes/bulletin-polkadot/tests/tests.rs @@ -15,6 +15,7 @@ use bulletin_polkadot_runtime::{ }, AccountId, BridgePolkadotGrandpa, BridgePolkadotMessages, }; +use bulletin_transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; use frame_support::{assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Hooks, traits::Get}; use pallet_bridge_messages::{ messages_generation::{encode_all_messages, encode_lane_data, prepare_messages_storage_proof}, @@ -39,7 +40,6 @@ use sp_runtime::{ }; use sp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut}; use std::collections::HashMap; -use bulletin_transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; fn advance_block() { let current_number = System::block_number(); diff --git a/runtimes/bulletin-westend/Cargo.toml b/runtimes/bulletin-westend/Cargo.toml index e573b595c..97cd56d9c 100644 --- a/runtimes/bulletin-westend/Cargo.toml +++ b/runtimes/bulletin-westend/Cargo.toml @@ -94,6 +94,8 @@ substrate-wasm-builder = { optional = true, workspace = true, default-features = [features] default = ["std"] std = [ + "bulletin-pallets-common/std", + "bulletin-transaction-storage-primitives/std", "codec/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", @@ -115,6 +117,7 @@ std = [ "pallet-aura/std", "pallet-authorship/std", "pallet-balances/std", + "pallet-bulletin-transaction-storage/std", "pallet-collator-selection/std", "pallet-message-queue/std", "pallet-session/std", @@ -123,11 +126,9 @@ std = [ "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", - "pallet-bulletin-transaction-storage/std", "pallet-utility/std", "pallet-xcm-benchmarks?/std", "pallet-xcm/std", - "bulletin-pallets-common/std", "parachain-info/std", "parachains-common/std", "polkadot-parachain-primitives/std", @@ -153,7 +154,6 @@ std = [ "substrate-wasm-builder", "testnet-parachains-constants/std", "tracing/std", - "bulletin-transaction-storage-primitives/std", "westend-runtime-constants/std", "xcm-builder/std", "xcm-executor/std", @@ -161,6 +161,7 @@ std = [ "xcm/std", ] runtime-benchmarks = [ + "bulletin-pallets-common/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-weight-reclaim/runtime-benchmarks", @@ -172,6 +173,7 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", + "pallet-bulletin-transaction-storage/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", "pallet-session/runtime-benchmarks", @@ -179,11 +181,9 @@ runtime-benchmarks = [ "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", - "pallet-bulletin-transaction-storage/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "bulletin-pallets-common/runtime-benchmarks", "parachains-common/runtime-benchmarks", "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", @@ -195,6 +195,7 @@ runtime-benchmarks = [ "xcm/runtime-benchmarks", ] try-runtime = [ + "bulletin-pallets-common/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", "cumulus-pallet-weight-reclaim/try-runtime", @@ -207,6 +208,7 @@ try-runtime = [ "pallet-aura/try-runtime", "pallet-authorship/try-runtime", "pallet-balances/try-runtime", + "pallet-bulletin-transaction-storage/try-runtime", "pallet-collator-selection/try-runtime", "pallet-message-queue/try-runtime", "pallet-session/try-runtime", @@ -214,10 +216,8 @@ try-runtime = [ "pallet-sudo/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", - "pallet-bulletin-transaction-storage/try-runtime", "pallet-utility/try-runtime", "pallet-xcm/try-runtime", - "bulletin-pallets-common/try-runtime", "parachain-info/try-runtime", "parachains-common/try-runtime", "polkadot-runtime-common/try-runtime", diff --git a/runtimes/bulletin-westend/src/storage.rs b/runtimes/bulletin-westend/src/storage.rs index 4c9f0c5bf..da0a77291 100644 --- a/runtimes/bulletin-westend/src/storage.rs +++ b/runtimes/bulletin-westend/src/storage.rs @@ -21,6 +21,7 @@ use super::{ RuntimeHoldReason, }; use alloc::vec::Vec; +use bulletin_pallets_common::{inspect_utility_wrapper, NoCurrency}; use frame_support::{ parameter_types, traits::{Contains, EitherOfDiverse, SortedMembers}, @@ -28,7 +29,6 @@ use frame_support::{ use frame_system::EnsureSignedBy; use pallet_bulletin_transaction_storage::CallInspector; use pallet_xcm::EnsureXcm; -use bulletin_pallets_common::{inspect_utility_wrapper, NoCurrency}; use sp_keyring::Sr25519Keyring; use sp_runtime::transaction_validity::{TransactionLongevity, TransactionPriority}; /// Provides test accounts for use with `EnsureSignedBy`. @@ -50,8 +50,9 @@ parameter_types! { pub const StoreRenewLongevity: TransactionLongevity = crate::DAYS as TransactionLongevity; } -/// Tells [`pallet_bulletin_transaction_storage::extension::ValidateStorageCalls`] how to find storage -/// calls inside wrapper extrinsics so it can recursively validate and consume authorization. +/// Tells [`pallet_bulletin_transaction_storage::extension::ValidateStorageCalls`] how to find +/// storage calls inside wrapper extrinsics so it can recursively validate and consume +/// authorization. /// /// Also implements [`Contains`] returning `true` for storage-mutating calls /// (store, store_with_cid_config, renew). Used with `EverythingBut` as the XCM diff --git a/runtimes/bulletin-westend/src/weights/mod.rs b/runtimes/bulletin-westend/src/weights/mod.rs index 2d3c21128..ca9af0ace 100644 --- a/runtimes/bulletin-westend/src/weights/mod.rs +++ b/runtimes/bulletin-westend/src/weights/mod.rs @@ -25,12 +25,12 @@ pub mod extrinsic_weights; pub mod frame_system; pub mod frame_system_extensions; pub mod pallet_balances; +pub mod pallet_bulletin_transaction_storage; pub mod pallet_collator_selection; pub mod pallet_message_queue; pub mod pallet_session; pub mod pallet_timestamp; pub mod pallet_transaction_payment; -pub mod pallet_bulletin_transaction_storage; pub mod pallet_utility; pub mod pallet_xcm; pub mod paritydb_weights; diff --git a/runtimes/bulletin-westend/tests/tests.rs b/runtimes/bulletin-westend/tests/tests.rs index e46eb5e18..866032084 100644 --- a/runtimes/bulletin-westend/tests/tests.rs +++ b/runtimes/bulletin-westend/tests/tests.rs @@ -16,6 +16,7 @@ #![cfg(test)] +use bulletin_transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; use bulletin_westend_runtime as runtime; use bulletin_westend_runtime::{ xcm_config::{GovernanceLocation, LocationToAccountId}, @@ -38,7 +39,6 @@ use sp_runtime::{ }; use std::collections::HashMap; use testnet_parachains_constants::westend::{fee::WeightToFee, locations::PeopleLocation}; -use bulletin_transaction_storage_primitives::cids::{calculate_cid, CidConfig, HashingAlgorithm}; use xcm::latest::prelude::*; use xcm_runtime_apis::conversions::LocationToAccountHelper; @@ -615,13 +615,13 @@ fn non_authorizer_cannot_sign_authorize_account_extrinsic() { fn people_chain_can_authorize_storage_with_transact() { // Prepare call. let account = Sr25519Keyring::Ferdie; - let authorize_call = RuntimeCall::TransactionStorage(pallet_bulletin_transaction_storage::Call::< - Runtime, - >::authorize_account { - who: account.to_account_id(), - transactions: 16, - bytes: 1024, - }); + let authorize_call = RuntimeCall::TransactionStorage( + pallet_bulletin_transaction_storage::Call::::authorize_account { + who: account.to_account_id(), + transactions: 16, + bytes: 1024, + }, + ); // Execute XCM as People chain origin would do with `Transact -> Origin::Xcm`. ExtBuilder::::default() @@ -659,13 +659,13 @@ fn people_next_chain_can_authorize_storage_with_transact() { let people_next_location = Location::new(1, [Parachain(5140)]); let account = Sr25519Keyring::Ferdie; - let authorize_call = RuntimeCall::TransactionStorage(pallet_bulletin_transaction_storage::Call::< - Runtime, - >::authorize_account { - who: account.to_account_id(), - transactions: 16, - bytes: 1024, - }); + let authorize_call = RuntimeCall::TransactionStorage( + pallet_bulletin_transaction_storage::Call::::authorize_account { + who: account.to_account_id(), + transactions: 16, + bytes: 1024, + }, + ); ExtBuilder::::default() .with_collators(vec![AccountId::from(ALICE)]) From 0a9d491a5d6c52315483262874bd67157c794234 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 2 Apr 2026 15:02:27 +0200 Subject: [PATCH 8/9] nit --- sdk/rust/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/rust/Cargo.toml b/sdk/rust/Cargo.toml index 2f9c4a1a2..acfa9b4ae 100644 --- a/sdk/rust/Cargo.toml +++ b/sdk/rust/Cargo.toml @@ -41,6 +41,7 @@ subxt = "0.44" default = ["std"] std = [ + "bulletin-transaction-storage-primitives/std", "cid/std", "codec/std", "scale-info/std", @@ -50,7 +51,6 @@ std = [ "subxt-signer", "thiserror", "tokio", - "bulletin-transaction-storage-primitives/std", ] # Runtime benchmarking (no-op for SDK, but required for workspace consistency) From 62a0bb434f3d1f35c794ba94f6601c28bc8a1e37 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 2 Apr 2026 22:21:20 +0200 Subject: [PATCH 9/9] Fix benchmark compilation after pallet crate rename Update references from `pallet_transaction_storage` to `pallet_bulletin_transaction_storage` in both runtimes' benchmark code. --- runtimes/bulletin-polkadot/src/lib.rs | 4 +++- runtimes/bulletin-westend/src/storage.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/runtimes/bulletin-polkadot/src/lib.rs b/runtimes/bulletin-polkadot/src/lib.rs index 6b7a342c8..0e7800b8a 100644 --- a/runtimes/bulletin-polkadot/src/lib.rs +++ b/runtimes/bulletin-polkadot/src/lib.rs @@ -466,7 +466,9 @@ const CHECK_PROOF: &str = "\ "; #[cfg(feature = "runtime-benchmarks")] -impl pallet_transaction_storage::benchmarking::BenchmarkHelper for CheckProofHelper { +impl pallet_bulletin_transaction_storage::benchmarking::BenchmarkHelper + for CheckProofHelper +{ fn encoded_check_proof(random_hash: &[u8]) -> Vec { assert_eq!(random_hash, &[0u8; 32], "CheckProofHelper proof was built with [0u8; 32]"); array_bytes::hex2bytes_unchecked(CHECK_PROOF) diff --git a/runtimes/bulletin-westend/src/storage.rs b/runtimes/bulletin-westend/src/storage.rs index d8d520a5d..32c2a5705 100644 --- a/runtimes/bulletin-westend/src/storage.rs +++ b/runtimes/bulletin-westend/src/storage.rs @@ -111,5 +111,6 @@ impl pallet_bulletin_transaction_storage::Config for Runtime { type RemoveExpiredAuthorizationPriority = RemoveExpiredAuthorizationPriority; type RemoveExpiredAuthorizationLongevity = RemoveExpiredAuthorizationLongevity; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = pallet_transaction_storage::benchmarking::DefaultCheckProofHelper; + type BenchmarkHelper = + pallet_bulletin_transaction_storage::benchmarking::DefaultCheckProofHelper; }