What’s key here is whether the leg length discrepancy (lld) is structural (eg bone is actually longer) or an acquired compensation (possible through injury or trauma). Did your doctor discuss this? How was the lld assessed?
Edit: Have you had any falls, injurys, knocks, accidents in the last few months?