On principled local optimization methods for federated learning