build(operator): ⬆️ Upgrade to storage-hub 0.2.0 (#327)

## ⚠️ Breaking Changes ⚠️

Upgrades to SH version 0.2.0. Breaking changes for this version are
outlined in the corresponding
[release](https://github.com/Moonsong-Labs/storage-hub/releases/tag/v0.2.0).

Particularly, in this PR, the following breaking changes are implemented
for DH node operators:

### Breaking CLI changes vs `main`

- **Fisherman vs provider role**  
- `--fisherman` now has `conflicts_with = "provider"`
(`FishermanConfigurations::fisherman`).
- Any existing scripts that started a node with both `--provider` and
`--fisherman` will now fail clap validation.

- **Removed / replaced fisherman tuning flags**  
- The following flags no longer exist and will cause errors if still
used:
- `--fisherman-incomplete-sync-max` (field
`fisherman_incomplete_sync_max`)
- `--fisherman-incomplete-sync-page-size` (field
`fisherman_incomplete_sync_page_size`)
- `--fisherman-sync-mode-min-blocks-behind` (field
`fisherman_sync_mode_min_blocks_behind`)
  - They are replaced by:  
- `--fisherman-batch-interval-seconds`
(`fisherman_batch_interval_seconds`, default `60`)
- `--fisherman-batch-deletion-limit` (`fisherman_batch_deletion_limit`,
default `1000`)

- **MSP DB wiring no longer piggybacks on the indexer DB**  
- Previously, enabling the indexer (`IndexerConfigurations`) also wired
its DB pool into the MSP move‑bucket path via
`with_indexer_db_pool(maybe_indexer_db_pool)`.
- Now, MSP DB access is **only** configured if you pass the new
`--msp-database-url` provider flag; the indexer’s `--indexer` /
`--indexer-database-url` no longer implicitly provide DB access to MSP
logic. This will change behaviour for MSP nodes that relied on just the
indexer flags.

### New / additive CLI flags (non‑breaking but behaviourally relevant)

- **Provider flags**  
- `--pending-db-url` (`pending_db_url`, env `SH_PENDING_DB_URL`) for
persisting pending extrinsics.
- `--internal-buffer-size` (`internal_buffer_size`, default `1024`) for
DB chunk batching during file transfer.

- **Reordered but unchanged**  
- `--msp-distribute-files` still exists (bool flag), just moved within
`ProviderConfigurations`; name and type are unchanged, but now also
explicitly toggles `enable_msp_distribute_files` only when
`provider_type == msp`.
This commit is contained in:
Facundo Farall 2025-12-02 07:55:31 -03:00 committed by GitHub
parent f84b6debb7
commit 4d5716fdcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 274 additions and 122 deletions

96
operator/Cargo.lock generated
View file

@ -8993,7 +8993,7 @@ dependencies = [
[[package]]
name = "pallet-bucket-nfts"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -9069,7 +9069,7 @@ dependencies = [
[[package]]
name = "pallet-cr-randomness"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-support",
"frame-system",
@ -9329,7 +9329,7 @@ dependencies = [
[[package]]
name = "pallet-evm-precompile-file-system"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"fp-account",
"fp-evm",
@ -9582,7 +9582,7 @@ dependencies = [
[[package]]
name = "pallet-file-system"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -9609,7 +9609,7 @@ dependencies = [
[[package]]
name = "pallet-file-system-runtime-api"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"parity-scale-codec",
"scale-info",
@ -9805,7 +9805,7 @@ dependencies = [
[[package]]
name = "pallet-payment-streams"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -9825,7 +9825,7 @@ dependencies = [
[[package]]
name = "pallet-payment-streams-runtime-api"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"parity-scale-codec",
"scale-info",
@ -9853,7 +9853,7 @@ dependencies = [
[[package]]
name = "pallet-proofs-dealer"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -9875,7 +9875,7 @@ dependencies = [
[[package]]
name = "pallet-proofs-dealer-runtime-api"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"parity-scale-codec",
"scale-info",
@ -9897,7 +9897,7 @@ dependencies = [
[[package]]
name = "pallet-randomness"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -10038,7 +10038,7 @@ dependencies = [
[[package]]
name = "pallet-storage-providers"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -10060,7 +10060,7 @@ dependencies = [
[[package]]
name = "pallet-storage-providers-runtime-api"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"parity-scale-codec",
"scale-info",
@ -15179,7 +15179,7 @@ dependencies = [
[[package]]
name = "shc-actors-derive"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"once_cell",
"proc-macro2",
@ -15192,7 +15192,7 @@ dependencies = [
[[package]]
name = "shc-actors-framework"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"anyhow",
"bincode",
@ -15210,7 +15210,7 @@ dependencies = [
[[package]]
name = "shc-blockchain-service"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"anyhow",
"array-bytes",
@ -15244,6 +15244,7 @@ dependencies = [
"serde_json",
"shc-actors-derive",
"shc-actors-framework",
"shc-blockchain-service-db",
"shc-common",
"shc-forest-manager",
"shp-constants",
@ -15260,10 +15261,34 @@ dependencies = [
"tokio",
]
[[package]]
name = "shc-blockchain-service-db"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"chrono",
"diesel",
"diesel-async",
"diesel_migrations",
"futures",
"hex",
"log",
"rustls 0.23.32",
"rustls-pemfile 2.2.0",
"rustls-platform-verifier 0.5.3",
"sc-transaction-pool-api",
"serde",
"serde_json",
"thiserror 1.0.69",
"tokio",
"tokio-postgres",
"tokio-postgres-rustls",
]
[[package]]
name = "shc-client"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"anyhow",
"array-bytes",
@ -15329,7 +15354,7 @@ dependencies = [
[[package]]
name = "shc-common"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"anyhow",
"bigdecimal",
@ -15394,7 +15419,7 @@ dependencies = [
[[package]]
name = "shc-file-manager"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"bincode",
"hash-db",
@ -15418,7 +15443,7 @@ dependencies = [
[[package]]
name = "shc-file-transfer-service"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"anyhow",
"array-bytes",
@ -15447,7 +15472,7 @@ dependencies = [
[[package]]
name = "shc-fisherman-service"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"async-trait",
"diesel",
@ -15477,7 +15502,7 @@ dependencies = [
[[package]]
name = "shc-forest-manager"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"async-trait",
"bincode",
@ -15502,7 +15527,7 @@ dependencies = [
[[package]]
name = "shc-indexer-db"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"bigdecimal",
"chrono",
@ -15530,7 +15555,7 @@ dependencies = [
[[package]]
name = "shc-indexer-service"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"anyhow",
"array-bytes",
@ -15581,7 +15606,7 @@ dependencies = [
[[package]]
name = "shc-rpc"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"array-bytes",
"async-trait",
@ -15619,6 +15644,7 @@ dependencies = [
"suppaftp",
"thiserror 1.0.69",
"tokio",
"tokio-stream",
"tokio-util",
"url",
]
@ -15632,7 +15658,7 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "shp-constants"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"sp-core",
"sp-runtime",
@ -15641,7 +15667,7 @@ dependencies = [
[[package]]
name = "shp-data-price-updater"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-support",
"parity-scale-codec",
@ -15656,7 +15682,7 @@ dependencies = [
[[package]]
name = "shp-file-key-verifier"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-support",
"parity-scale-codec",
@ -15674,7 +15700,7 @@ dependencies = [
[[package]]
name = "shp-file-metadata"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"hex",
"num-bigint",
@ -15690,7 +15716,7 @@ dependencies = [
[[package]]
name = "shp-forest-verifier"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-support",
"parity-scale-codec",
@ -15707,7 +15733,7 @@ dependencies = [
[[package]]
name = "shp-opaque"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"parachains-common",
"sp-runtime",
@ -15716,7 +15742,7 @@ dependencies = [
[[package]]
name = "shp-session-keys"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"async-trait",
"parity-scale-codec",
@ -15731,7 +15757,7 @@ dependencies = [
[[package]]
name = "shp-traits"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"frame-support",
"parity-scale-codec",
@ -15745,7 +15771,7 @@ dependencies = [
[[package]]
name = "shp-treasury-funding"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"log",
"shp-traits",
@ -15756,7 +15782,7 @@ dependencies = [
[[package]]
name = "shp-tx-implicits-runtime-api"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"parity-scale-codec",
"scale-info",
@ -15769,7 +15795,7 @@ dependencies = [
[[package]]
name = "shp-types"
version = "0.1.0"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.1.4#18a562abfebeee7159ca9178dfb0a6c36f7fb94e"
source = "git+https://github.com/Moonsong-Labs/storage-hub.git?tag=v0.2.0#d9a283293a2612a1a567ab5b6848e84e4ea0a858"
dependencies = [
"sp-core",
"sp-runtime",

View file

@ -265,44 +265,44 @@ 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.1.4", default-features = false }
pallet-cr-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-file-system-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-payment-streams = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-payment-streams-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-proofs-dealer = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-proofs-dealer-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-storage-providers = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-storage-providers-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-constants = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-data-price-updater = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-file-key-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-file-metadata = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-forest-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-traits = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-treasury-funding = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
storage-hub-runtime = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-bucket-nfts = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-cr-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-file-system-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-payment-streams = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-payment-streams-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-proofs-dealer = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-proofs-dealer-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-storage-providers = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
pallet-storage-providers-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-constants = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-data-price-updater = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-file-key-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-file-metadata = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-forest-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-traits = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-treasury-funding = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
storage-hub-runtime = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
## Client
cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false }
shc-actors-derive = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-actors-framework = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-blockchain-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-client = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-common = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-file-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-file-transfer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-fisherman-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-forest-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-indexer-db = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-indexer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-rpc = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-opaque = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-tx-implicits-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shp-types = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
shc-actors-derive = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-actors-framework = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-blockchain-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-client = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-common = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-file-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-file-transfer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-fisherman-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-forest-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-indexer-db = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-indexer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shc-rpc = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-opaque = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-tx-implicits-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
shp-types = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
## Precompiles
pallet-evm-precompile-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.1.4", default-features = false }
pallet-evm-precompile-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.2.0", default-features = false }
# Static linking
#### Needed to build static binaries ####

View file

@ -58,14 +58,6 @@ pub struct Cli {
#[command(flatten)]
pub provider_config: ProviderConfigurations,
/// Indexer configurations
#[command(flatten)]
pub indexer_config: IndexerConfigurations,
/// Fisherman configurations
#[command(flatten)]
pub fisherman_config: FishermanConfigurations,
/// Provider configurations file path (allow to specify the provider configuration in a file instead of the cli)
#[arg(long, conflicts_with_all = [
"provider", "provider_type", "max_storage_capacity", "jump_capacity",
@ -76,9 +68,19 @@ pub struct Cli {
"bsp_upload_file_task", "bsp_upload_file_max_try_count", "bsp_upload_file_max_tip",
"bsp_move_bucket_task", "bsp_move_bucket_grace_period",
"bsp_charge_fees_task", "bsp_charge_fees_min_debt",
"bsp_submit_proof_task", "bsp_submit_proof_max_attempts", "fisherman", "fisherman_database_url",
"bsp_submit_proof_task", "bsp_submit_proof_max_attempts",
"pending_db_url",
"fisherman", "fisherman_database_url",
])]
pub provider_config_file: Option<String>,
/// Indexer configurations
#[command(flatten)]
pub indexer_config: IndexerConfigurations,
/// Fisherman configurations
#[command(flatten)]
pub fisherman_config: FishermanConfigurations,
}
#[derive(Debug, clap::Subcommand)]
@ -241,6 +243,17 @@ pub struct ProviderConfigurations {
#[arg(long, default_value = "10")]
pub max_blocks_behind_to_catch_up_root_changes: Option<u32>,
/// Enable MSP file distribution to BSPs (disabled by default unless set via config/CLI).
/// Only applicable when running as an MSP provider.
#[arg(long, value_name = "BOOLEAN")]
pub msp_distribute_files: bool,
/// Postgres database URL for persisting pending extrinsics (Blockchain Service DB).
/// If not provided, the service will use the `SH_PENDING_DB_URL` environment variable.
/// If neither is set, pending transactions will not be persisted.
#[arg(long("pending-db-url"), env = "SH_PENDING_DB_URL")]
pub pending_db_url: Option<String>,
// ============== Provider RPC options ==============
// ============== Remote file upload/download options ==============
/// Maximum file size in bytes (default: 10GB)
@ -280,6 +293,11 @@ pub struct ProviderConfigurations {
#[arg(long, value_name = "COUNT", default_value = "512")]
pub chunks_buffer: Option<u64>,
/// The number of 1KB (FILE_CHUNK_SIZE) chunks we batch and queue from the db while
/// transferring the file on a save_file_to_disk call.
#[arg(long, value_name = "COUNT", default_value = "1024")]
pub internal_buffer_size: Option<u64>,
// ============== MSP Charge Fees task options ==============
/// Enable and configure MSP Charge Fees task.
#[arg(long)]
@ -334,11 +352,6 @@ pub struct ProviderConfigurations {
)]
pub msp_move_bucket_max_tip: Option<u128>,
/// Enable MSP file distribution to BSPs (disabled by default unless set via config/CLI).
/// Only applicable when running as an MSP provider.
#[arg(long, value_name = "BOOLEAN")]
pub msp_distribute_files: bool,
// ============== BSP Upload File task options ==============
/// Enable and configure BSP Upload File task.
#[arg(long)]
@ -418,6 +431,15 @@ pub struct ProviderConfigurations {
])
)]
pub bsp_submit_proof_max_attempts: Option<u32>,
/// Optional database URL for MSP nodes only. If provided, enables database access
/// for operations such as move bucket operations without requiring the full indexer service.
#[arg(
long,
value_name = "DATABASE_URL",
help_heading = "MSP Database Options"
)]
pub msp_database_url: Option<String>,
}
impl ProviderConfigurations {
@ -452,6 +474,11 @@ impl ProviderConfigurations {
rpc_config.remote_file.chunks_buffer = chunks_buffer as usize;
}
}
if let Some(internal_buffer_size) = self.internal_buffer_size {
if internal_buffer_size > 0 {
rpc_config.remote_file.internal_buffer_size = internal_buffer_size as usize;
}
}
// Get provider type to conditionally apply options
let provider_type = self
@ -521,6 +548,18 @@ impl ProviderConfigurations {
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);
bs_changed = true;
}
// If a pending DB URL was provided, enable blockchain service options and pass it through
if let Some(url) = self.pending_db_url.clone() {
bs_options.pending_db_url = Some(url);
bs_changed = true;
}
if let Some(sync_mode_min_blocks_behind) = self.sync_mode_min_blocks_behind {
bs_options.sync_mode_min_blocks_behind = Some(sync_mode_min_blocks_behind);
bs_changed = true;
@ -567,6 +606,7 @@ impl ProviderConfigurations {
bsp_charge_fees,
bsp_submit_proof,
blockchain_service,
msp_database_url: self.msp_database_url.clone(),
// We don't support maintenance mode for now.
// maintenance_mode: self.maintenance_mode,
}
@ -618,7 +658,7 @@ impl IndexerConfigurations {
#[derive(Debug, Parser, Clone)]
pub struct FishermanConfigurations {
/// Enable the fisherman service.
#[arg(long)]
#[arg(long, conflicts_with = "provider")]
pub fisherman: bool,
/// Postgres database URL for the fisherman service.
@ -632,18 +672,13 @@ pub struct FishermanConfigurations {
)]
pub fisherman_database_url: Option<String>,
/// Maximum number of incomplete storage requests to process after the first block processed coming out of syncing mode.
#[arg(long, value_name = "COUNT", default_value = "10000", value_parser = clap::value_parser!(u32).range(1..))]
pub fisherman_incomplete_sync_max: u32,
/// Duration between batch deletion processing cycles (in seconds).
#[arg(long, default_value = "60", value_parser = clap::value_parser!(u64).range(1..))]
pub fisherman_batch_interval_seconds: u64,
/// Page size for incomplete storage request pagination.
/// Must be at least 1.
#[arg(long, value_name = "SIZE", default_value = "256", value_parser = clap::value_parser!(u32).range(1..))]
pub fisherman_incomplete_sync_page_size: u32,
/// The minimum number of blocks between the last processed block and the current best block to consider the fisherman out of sync.
#[arg(long, default_value = "5")]
pub fisherman_sync_mode_min_blocks_behind: u32,
/// 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,
}
impl FishermanConfigurations {
@ -654,9 +689,8 @@ impl FishermanConfigurations {
.fisherman_database_url
.clone()
.expect("Fisherman database URL is required"),
incomplete_sync_max: self.fisherman_incomplete_sync_max,
incomplete_sync_page_size: self.fisherman_incomplete_sync_page_size,
sync_mode_min_blocks_behind: self.fisherman_sync_mode_min_blocks_behind,
batch_interval_seconds: self.fisherman_batch_interval_seconds,
batch_deletion_limit: self.fisherman_batch_deletion_limit,
maintenance_mode: false, // Skipping maintenance mode for now
})
} else {

View file

@ -76,6 +76,8 @@ pub struct ProviderOptions {
/// Configuration options for blockchain service.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub blockchain_service: Option<BlockchainServiceOptions>,
/// MSP database URL.
pub msp_database_url: Option<String>,
// Whether the node is running in maintenance mode. We are not supporting maintenance mode.
// pub maintenance_mode: bool,
}

View file

@ -1077,10 +1077,10 @@ async fn configure_and_spawn_indexer<Runtime: StorageEnableRuntime>(
indexer_options: &Option<IndexerOptions>,
task_manager: &TaskManager,
client: Arc<StorageEnableClient<Runtime>>,
) -> Result<Option<DbPool>, sc_service::Error> {
) -> Result<(), sc_service::Error> {
let indexer_options = match indexer_options {
Some(config) => config,
None => return Ok(None),
None => return Ok(()),
};
// Setup database pool
@ -1100,9 +1100,8 @@ async fn configure_and_spawn_indexer<Runtime: StorageEnableRuntime>(
)
.await;
Ok(Some(db_pool))
Ok(())
}
/// Initialize the StorageHub builder with configured services based on the node's role.
///
/// If `indexer_options` is provided, spawns the indexer service regardless of role configuration.
@ -1135,9 +1134,7 @@ where
StorageHubBuilder<R, S, Runtime>: StorageLayerBuilder,
{
// Spawn indexer service if enabled. Runs before role check to allow standalone operation.
let maybe_indexer_db_pool =
configure_and_spawn_indexer::<Runtime>(&indexer_options, &task_manager, client.clone())
.await?;
configure_and_spawn_indexer::<Runtime>(&indexer_options, &task_manager, client.clone()).await?;
let role_options = match role_options {
Some(role) => role,
@ -1187,6 +1184,7 @@ where
bsp_charge_fees,
bsp_submit_proof,
blockchain_service,
msp_database_url,
..
}) => {
info!(
@ -1212,9 +1210,14 @@ where
// MSP-specific configuration
if *provider_type == ProviderType::Msp {
builder
.with_notify_period(*msp_charging_period)
.with_indexer_db_pool(maybe_indexer_db_pool);
builder.with_notify_period(*msp_charging_period);
// MSPs can optionally have database access to execute move bucket operations.
if let Some(db_url) = msp_database_url {
info!("Setting up MSP database connection: {}", db_url);
let msp_db_pool = setup_database_pool(db_url.clone()).await?;
builder.with_indexer_db_pool(Some(msp_db_pool));
}
}
if let Some(c) = blockchain_service {

View file

@ -18,8 +18,8 @@
// It is only compiled for native (std) builds to avoid pulling `shc-common` into the
// no_std Wasm runtime.
use shc_common::{
traits::{ExtensionOperations, StorageEnableRuntime},
types::{MinimalExtension, StorageEnableEvents},
traits::{ExtensionOperations, StorageEnableRuntime, TransactionHashProvider},
types::{MinimalExtension, StorageEnableEvents, StorageHubEventsVec},
};
use sp_core::H256;
@ -32,7 +32,7 @@ impl StorageEnableRuntime for crate::Runtime {
type RuntimeApi = crate::RuntimeApi;
}
// Implement the transaction extension helpers for the concrete runtime's TxExtension.
// Implement the transaction extension helpers for the concrete runtime's SignedExtra.
impl ExtensionOperations<crate::RuntimeCall, crate::Runtime> for crate::SignedExtra {
type Hash = H256;
@ -48,7 +48,7 @@ impl ExtensionOperations<crate::RuntimeCall, crate::Runtime> for crate::SignedEx
pallet_transaction_payment::ChargeTransactionPayment::<crate::Runtime>::from(
minimal.tip,
),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_metadata_hash_extension::CheckMetadataHash::<crate::Runtime>::new(false),
)
}
}
@ -74,3 +74,32 @@ impl Into<StorageEnableEvents<crate::Runtime>> for crate::RuntimeEvent {
}
}
}
// Implement transaction hash extraction for the EVM runtime.
impl TransactionHashProvider for crate::Runtime {
fn build_transaction_hash_map(
all_events: &StorageHubEventsVec<Self>,
) -> std::collections::HashMap<u32, H256> {
let mut tx_map = std::collections::HashMap::new();
for ev in all_events {
if let frame_system::Phase::ApplyExtrinsic(extrinsic_index) = ev.phase {
// Convert to StorageEnableEvents
let storage_event: StorageEnableEvents<Self> = ev.event.clone().into();
// Check if it's an `Executed` Ethereum event in the `Other` variant
if let StorageEnableEvents::Other(runtime_event) = storage_event {
if let crate::RuntimeEvent::Ethereum(pallet_ethereum::Event::Executed {
transaction_hash,
..
}) = runtime_event
{
tx_map.insert(extrinsic_index, transaction_hash);
}
}
}
}
tx_map
}
}

View file

@ -18,8 +18,8 @@
// It is only compiled for native (std) builds to avoid pulling `shc-common` into the
// no_std Wasm runtime.
use shc_common::{
traits::{ExtensionOperations, StorageEnableRuntime},
types::{MinimalExtension, StorageEnableEvents},
traits::{ExtensionOperations, StorageEnableRuntime, TransactionHashProvider},
types::{MinimalExtension, StorageEnableEvents, StorageHubEventsVec},
};
use sp_core::H256;
@ -32,7 +32,7 @@ impl StorageEnableRuntime for crate::Runtime {
type RuntimeApi = crate::RuntimeApi;
}
// Implement the transaction extension helpers for the concrete runtime's TxExtension.
// Implement the transaction extension helpers for the concrete runtime's SignedExtra.
impl ExtensionOperations<crate::RuntimeCall, crate::Runtime> for crate::SignedExtra {
type Hash = H256;
@ -48,7 +48,7 @@ impl ExtensionOperations<crate::RuntimeCall, crate::Runtime> for crate::SignedEx
pallet_transaction_payment::ChargeTransactionPayment::<crate::Runtime>::from(
minimal.tip,
),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_metadata_hash_extension::CheckMetadataHash::<crate::Runtime>::new(false),
)
}
}
@ -74,3 +74,32 @@ impl Into<StorageEnableEvents<crate::Runtime>> for crate::RuntimeEvent {
}
}
}
// Implement transaction hash extraction for the EVM runtime.
impl TransactionHashProvider for crate::Runtime {
fn build_transaction_hash_map(
all_events: &StorageHubEventsVec<Self>,
) -> std::collections::HashMap<u32, H256> {
let mut tx_map = std::collections::HashMap::new();
for ev in all_events {
if let frame_system::Phase::ApplyExtrinsic(extrinsic_index) = ev.phase {
// Convert to StorageEnableEvents
let storage_event: StorageEnableEvents<Self> = ev.event.clone().into();
// Check if it's an `Executed` Ethereum event in the `Other` variant
if let StorageEnableEvents::Other(runtime_event) = storage_event {
if let crate::RuntimeEvent::Ethereum(pallet_ethereum::Event::Executed {
transaction_hash,
..
}) = runtime_event
{
tx_map.insert(extrinsic_index, transaction_hash);
}
}
}
}
tx_map
}
}

View file

@ -18,8 +18,8 @@
// It is only compiled for native (std) builds to avoid pulling `shc-common` into the
// no_std Wasm runtime.
use shc_common::{
traits::{ExtensionOperations, StorageEnableRuntime},
types::{MinimalExtension, StorageEnableEvents},
traits::{ExtensionOperations, StorageEnableRuntime, TransactionHashProvider},
types::{MinimalExtension, StorageEnableEvents, StorageHubEventsVec},
};
use sp_core::H256;
@ -32,7 +32,7 @@ impl StorageEnableRuntime for crate::Runtime {
type RuntimeApi = crate::RuntimeApi;
}
// Implement the transaction extension helpers for the concrete runtime's TxExtension.
// Implement the transaction extension helpers for the concrete runtime's SignedExtra.
impl ExtensionOperations<crate::RuntimeCall, crate::Runtime> for crate::SignedExtra {
type Hash = H256;
@ -48,7 +48,7 @@ impl ExtensionOperations<crate::RuntimeCall, crate::Runtime> for crate::SignedEx
pallet_transaction_payment::ChargeTransactionPayment::<crate::Runtime>::from(
minimal.tip,
),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_metadata_hash_extension::CheckMetadataHash::<crate::Runtime>::new(false),
)
}
}
@ -74,3 +74,32 @@ impl Into<StorageEnableEvents<crate::Runtime>> for crate::RuntimeEvent {
}
}
}
// Implement transaction hash extraction for the EVM runtime.
impl TransactionHashProvider for crate::Runtime {
fn build_transaction_hash_map(
all_events: &StorageHubEventsVec<Self>,
) -> std::collections::HashMap<u32, H256> {
let mut tx_map = std::collections::HashMap::new();
for ev in all_events {
if let frame_system::Phase::ApplyExtrinsic(extrinsic_index) = ev.phase {
// Convert to StorageEnableEvents
let storage_event: StorageEnableEvents<Self> = ev.event.clone().into();
// Check if it's an `Executed` Ethereum event in the `Other` variant
if let StorageEnableEvents::Other(runtime_event) = storage_event {
if let crate::RuntimeEvent::Ethereum(pallet_ethereum::Event::Executed {
transaction_hash,
..
}) = runtime_event
{
tx_map.insert(extrinsic_index, transaction_hash);
}
}
}
}
tx_map
}
}

View file

@ -1,5 +1,5 @@
{
"version": "0.1.0-autogenerated.427841660215020592",
"version": "0.1.0-autogenerated.11476932184186799098",
"name": "@polkadot-api/descriptors",
"files": [
"dist"

Binary file not shown.