mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Summary This PR adds Moonbeam's CallPermit precompile to DataHaven, enabling gasless meta-transactions through EIP-712 signature-based permissions. Users can sign transaction permits offline, allowing relayers to execute transactions on their behalf while maintaining full security and authentication. ## Key Features ### CallPermit Precompile Functions - **`dispatch(address from, address to, uint256 value, bytes data, uint64[] gasLimit, uint256 deadline, uint8 v, bytes32 r, bytes32 s)`**: Execute permitted calls with signature verification - **`nonces(address owner)`**: Get current nonce for permit validation ### Technical Implementation - **Address**: `0x080A` (2058 in decimal) - **EIP-712 Compliance**: Structured signature validation with proper domain separation - **Nonce Management**: Per-user nonce tracking for replay protection - **Deadline Validation**: Time-bound permits for enhanced security - **Gas Forwarding**: Proper gas limit enforcement and forwarding Depends on https://github.com/datahaven-xyz/datahaven/pull/137 --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .cargo | ||
| benchmarking | ||
| node | ||
| pallets | ||
| precompiles | ||
| 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