ethereum / sourcify

Decentralized Solidity contract source code verification service
https://sourcify.dev
MIT License
769 stars 378 forks source link

Implement retry mechanism for fetching of contract creation tx #1480

Open manuelwedler opened 1 month ago

manuelwedler commented 1 month ago

From time to time, we have failing tests for fetching the contract creation transaction from etherscan. The Etherscan API is just some times inaccessible. Here is an example for a failing CI: https://app.circleci.com/pipelines/github/ethereum/sourcify/6426/workflows/1bee0997-2d25-4bd9-98fa-13f64ca43d35/jobs/38746

I propose to implement a retry mechanism for fetching the creation transaction. In case an API is simply unavailable for a short time, retrials can make the verification more stable. Retrials with exponential backoff are usually a good idea to not run into rate limiting again and again (here is an example for this technique).