vocdoni / census3

Golang library and a HTTP/API service that can be used to fetch an updated list of token holders for a Ethereum ERC20, ERC721, ERC777, or other external providers (ex. POAPs or GitcoinPassport).
GNU Affero General Public License v3.0
9 stars 2 forks source link

Bug: web3 scanner issues #181

Closed lucasmenendez closed 8 months ago

lucasmenendez commented 8 months ago
github-actions[bot] commented 8 months ago

Image description CodeRabbit

Walkthrough

This update introduces enhanced error handling and retry mechanisms for RPC calls, along with improved logging for better debugging. It also refactors address handling in the ERC20 provider for consistency and adds logic to reset the creation block based on reference values.

Changes

File(s) Summary
scanner/providers/web3/const.go, scanner/providers/web3/web3_provider.go Introduced a new constant RetryWeb3Cooldown set to 500 milliseconds. Enhanced RPC error handling, added retry mechanisms for RPC calls, and improved error logging for better debugging.
scanner/providers/web3/erc20_provider.go Refactored the code to consistently use p.address for address handling. Added logic to reset p.creationBlock based on the reference's value.

🐰💻

In the land of code where the shadows lie, A rabbit hopped forth, his gaze held high. With each line changed, he danced and spun, Celebrating the battles fought and won.

Errors tamed, retries in place, Logging improved, no trace of haste. Address handled with consistent grace, Creation block reset, no memory space.

So here's to the code, ever so bright, To the rabbit coder, working through the night! 🌙🎉


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.