datahaven/operator/pallets/session-benchmarking/Cargo.toml

41 lines
1,011 B
TOML
Raw Permalink Normal View History

fix: add missing benchmarks and weights (#302) ## Add missing weights The aim of this PR is to complete our weights by enabling more runtime benchmarks from the pallets used in DataHaven. I will start this effort with Storage Hub pallets. ## What's included - [x] `pallet_nfts` - [x] Added signing helper for pallet nfts - [x] Add pallet to benchmarks - [x] Run benches and generate weights - [x] Wire up weights to runtimes - [x] `pallet_session` - [x] Added a `pallet_session_benchmarking` crate - [x] Added signing helpers - [x] Add pallet to benchmarks - [x] Run benches and generate weights - [x] Wire up weights to runtimes - [x] `pallet_payment_streams` - [x] Add `TreasuryAccount` helper and configure properly - [x] Add pallet to benchmarks - [x] Run benches and generate weights - [x] Wire up weights to runtimes - [x] `pallet_storage_providers` - [x] Add `TreasuryAccount` helper and configure properly - [x] Add pallet to benchmarks - [x] Run benches and generate weights - [x] Wire up weights to runtimes - [x] `pallet_file_system` - [x] Add pallet to benchmarks and configure properly - [ ] Run benches and generate weights - [x] Wire up weights to runtimes - [x] `pallet_proofs_dealer` - [x] Add pallet to benchmarks and configure properly - [x] Run benches and generate weights - [x] Wire up weights to runtimes ## What's not included - `pallet_identity` - We'll enable it once we update to `2506`, that will allow us to have a BenchmarkHelper in the config on the pallet (see [here](https://github.com/datahaven-xyz/datahaven/blob/ac28323e7d9e690ae1ccbb27b55f00c3e6522681/operator/runtime/mainnet/src/configs/mod.rs#L632-L643)) - `pallet_grandpa` - the upstream pallet defines [benchmarks](https://github.com/paritytech/polkadot-sdk/blob/bbc435c7667d3283ba280a8fec44676357392753/substrate/frame/grandpa/src/benchmarking.rs#L25) for `check_equivocation_proof` and `note_stalled`, but the required weights to be wired are actually `report_equivocation`, `report_equivocation_unsigned` and `note_stalled`. That means including `pallet_grandpa` in the benchmarks results in an inconsistent `WeightInfo` implementation, so further understanding in the pallet's approach to benchmarking is needed. - `pallet_file_system` -> Run benches and generate weights. Weights will fail because of a hardcoded `AccountId32` on the [benchmarks](https://github.com/Moonsong-Labs/storage-hub/blob/57d2a195d58d39e0d6e38a927ec312dd0f640522/pallets/file-system/src/benchmark_proofs.rs#L69-L71). I'll create a PR for SH soon. These two are left for a follow up PR.
2026-02-03 16:12:11 +00:00
[package]
authors = { workspace = true }
description = "Benchmarking helpers for pallet-session in DataHaven runtimes."
edition = { workspace = true }
license = { workspace = true }
name = "pallet-session-benchmarking"
version = { workspace = true }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[lints]
workspace = true
[dependencies]
codec = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-session = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"pallet-session/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]