mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Summary This PR integrates the Substrate Proxy pallet into DataHaven runtimes (testnet, stagenet, mainnet) with comprehensive test coverage. The proxy pallet enables account delegation functionality, allowing accounts to authorize other accounts to execute calls on their behalf with configurable permissions. ## Changes ### Proxy Pallet Integration - **Added proxy pallet** to all three DataHaven runtimes (testnet, stagenet, mainnet) - **Configured custom ProxyType enum** with DataHaven-specific proxy types: - `Any` - Unrestricted proxy access - `NonTransfer` - All calls except balance transfers - `Governance` - Governance and utility calls only - `Staking` - Staking operations (placeholder) - `CancelProxy` - Proxy announcement cancellation - `Balances` - Balance transfer operations only - `IdentityJudgement` - Identity judgement operations - `SudoOnly` - Privileged sudo operations only ### Runtime Configuration - **Integrated pallet-proxy** into runtime construction macros - **Configured proxy deposits** (base + per-proxy fees) - **Set proxy limits** (maximum proxies per account) - **Implemented InstanceFilter** for call filtering per proxy type - **Added proxy pallet to runtime APIs** and metadata ### Comprehensive Test Suite - `operator/runtime/testnet/tests/proxy.rs` - 24 comprehensive proxy tests - `operator/runtime/stagenet/tests/proxy.rs` - 24 comprehensive proxy tests - `operator/runtime/mainnet/tests/proxy.rs` - 24 comprehensive proxy tests - Updated `lib.rs` files in all three runtimes to include proxy test modules <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Enable account proxies across mainnet, stagenet, and testnet with configurable types, delays, and per-type call permissions. - Support anonymous (pure) proxies, proxy announcements with delays, and deposit/limit parameters for proxy management. - Tests - Add comprehensive integration tests covering proxy lifecycle, filtering, pure proxies, announcements, batching, chaining, multisig, identity, and sudo paths. - Test builder now supports optional sudo setup. - Chores - Add benchmarking, weights, and try-runtime support for proxies. - Update internal package metadata version. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com> Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| .cargo | ||
| benchmarking | ||
| node | ||
| pallets | ||
| primitives | ||
| runtime | ||
| scripts | ||
| test | ||
| .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