Add `FrozenEvent.get_state_key` and use it in a couple of places.