From 91987daf1ee3d85ecc93b7b54bdce417082ddbb6 Mon Sep 17 00:00:00 2001 From: Gonza Montiel Date: Thu, 29 Jan 2026 10:13:31 -0300 Subject: [PATCH 1/4] fix: set username grace period and deposit (#416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary Set username deletion to use a 30‑day grace period (in blocks) and added a non‑zero username deposit, both based on the Moonbeam's runtimes. This makes username unbinding wait before deletion and makes authority‑issued usernames non‑free, mitigating the sybil vector while aligning with existing identity config patterns. ### Changes - Configures for `pallet_identity` - `UsernameGracePeriod = 30 * DAYS` - `UsernameGracePeriod = deposit(0, MaxUsernameLength::get())` --- operator/runtime/mainnet/src/configs/mod.rs | 6 ++++-- operator/runtime/stagenet/src/configs/mod.rs | 6 ++++-- operator/runtime/testnet/src/configs/mod.rs | 6 ++++-- test/.papi/metadata/datahaven.scale | Bin 627667 -> 627667 bytes 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/operator/runtime/mainnet/src/configs/mod.rs b/operator/runtime/mainnet/src/configs/mod.rs index db7e60be..3bd49071 100644 --- a/operator/runtime/mainnet/src/configs/mod.rs +++ b/operator/runtime/mainnet/src/configs/mod.rs @@ -595,6 +595,8 @@ parameter_types! { pub const MaxAdditionalFields: u32 = 100; pub const MaxRegistrars: u32 = 20; pub const PendingUsernameExpiration: u32 = 7 * DAYS; + pub const UsernameGracePeriod: u32 = 30 * DAYS; + pub const UsernameDeposit: Balance = deposit(0, MaxUsernameLength::get()); pub const MaxSuffixLength: u32 = 7; pub const MaxUsernameLength: u32 = 32; } @@ -626,8 +628,8 @@ impl pallet_identity::Config for Runtime { type MaxSuffixLength = MaxSuffixLength; type MaxUsernameLength = MaxUsernameLength; type WeightInfo = pallet_identity::weights::SubstrateWeight; - type UsernameDeposit = (); - type UsernameGracePeriod = (); + type UsernameDeposit = UsernameDeposit; + type UsernameGracePeriod = UsernameGracePeriod; // TODO: Re-enable after upgrade to Polkadot SDK stable2412-8 // see https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-8 diff --git a/operator/runtime/stagenet/src/configs/mod.rs b/operator/runtime/stagenet/src/configs/mod.rs index 63c05aac..509734a7 100644 --- a/operator/runtime/stagenet/src/configs/mod.rs +++ b/operator/runtime/stagenet/src/configs/mod.rs @@ -592,6 +592,8 @@ parameter_types! { pub const MaxAdditionalFields: u32 = 100; pub const MaxRegistrars: u32 = 20; pub const PendingUsernameExpiration: u32 = 7 * DAYS; + pub const UsernameGracePeriod: u32 = 30 * DAYS; + pub const UsernameDeposit: Balance = deposit(0, MaxUsernameLength::get()); pub const MaxSuffixLength: u32 = 7; pub const MaxUsernameLength: u32 = 32; } @@ -623,8 +625,8 @@ impl pallet_identity::Config for Runtime { type MaxSuffixLength = MaxSuffixLength; type MaxUsernameLength = MaxUsernameLength; type WeightInfo = pallet_identity::weights::SubstrateWeight; - type UsernameDeposit = (); - type UsernameGracePeriod = (); + type UsernameDeposit = UsernameDeposit; + type UsernameGracePeriod = UsernameGracePeriod; // TODO: Re-enable after upgrade to Polkadot SDK stable2412-8 // see https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-8 diff --git a/operator/runtime/testnet/src/configs/mod.rs b/operator/runtime/testnet/src/configs/mod.rs index bc48c537..0ba71058 100644 --- a/operator/runtime/testnet/src/configs/mod.rs +++ b/operator/runtime/testnet/src/configs/mod.rs @@ -595,6 +595,8 @@ parameter_types! { pub const MaxAdditionalFields: u32 = 100; pub const MaxRegistrars: u32 = 20; pub const PendingUsernameExpiration: u32 = 7 * DAYS; + pub const UsernameGracePeriod: u32 = 30 * DAYS; + pub const UsernameDeposit: Balance = deposit(0, MaxUsernameLength::get()); pub const MaxSuffixLength: u32 = 7; pub const MaxUsernameLength: u32 = 32; } @@ -626,8 +628,8 @@ impl pallet_identity::Config for Runtime { type MaxSuffixLength = MaxSuffixLength; type MaxUsernameLength = MaxUsernameLength; type WeightInfo = pallet_identity::weights::SubstrateWeight; - type UsernameDeposit = (); - type UsernameGracePeriod = (); + type UsernameDeposit = UsernameDeposit; + type UsernameGracePeriod = UsernameGracePeriod; // TODO: Re-enable after upgrade to Polkadot SDK stable2412-8 // see https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-8 diff --git a/test/.papi/metadata/datahaven.scale b/test/.papi/metadata/datahaven.scale index a63800a7d3a479325216192462894c147ec14c4a..74c4129cc1309e6955671c0e29d8c78e1c94fbb7 100644 GIT binary patch delta 57 zcmcb-TF7M3lnJF8he_>F7M3lnJFBPfabe}#e!QAhnVFe^fua3v9V-yC0Wmueb8LTG I$N5YI0Ct-epa1{> From 2f3d669b42c65adeccae8312e111b2c5ab53c780 Mon Sep 17 00:00:00 2001 From: Michael Assaf <94772640+snowmead@users.noreply.github.com> Date: Thu, 29 Jan 2026 14:09:56 -0500 Subject: [PATCH 2/4] build: :arrow_up: Upgrade to SH v0.3.5 (#423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrades StorageHub dependencies from v0.3.3 to v0.3.5. This requires a client upgrade. ## ⚠️ Breaking Changes ⚠️ Fisherman CLI options have been added to support specifying filtering and ordering strategies for pending file deletions with reasonable defaults: - `--fisherman-filtering`: The filtering strategy [**`none` (default)**, `ttl`] - `--fisherman-ordering`: The ordering strategy [**`chronological` (default)**, `randomized`] - `--fisherman-ttl-threshold-seconds`: TTL for a file to be ignored for deletion in seconds MSP and BSP CLI options have been added to support specifying a specific batch response and confirm size for MSP and BSP nodes with reasonable defaults. - `--bsp-confirm-file-batch-size`: How many storage requests to respond to (confirming) in a single extrinsic call **(default: 20)** - `--msp-respond-storage-batch-size`: How many storage requests to respond to (accepting or rejecting) in a single extrinsic call **(default: 20)** --- operator/Cargo.lock | 148 +++++++++++++++++++-------------------- operator/Cargo.toml | 68 +++++++++--------- operator/node/src/cli.rs | 95 +++++++++++++++++++++++++ 3 files changed, 203 insertions(+), 108 deletions(-) diff --git a/operator/Cargo.lock b/operator/Cargo.lock index f04f35fd..cb1e81c8 100644 --- a/operator/Cargo.lock +++ b/operator/Cargo.lock @@ -8618,8 +8618,8 @@ dependencies = [ [[package]] name = "pallet-bucket-nfts" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -8675,8 +8675,8 @@ dependencies = [ [[package]] name = "pallet-cr-randomness" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-support", "frame-system", @@ -8959,8 +8959,8 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-file-system" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "fp-account", "fp-evm", @@ -9199,8 +9199,8 @@ dependencies = [ [[package]] name = "pallet-file-system" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -9226,8 +9226,8 @@ dependencies = [ [[package]] name = "pallet-file-system-runtime-api" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "parity-scale-codec", "scale-info", @@ -9422,8 +9422,8 @@ dependencies = [ [[package]] name = "pallet-payment-streams" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -9442,8 +9442,8 @@ dependencies = [ [[package]] name = "pallet-payment-streams-runtime-api" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "parity-scale-codec", "scale-info", @@ -9470,8 +9470,8 @@ dependencies = [ [[package]] name = "pallet-proofs-dealer" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -9492,8 +9492,8 @@ dependencies = [ [[package]] name = "pallet-proofs-dealer-runtime-api" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "parity-scale-codec", "scale-info", @@ -9514,8 +9514,8 @@ dependencies = [ [[package]] name = "pallet-randomness" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -9655,8 +9655,8 @@ dependencies = [ [[package]] name = "pallet-storage-providers" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-benchmarking", "frame-support", @@ -9677,8 +9677,8 @@ dependencies = [ [[package]] name = "pallet-storage-providers-runtime-api" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "parity-scale-codec", "scale-info", @@ -13840,8 +13840,8 @@ dependencies = [ [[package]] name = "shc-actors-derive" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "once_cell", "proc-macro2", @@ -13853,8 +13853,8 @@ dependencies = [ [[package]] name = "shc-actors-framework" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "bincode", @@ -13872,8 +13872,8 @@ dependencies = [ [[package]] name = "shc-blockchain-service" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "array-bytes", @@ -13928,8 +13928,8 @@ dependencies = [ [[package]] name = "shc-blockchain-service-db" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "chrono", "diesel", @@ -13952,8 +13952,8 @@ dependencies = [ [[package]] name = "shc-client" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "array-bytes", @@ -14026,8 +14026,8 @@ dependencies = [ [[package]] name = "shc-common" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "bigdecimal", @@ -14090,8 +14090,8 @@ dependencies = [ [[package]] name = "shc-file-manager" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "bincode", "hash-db", @@ -14114,8 +14114,8 @@ dependencies = [ [[package]] name = "shc-file-transfer-service" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "array-bytes", @@ -14143,8 +14143,8 @@ dependencies = [ [[package]] name = "shc-fisherman-service" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "async-trait", "diesel", @@ -14174,8 +14174,8 @@ dependencies = [ [[package]] name = "shc-forest-manager" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "async-trait", @@ -14200,8 +14200,8 @@ dependencies = [ [[package]] name = "shc-indexer-db" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "bigdecimal", "chrono", @@ -14228,8 +14228,8 @@ dependencies = [ [[package]] name = "shc-indexer-service" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "anyhow", "array-bytes", @@ -14279,8 +14279,8 @@ dependencies = [ [[package]] name = "shc-rpc" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "array-bytes", "async-trait", @@ -14325,8 +14325,8 @@ dependencies = [ [[package]] name = "shc-telemetry" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -14342,8 +14342,8 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "shp-constants" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "sp-core", "sp-runtime", @@ -14351,8 +14351,8 @@ dependencies = [ [[package]] name = "shp-data-price-updater" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-support", "parity-scale-codec", @@ -14366,8 +14366,8 @@ dependencies = [ [[package]] name = "shp-file-key-verifier" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-support", "parity-scale-codec", @@ -14384,8 +14384,8 @@ dependencies = [ [[package]] name = "shp-file-metadata" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "hex", "num-bigint", @@ -14400,8 +14400,8 @@ dependencies = [ [[package]] name = "shp-forest-verifier" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-support", "parity-scale-codec", @@ -14417,16 +14417,16 @@ dependencies = [ [[package]] name = "shp-opaque" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "sp-runtime", ] [[package]] name = "shp-session-keys" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "async-trait", "parity-scale-codec", @@ -14440,8 +14440,8 @@ dependencies = [ [[package]] name = "shp-traits" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "frame-support", "parity-scale-codec", @@ -14454,8 +14454,8 @@ dependencies = [ [[package]] name = "shp-treasury-funding" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "log", "shp-traits", @@ -14465,8 +14465,8 @@ dependencies = [ [[package]] name = "shp-tx-implicits-runtime-api" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "parity-scale-codec", "scale-info", @@ -14478,8 +14478,8 @@ dependencies = [ [[package]] name = "shp-types" -version = "0.3.3" -source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.3#57d2a195d58d39e0d6e38a927ec312dd0f640522" +version = "0.3.5" +source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.3.5#e21f2316c07e9fc43fc67f20373e6c24a8f4d5ae" dependencies = [ "sp-core", "sp-runtime", diff --git a/operator/Cargo.toml b/operator/Cargo.toml index 5796fad8..a4b3c94f 100644 --- a/operator/Cargo.toml +++ b/operator/Cargo.toml @@ -265,42 +265,42 @@ fc-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stabl # StorageHub ## Runtime -pallet-bucket-nfts = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-cr-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-file-system-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-payment-streams = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-payment-streams-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-proofs-dealer = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-proofs-dealer-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-storage-providers = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -pallet-storage-providers-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-constants = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-data-price-updater = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-file-key-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-file-metadata = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-forest-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-traits = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-treasury-funding = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } +pallet-bucket-nfts = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-cr-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-file-system-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-payment-streams = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-payment-streams-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-proofs-dealer = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-proofs-dealer-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-storage-providers = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +pallet-storage-providers-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-constants = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-data-price-updater = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-file-key-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-file-metadata = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-forest-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-traits = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-treasury-funding = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } ## Client -shc-actors-derive = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-actors-framework = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-blockchain-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-client = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-common = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-file-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-file-transfer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-fisherman-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-forest-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-indexer-db = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-indexer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shc-rpc = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-opaque = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-tx-implicits-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } -shp-types = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } +shc-actors-derive = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-actors-framework = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-blockchain-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-client = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-common = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-file-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-file-transfer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-fisherman-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-forest-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-indexer-db = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-indexer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shc-rpc = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-opaque = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-tx-implicits-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } +shp-types = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } ## Precompiles -pallet-evm-precompile-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.3", default-features = false } +pallet-evm-precompile-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.3.5", default-features = false } # Static linking diff --git a/operator/node/src/cli.rs b/operator/node/src/cli.rs index 4ce67df6..1573aa77 100644 --- a/operator/node/src/cli.rs +++ b/operator/node/src/cli.rs @@ -24,6 +24,7 @@ use shc_client::builder::{ BspUploadFileOptions, FishermanOptions, IndexerOptions, MspChargeFeesOptions, MspMoveBucketOptions, }; +use shc_indexer_db::models::{FileFiltering, FileOrdering}; use shc_indexer_service::IndexerMode; use shc_rpc::RpcConfig; use shp_types::StorageDataUnit; @@ -300,6 +301,15 @@ pub struct ProviderConfigurations { #[arg(long, value_name = "COUNT", default_value = "1024")] pub internal_buffer_size: Option, + /// Maximum number of MSP respond storage requests to batch together (default: 20) + #[arg( + long, + value_name = "COUNT", + help_heading = "Blockchain Service Options", + default_value = "20" + )] + pub msp_respond_storage_batch_size: Option, + // ============== MSP Charge Fees task options ============== /// Enable and configure MSP Charge Fees task. #[arg(long)] @@ -383,6 +393,15 @@ pub struct ProviderConfigurations { )] pub bsp_upload_file_max_tip: Option, + /// Maximum number of BSP confirm storing requests to batch together (default: 20) + #[arg( + long, + value_name = "COUNT", + help_heading = "Blockchain Service Options", + default_value = "20" + )] + pub bsp_confirm_file_batch_size: Option, + // ============== BSP Move Bucket task options ============== /// Enable and configure BSP Move Bucket task. #[arg(long)] @@ -593,6 +612,16 @@ impl ProviderConfigurations { bs_changed = true; } + if let Some(bsp_confirm_file_batch_size) = self.bsp_confirm_file_batch_size { + bs_options.bsp_confirm_file_batch_size = Some(bsp_confirm_file_batch_size); + bs_changed = true; + } + + if let Some(msp_respond_storage_batch_size) = self.msp_respond_storage_batch_size { + bs_options.msp_respond_storage_batch_size = Some(msp_respond_storage_batch_size); + bs_changed = true; + } + // Set MSP distribution flag if provided on CLI and role is MSP if self.msp_distribute_files && provider_type == ProviderType::Msp { bs_options.enable_msp_distribute_files = Some(true); @@ -674,6 +703,26 @@ impl IndexerConfigurations { } } +/// Filtering strategy for fisherman pending deletion queries. +#[derive(ValueEnum, Clone, Debug, Default)] +pub enum FishermanFiltering { + /// No filtering - process all pending deletions (default). + #[default] + None, + /// TTL-based filtering - skip deletions pending longer than threshold. + Ttl, +} + +/// Ordering strategy for fisherman pending deletion queries. +#[derive(ValueEnum, Clone, Debug, Default)] +pub enum FishermanOrdering { + /// Chronological ordering - process oldest deletions first (FIFO, default). + #[default] + Chronological, + /// Randomized ordering - shuffle processing order. + Randomized, +} + #[derive(Debug, Parser, Clone)] pub struct FishermanConfigurations { /// Enable the fisherman service. @@ -698,11 +747,55 @@ pub struct FishermanConfigurations { /// Maximum number of files to process per batch deletion cycle. #[arg(long, default_value = "1000", value_parser = clap::value_parser!(u64).range(1..))] pub fisherman_batch_deletion_limit: u64, + + /// Filtering strategy for pending deletions. + #[arg( + long, + value_enum, + default_value = "none", + help_heading = "Fisherman Strategy Options" + )] + pub fisherman_filtering: FishermanFiltering, + + /// Ordering strategy for pending deletions. + #[arg( + long, + value_enum, + default_value = "chronological", + help_heading = "Fisherman Strategy Options" + )] + pub fisherman_ordering: FishermanOrdering, + + /// TTL threshold in seconds for pending deletions. + /// Files that have been pending deletion for longer than this threshold are skipped. + /// Required when --fisherman-filtering=ttl. + #[arg( + long, + value_parser = clap::value_parser!(u64).range(1..), + required_if_eq("fisherman_filtering", "ttl"), + help_heading = "Fisherman Strategy Options" + )] + pub fisherman_ttl_threshold_seconds: Option, } impl FishermanConfigurations { pub fn fisherman_options(&self) -> Option { if self.fisherman { + // Convert CLI enums to indexer-db enums + let filtering = match self.fisherman_filtering { + FishermanFiltering::None => FileFiltering::None, + FishermanFiltering::Ttl => FileFiltering::Ttl { + threshold_seconds: self + .fisherman_ttl_threshold_seconds + .expect("Required when filtering=ttl"), + }, + }; + + let ordering = match self.fisherman_ordering { + FishermanOrdering::Chronological => FileOrdering::Chronological, + FishermanOrdering::Randomized => FileOrdering::Randomized, + }; + Some(FishermanOptions { database_url: self .fisherman_database_url @@ -711,6 +804,8 @@ impl FishermanConfigurations { batch_interval_seconds: self.fisherman_batch_interval_seconds, batch_deletion_limit: self.fisherman_batch_deletion_limit, maintenance_mode: false, // Skipping maintenance mode for now + filtering, + ordering, }) } else { None From 5f87493080938a3aee8cab50639abff116c42fbe Mon Sep 17 00:00:00 2001 From: Steve Degosserie <723552+stiiifff@users.noreply.github.com> Date: Thu, 29 Jan 2026 22:32:57 +0100 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E2=9C=A8=20Bump=20client=20version?= =?UTF-8?q?=20to=20v0.21.0=20(#424)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- operator/Cargo.lock | 116 ++++++++++++++++++++++---------------------- operator/Cargo.toml | 2 +- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/operator/Cargo.lock b/operator/Cargo.lock index cb1e81c8..ea2fd6a4 100644 --- a/operator/Cargo.lock +++ b/operator/Cargo.lock @@ -1521,7 +1521,7 @@ dependencies = [ "pallet-message-queue", "parity-scale-codec", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "sp-core", "sp-runtime", "sp-std", @@ -2607,7 +2607,7 @@ dependencies = [ [[package]] name = "datahaven-mainnet-runtime" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "bridge-hub-common 0.13.1", @@ -2716,8 +2716,8 @@ dependencies = [ "shp-treasury-funding", "shp-tx-implicits-runtime-api", "smallvec", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "snowbridge-merkle-tree", "snowbridge-outbound-queue-primitives", @@ -2760,7 +2760,7 @@ dependencies = [ [[package]] name = "datahaven-node" -version = "0.20.0" +version = "0.21.0" dependencies = [ "async-channel 1.9.0", "clap", @@ -2871,7 +2871,7 @@ dependencies = [ [[package]] name = "datahaven-runtime-common" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "fp-account", @@ -2905,7 +2905,7 @@ dependencies = [ [[package]] name = "datahaven-stagenet-runtime" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "bridge-hub-common 0.13.1", @@ -3014,8 +3014,8 @@ dependencies = [ "shp-treasury-funding", "shp-tx-implicits-runtime-api", "smallvec", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "snowbridge-merkle-tree", "snowbridge-outbound-queue-primitives", @@ -3058,7 +3058,7 @@ dependencies = [ [[package]] name = "datahaven-testnet-runtime" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "bridge-hub-common 0.13.1", @@ -3167,8 +3167,8 @@ dependencies = [ "shp-treasury-funding", "shp-tx-implicits-runtime-api", "smallvec", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "snowbridge-merkle-tree", "snowbridge-outbound-queue-primitives", @@ -3360,7 +3360,7 @@ dependencies = [ [[package]] name = "dhp-bridge" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-support", "frame-system", @@ -3368,7 +3368,7 @@ dependencies = [ "pallet-datahaven-native-transfer", "pallet-external-validators", "parity-scale-codec", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "sp-core", "sp-std", @@ -8695,7 +8695,7 @@ dependencies = [ [[package]] name = "pallet-datahaven-native-transfer" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8703,7 +8703,7 @@ dependencies = [ "pallet-balances", "parity-scale-codec", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-outbound-queue-primitives", "sp-core", "sp-io", @@ -8807,7 +8807,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-balances-erc20" -version = "0.20.0" +version = "0.21.0" dependencies = [ "fp-evm", "frame-support", @@ -8830,7 +8830,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-batch" -version = "0.20.0" +version = "0.21.0" dependencies = [ "evm", "fp-evm", @@ -8869,7 +8869,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-call-permit" -version = "0.20.0" +version = "0.21.0" dependencies = [ "evm", "fp-evm", @@ -8935,7 +8935,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-datahaven-native-transfer" -version = "0.20.0" +version = "0.21.0" dependencies = [ "evm", "fp-evm", @@ -8949,7 +8949,7 @@ dependencies = [ "parity-scale-codec", "precompile-utils", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-outbound-queue-primitives", "sp-core", "sp-io", @@ -9028,7 +9028,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-proxy" -version = "0.20.0" +version = "0.21.0" dependencies = [ "evm", "fp-evm", @@ -9072,7 +9072,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-registry" -version = "0.20.0" +version = "0.21.0" dependencies = [ "fp-evm", "frame-support", @@ -9123,7 +9123,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-outbound-queue-primitives", "sp-core", "sp-io", @@ -9133,7 +9133,7 @@ dependencies = [ [[package]] name = "pallet-external-validators" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9157,7 +9157,7 @@ dependencies = [ [[package]] name = "pallet-external-validators-rewards" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9170,7 +9170,7 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-outbound-queue-primitives", "sp-core", "sp-io", @@ -9394,7 +9394,7 @@ dependencies = [ [[package]] name = "pallet-outbound-commitment-store" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-support", "frame-system", @@ -14759,7 +14759,7 @@ dependencies = [ [[package]] name = "snowbridge-beacon-primitives" -version = "0.20.0" +version = "0.21.0" dependencies = [ "byte-slice-cast", "frame-support", @@ -14804,7 +14804,7 @@ dependencies = [ [[package]] name = "snowbridge-core" -version = "0.20.0" +version = "0.21.0" dependencies = [ "bp-relayers", "ethabi-decode", @@ -14881,8 +14881,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-verification-primitives", "sp-core", "sp-io", @@ -14895,7 +14895,7 @@ dependencies = [ [[package]] name = "snowbridge-merkle-tree" -version = "0.20.0" +version = "0.21.0" dependencies = [ "array-bytes", "hex", @@ -14936,7 +14936,7 @@ dependencies = [ [[package]] name = "snowbridge-outbound-queue-primitives" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "ethabi-decode", @@ -14948,7 +14948,7 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-verification-primitives", "sp-arithmetic", "sp-core", @@ -14962,12 +14962,12 @@ dependencies = [ [[package]] name = "snowbridge-outbound-queue-v2-runtime-api" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-merkle-tree", "snowbridge-outbound-queue-primitives", "sp-api", @@ -14977,7 +14977,7 @@ dependencies = [ [[package]] name = "snowbridge-pallet-ethereum-client" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -14990,8 +14990,8 @@ dependencies = [ "scale-info", "serde", "serde_json", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-ethereum 0.3.0", "snowbridge-inbound-queue-primitives", "snowbridge-pallet-ethereum-client-fixtures", @@ -15007,8 +15007,8 @@ name = "snowbridge-pallet-ethereum-client-fixtures" version = "0.9.0" dependencies = [ "hex-literal 0.3.4", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "sp-core", "sp-std", @@ -15016,7 +15016,7 @@ dependencies = [ [[package]] name = "snowbridge-pallet-inbound-queue-v2" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "bp-relayers", @@ -15030,8 +15030,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "snowbridge-pallet-ethereum-client", "snowbridge-pallet-inbound-queue-v2-fixtures", @@ -15052,8 +15052,8 @@ name = "snowbridge-pallet-inbound-queue-v2-fixtures" version = "0.10.0" dependencies = [ "hex-literal 0.3.4", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "sp-core", "sp-std", @@ -15083,7 +15083,7 @@ dependencies = [ [[package]] name = "snowbridge-pallet-outbound-queue-v2" -version = "0.20.0" +version = "0.21.0" dependencies = [ "alloy-core", "bp-relayers", @@ -15097,8 +15097,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "snowbridge-beacon-primitives 0.20.0", - "snowbridge-core 0.20.0", + "snowbridge-beacon-primitives 0.21.0", + "snowbridge-core 0.21.0", "snowbridge-inbound-queue-primitives", "snowbridge-merkle-tree", "snowbridge-outbound-queue-primitives", @@ -15129,7 +15129,7 @@ dependencies = [ "parity-scale-codec", "polkadot-primitives", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-outbound-queue-primitives", "snowbridge-pallet-outbound-queue", "sp-core", @@ -15142,7 +15142,7 @@ dependencies = [ [[package]] name = "snowbridge-pallet-system-v2" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -15154,7 +15154,7 @@ dependencies = [ "parity-scale-codec", "polkadot-primitives", "scale-info", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "snowbridge-outbound-queue-primitives", "snowbridge-pallet-outbound-queue-v2", "snowbridge-pallet-system", @@ -15170,10 +15170,10 @@ dependencies = [ [[package]] name = "snowbridge-system-v2-runtime-api" -version = "0.20.0" +version = "0.21.0" dependencies = [ "parity-scale-codec", - "snowbridge-core 0.20.0", + "snowbridge-core 0.21.0", "sp-api", "sp-std", "staging-xcm", @@ -15181,7 +15181,7 @@ dependencies = [ [[package]] name = "snowbridge-test-utils" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -15201,12 +15201,12 @@ dependencies = [ [[package]] name = "snowbridge-verification-primitives" -version = "0.20.0" +version = "0.21.0" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", - "snowbridge-beacon-primitives 0.20.0", + "snowbridge-beacon-primitives 0.21.0", "sp-core", "sp-std", ] diff --git a/operator/Cargo.toml b/operator/Cargo.toml index a4b3c94f..4445ae85 100644 --- a/operator/Cargo.toml +++ b/operator/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" homepage = "https://datahaven.xyz/" license = "GPL-3" repository = "https://github.com/datahavenxyz/datahaven" -version = "0.20.0" +version = "0.21.0" [workspace] members = [ From ce24450b706635e58cdf15f49ab49d72a461e0f2 Mon Sep 17 00:00:00 2001 From: Steve Degosserie <723552+stiiifff@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:16:28 +0100 Subject: [PATCH 4/4] feat: Add pallet-proxy-genesis-companion from Moonbeam (#419) ## Summary - Import `pallet-proxy-genesis-companion` from Moonbeam to enable proxy account configuration at genesis time - Configure the pallet in all runtimes (mainnet, stagenet, testnet) with pallet index 106 - Add `Serialize`/`Deserialize` derives to `ProxyType` enum to satisfy `MaybeSerializeDeserialize` bounds - Include mock runtime and unit tests adapted for polkadot-stable2412-6 This pallet extends `pallet-proxy` with genesis configuration support, allowing proxy relationships to be established at chain genesis rather than requiring extrinsic calls after launch. ### Key adaptations from Moonbeam The pallet was modified to work with the DataHaven SDK version (polkadot-stable2412-6): - Removed `BlockNumberProvider` associated type constraint (not present in this version of pallet-proxy) - Uses `frame_system::pallet_prelude::BlockNumberFor` directly for delay parameter - Uses `MaybeSerializeDeserialize` trait bound for `ProxyType` --------- Co-authored-by: Claude Opus 4.5 Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com> Co-authored-by: Ahmad Kaouk --- operator/Cargo.lock | 23 +++ operator/Cargo.toml | 1 + .../proxy-genesis-companion/Cargo.toml | 40 ++++ .../proxy-genesis-companion/src/lib.rs | 85 +++++++++ .../proxy-genesis-companion/src/mock.rs | 172 ++++++++++++++++++ .../proxy-genesis-companion/src/tests.rs | 63 +++++++ operator/runtime/mainnet/Cargo.toml | 5 + operator/runtime/mainnet/src/configs/mod.rs | 6 + operator/runtime/mainnet/src/lib.rs | 3 + operator/runtime/stagenet/Cargo.toml | 5 + operator/runtime/stagenet/src/configs/mod.rs | 6 + operator/runtime/stagenet/src/lib.rs | 3 + operator/runtime/testnet/Cargo.toml | 5 + operator/runtime/testnet/src/configs/mod.rs | 6 + operator/runtime/testnet/src/lib.rs | 3 + test/.papi/descriptors/package.json | 2 +- test/.papi/metadata/datahaven.scale | Bin 627667 -> 627696 bytes 17 files changed, 427 insertions(+), 1 deletion(-) create mode 100644 operator/pallets/proxy-genesis-companion/Cargo.toml create mode 100644 operator/pallets/proxy-genesis-companion/src/lib.rs create mode 100644 operator/pallets/proxy-genesis-companion/src/mock.rs create mode 100644 operator/pallets/proxy-genesis-companion/src/tests.rs diff --git a/operator/Cargo.lock b/operator/Cargo.lock index ea2fd6a4..652aa154 100644 --- a/operator/Cargo.lock +++ b/operator/Cargo.lock @@ -2684,6 +2684,7 @@ dependencies = [ "pallet-proofs-dealer", "pallet-proofs-dealer-runtime-api", "pallet-proxy", + "pallet-proxy-genesis-companion", "pallet-randomness", "pallet-referenda", "pallet-safe-mode", @@ -2705,6 +2706,7 @@ dependencies = [ "polkadot-runtime-common", "precompile-utils", "scale-info", + "serde", "serde_json", "shc-common", "shp-constants", @@ -2982,6 +2984,7 @@ dependencies = [ "pallet-proofs-dealer", "pallet-proofs-dealer-runtime-api", "pallet-proxy", + "pallet-proxy-genesis-companion", "pallet-randomness", "pallet-referenda", "pallet-safe-mode", @@ -3003,6 +3006,7 @@ dependencies = [ "polkadot-runtime-common", "precompile-utils", "scale-info", + "serde", "serde_json", "shc-common", "shp-constants", @@ -3135,6 +3139,7 @@ dependencies = [ "pallet-proofs-dealer", "pallet-proofs-dealer-runtime-api", "pallet-proxy", + "pallet-proxy-genesis-companion", "pallet-randomness", "pallet-referenda", "pallet-safe-mode", @@ -3156,6 +3161,7 @@ dependencies = [ "polkadot-runtime-common", "precompile-utils", "scale-info", + "serde", "serde_json", "shc-common", "shp-constants", @@ -9512,6 +9518,23 @@ dependencies = [ "scale-info", ] +[[package]] +name = "pallet-proxy-genesis-companion" +version = "0.21.0" +dependencies = [ + "frame-support", + "frame-system", + "pallet-balances", + "pallet-proxy", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-randomness" version = "0.3.5" diff --git a/operator/Cargo.toml b/operator/Cargo.toml index 4445ae85..31eaf63c 100644 --- a/operator/Cargo.toml +++ b/operator/Cargo.toml @@ -43,6 +43,7 @@ pallet-external-validator-slashes = { path = "./pallets/external-validator-slash pallet-external-validators = { path = "./pallets/external-validators", default-features = false } pallet-external-validators-rewards = { path = "./pallets/external-validators-rewards", default-features = false } pallet-outbound-commitment-store = { path = "./pallets/outbound-commitment-store", default-features = false } +pallet-proxy-genesis-companion = { path = "./pallets/proxy-genesis-companion", default-features = false } # Crates.io (wasm) alloy-core = { version = "0.8.15", default-features = false } diff --git a/operator/pallets/proxy-genesis-companion/Cargo.toml b/operator/pallets/proxy-genesis-companion/Cargo.toml new file mode 100644 index 00000000..1e9c634d --- /dev/null +++ b/operator/pallets/proxy-genesis-companion/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "pallet-proxy-genesis-companion" +authors = { workspace = true } +description = "A simple pallet that expands pallet-proxy with a genesis configuration" +edition = { workspace = true } +version = { workspace = true } +license = { workspace = true } + +[dependencies] +codec = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-proxy = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[dev-dependencies] +pallet-balances = { workspace = true, features = ["insecure_zero_ed", "std"] } +serde = { workspace = true, features = ["derive", "std"] } +sp-core = { workspace = true, features = ["std"] } +sp-io = { workspace = true, features = ["std"] } + +[features] +default = ["std"] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "pallet-proxy/std", + "scale-info/std", + "sp-runtime/std", + "sp-std/std", +] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-proxy/try-runtime", + "sp-runtime/try-runtime", +] diff --git a/operator/pallets/proxy-genesis-companion/src/lib.rs b/operator/pallets/proxy-genesis-companion/src/lib.rs new file mode 100644 index 00000000..9711075b --- /dev/null +++ b/operator/pallets/proxy-genesis-companion/src/lib.rs @@ -0,0 +1,85 @@ +// Copyright 2019-2025 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! A companion pallet to pallet-proxy +//! +//! This pallet allows you to specify proxy accounts that will exist from genesis. This +//! functionality could be moved upstream into pallet proxy eventually, but for now there are fewer +//! obstacles to including it here. + +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + +use frame_support::pallet; +pub use pallet::*; + +#[pallet] +pub mod pallet { + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::BlockNumberFor; + use sp_std::vec::Vec; + + /// Pallet for configuring proxy at genesis + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(PhantomData); + + /// This pallet requires pallet-proxy to be installed. + #[pallet::config] + pub trait Config: + frame_system::Config + pallet_proxy::Config::ProxyType> + { + /// This MUST be the same as in pallet_proxy or it won't compile + type ProxyType: MaybeSerializeDeserialize + Clone; + } + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub proxies: Vec<( + T::AccountId, + T::AccountId, + ::ProxyType, + BlockNumberFor, + )>, + } + + impl Default for GenesisConfig { + fn default() -> Self { + Self { + proxies: Vec::new(), + } + } + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + for (delegator, delegatee, proxy_type, delay) in &self.proxies { + pallet_proxy::Pallet::::add_proxy_delegate( + delegator, + delegatee.clone(), + proxy_type.clone(), + *delay, + ) + .expect("Genesis proxy could not be added"); + } + } + } +} diff --git a/operator/pallets/proxy-genesis-companion/src/mock.rs b/operator/pallets/proxy-genesis-companion/src/mock.rs new file mode 100644 index 00000000..116fd2c2 --- /dev/null +++ b/operator/pallets/proxy-genesis-companion/src/mock.rs @@ -0,0 +1,172 @@ +// Copyright 2019-2025 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! A minimal runtime including the proxy-genesis-companion pallet +use super::*; +use crate as proxy_companion; +use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::{ + construct_runtime, derive_impl, parameter_types, + traits::{ConstU32, InstanceFilter}, +}; +use sp_runtime::{traits::BlakeTwo256, BuildStorage}; + +pub type AccountId = u64; +pub type Balance = u128; + +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +construct_runtime!( + pub enum Test + { + System: frame_system, + Balances: pallet_balances, + Proxy: pallet_proxy, + ProxyGenesisCompanion: proxy_companion, + } +); + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] +impl frame_system::Config for Test { + type Block = Block; + type AccountData = pallet_balances::AccountData; +} + +parameter_types! { + pub const ExistentialDeposit: u128 = 0; +} + +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] +impl pallet_balances::Config for Test { + type Balance = Balance; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; +} + +parameter_types! { + pub const ProxyDepositBase: Balance = 1; + pub const ProxyDepositFactor: Balance = 1; + pub const MaxProxies: u16 = 32; + pub const AnnouncementDepositBase: Balance = 1; + pub const AnnouncementDepositFactor: Balance = 1; + pub const MaxPending: u16 = 32; +} + +/// The type used to represent the kinds of proxying allowed. +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + Debug, + MaxEncodedLen, + scale_info::TypeInfo, + serde::Serialize, + serde::Deserialize, + Default, +)] +pub struct ProxyType; + +impl InstanceFilter for ProxyType { + fn filter(&self, _c: &RuntimeCall) -> bool { + true + } + + fn is_superset(&self, _o: &Self) -> bool { + true + } +} + +impl pallet_proxy::Config for Test { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type ProxyType = ProxyType; + type ProxyDepositBase = ProxyDepositBase; + type ProxyDepositFactor = ProxyDepositFactor; + type MaxProxies = ConstU32<32>; + type WeightInfo = (); + type MaxPending = ConstU32<32>; + type CallHasher = BlakeTwo256; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; +} + +impl Config for Test { + type ProxyType = ProxyType; +} + +/// Externality builder for pallet proxy genesis companion's mock runtime +pub(crate) struct ExtBuilder { + proxies: Vec<(AccountId, AccountId)>, + balances: Vec<(AccountId, Balance)>, +} + +impl Default for ExtBuilder { + fn default() -> ExtBuilder { + ExtBuilder { + proxies: Vec::new(), + balances: Vec::new(), + } + } +} + +impl ExtBuilder { + pub(crate) fn with_balances(mut self, balances: Vec<(AccountId, Balance)>) -> Self { + self.balances = balances; + self + } + + pub(crate) fn with_proxies(mut self, proxies: Vec<(AccountId, AccountId)>) -> Self { + self.proxies = proxies; + self + } + + pub(crate) fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default() + .build_storage() + .expect("Frame system builds valid default genesis config"); + + pallet_balances::GenesisConfig:: { + balances: self.balances, + ..Default::default() + } + .assimilate_storage(&mut t) + .expect("Pallet balances storage can be assimilated"); + + let genesis_config = proxy_companion::GenesisConfig:: { + // Here we add the trivial proxy type and default duration. + // This saves the test writer from having to always specify this. + proxies: self + .proxies + .into_iter() + .map(|(a, b)| (a, b, ProxyType, 100)) + .collect(), + }; + genesis_config + .assimilate_storage(&mut t) + .expect("Pallet proxy genesis companion storage can be assimilated"); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} diff --git a/operator/pallets/proxy-genesis-companion/src/tests.rs b/operator/pallets/proxy-genesis-companion/src/tests.rs new file mode 100644 index 00000000..1d76c3d6 --- /dev/null +++ b/operator/pallets/proxy-genesis-companion/src/tests.rs @@ -0,0 +1,63 @@ +// Copyright 2019-2025 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Unit testing +use crate::mock::{ExtBuilder, Proxy, ProxyType, Test}; +use pallet_proxy::ProxyDefinition; + +#[test] +fn empty_genesis_works() { + ExtBuilder::default() + .build() + .execute_with(|| assert_eq!(pallet_proxy::Proxies::::iter().count(), 0)) +} + +#[test] +fn non_empty_genesis_works() { + ExtBuilder::default() + // Account 1 delegates to account 2 + .with_proxies(vec![(1, 2)]) + // Account 1 is funded to pay the proxy deposit + .with_balances(vec![(1, 10)]) + .build() + .execute_with(|| { + // Lookup info that we expect to be stored from genesis + let (proxy_defs, deposit) = Proxy::proxies(1); + + // Make sure that Account 1 delegates to Account 2 and nobody else + assert_eq!(proxy_defs.len(), 1); + assert_eq!( + proxy_defs[0], + ProxyDefinition { + delegate: 2, + proxy_type: ProxyType, + delay: 100 + } + ); + + // Make sure that Account 1 has the proper deposit amount reserved + assert_eq!(deposit, 2); + }) +} + +#[test] +#[should_panic(expected = "Genesis proxy could not be added")] +fn genesis_fails_if_balance_insufficient() { + ExtBuilder::default() + .with_proxies(vec![(1, 2)]) + .build() + .execute_with(|| ()) +} diff --git a/operator/runtime/mainnet/Cargo.toml b/operator/runtime/mainnet/Cargo.toml index 50a667f1..a7242a12 100644 --- a/operator/runtime/mainnet/Cargo.toml +++ b/operator/runtime/mainnet/Cargo.toml @@ -67,6 +67,7 @@ pallet-outbound-commitment-store = { workspace = true } pallet-parameters = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } +pallet-proxy-genesis-companion = { workspace = true } pallet-referenda = { workspace = true } pallet-safe-mode = { workspace = true } pallet-scheduler = { workspace = true } @@ -84,6 +85,7 @@ polkadot-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } precompile-utils = { workspace = true } scale-info = { workspace = true, features = ["derive", "serde"] } +serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, default-features = false, features = [ "alloc", ] } @@ -235,6 +237,7 @@ std = [ "pallet-tx-pause/std", "pallet-referenda/std", "pallet-proxy/std", + "pallet-proxy-genesis-companion/std", "pallet-scheduler/std", "pallet-session/std", "pallet-sudo/std", @@ -248,6 +251,7 @@ std = [ "polkadot-runtime-common/std", "precompile-utils/std", "scale-info/std", + "serde/std", "serde_json/std", "snowbridge-beacon-primitives/std", "snowbridge-inbound-queue-primitives/std", @@ -390,6 +394,7 @@ try-runtime = [ "pallet-tx-pause/try-runtime", "pallet-referenda/try-runtime", "pallet-proxy/try-runtime", + "pallet-proxy-genesis-companion/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", "pallet-sudo/try-runtime", diff --git a/operator/runtime/mainnet/src/configs/mod.rs b/operator/runtime/mainnet/src/configs/mod.rs index 3bd49071..c65db6b7 100644 --- a/operator/runtime/mainnet/src/configs/mod.rs +++ b/operator/runtime/mainnet/src/configs/mod.rs @@ -49,6 +49,8 @@ use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; RuntimeDebug, MaxEncodedLen, TypeInfo, + serde::Serialize, + serde::Deserialize, )] pub enum ProxyType { /// Allow any call to be made by the proxy account @@ -829,6 +831,10 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +impl pallet_proxy_genesis_companion::Config for Runtime { + type ProxyType = ProxyType; +} + impl pallet_parameters::Config for Runtime { type AdminOrigin = EnsureRoot; type RuntimeEvent = RuntimeEvent; diff --git a/operator/runtime/mainnet/src/lib.rs b/operator/runtime/mainnet/src/lib.rs index c318dc4e..d27f07e2 100644 --- a/operator/runtime/mainnet/src/lib.rs +++ b/operator/runtime/mainnet/src/lib.rs @@ -500,6 +500,9 @@ mod runtime { #[runtime::pallet_index(105)] pub type ExternalValidatorsSlashes = pallet_external_validator_slashes; + + #[runtime::pallet_index(106)] + pub type ProxyGenesisCompanion = pallet_proxy_genesis_companion; // ╚═══════════════════ DataHaven-specific Pallets ══════════════════╝ } diff --git a/operator/runtime/stagenet/Cargo.toml b/operator/runtime/stagenet/Cargo.toml index 4ade787b..131083a9 100644 --- a/operator/runtime/stagenet/Cargo.toml +++ b/operator/runtime/stagenet/Cargo.toml @@ -67,6 +67,7 @@ pallet-outbound-commitment-store = { workspace = true } pallet-parameters = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } +pallet-proxy-genesis-companion = { workspace = true } pallet-referenda = { workspace = true } pallet-safe-mode = { workspace = true } pallet-scheduler = { workspace = true } @@ -84,6 +85,7 @@ polkadot-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } precompile-utils = { workspace = true } scale-info = { workspace = true, features = ["derive", "serde"] } +serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, default-features = false, features = [ "alloc", ] } @@ -236,6 +238,7 @@ std = [ "pallet-tx-pause/std", "pallet-referenda/std", "pallet-proxy/std", + "pallet-proxy-genesis-companion/std", "pallet-scheduler/std", "pallet-session/std", "pallet-sudo/std", @@ -249,6 +252,7 @@ std = [ "polkadot-runtime-common/std", "precompile-utils/std", "scale-info/std", + "serde/std", "serde_json/std", "snowbridge-beacon-primitives/std", "snowbridge-inbound-queue-primitives/std", @@ -391,6 +395,7 @@ try-runtime = [ "pallet-tx-pause/try-runtime", "pallet-referenda/try-runtime", "pallet-proxy/try-runtime", + "pallet-proxy-genesis-companion/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", "pallet-sudo/try-runtime", diff --git a/operator/runtime/stagenet/src/configs/mod.rs b/operator/runtime/stagenet/src/configs/mod.rs index 509734a7..0e2d181f 100644 --- a/operator/runtime/stagenet/src/configs/mod.rs +++ b/operator/runtime/stagenet/src/configs/mod.rs @@ -49,6 +49,8 @@ use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; RuntimeDebug, MaxEncodedLen, TypeInfo, + serde::Serialize, + serde::Deserialize, )] pub enum ProxyType { /// Allow any call to be made by the proxy account @@ -826,6 +828,10 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +impl pallet_proxy_genesis_companion::Config for Runtime { + type ProxyType = ProxyType; +} + impl pallet_parameters::Config for Runtime { type AdminOrigin = EnsureRoot; type RuntimeEvent = RuntimeEvent; diff --git a/operator/runtime/stagenet/src/lib.rs b/operator/runtime/stagenet/src/lib.rs index 10d7c835..36f69c61 100644 --- a/operator/runtime/stagenet/src/lib.rs +++ b/operator/runtime/stagenet/src/lib.rs @@ -502,6 +502,9 @@ mod runtime { #[runtime::pallet_index(105)] pub type ExternalValidatorsSlashes = pallet_external_validator_slashes; + + #[runtime::pallet_index(106)] + pub type ProxyGenesisCompanion = pallet_proxy_genesis_companion; // ╚═══════════════════ DataHaven-specific Pallets ══════════════════╝ } diff --git a/operator/runtime/testnet/Cargo.toml b/operator/runtime/testnet/Cargo.toml index fc278e41..2c40f671 100644 --- a/operator/runtime/testnet/Cargo.toml +++ b/operator/runtime/testnet/Cargo.toml @@ -68,6 +68,7 @@ pallet-outbound-commitment-store = { workspace = true } pallet-parameters = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } +pallet-proxy-genesis-companion = { workspace = true } pallet-referenda = { workspace = true } pallet-safe-mode = { workspace = true } pallet-scheduler = { workspace = true } @@ -85,6 +86,7 @@ polkadot-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } precompile-utils = { workspace = true } scale-info = { workspace = true, features = ["derive", "serde"] } +serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, default-features = false, features = [ "alloc", ] } @@ -234,6 +236,7 @@ std = [ "pallet-tx-pause/std", "pallet-referenda/std", "pallet-proxy/std", + "pallet-proxy-genesis-companion/std", "pallet-scheduler/std", "pallet-session/std", "pallet-sudo/std", @@ -246,6 +249,7 @@ std = [ "polkadot-primitives/std", "polkadot-runtime-common/std", "scale-info/std", + "serde/std", "serde_json/std", "snowbridge-beacon-primitives/std", "snowbridge-inbound-queue-primitives/std", @@ -387,6 +391,7 @@ try-runtime = [ "pallet-tx-pause/try-runtime", "pallet-referenda/try-runtime", "pallet-proxy/try-runtime", + "pallet-proxy-genesis-companion/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", "pallet-sudo/try-runtime", diff --git a/operator/runtime/testnet/src/configs/mod.rs b/operator/runtime/testnet/src/configs/mod.rs index 0ba71058..783c0759 100644 --- a/operator/runtime/testnet/src/configs/mod.rs +++ b/operator/runtime/testnet/src/configs/mod.rs @@ -49,6 +49,8 @@ use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; RuntimeDebug, MaxEncodedLen, TypeInfo, + serde::Serialize, + serde::Deserialize, )] pub enum ProxyType { /// Allow any call to be made by the proxy account @@ -829,6 +831,10 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +impl pallet_proxy_genesis_companion::Config for Runtime { + type ProxyType = ProxyType; +} + impl pallet_parameters::Config for Runtime { type AdminOrigin = EnsureRoot; type RuntimeEvent = RuntimeEvent; diff --git a/operator/runtime/testnet/src/lib.rs b/operator/runtime/testnet/src/lib.rs index 14a47891..46a777a5 100644 --- a/operator/runtime/testnet/src/lib.rs +++ b/operator/runtime/testnet/src/lib.rs @@ -500,6 +500,9 @@ mod runtime { #[runtime::pallet_index(105)] pub type ExternalValidatorsSlashes = pallet_external_validator_slashes; + + #[runtime::pallet_index(106)] + pub type ProxyGenesisCompanion = pallet_proxy_genesis_companion; // ╚═══════════════════ DataHaven-specific Pallets ══════════════════╝ } diff --git a/test/.papi/descriptors/package.json b/test/.papi/descriptors/package.json index 184bc2d5..8ece9265 100644 --- a/test/.papi/descriptors/package.json +++ b/test/.papi/descriptors/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.0-autogenerated.18110841939960448741", + "version": "0.1.0-autogenerated.14314240478086326730", "name": "@polkadot-api/descriptors", "files": [ "dist" diff --git a/test/.papi/metadata/datahaven.scale b/test/.papi/metadata/datahaven.scale index 74c4129cc1309e6955671c0e29d8c78e1c94fbb7..0fdd89171ab4024e8018d59f280c10407b8fd264 100644 GIT binary patch delta 78 zcmcb-TF7M3ln337}#+7sniftU@5*@2j2d!ihtroK!_Kv8~0rF&{# bYH?<wuZSVBu^l}3LAj=tL delta 49 zcmeycTF7M3ln337~A+7sniftU@5*@2j2d!ihtrvCQjzMP(J0J-rH A5C8xG