2025-03-17 16:57:14 +00:00
|
|
|
[package]
|
2025-04-18 20:28:00 +00:00
|
|
|
authors = { workspace = true }
|
2025-05-08 23:32:55 +00:00
|
|
|
description = "DataHaven Testnet runtime"
|
2025-04-18 20:28:00 +00:00
|
|
|
edition = { workspace = true }
|
2025-05-08 23:32:55 +00:00
|
|
|
homepage = { workspace = true }
|
2025-11-10 11:56:41 +00:00
|
|
|
license = { workspace = true }
|
2025-05-08 23:32:55 +00:00
|
|
|
name = "datahaven-testnet-runtime"
|
2025-03-17 16:57:14 +00:00
|
|
|
publish = false
|
2025-05-08 23:32:55 +00:00
|
|
|
repository = { workspace = true }
|
2025-09-29 21:35:12 +00:00
|
|
|
version = { workspace = true }
|
2025-03-17 16:57:14 +00:00
|
|
|
|
|
|
|
|
[package.metadata.docs.rs]
|
|
|
|
|
targets = ["x86_64-unknown-linux-gnu"]
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2026-01-16 19:49:45 +00:00
|
|
|
alloy-core = { workspace = true, features = ["sol-types"] }
|
2025-04-25 23:28:41 +00:00
|
|
|
bridge-hub-common = { workspace = true, optional = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
codec = { workspace = true, features = ["derive"] }
|
2025-04-14 18:38:55 +00:00
|
|
|
datahaven-runtime-common = { workspace = true }
|
2025-04-30 17:01:21 +00:00
|
|
|
dhp-bridge = { workspace = true }
|
2025-04-14 11:40:24 +00:00
|
|
|
fp-account = { workspace = true, features = ["serde"] }
|
|
|
|
|
fp-evm = { workspace = true, features = ["serde"] }
|
|
|
|
|
fp-rpc = { workspace = true }
|
|
|
|
|
fp-self-contained = { workspace = true, features = ["serde", "try-runtime"] }
|
2025-05-08 13:14:30 +00:00
|
|
|
frame-benchmarking = { workspace = true, optional = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
frame-executive = { workspace = true }
|
|
|
|
|
frame-metadata-hash-extension = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
frame-support = { workspace = true, features = ["experimental"] }
|
2025-04-18 20:28:00 +00:00
|
|
|
frame-system = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
frame-system-benchmarking = { workspace = true, optional = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
frame-system-rpc-runtime-api = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
frame-try-runtime = { workspace = true, optional = true }
|
2025-04-09 14:59:05 +00:00
|
|
|
hex = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
hex-literal = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
itoa = { workspace = true }
|
feat(operator): Add External Validators Rewards Pallet (#72)
This PR introduces and integrates the new
`pallet-external-validators-rewards` into the operator runtimes. This
pallet is responsible for managing and distributing rewards to external
validators. The pallet was originally introduced by Tanssi. It was
heavily modified to abstract the message building and sending with
Snowbridge.
### Key Changes Related to `pallet-external-validators-rewards`:
* **Pallet and Runtime API Addition:**
* The `pallet-external-validators-rewards` has been added to `mainnet`,
`stagenet`, and `testnet` runtimes
* **Runtime Configuration
(`operator/runtime/{mainnet,stagenet,testnet}/src/configs/mod.rs`):**
* **`RewardsRegistryAddress` Parameter:** A new dynamic runtime
parameter `RewardsRegistryAddress` (type `H160`) has been added to
`runtime_params.rs`. This will hold the Ethereum address of the Rewards
Registry contract.
* **Author Rewards with `RewardsPoints`:**
* A new struct `RewardsPoints` implements
`pallet_authorship::EventHandler`.
* Its `note_author` function rewards block authors (if they are not
whitelisted validators) by calling
`ExternalValidatorsRewards::reward_by_ids`.
* The `EventHandler` in `pallet_authorship::Config` is updated to
`(RewardsPoints, ImOnline)`.
* **Integration with `pallet-external-validators`:**
* The `OnEraStart` and `OnEraEnd` hooks in
`pallet_external_validators::Config` are now set to
`ExternalValidatorsRewards`, allowing the rewards pallet to react to era
changes.
* **`RewardsSendAdapter` for Ethereum Communication:**
* A new struct `RewardsSendAdapter` implements
`pallet_external_validators_rewards::types::SendMessage`.
* `build()`: Constructs an `OutboundMessage` to call the
`updateRewardsMerkleRoot(bytes32)` function on the
`RewardsRegistryAddress` on Ethereum. The calldata includes the selector
(hashed from `UpdateRewardsMerkleRootSignature`) and the
`rewards_merkle_root`.
* `validate()` and `deliver()`: Utilize `OutboundQueueV2` for message
validation and delivery.
* A constant `UpdateRewardsMerkleRootSignature` (
`b"updateRewardsMerkleRoot(bytes32)"`) is defined for this purpose.
* **Runtime API
(`operator/runtime/{mainnet,stagenet,testnet}/src/lib.rs`):**
* The runtime implements
`pallet_external_validators_rewards_runtime_api::ExternalValidatorsRewardsApi`.
* This exposes two functions:
* `generate_rewards_merkle_proof(account_id: AccountId, era_index:
EraIndex) -> Option<MerkleProof>`
* `verify_rewards_merkle_proof(merkle_proof: MerkleProof) -> bool`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a rewards system for external validators with era-based
tracking, Merkle proof generation, and verification.
- Added runtime APIs to generate and verify validator rewards Merkle
proofs.
- Enabled rewards distribution via outbound messaging to an external
registry contract.
- Configured runtime parameters for the rewards registry address.
- Added fixed author reward points and integrated rewards logic into
block authorship events.
- Provided a mock runtime environment and benchmarking support for the
rewards pallet.
- **Tests**
- Added comprehensive tests and benchmarks for validator rewards
distribution and Merkle proof functionality.
- **Chores**
- Integrated new pallets and runtime APIs into mainnet, stagenet, and
testnet configurations.
- Updated dependencies and feature groups to include new rewards-related
pallets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Facundo Farall <37149322+ffarall@users.noreply.github.com>
2025-05-22 00:51:24 +00:00
|
|
|
log = { workspace = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
num-bigint = { workspace = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
num_enum = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-authorship = { workspace = true }
|
|
|
|
|
pallet-babe = { workspace = true }
|
feat: ✨ Standardize currency system to HAVE token with Wei-based units (#130)
## Summary
This PR modernizes DataHaven's currency system by standardizing all
three runtimes (mainnet, stagenet, testnet) to use Ethereum-compatible
Wei-based units with HAVE as the native token name.
### Key Changes
#### 🔄 Currency Unit Standardization
- **Migrated from decimal-based to Wei-based system** (18 decimals)
- **Wei units**: WEI → KILOWEI → MEGAWEI → GIGAWEI
- **HAVE units**: MICROHAVE → MILLIHAVE → HAVE → KILOHAVE
- **Zero Existential Deposit**: Enables dust account support with
`insecure_zero_ed` feature
#### 🏷️ Token Naming
- **UNIT → HAVE**: Native token renamed to reflect DataHaven branding
- **Consistent terminology**: All constants, comments, and documentation
updated
- **Supply factors preserved**: Mainnet (100x), Stagenet/Testnet (1x)
#### ⚖️ Block Weights & Gas Configuration
- **Solochain-optimized**: Updated MAX_POV_SIZE and block weight
parameters
- **EVM compatibility**: Fixed GasLimitPovSizeRatio (u32 → u64) and
storage growth ratios
- **Proper fee structure**: Aligned with Ethereum standards
#### 🧪 Test Updates
- **Treasury tests fixed**: Updated to handle zero existential deposit
behavior
- **All tests passing**: Currency references updated across all runtime
tests
- **Storage hub parameters**: Updated to use HAVE token terminology
### Breaking Changes
⚠️ **Currency precision changed from 12 to 18 decimals**
- Applications using currency constants must update to new HAVE-based
naming
- ExistentialDeposit now 0 (was previously enforced minimum balance)
### Runtime Coverage
- ✅ **Mainnet runtime** (supply factor: 100)
- ✅ **Stagenet runtime** (supply factor: 1)
- ✅ **Testnet runtime** (supply factor: 1)
- ✅ **Storage hub parameters** (runtime params updated)
### Technical Details
#### Fee Structure
```rust
pub const TRANSACTION_BYTE_FEE: Balance = 1 * GIGAWEI * SUPPLY_FACTOR;
pub const STORAGE_BYTE_FEE: Balance = 100 * MICROHAVE * SUPPLY_FACTOR;
pub const WEIGHT_FEE: Balance = 50 * KILOWEI * SUPPLY_FACTOR / 4;
```
#### Block Configuration
```rust
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
MAX_POV_SIZE as u64,
);
```
## Test Plan
- [x] All runtime builds compile successfully
- [x] All unit tests pass across three runtimes
- [x] Treasury fee handling verified with zero existential deposit
- [x] Storage hub parameter compatibility confirmed
- [x] EVM gas limit calculations validated
## Files Modified
**27 files changed, 728 insertions(+), 342 deletions(-)**
- Runtime lib.rs files (currency module definitions)
- Cargo.toml files (insecure_zero_ed feature)
- Configuration modules (block weights, gas limits)
- Test suites (currency constant references)
- Storage hub runtime parameters
---
🤖 *Generated with [Claude Code](https://claude.ai/code)*
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- New Features
- Introduced a unified currency module with HAVE units (18 decimals),
fees, and a deposit helper.
- Adopted dynamic block weight/length configuration (5 MB blocks) and
re-exported gas-to-weight constants.
- Improvements
- Switched all runtimes and pricing parameters from UNIT/NANO_UNIT to
HAVE/GIGAWEI.
- Updated deposits, fees, and rewards to HAVE-based values across
modules (including StorageHub and Snowbridge).
- Made existential deposit runtime-configurable; enabled zero-ED mode on
selected networks.
- Updated metadata hash and token metadata to reference HAVE (symbol
wHAVE, 18 decimals).
<!-- 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>
2025-08-18 11:26:30 +00:00
|
|
|
pallet-balances = { workspace = true, features = ["insecure_zero_ed"] }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-beefy = { workspace = true }
|
|
|
|
|
pallet-beefy-mmr = { workspace = true }
|
2025-09-02 20:46:35 +00:00
|
|
|
pallet-collective = { workspace = true }
|
|
|
|
|
pallet-conviction-voting = { workspace = true }
|
2025-08-06 11:44:42 +00:00
|
|
|
pallet-datahaven-native-transfer = { workspace = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] }
|
|
|
|
|
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-evm-chain-id = { workspace = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
pallet-evm-precompile-blake2 = { workspace = true }
|
|
|
|
|
pallet-evm-precompile-bn128 = { workspace = true }
|
2025-10-09 08:30:50 +00:00
|
|
|
pallet-evm-precompile-conviction-voting = { workspace = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
pallet-evm-precompile-modexp = { workspace = true }
|
|
|
|
|
pallet-evm-precompile-sha3fips = { workspace = true }
|
|
|
|
|
pallet-evm-precompile-simple = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-external-validator-slashes = { workspace = true }
|
2025-05-14 09:05:07 +00:00
|
|
|
pallet-external-validators = { workspace = true }
|
feat(operator): Add External Validators Rewards Pallet (#72)
This PR introduces and integrates the new
`pallet-external-validators-rewards` into the operator runtimes. This
pallet is responsible for managing and distributing rewards to external
validators. The pallet was originally introduced by Tanssi. It was
heavily modified to abstract the message building and sending with
Snowbridge.
### Key Changes Related to `pallet-external-validators-rewards`:
* **Pallet and Runtime API Addition:**
* The `pallet-external-validators-rewards` has been added to `mainnet`,
`stagenet`, and `testnet` runtimes
* **Runtime Configuration
(`operator/runtime/{mainnet,stagenet,testnet}/src/configs/mod.rs`):**
* **`RewardsRegistryAddress` Parameter:** A new dynamic runtime
parameter `RewardsRegistryAddress` (type `H160`) has been added to
`runtime_params.rs`. This will hold the Ethereum address of the Rewards
Registry contract.
* **Author Rewards with `RewardsPoints`:**
* A new struct `RewardsPoints` implements
`pallet_authorship::EventHandler`.
* Its `note_author` function rewards block authors (if they are not
whitelisted validators) by calling
`ExternalValidatorsRewards::reward_by_ids`.
* The `EventHandler` in `pallet_authorship::Config` is updated to
`(RewardsPoints, ImOnline)`.
* **Integration with `pallet-external-validators`:**
* The `OnEraStart` and `OnEraEnd` hooks in
`pallet_external_validators::Config` are now set to
`ExternalValidatorsRewards`, allowing the rewards pallet to react to era
changes.
* **`RewardsSendAdapter` for Ethereum Communication:**
* A new struct `RewardsSendAdapter` implements
`pallet_external_validators_rewards::types::SendMessage`.
* `build()`: Constructs an `OutboundMessage` to call the
`updateRewardsMerkleRoot(bytes32)` function on the
`RewardsRegistryAddress` on Ethereum. The calldata includes the selector
(hashed from `UpdateRewardsMerkleRootSignature`) and the
`rewards_merkle_root`.
* `validate()` and `deliver()`: Utilize `OutboundQueueV2` for message
validation and delivery.
* A constant `UpdateRewardsMerkleRootSignature` (
`b"updateRewardsMerkleRoot(bytes32)"`) is defined for this purpose.
* **Runtime API
(`operator/runtime/{mainnet,stagenet,testnet}/src/lib.rs`):**
* The runtime implements
`pallet_external_validators_rewards_runtime_api::ExternalValidatorsRewardsApi`.
* This exposes two functions:
* `generate_rewards_merkle_proof(account_id: AccountId, era_index:
EraIndex) -> Option<MerkleProof>`
* `verify_rewards_merkle_proof(merkle_proof: MerkleProof) -> bool`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a rewards system for external validators with era-based
tracking, Merkle proof generation, and verification.
- Added runtime APIs to generate and verify validator rewards Merkle
proofs.
- Enabled rewards distribution via outbound messaging to an external
registry contract.
- Configured runtime parameters for the rewards registry address.
- Added fixed author reward points and integrated rewards logic into
block authorship events.
- Provided a mock runtime environment and benchmarking support for the
rewards pallet.
- **Tests**
- Added comprehensive tests and benchmarks for validator rewards
distribution and Merkle proof functionality.
- **Chores**
- Integrated new pallets and runtime APIs into mainnet, stagenet, and
testnet configurations.
- Updated dependencies and feature groups to include new rewards-related
pallets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Facundo Farall <37149322+ffarall@users.noreply.github.com>
2025-05-22 00:51:24 +00:00
|
|
|
pallet-external-validators-rewards = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-grandpa = { workspace = true }
|
|
|
|
|
pallet-identity = { workspace = true }
|
|
|
|
|
pallet-im-online = { workspace = true }
|
2025-04-25 23:28:41 +00:00
|
|
|
pallet-message-queue = { workspace = true }
|
2025-09-24 10:27:44 +00:00
|
|
|
pallet-migrations = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-mmr = { workspace = true }
|
|
|
|
|
pallet-multisig = { workspace = true }
|
|
|
|
|
pallet-offences = { workspace = true }
|
2025-05-06 17:22:01 +00:00
|
|
|
pallet-outbound-commitment-store = { workspace = true }
|
2025-04-23 17:25:49 +00:00
|
|
|
pallet-parameters = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-preimage = { workspace = true }
|
feat: ✨ Integrate Proxy pallet into DataHaven runtimes (#128)
## 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>
2025-08-18 07:46:59 +00:00
|
|
|
pallet-proxy = { workspace = true }
|
2026-01-30 11:16:28 +00:00
|
|
|
pallet-proxy-genesis-companion = { workspace = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
pallet-referenda = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-safe-mode = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-scheduler = { workspace = true }
|
|
|
|
|
pallet-session = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-session-benchmarking = { workspace = true, optional = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-sudo = { workspace = true }
|
|
|
|
|
pallet-timestamp = { workspace = true }
|
|
|
|
|
pallet-transaction-payment = { workspace = true }
|
|
|
|
|
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
|
2025-06-25 06:09:26 +00:00
|
|
|
pallet-treasury = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-tx-pause = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
pallet-utility = { workspace = true }
|
2025-09-02 20:46:35 +00:00
|
|
|
pallet-whitelist = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
polkadot-primitives = { workspace = true }
|
|
|
|
|
polkadot-runtime-common = { workspace = true }
|
2026-02-03 16:12:11 +00:00
|
|
|
k256 = { workspace = true, optional = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
precompile-utils = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
scale-info = { workspace = true, features = ["derive", "serde"] }
|
2026-01-30 11:16:28 +00:00
|
|
|
serde = { workspace = true, features = ["derive"] }
|
2025-05-08 23:32:55 +00:00
|
|
|
serde_json = { workspace = true, default-features = false, features = [
|
|
|
|
|
"alloc",
|
|
|
|
|
] }
|
2025-09-02 13:05:36 +00:00
|
|
|
smallvec = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
snowbridge-beacon-primitives = { workspace = true }
|
2025-04-30 17:58:45 +00:00
|
|
|
snowbridge-core = { workspace = true }
|
2025-04-18 20:28:00 +00:00
|
|
|
snowbridge-inbound-queue-primitives = { workspace = true }
|
2025-04-30 17:01:21 +00:00
|
|
|
snowbridge-merkle-tree = { workspace = true }
|
2025-04-25 23:28:41 +00:00
|
|
|
snowbridge-outbound-queue-primitives = { workspace = true }
|
2025-04-30 17:01:21 +00:00
|
|
|
snowbridge-outbound-queue-v2-runtime-api = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
snowbridge-pallet-ethereum-client = { workspace = true }
|
2026-01-12 18:50:25 +00:00
|
|
|
snowbridge-pallet-ethereum-client-fixtures = { workspace = true, optional = true }
|
2025-04-18 20:28:00 +00:00
|
|
|
snowbridge-pallet-inbound-queue-v2 = { workspace = true }
|
2025-04-25 23:28:41 +00:00
|
|
|
snowbridge-pallet-outbound-queue-v2 = { workspace = true }
|
2025-04-30 17:58:45 +00:00
|
|
|
snowbridge-pallet-system = { workspace = true }
|
|
|
|
|
snowbridge-pallet-system-v2 = { workspace = true }
|
|
|
|
|
snowbridge-system-v2-runtime-api = { workspace = true }
|
2025-04-18 20:28:00 +00:00
|
|
|
snowbridge-verification-primitives = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
sp-api = { workspace = true }
|
|
|
|
|
sp-block-builder = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
sp-consensus-babe = { workspace = true, features = ["serde"] }
|
|
|
|
|
sp-consensus-beefy = { workspace = true, features = ["serde"] }
|
|
|
|
|
sp-consensus-grandpa = { workspace = true, features = ["serde"] }
|
|
|
|
|
sp-core = { workspace = true, features = ["serde"] }
|
2025-04-14 18:38:55 +00:00
|
|
|
sp-genesis-builder = { workspace = true }
|
|
|
|
|
sp-inherents = { workspace = true }
|
2025-08-06 11:44:42 +00:00
|
|
|
sp-io = { workspace = true }
|
2025-04-14 18:38:55 +00:00
|
|
|
sp-keyring = { workspace = true }
|
|
|
|
|
sp-offchain = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
sp-runtime = { workspace = true, features = ["serde"] }
|
2025-04-14 18:38:55 +00:00
|
|
|
sp-session = { workspace = true }
|
|
|
|
|
sp-staking = { workspace = true }
|
|
|
|
|
sp-std = { workspace = true }
|
|
|
|
|
sp-storage = { workspace = true }
|
|
|
|
|
sp-transaction-pool = { workspace = true }
|
2025-05-08 13:14:30 +00:00
|
|
|
sp-version = { workspace = true, features = ["serde"] }
|
2025-11-03 13:49:30 +00:00
|
|
|
strum = { workspace = true }
|
|
|
|
|
strum_macros = { workspace = true }
|
2025-04-18 20:28:00 +00:00
|
|
|
xcm = { workspace = true }
|
|
|
|
|
xcm-builder = { workspace = true }
|
|
|
|
|
xcm-executor = { workspace = true }
|
2025-03-17 16:57:14 +00:00
|
|
|
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
# DataHaven precompiles
|
feat: Add ERC20 Balances precompile (#150)
## Summary
- Introduces an ERC20-compatible precompile backed by `pallet_balances`,
including approvals and EIP-2612 permit.
- Wires the precompile into Mainnet, Testnet, and Stagenet at address
`0x0000000000000000000000000000000000000802` (u64: 2050).
- Adds comprehensive unit tests and a mock runtime.
## Motivation
- Allow EVM contracts and tooling to interact with Substrate balances
via a familiar ERC20 interface.
- Support off-chain approvals via EIP-2612 for gasless approvals and
improved UX.
## Key Changes
- New crate: `operator/precompiles/erc20-balances`
- Core logic: `src/lib.rs`
- EIP-2612 helpers and validation: `src/eip2612.rs`
- Tests + mock runtime: `src/tests.rs`, `src/mock.rs`
- Runtime wiring (all networks): add `Erc20BalancesPrecompile` at
`AddressU64<2050>`
- `operator/runtime/{mainnet,stagenet,testnet}/src/precompiles.rs`
- Workspace plumbing: include `pallet-evm-precompile-balances-erc20` in
`operator/Cargo.toml`
## Interface
- ERC20: `totalSupply`, `balanceOf`, `allowance`, `approve`, `transfer`,
`transferFrom`, `name`, `symbol`, `decimals`
- Native-only flows: `deposit()` (fallback/payable) and
`withdraw(uint256)`
- EIP-2612: `permit(owner,spender,value,deadline,v,r,s)`,
`nonces(owner)`, `DOMAIN_SEPARATOR()`
- Events: `Transfer`, `Approval`, `Deposit`, `Withdrawal`
- Storage:
- Approvals via `ApprovesStorage` (double map: owner → spender → amount)
- EIP-2612 nonces via `NoncesStorage` keyed by `H160`
- Instance-aware prefixes to support multiple `pallet_balances`
instances
2025-09-12 08:57:44 +00:00
|
|
|
pallet-evm-precompile-balances-erc20 = { workspace = true }
|
feat: ✨ Add Moonbeam Batch precompile (#138)
## Summary
This PR adds Moonbeam's Batch precompile to DataHaven, enabling
efficient batching of multiple EVM transactions in a single call. This
implementation follows Moonbeam's exact architecture and provides
significant gas savings for batch operations.
## Key Features
### Batch Precompile Functions
- **`batchSome(address[], uint256[], bytes[], uint64[])`**: Execute
multiple calls, continuing on failures
- **`batchSomeUntilFailure(address[], uint256[], bytes[], uint64[])`**:
Execute calls until first failure
- **`batchAll(address[], uint256[], bytes[], uint64[])`**: Execute all
calls, reverting if any fail
### Technical Implementation
- **Address**: `0x0808` (2056 in decimal)
- **Access Control**: Restricted nesting with `SubcallWithMaxNesting<2>`
- **Self-recursion**: Only the Batch precompile can call itself
(`OnlyFrom<AddressU64<2056>>`)
- **Gas Management**: Proper gas estimation and refund handling
- **Error Handling**: Comprehensive revert reasons and event logging
Depends on #137
---------
Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com>
2025-09-05 17:24:09 +00:00
|
|
|
pallet-evm-precompile-batch = { workspace = true }
|
feat: ✨ Add Moonbeam CallPermit precompile (#140)
## 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>
2025-09-07 13:00:37 +00:00
|
|
|
pallet-evm-precompile-call-permit = { workspace = true }
|
2025-10-08 21:16:34 +00:00
|
|
|
pallet-evm-precompile-collective = { workspace = true }
|
2025-12-02 12:57:40 +00:00
|
|
|
pallet-evm-precompile-datahaven-native-transfer = { workspace = true }
|
2025-10-08 21:16:34 +00:00
|
|
|
pallet-evm-precompile-identity = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-evm-precompile-preimage = { workspace = true }
|
2025-09-12 07:45:26 +00:00
|
|
|
pallet-evm-precompile-proxy = { workspace = true }
|
2025-10-10 22:17:21 +00:00
|
|
|
pallet-evm-precompile-referenda = { workspace = true }
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
pallet-evm-precompile-registry = { workspace = true }
|
|
|
|
|
|
2025-09-02 13:05:36 +00:00
|
|
|
# StorageHub
|
2025-09-03 08:57:57 +00:00
|
|
|
pallet-bucket-nfts = { workspace = true }
|
|
|
|
|
pallet-cr-randomness = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-evm-precompile-file-system = { workspace = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
pallet-file-system = { workspace = true }
|
|
|
|
|
pallet-file-system-runtime-api = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
pallet-nfts = { workspace = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
pallet-payment-streams = { workspace = true }
|
|
|
|
|
pallet-payment-streams-runtime-api = { workspace = true }
|
|
|
|
|
pallet-proofs-dealer = { workspace = true }
|
|
|
|
|
pallet-proofs-dealer-runtime-api = { workspace = true }
|
|
|
|
|
pallet-randomness = { workspace = true }
|
|
|
|
|
pallet-storage-providers = { workspace = true }
|
|
|
|
|
pallet-storage-providers-runtime-api = { workspace = true }
|
2025-09-10 06:15:27 +00:00
|
|
|
shc-common = { workspace = true, optional = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
shp-constants = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
shp-data-price-updater = { workspace = true }
|
|
|
|
|
shp-file-key-verifier = { workspace = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
shp-file-metadata = { workspace = true }
|
2025-11-03 13:49:30 +00:00
|
|
|
shp-forest-verifier = { workspace = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
shp-traits = { workspace = true }
|
|
|
|
|
shp-treasury-funding = { workspace = true }
|
2025-11-16 15:44:17 +00:00
|
|
|
shp-tx-implicits-runtime-api = { workspace = true }
|
2025-09-03 08:57:57 +00:00
|
|
|
sp-trie = { workspace = true }
|
2025-09-02 13:05:36 +00:00
|
|
|
|
2025-03-17 16:57:14 +00:00
|
|
|
[build-dependencies]
|
2025-05-08 13:14:30 +00:00
|
|
|
substrate-wasm-builder = { workspace = true, optional = true, default-features = true }
|
2025-03-17 16:57:14 +00:00
|
|
|
|
feat: ✨ Native Token Transfer to Ethereum (#88)
### Summary
- Implement native token transfers from DataHaven to Ethereum using
Snowbridge infrastructure
- Add comprehensive datahaven-native-transfer pallet with lock-and-mint
mechanism for cross-chain token representation
### Key Features
**New Pallet: datahaven-native-transfer**
- Cross-chain transfers: Transfer DataHaven native tokens to Ethereum
addresses via `transfer_to_ethereum extrinsic`
- Token locking mechanism: Secure token storage in deterministic
Ethereum sovereign account during transfers
- Fee management: Required fees for all transfers to compensate relayers
and prevent spam
- Emergency controls: Pause/unpause functionality
- Token registration: Integration with Snowbridge's token registration
for native token identification
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced the DataHaven Native Transfer pallet enabling secure
cross-chain transfers of DataHaven native tokens to and from Ethereum
via Snowbridge.
- Added token locking on DataHaven, minting on Ethereum, and mandatory
fee collection to cover gas costs and incentivize relayers.
- Implemented pause and unpause controls for emergency management of
token transfers.
- **Configuration**
- Integrated the new pallet into mainnet, stagenet, and testnet runtimes
with updated network, account, and treasury settings.
- Added Ethereum sovereign account constants and native token ID support
for optimized cross-chain operations.
- **Documentation**
- Added comprehensive README and inline documentation detailing pallet
features, extrinsics, events, errors, and security considerations.
- **Tests**
- Added extensive unit and integration tests covering token transfers,
native token registration, fee handling, pause functionality, and event
validation across all supported networks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-06-11 22:07:36 +00:00
|
|
|
[dev-dependencies]
|
|
|
|
|
# Test utilities
|
|
|
|
|
frame-support-test = { workspace = true }
|
|
|
|
|
sp-io = { workspace = true }
|
|
|
|
|
sp-tracing = { workspace = true }
|
|
|
|
|
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
precompile-utils = { workspace = true, features = ["std", "testing"] }
|
|
|
|
|
|
feat: ✨ Native Token Transfer to Ethereum (#88)
### Summary
- Implement native token transfers from DataHaven to Ethereum using
Snowbridge infrastructure
- Add comprehensive datahaven-native-transfer pallet with lock-and-mint
mechanism for cross-chain token representation
### Key Features
**New Pallet: datahaven-native-transfer**
- Cross-chain transfers: Transfer DataHaven native tokens to Ethereum
addresses via `transfer_to_ethereum extrinsic`
- Token locking mechanism: Secure token storage in deterministic
Ethereum sovereign account during transfers
- Fee management: Required fees for all transfers to compensate relayers
and prevent spam
- Emergency controls: Pause/unpause functionality
- Token registration: Integration with Snowbridge's token registration
for native token identification
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced the DataHaven Native Transfer pallet enabling secure
cross-chain transfers of DataHaven native tokens to and from Ethereum
via Snowbridge.
- Added token locking on DataHaven, minting on Ethereum, and mandatory
fee collection to cover gas costs and incentivize relayers.
- Implemented pause and unpause controls for emergency management of
token transfers.
- **Configuration**
- Integrated the new pallet into mainnet, stagenet, and testnet runtimes
with updated network, account, and treasury settings.
- Added Ethereum sovereign account constants and native token ID support
for optimized cross-chain operations.
- **Documentation**
- Added comprehensive README and inline documentation detailing pallet
features, extrinsics, events, errors, and security considerations.
- **Tests**
- Added extensive unit and integration tests covering token transfers,
native token registration, fee handling, pause functionality, and event
validation across all supported networks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-06-11 22:07:36 +00:00
|
|
|
# Snowbridge testing
|
|
|
|
|
snowbridge-core = { workspace = true }
|
2025-08-06 11:44:42 +00:00
|
|
|
snowbridge-outbound-queue-primitives = { workspace = true }
|
feat: ✨ Native Token Transfer to Ethereum (#88)
### Summary
- Implement native token transfers from DataHaven to Ethereum using
Snowbridge infrastructure
- Add comprehensive datahaven-native-transfer pallet with lock-and-mint
mechanism for cross-chain token representation
### Key Features
**New Pallet: datahaven-native-transfer**
- Cross-chain transfers: Transfer DataHaven native tokens to Ethereum
addresses via `transfer_to_ethereum extrinsic`
- Token locking mechanism: Secure token storage in deterministic
Ethereum sovereign account during transfers
- Fee management: Required fees for all transfers to compensate relayers
and prevent spam
- Emergency controls: Pause/unpause functionality
- Token registration: Integration with Snowbridge's token registration
for native token identification
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced the DataHaven Native Transfer pallet enabling secure
cross-chain transfers of DataHaven native tokens to and from Ethereum
via Snowbridge.
- Added token locking on DataHaven, minting on Ethereum, and mandatory
fee collection to cover gas costs and incentivize relayers.
- Implemented pause and unpause controls for emergency management of
token transfers.
- **Configuration**
- Integrated the new pallet into mainnet, stagenet, and testnet runtimes
with updated network, account, and treasury settings.
- Added Ethereum sovereign account constants and native token ID support
for optimized cross-chain operations.
- **Documentation**
- Added comprehensive README and inline documentation detailing pallet
features, extrinsics, events, errors, and security considerations.
- **Tests**
- Added extensive unit and integration tests covering token transfers,
native token registration, fee handling, pause functionality, and event
validation across all supported networks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-06-11 22:07:36 +00:00
|
|
|
snowbridge-pallet-system = { workspace = true }
|
|
|
|
|
snowbridge-pallet-system-v2 = { workspace = true }
|
|
|
|
|
|
2025-03-17 16:57:14 +00:00
|
|
|
[features]
|
|
|
|
|
default = ["std"]
|
|
|
|
|
std = [
|
2026-01-16 19:49:45 +00:00
|
|
|
"alloy-core/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"codec/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"datahaven-runtime-common/std",
|
|
|
|
|
"fp-account/std",
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
"fp-evm/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"frame-benchmarking?/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"frame-executive/std",
|
|
|
|
|
"frame-metadata-hash-extension/std",
|
|
|
|
|
"frame-support/std",
|
|
|
|
|
"frame-system-benchmarking?/std",
|
fix: add missing weights (#271)
### Add missing weights for BABE, GRANDPA, and Randomness
#### Summary
Adds generated weights and wires them into the runtime for the BABE,
GRANDPA, and Randomness pallets to replace defaults and ensure accurate
execution costs across networks.
#### What’s changed
- **New weights added** for `pallet_grandpa`, `pallet_babe` and
`pallet_randomness`
- **Runtime configs updated to use new weights**
- `operator/runtime/mainnet/src/configs/mod.rs`
- `operator/runtime/stagenet/src/configs/mod.rs`
- `operator/runtime/testnet/src/configs/mod.rs`
#### For follow-up PRS
- fix `pallet_identity` failure at running benchmarks
- fix `pallet_collective` benchmarking missmatch (related to
https://github.com/paritytech/polkadot-sdk/pull/6435)
- add `pallet_session_benchmarking` without including `pallet_staking`
(or some workaround)
- add StorageHub weights to our benchmarked pallets (`pallet_nfts`,
`pallet_storage_providers`, `pallet_payment_streams`,
`pallet_proofs_dealer`, `pallet_file_system`, `pallet_bucket_nfts`, etc)
2025-11-02 20:50:55 +00:00
|
|
|
"pallet-session-benchmarking?/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"frame-system-rpc-runtime-api/std",
|
|
|
|
|
"frame-system/std",
|
|
|
|
|
"frame-try-runtime?/std",
|
2025-04-02 21:49:47 +00:00
|
|
|
"pallet-authorship/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"pallet-babe/std",
|
|
|
|
|
"pallet-balances/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-beefy-mmr/std",
|
|
|
|
|
"pallet-beefy/std",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-collective/std",
|
|
|
|
|
"pallet-conviction-voting/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-ethereum/std",
|
|
|
|
|
"pallet-evm-chain-id/std",
|
|
|
|
|
"pallet-evm/std",
|
feat: Add ERC20 Balances precompile (#150)
## Summary
- Introduces an ERC20-compatible precompile backed by `pallet_balances`,
including approvals and EIP-2612 permit.
- Wires the precompile into Mainnet, Testnet, and Stagenet at address
`0x0000000000000000000000000000000000000802` (u64: 2050).
- Adds comprehensive unit tests and a mock runtime.
## Motivation
- Allow EVM contracts and tooling to interact with Substrate balances
via a familiar ERC20 interface.
- Support off-chain approvals via EIP-2612 for gasless approvals and
improved UX.
## Key Changes
- New crate: `operator/precompiles/erc20-balances`
- Core logic: `src/lib.rs`
- EIP-2612 helpers and validation: `src/eip2612.rs`
- Tests + mock runtime: `src/tests.rs`, `src/mock.rs`
- Runtime wiring (all networks): add `Erc20BalancesPrecompile` at
`AddressU64<2050>`
- `operator/runtime/{mainnet,stagenet,testnet}/src/precompiles.rs`
- Workspace plumbing: include `pallet-evm-precompile-balances-erc20` in
`operator/Cargo.toml`
## Interface
- ERC20: `totalSupply`, `balanceOf`, `allowance`, `approve`, `transfer`,
`transferFrom`, `name`, `symbol`, `decimals`
- Native-only flows: `deposit()` (fallback/payable) and
`withdraw(uint256)`
- EIP-2612: `permit(owner,spender,value,deadline,v,r,s)`,
`nonces(owner)`, `DOMAIN_SEPARATOR()`
- Events: `Transfer`, `Approval`, `Deposit`, `Withdrawal`
- Storage:
- Approvals via `ApprovesStorage` (double map: owner → spender → amount)
- EIP-2612 nonces via `NoncesStorage` keyed by `H160`
- Instance-aware prefixes to support multiple `pallet_balances`
instances
2025-09-12 08:57:44 +00:00
|
|
|
"pallet-evm-precompile-balances-erc20/std",
|
feat: ✨ Add Moonbeam Batch precompile (#138)
## Summary
This PR adds Moonbeam's Batch precompile to DataHaven, enabling
efficient batching of multiple EVM transactions in a single call. This
implementation follows Moonbeam's exact architecture and provides
significant gas savings for batch operations.
## Key Features
### Batch Precompile Functions
- **`batchSome(address[], uint256[], bytes[], uint64[])`**: Execute
multiple calls, continuing on failures
- **`batchSomeUntilFailure(address[], uint256[], bytes[], uint64[])`**:
Execute calls until first failure
- **`batchAll(address[], uint256[], bytes[], uint64[])`**: Execute all
calls, reverting if any fail
### Technical Implementation
- **Address**: `0x0808` (2056 in decimal)
- **Access Control**: Restricted nesting with `SubcallWithMaxNesting<2>`
- **Self-recursion**: Only the Batch precompile can call itself
(`OnlyFrom<AddressU64<2056>>`)
- **Gas Management**: Proper gas estimation and refund handling
- **Error Handling**: Comprehensive revert reasons and event logging
Depends on #137
---------
Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com>
2025-09-05 17:24:09 +00:00
|
|
|
"pallet-evm-precompile-batch/std",
|
feat: ✨ Add Moonbeam CallPermit precompile (#140)
## 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>
2025-09-07 13:00:37 +00:00
|
|
|
"pallet-evm-precompile-call-permit/std",
|
2025-10-09 11:16:46 +00:00
|
|
|
"pallet-evm-precompile-preimage/std",
|
2025-10-08 21:16:34 +00:00
|
|
|
"pallet-evm-precompile-collective/std",
|
2025-10-09 08:30:50 +00:00
|
|
|
"pallet-evm-precompile-conviction-voting/std",
|
2025-12-02 12:57:40 +00:00
|
|
|
"pallet-evm-precompile-datahaven-native-transfer/std",
|
2025-10-08 21:16:34 +00:00
|
|
|
"pallet-evm-precompile-identity/std",
|
2025-09-12 07:45:26 +00:00
|
|
|
"pallet-evm-precompile-proxy/std",
|
2025-10-10 22:17:21 +00:00
|
|
|
"pallet-evm-precompile-referenda/std",
|
feat: ✨ Add Moonbeam EVM Precompile Registry (#137)
## Summary
This PR implements a comprehensive EVM precompile registry system for
DataHaven, following Moonbeam's exact architecture and patterns. The
implementation includes:
- **Registry Precompile**: A new precompile at address `0x0815` (2069)
that manages and queries available precompiles
- **Core Ethereum Precompiles**: Standard Ethereum precompiles
(ECRecover, SHA256, RIPEMD160, Identity, ModExp, BN128Add, BN128Mul,
BN128Pairing, Blake2F, SHA3FIPS)
- **Modular Architecture**: Clean separation following Moonbeam's
structure with dedicated precompile modules per runtime
## Key Features
### Registry Precompile Functions
- `isPrecompile(address)`: Check if an address corresponds to any
precompile (active or inactive)
- `isActivePrecompile(address)`: Check if a precompile is currently
active in the runtime
- `updateAccountCode(address)`: Insert dummy EVM bytecode for Solidity
compatibility
### Runtime Integration
- Integrated across all three runtimes (testnet, stagenet, mainnet)
- Uses Moonbeam's `PrecompileSetBuilder` pattern for composable
precompile management
- Proper gas accounting with database read/write operations
- Access control through `CallableByContract` and `CallableByPrecompile`
traits
---------
Co-authored-by: undercover-cactus <lola@moonsonglabs.com>
2025-09-04 08:25:59 +00:00
|
|
|
"pallet-evm-precompile-registry/std",
|
2025-09-15 08:43:00 +00:00
|
|
|
"pallet-evm-precompile-file-system/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"pallet-grandpa/std",
|
2025-04-02 22:52:18 +00:00
|
|
|
"pallet-identity/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-im-online/std",
|
2025-04-25 23:28:41 +00:00
|
|
|
"pallet-message-queue/std",
|
2025-09-24 10:27:44 +00:00
|
|
|
"pallet-migrations/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"pallet-mmr/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-multisig/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"pallet-offences/std",
|
2025-04-23 17:25:49 +00:00
|
|
|
"pallet-parameters/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"pallet-preimage/std",
|
feat: Add SafeMode and TxPause Pallets (#192)
### Overview
This PR integrates the `pallet-safe-mode` and `pallet-tx-pause` from
Polkadot SDK to provide comprehensive emergency governance controls
across all DataHaven runtime networks (mainnet, stagenet, testnet).
### Key Changes
#### 🔧 **Core Integration**
- **Dependencies**: Added `pallet-safe-mode` and `pallet-tx-pause` from
`polkadot-stable2412-6`
- **Runtime Integration**: Integrated both pallets across all three
runtime networks with pallet indices 103 and 104
- **Call Filtering**: Implemented unified `RuntimeCallFilter` that
combines Normal, SafeMode, and TxPause restrictions
#### 🛡️ **SafeMode Pallet Configuration**
- **Duration**: 1 day activation period (`DAYS` constant)
- **Deposits**: Disabled permissionless entry/extension (all `None`)
- **Origins**: Root-only for all force operations (`force_enter`,
`force_exit`, `force_extend`, etc.)
- **Whitelisting**: SafeMode and Sudo calls are immune to restrictions
#### ⏸️ **TxPause Pallet Configuration**
- **Origins**: Root-only pause/unpause control
- **Whitelisting**: SafeMode and Sudo calls cannot be paused
- **Max Call Name Length**: 256 characters
#### 🏗️ **Architecture**
- **Shared Types**: Created `operator/runtime/common/src/safe_mode.rs`
with reusable configurations
- **Combined Filtering**: `RuntimeCallFilter` applies all three filter
layers (Normal + SafeMode + TxPause)
- **Consistent Config**: Identical configuration across mainnet,
stagenet, and testnet
#### 📊 **Infrastructure Updates**
- **Benchmarking**: Added both pallets to benchmark suites across all
networks
- **Weight Mappings**: Placeholder weights using Substrate defaults
(ready for chain-specific benchmarking)
- **Metadata**: Updated runtime metadata for new pallet exposure
#### 🧪 **Testing Framework**
- **Coverage**: Tests for individual pallet behavior, combined
restrictions, whitelisting, and edge cases
### Emergency Control Capabilities
**SafeMode Pallet** (8 calls):
- User calls: `enter`, `extend`, `release_deposit`
- Force calls: `force_enter`, `force_exit`, `force_extend`,
`force_slash_deposit`, `force_release_deposit`
**TxPause Pallet** (2 calls):
- `pause_call` / `unpause_call` - Granular transaction type pausing
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-10-06 17:00:10 +00:00
|
|
|
"pallet-safe-mode/std",
|
|
|
|
|
"pallet-tx-pause/std",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-referenda/std",
|
feat: ✨ Integrate Proxy pallet into DataHaven runtimes (#128)
## 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>
2025-08-18 07:46:59 +00:00
|
|
|
"pallet-proxy/std",
|
2026-01-30 11:16:28 +00:00
|
|
|
"pallet-proxy-genesis-companion/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"pallet-scheduler/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"pallet-session/std",
|
|
|
|
|
"pallet-sudo/std",
|
|
|
|
|
"pallet-timestamp/std",
|
|
|
|
|
"pallet-transaction-payment-rpc-runtime-api/std",
|
|
|
|
|
"pallet-transaction-payment/std",
|
2025-06-25 06:09:26 +00:00
|
|
|
"pallet-treasury/std",
|
2025-04-02 13:42:47 +00:00
|
|
|
"pallet-utility/std",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-whitelist/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"polkadot-primitives/std",
|
2025-04-14 11:40:24 +00:00
|
|
|
"polkadot-runtime-common/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"scale-info/std",
|
2026-01-30 11:16:28 +00:00
|
|
|
"serde/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"serde_json/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"snowbridge-beacon-primitives/std",
|
2025-04-18 20:28:00 +00:00
|
|
|
"snowbridge-inbound-queue-primitives/std",
|
2025-04-25 23:28:41 +00:00
|
|
|
"snowbridge-outbound-queue-primitives/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"snowbridge-pallet-ethereum-client/std",
|
2025-04-18 20:28:00 +00:00
|
|
|
"snowbridge-pallet-inbound-queue-v2/std",
|
2025-04-25 23:28:41 +00:00
|
|
|
"snowbridge-pallet-outbound-queue-v2/std",
|
|
|
|
|
"snowbridge-merkle-tree/std",
|
|
|
|
|
"snowbridge-outbound-queue-v2-runtime-api/std",
|
2025-04-30 17:58:45 +00:00
|
|
|
"snowbridge-pallet-system/std",
|
|
|
|
|
"snowbridge-pallet-system-v2/std",
|
|
|
|
|
"snowbridge-system-v2-runtime-api/std",
|
2025-04-18 20:28:00 +00:00
|
|
|
"dhp-bridge/std",
|
|
|
|
|
"snowbridge-verification-primitives/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"sp-api/std",
|
|
|
|
|
"sp-block-builder/std",
|
|
|
|
|
"sp-consensus-babe/std",
|
2025-04-30 17:58:45 +00:00
|
|
|
"sp-consensus-beefy/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"sp-consensus-grandpa/std",
|
|
|
|
|
"sp-core/std",
|
|
|
|
|
"sp-genesis-builder/std",
|
|
|
|
|
"sp-inherents/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"sp-keyring/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"sp-offchain/std",
|
|
|
|
|
"sp-runtime/std",
|
|
|
|
|
"sp-session/std",
|
|
|
|
|
"sp-staking/std",
|
|
|
|
|
"sp-std/std",
|
2025-04-14 18:38:55 +00:00
|
|
|
"sp-storage/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
"sp-transaction-pool/std",
|
|
|
|
|
"sp-version/std",
|
|
|
|
|
"substrate-wasm-builder",
|
2025-05-06 11:38:53 +00:00
|
|
|
"pallet-outbound-commitment-store/std",
|
2025-05-14 09:05:07 +00:00
|
|
|
"pallet-external-validators/std",
|
feat(operator): Add External Validators Rewards Pallet (#72)
This PR introduces and integrates the new
`pallet-external-validators-rewards` into the operator runtimes. This
pallet is responsible for managing and distributing rewards to external
validators. The pallet was originally introduced by Tanssi. It was
heavily modified to abstract the message building and sending with
Snowbridge.
### Key Changes Related to `pallet-external-validators-rewards`:
* **Pallet and Runtime API Addition:**
* The `pallet-external-validators-rewards` has been added to `mainnet`,
`stagenet`, and `testnet` runtimes
* **Runtime Configuration
(`operator/runtime/{mainnet,stagenet,testnet}/src/configs/mod.rs`):**
* **`RewardsRegistryAddress` Parameter:** A new dynamic runtime
parameter `RewardsRegistryAddress` (type `H160`) has been added to
`runtime_params.rs`. This will hold the Ethereum address of the Rewards
Registry contract.
* **Author Rewards with `RewardsPoints`:**
* A new struct `RewardsPoints` implements
`pallet_authorship::EventHandler`.
* Its `note_author` function rewards block authors (if they are not
whitelisted validators) by calling
`ExternalValidatorsRewards::reward_by_ids`.
* The `EventHandler` in `pallet_authorship::Config` is updated to
`(RewardsPoints, ImOnline)`.
* **Integration with `pallet-external-validators`:**
* The `OnEraStart` and `OnEraEnd` hooks in
`pallet_external_validators::Config` are now set to
`ExternalValidatorsRewards`, allowing the rewards pallet to react to era
changes.
* **`RewardsSendAdapter` for Ethereum Communication:**
* A new struct `RewardsSendAdapter` implements
`pallet_external_validators_rewards::types::SendMessage`.
* `build()`: Constructs an `OutboundMessage` to call the
`updateRewardsMerkleRoot(bytes32)` function on the
`RewardsRegistryAddress` on Ethereum. The calldata includes the selector
(hashed from `UpdateRewardsMerkleRootSignature`) and the
`rewards_merkle_root`.
* `validate()` and `deliver()`: Utilize `OutboundQueueV2` for message
validation and delivery.
* A constant `UpdateRewardsMerkleRootSignature` (
`b"updateRewardsMerkleRoot(bytes32)"`) is defined for this purpose.
* **Runtime API
(`operator/runtime/{mainnet,stagenet,testnet}/src/lib.rs`):**
* The runtime implements
`pallet_external_validators_rewards_runtime_api::ExternalValidatorsRewardsApi`.
* This exposes two functions:
* `generate_rewards_merkle_proof(account_id: AccountId, era_index:
EraIndex) -> Option<MerkleProof>`
* `verify_rewards_merkle_proof(merkle_proof: MerkleProof) -> bool`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a rewards system for external validators with era-based
tracking, Merkle proof generation, and verification.
- Added runtime APIs to generate and verify validator rewards Merkle
proofs.
- Enabled rewards distribution via outbound messaging to an external
registry contract.
- Configured runtime parameters for the rewards registry address.
- Added fixed author reward points and integrated rewards logic into
block authorship events.
- Provided a mock runtime environment and benchmarking support for the
rewards pallet.
- **Tests**
- Added comprehensive tests and benchmarks for validator rewards
distribution and Merkle proof functionality.
- **Chores**
- Integrated new pallets and runtime APIs into mainnet, stagenet, and
testnet configurations.
- Updated dependencies and feature groups to include new rewards-related
pallets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Facundo Farall <37149322+ffarall@users.noreply.github.com>
2025-05-22 00:51:24 +00:00
|
|
|
"pallet-external-validators-rewards/std",
|
2025-10-29 10:43:55 +00:00
|
|
|
"pallet-external-validator-slashes/std",
|
feat: ✨ Native Token Transfer to Ethereum (#88)
### Summary
- Implement native token transfers from DataHaven to Ethereum using
Snowbridge infrastructure
- Add comprehensive datahaven-native-transfer pallet with lock-and-mint
mechanism for cross-chain token representation
### Key Features
**New Pallet: datahaven-native-transfer**
- Cross-chain transfers: Transfer DataHaven native tokens to Ethereum
addresses via `transfer_to_ethereum extrinsic`
- Token locking mechanism: Secure token storage in deterministic
Ethereum sovereign account during transfers
- Fee management: Required fees for all transfers to compensate relayers
and prevent spam
- Emergency controls: Pause/unpause functionality
- Token registration: Integration with Snowbridge's token registration
for native token identification
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced the DataHaven Native Transfer pallet enabling secure
cross-chain transfers of DataHaven native tokens to and from Ethereum
via Snowbridge.
- Added token locking on DataHaven, minting on Ethereum, and mandatory
fee collection to cover gas costs and incentivize relayers.
- Implemented pause and unpause controls for emergency management of
token transfers.
- **Configuration**
- Integrated the new pallet into mainnet, stagenet, and testnet runtimes
with updated network, account, and treasury settings.
- Added Ethereum sovereign account constants and native token ID support
for optimized cross-chain operations.
- **Documentation**
- Added comprehensive README and inline documentation detailing pallet
features, extrinsics, events, errors, and security considerations.
- **Tests**
- Added extensive unit and integration tests covering token transfers,
native token registration, fee handling, pause functionality, and event
validation across all supported networks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-06-11 22:07:36 +00:00
|
|
|
"pallet-datahaven-native-transfer/std",
|
2025-09-02 13:05:36 +00:00
|
|
|
# StorageHub
|
2025-10-29 10:43:55 +00:00
|
|
|
"pallet-bucket-nfts/std",
|
2025-09-02 13:05:36 +00:00
|
|
|
"pallet-nfts/std",
|
2025-10-29 10:43:55 +00:00
|
|
|
"pallet-cr-randomness/std",
|
|
|
|
|
"pallet-file-system/std",
|
|
|
|
|
"pallet-file-system-runtime-api/std",
|
|
|
|
|
"pallet-payment-streams/std",
|
|
|
|
|
"pallet-payment-streams-runtime-api/std",
|
|
|
|
|
"pallet-proofs-dealer/std",
|
|
|
|
|
"pallet-proofs-dealer-runtime-api/std",
|
|
|
|
|
"pallet-randomness/std",
|
|
|
|
|
"pallet-storage-providers/std",
|
|
|
|
|
"pallet-storage-providers-runtime-api/std",
|
2025-09-10 06:15:27 +00:00
|
|
|
"dep:shc-common",
|
2025-10-29 10:43:55 +00:00
|
|
|
"shc-common/std",
|
2025-09-02 13:05:36 +00:00
|
|
|
"shp-constants/std",
|
2025-10-29 10:43:55 +00:00
|
|
|
"shp-file-metadata/std",
|
|
|
|
|
"shp-forest-verifier/std",
|
|
|
|
|
"shp-traits/std",
|
|
|
|
|
"shp-treasury-funding/std",
|
2025-09-02 13:05:36 +00:00
|
|
|
"shp-file-key-verifier/std",
|
2025-03-17 16:57:14 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
runtime-benchmarks = [
|
2025-04-25 23:28:41 +00:00
|
|
|
"bridge-hub-common",
|
2025-04-14 18:38:55 +00:00
|
|
|
"datahaven-runtime-common/runtime-benchmarks",
|
2025-03-17 16:57:14 +00:00
|
|
|
"frame-benchmarking/runtime-benchmarks",
|
|
|
|
|
"frame-support/runtime-benchmarks",
|
|
|
|
|
"frame-system-benchmarking/runtime-benchmarks",
|
|
|
|
|
"frame-system/runtime-benchmarks",
|
2025-04-02 21:49:47 +00:00
|
|
|
"pallet-balances/runtime-benchmarks",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-beefy-mmr/runtime-benchmarks",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-collective/runtime-benchmarks",
|
|
|
|
|
"pallet-conviction-voting/runtime-benchmarks",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-ethereum/runtime-benchmarks",
|
|
|
|
|
"pallet-evm/runtime-benchmarks",
|
2025-03-17 16:57:14 +00:00
|
|
|
"pallet-grandpa/runtime-benchmarks",
|
2025-04-02 22:52:18 +00:00
|
|
|
"pallet-identity/runtime-benchmarks",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-im-online/runtime-benchmarks",
|
2025-04-25 23:28:41 +00:00
|
|
|
"pallet-message-queue/runtime-benchmarks",
|
2025-09-24 10:27:44 +00:00
|
|
|
"pallet-migrations/runtime-benchmarks",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-mmr/runtime-benchmarks",
|
2025-04-02 14:22:53 +00:00
|
|
|
"pallet-multisig/runtime-benchmarks",
|
2025-04-02 21:49:47 +00:00
|
|
|
"pallet-offences/runtime-benchmarks",
|
2025-04-23 17:25:49 +00:00
|
|
|
"pallet-parameters/runtime-benchmarks",
|
fix: add missing weights (#271)
### Add missing weights for BABE, GRANDPA, and Randomness
#### Summary
Adds generated weights and wires them into the runtime for the BABE,
GRANDPA, and Randomness pallets to replace defaults and ensure accurate
execution costs across networks.
#### What’s changed
- **New weights added** for `pallet_grandpa`, `pallet_babe` and
`pallet_randomness`
- **Runtime configs updated to use new weights**
- `operator/runtime/mainnet/src/configs/mod.rs`
- `operator/runtime/stagenet/src/configs/mod.rs`
- `operator/runtime/testnet/src/configs/mod.rs`
#### For follow-up PRS
- fix `pallet_identity` failure at running benchmarks
- fix `pallet_collective` benchmarking missmatch (related to
https://github.com/paritytech/polkadot-sdk/pull/6435)
- add `pallet_session_benchmarking` without including `pallet_staking`
(or some workaround)
- add StorageHub weights to our benchmarked pallets (`pallet_nfts`,
`pallet_storage_providers`, `pallet_payment_streams`,
`pallet_proofs_dealer`, `pallet_file_system`, `pallet_bucket_nfts`, etc)
2025-11-02 20:50:55 +00:00
|
|
|
"pallet-randomness/runtime-benchmarks",
|
2025-04-02 17:14:23 +00:00
|
|
|
"pallet-preimage/runtime-benchmarks",
|
feat: Add SafeMode and TxPause Pallets (#192)
### Overview
This PR integrates the `pallet-safe-mode` and `pallet-tx-pause` from
Polkadot SDK to provide comprehensive emergency governance controls
across all DataHaven runtime networks (mainnet, stagenet, testnet).
### Key Changes
#### 🔧 **Core Integration**
- **Dependencies**: Added `pallet-safe-mode` and `pallet-tx-pause` from
`polkadot-stable2412-6`
- **Runtime Integration**: Integrated both pallets across all three
runtime networks with pallet indices 103 and 104
- **Call Filtering**: Implemented unified `RuntimeCallFilter` that
combines Normal, SafeMode, and TxPause restrictions
#### 🛡️ **SafeMode Pallet Configuration**
- **Duration**: 1 day activation period (`DAYS` constant)
- **Deposits**: Disabled permissionless entry/extension (all `None`)
- **Origins**: Root-only for all force operations (`force_enter`,
`force_exit`, `force_extend`, etc.)
- **Whitelisting**: SafeMode and Sudo calls are immune to restrictions
#### ⏸️ **TxPause Pallet Configuration**
- **Origins**: Root-only pause/unpause control
- **Whitelisting**: SafeMode and Sudo calls cannot be paused
- **Max Call Name Length**: 256 characters
#### 🏗️ **Architecture**
- **Shared Types**: Created `operator/runtime/common/src/safe_mode.rs`
with reusable configurations
- **Combined Filtering**: `RuntimeCallFilter` applies all three filter
layers (Normal + SafeMode + TxPause)
- **Consistent Config**: Identical configuration across mainnet,
stagenet, and testnet
#### 📊 **Infrastructure Updates**
- **Benchmarking**: Added both pallets to benchmark suites across all
networks
- **Weight Mappings**: Placeholder weights using Substrate defaults
(ready for chain-specific benchmarking)
- **Metadata**: Updated runtime metadata for new pallet exposure
#### 🧪 **Testing Framework**
- **Coverage**: Tests for individual pallet behavior, combined
restrictions, whitelisting, and edge cases
### Emergency Control Capabilities
**SafeMode Pallet** (8 calls):
- User calls: `enter`, `extend`, `release_deposit`
- Force calls: `force_enter`, `force_exit`, `force_extend`,
`force_slash_deposit`, `force_release_deposit`
**TxPause Pallet** (2 calls):
- `pause_call` / `unpause_call` - Granular transaction type pausing
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-10-06 17:00:10 +00:00
|
|
|
"pallet-safe-mode/runtime-benchmarks",
|
|
|
|
|
"pallet-tx-pause/runtime-benchmarks",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-referenda/runtime-benchmarks",
|
feat: ✨ Integrate Proxy pallet into DataHaven runtimes (#128)
## 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>
2025-08-18 07:46:59 +00:00
|
|
|
"pallet-proxy/runtime-benchmarks",
|
2025-04-02 19:28:30 +00:00
|
|
|
"pallet-scheduler/runtime-benchmarks",
|
fix: add missing weights (#271)
### Add missing weights for BABE, GRANDPA, and Randomness
#### Summary
Adds generated weights and wires them into the runtime for the BABE,
GRANDPA, and Randomness pallets to replace defaults and ensure accurate
execution costs across networks.
#### What’s changed
- **New weights added** for `pallet_grandpa`, `pallet_babe` and
`pallet_randomness`
- **Runtime configs updated to use new weights**
- `operator/runtime/mainnet/src/configs/mod.rs`
- `operator/runtime/stagenet/src/configs/mod.rs`
- `operator/runtime/testnet/src/configs/mod.rs`
#### For follow-up PRS
- fix `pallet_identity` failure at running benchmarks
- fix `pallet_collective` benchmarking missmatch (related to
https://github.com/paritytech/polkadot-sdk/pull/6435)
- add `pallet_session_benchmarking` without including `pallet_staking`
(or some workaround)
- add StorageHub weights to our benchmarked pallets (`pallet_nfts`,
`pallet_storage_providers`, `pallet_payment_streams`,
`pallet_proofs_dealer`, `pallet_file_system`, `pallet_bucket_nfts`, etc)
2025-11-02 20:50:55 +00:00
|
|
|
"pallet-session-benchmarking/runtime-benchmarks",
|
2025-03-17 16:57:14 +00:00
|
|
|
"pallet-sudo/runtime-benchmarks",
|
|
|
|
|
"pallet-timestamp/runtime-benchmarks",
|
2025-06-25 06:09:26 +00:00
|
|
|
"pallet-treasury/runtime-benchmarks",
|
2025-04-02 13:42:47 +00:00
|
|
|
"pallet-utility/runtime-benchmarks",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-whitelist/runtime-benchmarks",
|
2025-04-14 11:40:24 +00:00
|
|
|
"polkadot-primitives/runtime-benchmarks",
|
2025-04-14 18:38:55 +00:00
|
|
|
"polkadot-runtime-common/runtime-benchmarks",
|
2025-04-18 20:28:00 +00:00
|
|
|
"snowbridge-inbound-queue-primitives/runtime-benchmarks",
|
2025-03-17 16:57:14 +00:00
|
|
|
"snowbridge-pallet-ethereum-client/runtime-benchmarks",
|
2026-01-12 18:50:25 +00:00
|
|
|
"snowbridge-pallet-ethereum-client-fixtures/runtime-benchmarks",
|
2025-04-18 20:28:00 +00:00
|
|
|
"snowbridge-pallet-inbound-queue-v2/runtime-benchmarks",
|
2025-04-30 17:58:45 +00:00
|
|
|
"snowbridge-pallet-system-v2/runtime-benchmarks",
|
2025-04-25 23:28:41 +00:00
|
|
|
"snowbridge-pallet-outbound-queue-v2/runtime-benchmarks",
|
2025-03-17 16:57:14 +00:00
|
|
|
"sp-runtime/runtime-benchmarks",
|
2025-04-30 17:58:45 +00:00
|
|
|
"snowbridge-pallet-system/runtime-benchmarks",
|
2025-05-06 11:38:53 +00:00
|
|
|
"pallet-outbound-commitment-store/runtime-benchmarks",
|
2025-05-14 09:05:07 +00:00
|
|
|
"pallet-external-validators/runtime-benchmarks",
|
feat(operator): Add External Validators Rewards Pallet (#72)
This PR introduces and integrates the new
`pallet-external-validators-rewards` into the operator runtimes. This
pallet is responsible for managing and distributing rewards to external
validators. The pallet was originally introduced by Tanssi. It was
heavily modified to abstract the message building and sending with
Snowbridge.
### Key Changes Related to `pallet-external-validators-rewards`:
* **Pallet and Runtime API Addition:**
* The `pallet-external-validators-rewards` has been added to `mainnet`,
`stagenet`, and `testnet` runtimes
* **Runtime Configuration
(`operator/runtime/{mainnet,stagenet,testnet}/src/configs/mod.rs`):**
* **`RewardsRegistryAddress` Parameter:** A new dynamic runtime
parameter `RewardsRegistryAddress` (type `H160`) has been added to
`runtime_params.rs`. This will hold the Ethereum address of the Rewards
Registry contract.
* **Author Rewards with `RewardsPoints`:**
* A new struct `RewardsPoints` implements
`pallet_authorship::EventHandler`.
* Its `note_author` function rewards block authors (if they are not
whitelisted validators) by calling
`ExternalValidatorsRewards::reward_by_ids`.
* The `EventHandler` in `pallet_authorship::Config` is updated to
`(RewardsPoints, ImOnline)`.
* **Integration with `pallet-external-validators`:**
* The `OnEraStart` and `OnEraEnd` hooks in
`pallet_external_validators::Config` are now set to
`ExternalValidatorsRewards`, allowing the rewards pallet to react to era
changes.
* **`RewardsSendAdapter` for Ethereum Communication:**
* A new struct `RewardsSendAdapter` implements
`pallet_external_validators_rewards::types::SendMessage`.
* `build()`: Constructs an `OutboundMessage` to call the
`updateRewardsMerkleRoot(bytes32)` function on the
`RewardsRegistryAddress` on Ethereum. The calldata includes the selector
(hashed from `UpdateRewardsMerkleRootSignature`) and the
`rewards_merkle_root`.
* `validate()` and `deliver()`: Utilize `OutboundQueueV2` for message
validation and delivery.
* A constant `UpdateRewardsMerkleRootSignature` (
`b"updateRewardsMerkleRoot(bytes32)"`) is defined for this purpose.
* **Runtime API
(`operator/runtime/{mainnet,stagenet,testnet}/src/lib.rs`):**
* The runtime implements
`pallet_external_validators_rewards_runtime_api::ExternalValidatorsRewardsApi`.
* This exposes two functions:
* `generate_rewards_merkle_proof(account_id: AccountId, era_index:
EraIndex) -> Option<MerkleProof>`
* `verify_rewards_merkle_proof(merkle_proof: MerkleProof) -> bool`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a rewards system for external validators with era-based
tracking, Merkle proof generation, and verification.
- Added runtime APIs to generate and verify validator rewards Merkle
proofs.
- Enabled rewards distribution via outbound messaging to an external
registry contract.
- Configured runtime parameters for the rewards registry address.
- Added fixed author reward points and integrated rewards logic into
block authorship events.
- Provided a mock runtime environment and benchmarking support for the
rewards pallet.
- **Tests**
- Added comprehensive tests and benchmarks for validator rewards
distribution and Merkle proof functionality.
- **Chores**
- Integrated new pallets and runtime APIs into mainnet, stagenet, and
testnet configurations.
- Updated dependencies and feature groups to include new rewards-related
pallets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Facundo Farall <37149322+ffarall@users.noreply.github.com>
2025-05-22 00:51:24 +00:00
|
|
|
"pallet-external-validators-rewards/runtime-benchmarks",
|
2025-10-29 10:43:55 +00:00
|
|
|
"pallet-external-validator-slashes/runtime-benchmarks",
|
feat: ✨ Native Token Transfer to Ethereum (#88)
### Summary
- Implement native token transfers from DataHaven to Ethereum using
Snowbridge infrastructure
- Add comprehensive datahaven-native-transfer pallet with lock-and-mint
mechanism for cross-chain token representation
### Key Features
**New Pallet: datahaven-native-transfer**
- Cross-chain transfers: Transfer DataHaven native tokens to Ethereum
addresses via `transfer_to_ethereum extrinsic`
- Token locking mechanism: Secure token storage in deterministic
Ethereum sovereign account during transfers
- Fee management: Required fees for all transfers to compensate relayers
and prevent spam
- Emergency controls: Pause/unpause functionality
- Token registration: Integration with Snowbridge's token registration
for native token identification
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced the DataHaven Native Transfer pallet enabling secure
cross-chain transfers of DataHaven native tokens to and from Ethereum
via Snowbridge.
- Added token locking on DataHaven, minting on Ethereum, and mandatory
fee collection to cover gas costs and incentivize relayers.
- Implemented pause and unpause controls for emergency management of
token transfers.
- **Configuration**
- Integrated the new pallet into mainnet, stagenet, and testnet runtimes
with updated network, account, and treasury settings.
- Added Ethereum sovereign account constants and native token ID support
for optimized cross-chain operations.
- **Documentation**
- Added comprehensive README and inline documentation detailing pallet
features, extrinsics, events, errors, and security considerations.
- **Tests**
- Added extensive unit and integration tests covering token transfers,
native token registration, fee handling, pause functionality, and event
validation across all supported networks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-06-11 22:07:36 +00:00
|
|
|
"pallet-datahaven-native-transfer/runtime-benchmarks",
|
2026-02-03 16:12:11 +00:00
|
|
|
# StorageHub pallets
|
|
|
|
|
"pallet-nfts/runtime-benchmarks",
|
|
|
|
|
"pallet-file-system/runtime-benchmarks",
|
|
|
|
|
"pallet-proofs-dealer/runtime-benchmarks",
|
|
|
|
|
"pallet-payment-streams/runtime-benchmarks",
|
|
|
|
|
"pallet-storage-providers/runtime-benchmarks",
|
|
|
|
|
"dep:k256",
|
2025-03-17 16:57:14 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
try-runtime = [
|
2025-04-14 18:38:55 +00:00
|
|
|
"fp-self-contained/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
"frame-executive/try-runtime",
|
|
|
|
|
"frame-support/try-runtime",
|
|
|
|
|
"frame-system/try-runtime",
|
|
|
|
|
"frame-try-runtime/try-runtime",
|
2025-04-02 21:49:47 +00:00
|
|
|
"pallet-authorship/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
"pallet-babe/try-runtime",
|
|
|
|
|
"pallet-balances/try-runtime",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-beefy-mmr/try-runtime",
|
|
|
|
|
"pallet-beefy/try-runtime",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-collective/try-runtime",
|
|
|
|
|
"pallet-conviction-voting/try-runtime",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-ethereum/try-runtime",
|
|
|
|
|
"pallet-evm/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
"pallet-grandpa/try-runtime",
|
2025-04-02 22:52:18 +00:00
|
|
|
"pallet-identity/try-runtime",
|
2025-04-02 21:49:47 +00:00
|
|
|
"pallet-im-online/try-runtime",
|
2025-04-25 23:28:41 +00:00
|
|
|
"pallet-message-queue/try-runtime",
|
2025-09-24 10:27:44 +00:00
|
|
|
"pallet-migrations/try-runtime",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-mmr/try-runtime",
|
2025-04-02 14:22:53 +00:00
|
|
|
"pallet-multisig/try-runtime",
|
2025-04-02 21:49:47 +00:00
|
|
|
"pallet-offences/try-runtime",
|
2025-04-23 17:25:49 +00:00
|
|
|
"pallet-parameters/try-runtime",
|
2025-04-02 17:14:23 +00:00
|
|
|
"pallet-preimage/try-runtime",
|
feat: Add SafeMode and TxPause Pallets (#192)
### Overview
This PR integrates the `pallet-safe-mode` and `pallet-tx-pause` from
Polkadot SDK to provide comprehensive emergency governance controls
across all DataHaven runtime networks (mainnet, stagenet, testnet).
### Key Changes
#### 🔧 **Core Integration**
- **Dependencies**: Added `pallet-safe-mode` and `pallet-tx-pause` from
`polkadot-stable2412-6`
- **Runtime Integration**: Integrated both pallets across all three
runtime networks with pallet indices 103 and 104
- **Call Filtering**: Implemented unified `RuntimeCallFilter` that
combines Normal, SafeMode, and TxPause restrictions
#### 🛡️ **SafeMode Pallet Configuration**
- **Duration**: 1 day activation period (`DAYS` constant)
- **Deposits**: Disabled permissionless entry/extension (all `None`)
- **Origins**: Root-only for all force operations (`force_enter`,
`force_exit`, `force_extend`, etc.)
- **Whitelisting**: SafeMode and Sudo calls are immune to restrictions
#### ⏸️ **TxPause Pallet Configuration**
- **Origins**: Root-only pause/unpause control
- **Whitelisting**: SafeMode and Sudo calls cannot be paused
- **Max Call Name Length**: 256 characters
#### 🏗️ **Architecture**
- **Shared Types**: Created `operator/runtime/common/src/safe_mode.rs`
with reusable configurations
- **Combined Filtering**: `RuntimeCallFilter` applies all three filter
layers (Normal + SafeMode + TxPause)
- **Consistent Config**: Identical configuration across mainnet,
stagenet, and testnet
#### 📊 **Infrastructure Updates**
- **Benchmarking**: Added both pallets to benchmark suites across all
networks
- **Weight Mappings**: Placeholder weights using Substrate defaults
(ready for chain-specific benchmarking)
- **Metadata**: Updated runtime metadata for new pallet exposure
#### 🧪 **Testing Framework**
- **Coverage**: Tests for individual pallet behavior, combined
restrictions, whitelisting, and edge cases
### Emergency Control Capabilities
**SafeMode Pallet** (8 calls):
- User calls: `enter`, `extend`, `release_deposit`
- Force calls: `force_enter`, `force_exit`, `force_extend`,
`force_slash_deposit`, `force_release_deposit`
**TxPause Pallet** (2 calls):
- `pause_call` / `unpause_call` - Granular transaction type pausing
---------
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-10-06 17:00:10 +00:00
|
|
|
"pallet-safe-mode/try-runtime",
|
|
|
|
|
"pallet-tx-pause/try-runtime",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-referenda/try-runtime",
|
feat: ✨ Integrate Proxy pallet into DataHaven runtimes (#128)
## 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>
2025-08-18 07:46:59 +00:00
|
|
|
"pallet-proxy/try-runtime",
|
2026-01-30 11:16:28 +00:00
|
|
|
"pallet-proxy-genesis-companion/try-runtime",
|
2025-04-02 19:28:30 +00:00
|
|
|
"pallet-scheduler/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
"pallet-session/try-runtime",
|
|
|
|
|
"pallet-sudo/try-runtime",
|
|
|
|
|
"pallet-timestamp/try-runtime",
|
|
|
|
|
"pallet-transaction-payment/try-runtime",
|
2025-06-25 06:09:26 +00:00
|
|
|
"pallet-treasury/try-runtime",
|
2025-04-14 18:38:55 +00:00
|
|
|
"pallet-utility/try-runtime",
|
2025-09-02 20:46:35 +00:00
|
|
|
"pallet-whitelist/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
"polkadot-runtime-common/try-runtime",
|
|
|
|
|
"snowbridge-pallet-ethereum-client/try-runtime",
|
2025-04-18 20:28:00 +00:00
|
|
|
"snowbridge-pallet-inbound-queue-v2/try-runtime",
|
2025-04-30 17:58:45 +00:00
|
|
|
"snowbridge-pallet-system-v2/try-runtime",
|
2025-04-25 23:28:41 +00:00
|
|
|
"snowbridge-pallet-outbound-queue-v2/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
"sp-runtime/try-runtime",
|
2025-04-30 17:58:45 +00:00
|
|
|
"snowbridge-pallet-system/try-runtime",
|
2025-05-06 11:38:53 +00:00
|
|
|
"pallet-outbound-commitment-store/try-runtime",
|
2025-05-14 09:05:07 +00:00
|
|
|
"pallet-external-validators/try-runtime",
|
feat(operator): Add External Validators Rewards Pallet (#72)
This PR introduces and integrates the new
`pallet-external-validators-rewards` into the operator runtimes. This
pallet is responsible for managing and distributing rewards to external
validators. The pallet was originally introduced by Tanssi. It was
heavily modified to abstract the message building and sending with
Snowbridge.
### Key Changes Related to `pallet-external-validators-rewards`:
* **Pallet and Runtime API Addition:**
* The `pallet-external-validators-rewards` has been added to `mainnet`,
`stagenet`, and `testnet` runtimes
* **Runtime Configuration
(`operator/runtime/{mainnet,stagenet,testnet}/src/configs/mod.rs`):**
* **`RewardsRegistryAddress` Parameter:** A new dynamic runtime
parameter `RewardsRegistryAddress` (type `H160`) has been added to
`runtime_params.rs`. This will hold the Ethereum address of the Rewards
Registry contract.
* **Author Rewards with `RewardsPoints`:**
* A new struct `RewardsPoints` implements
`pallet_authorship::EventHandler`.
* Its `note_author` function rewards block authors (if they are not
whitelisted validators) by calling
`ExternalValidatorsRewards::reward_by_ids`.
* The `EventHandler` in `pallet_authorship::Config` is updated to
`(RewardsPoints, ImOnline)`.
* **Integration with `pallet-external-validators`:**
* The `OnEraStart` and `OnEraEnd` hooks in
`pallet_external_validators::Config` are now set to
`ExternalValidatorsRewards`, allowing the rewards pallet to react to era
changes.
* **`RewardsSendAdapter` for Ethereum Communication:**
* A new struct `RewardsSendAdapter` implements
`pallet_external_validators_rewards::types::SendMessage`.
* `build()`: Constructs an `OutboundMessage` to call the
`updateRewardsMerkleRoot(bytes32)` function on the
`RewardsRegistryAddress` on Ethereum. The calldata includes the selector
(hashed from `UpdateRewardsMerkleRootSignature`) and the
`rewards_merkle_root`.
* `validate()` and `deliver()`: Utilize `OutboundQueueV2` for message
validation and delivery.
* A constant `UpdateRewardsMerkleRootSignature` (
`b"updateRewardsMerkleRoot(bytes32)"`) is defined for this purpose.
* **Runtime API
(`operator/runtime/{mainnet,stagenet,testnet}/src/lib.rs`):**
* The runtime implements
`pallet_external_validators_rewards_runtime_api::ExternalValidatorsRewardsApi`.
* This exposes two functions:
* `generate_rewards_merkle_proof(account_id: AccountId, era_index:
EraIndex) -> Option<MerkleProof>`
* `verify_rewards_merkle_proof(merkle_proof: MerkleProof) -> bool`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a rewards system for external validators with era-based
tracking, Merkle proof generation, and verification.
- Added runtime APIs to generate and verify validator rewards Merkle
proofs.
- Enabled rewards distribution via outbound messaging to an external
registry contract.
- Configured runtime parameters for the rewards registry address.
- Added fixed author reward points and integrated rewards logic into
block authorship events.
- Provided a mock runtime environment and benchmarking support for the
rewards pallet.
- **Tests**
- Added comprehensive tests and benchmarks for validator rewards
distribution and Merkle proof functionality.
- **Chores**
- Integrated new pallets and runtime APIs into mainnet, stagenet, and
testnet configurations.
- Updated dependencies and feature groups to include new rewards-related
pallets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Facundo Farall <37149322+ffarall@users.noreply.github.com>
2025-05-22 00:51:24 +00:00
|
|
|
"pallet-external-validators-rewards/try-runtime",
|
2025-10-29 10:43:55 +00:00
|
|
|
"pallet-external-validator-slashes/try-runtime",
|
feat: ✨ Native Token Transfer to Ethereum (#88)
### Summary
- Implement native token transfers from DataHaven to Ethereum using
Snowbridge infrastructure
- Add comprehensive datahaven-native-transfer pallet with lock-and-mint
mechanism for cross-chain token representation
### Key Features
**New Pallet: datahaven-native-transfer**
- Cross-chain transfers: Transfer DataHaven native tokens to Ethereum
addresses via `transfer_to_ethereum extrinsic`
- Token locking mechanism: Secure token storage in deterministic
Ethereum sovereign account during transfers
- Fee management: Required fees for all transfers to compensate relayers
and prevent spam
- Emergency controls: Pause/unpause functionality
- Token registration: Integration with Snowbridge's token registration
for native token identification
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced the DataHaven Native Transfer pallet enabling secure
cross-chain transfers of DataHaven native tokens to and from Ethereum
via Snowbridge.
- Added token locking on DataHaven, minting on Ethereum, and mandatory
fee collection to cover gas costs and incentivize relayers.
- Implemented pause and unpause controls for emergency management of
token transfers.
- **Configuration**
- Integrated the new pallet into mainnet, stagenet, and testnet runtimes
with updated network, account, and treasury settings.
- Added Ethereum sovereign account constants and native token ID support
for optimized cross-chain operations.
- **Documentation**
- Added comprehensive README and inline documentation detailing pallet
features, extrinsics, events, errors, and security considerations.
- **Tests**
- Added extensive unit and integration tests covering token transfers,
native token registration, fee handling, pause functionality, and event
validation across all supported networks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-06-11 22:07:36 +00:00
|
|
|
"pallet-datahaven-native-transfer/try-runtime",
|
2025-03-17 16:57:14 +00:00
|
|
|
]
|
|
|
|
|
|
2025-05-08 23:32:55 +00:00
|
|
|
fast-runtime = ["datahaven-runtime-common/fast-runtime"]
|
2025-03-17 16:57:14 +00:00
|
|
|
|
|
|
|
|
# Enable the metadata hash generation.
|
|
|
|
|
#
|
|
|
|
|
# This is hidden behind a feature because it increases the compile time.
|
|
|
|
|
# The wasm binary needs to be compiled twice, once to fetch the metadata,
|
|
|
|
|
# generate the metadata hash and then a second time with the
|
|
|
|
|
# `RUNTIME_METADATA_HASH` environment variable set for the `CheckMetadataHash`
|
|
|
|
|
# extension.
|
|
|
|
|
metadata-hash = ["substrate-wasm-builder/metadata-hash"]
|
|
|
|
|
|
|
|
|
|
# A convenience feature for enabling things when doing a build
|
|
|
|
|
# for an on-chain release.
|
|
|
|
|
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
|