Description
We introduced an enum of OperationStates for custom errors in #4261. However, it feels weird that such enum is only used for custom errors.
We should use the same enum for retrieving the state. We might also want to replace the state getters with this new state(bytes32 id) getter.