pyth-network / pyth-crosschain

Crosschain Pyth programs and utilities
https://pyth.network
Other
144 stars 195 forks source link

refactor(apps/price_pusher): Use viem instead of web3 for evm pusher #1829

Closed ali-bahjati closed 2 months ago

ali-bahjati commented 2 months ago

Web3 library is not very widely used anymore due to its complex and magical internal design. Some users were reporting issues like strange timeouts or unsupported RPC calls via web3 (and the deprecated HDWalletProvider by truffle that we use). This change refactors the code to use Viem. The experience with Viem is nice: it has strong types and good utilities. The error handling is also very well designed. The downside is that it has a steep learning curve to get it right.

This change refactors the code based on the PR reviews to make it simpler as well.

Lastly the version is bumped as a major release because the behaviour and logs have changed and it might affect production environments. It also signals the users to test it out properly before using it which is good because all the failure cases might not be handled.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 11:18am
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **xc-admin-frontend** | ⬜️ Ignored ([Inspect](https://vercel.com/pyth-web/xc-admin-frontend/Dyjhwzyfg17W3ckbYoFvjDfQDJwv)) | [Visit Preview](https://xc-admin-frontend-git-price-pusher-use-viem-for-evm-pyth-web.vercel.app) | | Aug 21, 2024 11:18am |