coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

idl: Fix idl write overwrites from retries #2964

Closed andreihrs closed 1 month ago

andreihrs commented 1 month ago

Retries caused unnecessary idl writes, even if the tx was succesful. This ended up corrupting the idl, ending up with a wrong IDL/corrupt deflated stream when trying to fetch it.

I moved the blockhash retrieval outside the retry loop, to resend the same tx in case there is a retry, up to the point the blockhash expires. From that point, we refetch the blockhash and resend the tx with a different blockhash

vercel[bot] commented 1 month ago

@andreihrs is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

andreihrs commented 1 month ago

I tracked the number of writes that were displayed to happen and it fit how many steps I was expecting the idl buffer write to take.

however, once I did this change, the idl write worked afterwards