datahaven/operator/precompiles
Steve Degosserie 76c21d32d2
fix: 🐛 Align ProxyType enum in Proxy precompile with runtime (#413)
## Summary

- Fixed `ProxyType` enum in the Solidity Proxy precompile interface to
match the runtime definition
- Removed non-existent `AuthorMapping` variant
- Added missing `SudoOnly` variant

## Problem

The Solidity interface in `Proxy.sol` had incorrect `ProxyType` enum
values that didn't match the runtime definition:

| Index | Runtime (Correct) | Solidity (Was) |
|-------|------------------|----------------|
| 0 | Any | Any |
| 1 | NonTransfer | NonTransfer |
| 2 | Governance | Governance |
| 3 | Staking | Staking |
| 4 | CancelProxy | CancelProxy |
| 5 | Balances | Balances |
| 6 | **IdentityJudgement** | **AuthorMapping**  |
| 7 | **SudoOnly** | **IdentityJudgement**  |

This mismatch would cause EVM users calling the Proxy precompile with
`IdentityJudgement` (index 7 in Solidity) to actually get `SudoOnly`
behavior, and `AuthorMapping` (index 6) would fail to decode entirely
since it doesn't exist in the runtime.

## Solution

Updated the Solidity enum to match the runtime:
```solidity
enum ProxyType {
    Any,
    NonTransfer,
    Governance,
    Staking,
    CancelProxy,
    Balances,
    IdentityJudgement,
    SudoOnly
}
```

## ⚠️ Breaking Changes ⚠️

- **`ProxyType.AuthorMapping` removed**: This variant never existed in
the runtime and would fail to decode.
- **`ProxyType.IdentityJudgement` index changed**: Moved from index 7 to
index 6. Solidity code using `ProxyType.IdentityJudgement` will now work
correctly (previously it mapped to `SudoOnly` in the runtime)
- **`ProxyType.SudoOnly` added**: New variant at index 7 for proxies
that can only execute Sudo pallet calls

## Test plan

- [x] Proxy precompile tests pass (32/32)
- [x] Mainnet runtime proxy tests pass (22/22)
- [x] Governance proxy tests pass (6/6)
- [x] Verified `InstanceFilter<RuntimeCall>` implementation handles all
8 variants correctly
- [x] Verified `EvmProxyCallFilter` implementation handles all 8
variants correctly

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:33:58 +01:00
..
batch feat: set POV gas limit ratio to zero for solo chain (#313) 2025-11-27 11:14:41 +01:00
call-permit fix: change pallet_evm alias to EVM to fix eth_getCode (#213) 2025-10-10 17:48:52 +00:00
collective feat: set POV gas limit ratio to zero for solo chain (#313) 2025-11-27 11:14:41 +01:00
conviction-voting feat: set POV gas limit ratio to zero for solo chain (#313) 2025-11-27 11:14:41 +01:00
datahaven-native-transfer feat: Add datahaven native transfer precompile (#309) 2025-12-02 13:57:40 +01:00
erc20-balances fix: 🔧 account for storage reads on withdrawal (#407) 2026-01-21 16:25:57 -03:00
identity feat: set POV gas limit ratio to zero for solo chain (#313) 2025-11-27 11:14:41 +01:00
precompile-registry feat: Add CI license check (#269) 2025-11-02 23:32:59 +02:00
preimage feat: set POV gas limit ratio to zero for solo chain (#313) 2025-11-27 11:14:41 +01:00
proxy fix: 🐛 Align ProxyType enum in Proxy precompile with runtime (#413) 2026-01-26 21:33:58 +01:00
referenda feat: set POV gas limit ratio to zero for solo chain (#313) 2025-11-27 11:14:41 +01:00