datahaven/test/scripts
Ahmad Kaouk 9be1acc97e
refactor: cleanup old rewards model (#383)
## 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`)
2026-01-09 15:25:49 +01:00
..
cargo-crossbuild.ts test: 🏗️ Setup e2e testing framework (#104) 2025-07-16 18:51:07 +02:00
check-generated-state.ts test : improve contract injection (#326) 2026-01-06 11:27:50 +00:00
compile-contracts.sh test: port Moonwall block validation suite (#201) 2025-10-06 09:47:35 +02:00
compile-contracts.ts test: port Moonwall block validation suite (#201) 2025-10-06 09:47:35 +02:00
contracts-checksum.ts test : improve contract injection (#326) 2026-01-06 11:27:50 +00:00
deploy-contracts.ts refactor: cleanup old rewards model (#383) 2026-01-09 15:25:49 +01:00
fund-providers.ts feat: 🚀 add storage-hub nodes to CLI (#287) 2025-11-22 11:49:14 +01:00
fund-validators.ts fix: build contracts with test/mocks (#317) 2025-11-24 17:36:29 +01:00
generate-contracts.ts test : improve contract injection (#326) 2026-01-06 11:27:50 +00:00
register-providers.ts feat: 🚀 add storage-hub nodes to CLI (#287) 2025-11-22 11:49:14 +01:00
send-txn.ts test: refactor e2e tests (#365) 2025-12-24 13:31:40 +01:00
set-datahaven-parameters.ts test: refactor e2e tests (#365) 2025-12-24 13:31:40 +01:00
setup-validators.ts test: refactor e2e tests (#365) 2025-12-24 13:31:40 +01:00
test-parallel.ts test: port ethereum tests from moonbeam (#278) 2025-11-22 10:02:05 +01:00
update-validator-set.ts test: 🏗️ Setup e2e testing framework (#104) 2025-07-16 18:51:07 +02:00