datahaven/operator
Ahmad Kaouk eb94be1e3f
feat: multi block migration pallet (#180)
## 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>
2025-09-24 12:27:44 +02:00
..
.cargo refactor: 🐳 Improve docker caching (again) (#86) 2025-05-27 16:14:15 +00:00
benchmarking test: init benchmark infra (#110) 2025-08-06 13:44:42 +02:00
node fix: allow to start the indexer even without any provider set (#170) 2025-09-17 17:09:12 +02:00
pallets test: init benchmark infra (#110) 2025-08-06 13:44:42 +02:00
precompiles feat: Add ERC20 Balances precompile (#150) 2025-09-12 08:57:44 +00:00
primitives test: init benchmark infra (#110) 2025-08-06 13:44:42 +02:00
runtime feat: multi block migration pallet (#180) 2025-09-24 12:27:44 +02:00
scripts refactor: cleanup obsolete test folder (#166) 2025-09-17 14:21:55 +02:00
.dockerignore refactor: 🐳 Improve docker caching (again) (#86) 2025-05-27 16:14:15 +00:00
.gitignore test: Native token transfer e2e tests (#120) 2025-08-22 18:27:14 +02:00
Cargo.lock feat: multi block migration pallet (#180) 2025-09-24 12:27:44 +02:00
Cargo.toml feat: multi block migration pallet (#180) 2025-09-24 12:27:44 +02:00
Dockerfile fix: Update Rust toolchain and Docker build dependencies (#156) 2025-09-11 09:56:14 +02:00
LICENSE build: 🏗️ DataHaven operator setup (#6) 2025-03-17 17:57:14 +01:00
README.md test: init benchmark infra (#110) 2025-08-06 13:44:42 +02:00
rust-toolchain.toml fix: Update Rust toolchain and Docker build dependencies (#156) 2025-09-11 09:56:14 +02:00

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 (or cargo 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:

  1. Automatically discover all available pallets
  2. Build the runtime WASM with runtime-benchmarks feature
  3. Generate weight files in runtime/{runtime}/src/weights/
  4. Provide a summary of successful and failed benchmarks

Script Parameters

  • runtime: Runtime to benchmark (testnet, stagenet, mainnet). Default: testnet
  • steps: Number of steps for benchmarking. Default: 50
  • repeat: 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