Description
In contracts/src/validator-manager/ValidatorRegistry.sol, _nextRegistrationId is never initialized and defaults to 0. The first registerValidator call therefore returns registrationId = 0.
However, Controller.sol explicitly rejects ID=0:
require(registrationId != 0, RegistrationIdIsZero());
This means the first registered validator can never be assigned a controller, and therefore can never be activated, removed, or have its voting power updated.
The storage comment says "starting from 1" but the code never sets the initial value to 1.
The existing test suite works around this silently by force-writing _nextRegistrationId = 1 via vm.store in TestUtils.sol, confirming the team is aware the default of 0 is incorrect.
Expected behaviour
_nextRegistrationId should be initialized to 1 so the first validator receives ID=1.
Suggested fix
Initialize _nextRegistrationId = 1 in the genesis setup or in the storage initializer.
Description
In
contracts/src/validator-manager/ValidatorRegistry.sol,_nextRegistrationIdis never initialized and defaults to0. The firstregisterValidatorcall therefore returnsregistrationId = 0.However,
Controller.solexplicitly rejects ID=0: