mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Summary This PR removes the old merkle root-based rewards model and completes the migration to EigenLayer Rewards V2 distribution. The old model required operators to claim rewards by providing merkle proofs, while the new model uses `submitRewards` to send rewards directly to EigenLayer's `RewardsCoordinator`. ### Key Changes - **Smart Contracts**: Removed `RewardsRegistry`, `RewardsRegistryStorage`, `IRewardsRegistry`, and `SortedMerkleProof` contracts along with all merkle claim functions from `ServiceManagerBase` - **Substrate Pallets**: Removed merkle proof generation from `external-validators-rewards` pallet and deleted the entire `runtime-api` crate (no longer needed) - **Test Framework**: Removed all RewardsRegistry-related code from deployment scripts, CLI handlers, and TypeScript bindings - **Runtimes**: Cleaned up all three runtimes (testnet, stagenet, mainnet) to remove runtime API implementations and unused imports ### Files Removed **Contracts:** - `contracts/src/middleware/RewardsRegistry.sol` - `contracts/src/middleware/RewardsRegistryStorage.sol` - `contracts/src/interfaces/IRewardsRegistry.sol` - `contracts/src/libraries/SortedMerkleProof.sol` - `contracts/test/RewardsRegistry.t.sol` - `contracts/test/ServiceManagerRewardsRegistry.t.sol` **Substrate:** - `operator/pallets/external-validators-rewards/runtime-api/` (entire crate) **Test Framework:** - `test/suites/rewards-message.test.ts` ### Files Modified **Contracts:** - `ServiceManagerBase.sol` - Removed merkle claim functions - `ServiceManagerBaseStorage.sol` - Removed `operatorSetToRewardsRegistry` mapping - `IServiceManager.sol` - Removed interface members **Substrate:** - `external-validators-rewards` pallet - Removed merkle proof generation, simplified `EraRewardsUtils` struct - All runtime configs - Removed `ExternalValidatorsRewardsApi` implementations **Test Framework:** - Updated deployment scripts, CLI handlers, relayer configs, and TypeScript bindings ### Stats ``` 50 files changed, 966 insertions(+), 4453 deletions(-) ``` ## Test plan - [x] All Rust tests pass (`cargo test`) - [x] All contract tests pass (`forge test`) - [x] TypeScript type checking passes (`bun typecheck`) - [x] Contracts build successfully (`forge build`) - [x] Operator builds successfully (`cargo build --release --features fast-runtime`) - [ ] E2E tests pass (`bun test:e2e`)
84 lines
2.2 KiB
TOML
84 lines
2.2 KiB
TOML
[package]
|
|
name = "pallet-external-validators-rewards"
|
|
authors = { workspace = true }
|
|
description = "Simple pallet to store external validators rewards."
|
|
edition = "2021"
|
|
license = "GPL-3.0-only"
|
|
version = { workspace = true }
|
|
|
|
[package.metadata.docs.rs]
|
|
targets = [ "x86_64-unknown-linux-gnu" ]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
log = { workspace = true }
|
|
parity-scale-codec = { workspace = true }
|
|
scale-info = { workspace = true, features = [ "derive" ] }
|
|
|
|
frame-support = { workspace = true }
|
|
frame-system = { workspace = true }
|
|
sp-core = { workspace = true }
|
|
sp-runtime = { workspace = true }
|
|
sp-staking = { workspace = true }
|
|
sp-std = { workspace = true }
|
|
|
|
frame-benchmarking = { workspace = true }
|
|
|
|
pallet-authorship = { workspace = true }
|
|
pallet-balances = { workspace = true, optional = true }
|
|
pallet-external-validators = { workspace = true }
|
|
pallet-session = { workspace = true, features = [ "historical" ] }
|
|
|
|
snowbridge-core = { workspace = true }
|
|
snowbridge-outbound-queue-primitives = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
pallet-timestamp = { workspace = true }
|
|
sp-io = { workspace = true }
|
|
|
|
[features]
|
|
default = [ "std" ]
|
|
std = [
|
|
"frame-benchmarking/std",
|
|
"frame-support/std",
|
|
"frame-system/std",
|
|
"log/std",
|
|
"pallet-authorship/std",
|
|
"pallet-balances/std",
|
|
"pallet-external-validators/std",
|
|
"pallet-session/std",
|
|
"pallet-timestamp/std",
|
|
"parity-scale-codec/std",
|
|
"scale-info/std",
|
|
"snowbridge-core/std",
|
|
"snowbridge-outbound-queue-primitives/std",
|
|
"sp-core/std",
|
|
"sp-io/std",
|
|
"sp-runtime/std",
|
|
"sp-staking/std",
|
|
"sp-std/std",
|
|
]
|
|
runtime-benchmarks = [
|
|
"frame-benchmarking/runtime-benchmarks",
|
|
"frame-support/runtime-benchmarks",
|
|
"frame-system/runtime-benchmarks",
|
|
"pallet-balances/runtime-benchmarks",
|
|
"pallet-external-validators/runtime-benchmarks",
|
|
"pallet-timestamp/runtime-benchmarks",
|
|
"snowbridge-core/runtime-benchmarks",
|
|
"sp-runtime/runtime-benchmarks",
|
|
"sp-staking/runtime-benchmarks",
|
|
]
|
|
|
|
try-runtime = [
|
|
"frame-support/try-runtime",
|
|
"frame-system/try-runtime",
|
|
"pallet-authorship/try-runtime",
|
|
"pallet-balances?/try-runtime",
|
|
"pallet-external-validators/try-runtime",
|
|
"pallet-session/try-runtime",
|
|
"pallet-timestamp/try-runtime",
|
|
"sp-runtime/try-runtime",
|
|
]
|