Rule reminder
Gerundio composto = same subject, less formal. Participio assoluto = different subjects OR same subject (very formal/literary). Both are correct when the subject is the same.
She hadn't slept. She was exhausted. (cause expressed before consequence) → Best formal construction: