Just realised that local id for a state is sort of worthless if a sender is provided. Now states can be filed in the state dictionary by their global id or their sender.