mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Overview This PR integrates Substrate's `pallet-migrations` into all DataHaven runtimes (mainnet, stagenet, testnet) to enable robust multi-block migration capabilities. This infrastructure allows complex runtime upgrades to be executed across multiple blocks while maintaining chain stability and providing governance controls. ## What Changed ### Core Integration - **Added `pallet-migrations` dependency** across all runtime configurations - **Integrated migration pallet** as pallet index 39 in all runtimes - **Created shared migration configuration** in `datahaven-runtime-common` ### Runtime Configuration - **Mainnet, Stagenet, and Testnet** now include identical migration configurations - **MaxServiceWeight** parameter set to 75% of max block weight for safe migration execution - **Migration cursor limits** configured (65KB max cursor, 256B max identifier) - **Failure handling** configured to freeze the chain on migration failures (similar to Moonbeam's maintenance mode) ## Future Work - [ ] Add custom failure handler (safe mode) to replace chain freeze - [ ] Generate DataHaven-specific benchmarks for migration weights --------- Co-authored-by: undercover-cactus <lola@moonsonglabs.com> |
||
|---|---|---|
| .. | ||
| .cargo | ||
| benchmarking | ||
| node | ||
| pallets | ||
| precompiles | ||
| primitives | ||
| runtime | ||
| scripts | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| rust-toolchain.toml | ||
DataHaven 🫎
Based on polkadot-sdk-solochain-template
Benchmarking
DataHaven uses runtime benchmarking to generate accurate weight calculations for all pallets. The benchmarking process is automated using frame-omni-bencher.
Requirements
Make sure you have the lastest rust version
frame-omni-bencher- Install with:cargo install frame-omni-bencher --profile=production(orcargo install --git https://github.com/paritytech/polkadot-sdk frame-omni-bencher --profile=production --locked)
Running Benchmarks
Execute the benchmarking script from the project root:
# Benchmark all pallets for testnet runtime (default)
./scripts/run-benchmarks.sh
# Benchmark specific runtime
./scripts/run-benchmarks.sh mainnet
# Custom steps and repetitions
./scripts/run-benchmarks.sh testnet 100 50
The script will:
- Automatically discover all available pallets
- Build the runtime WASM with
runtime-benchmarksfeature - Generate weight files in
runtime/{runtime}/src/weights/ - Provide a summary of successful and failed benchmarks
Script Parameters
runtime: Runtime to benchmark (testnet, stagenet, mainnet). Default: testnetsteps: Number of steps for benchmarking. Default: 50repeat: Number of repetitions. Default: 20
Zombienet testing
First, install zombienet.
To spawn a local solo chain with four validators and BABE finality, run:
zombienet -p native spawn test/config/zombie-datahaven-local.toml