Skip to content

refactor(target_chains/ethereum): remove batch update support #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 28, 2024

Conversation

Riateche
Copy link
Contributor

@Riateche Riateche commented Mar 27, 2024

  • Removed support for old batch update format from updatePriceFeeds, parsePriceFeedUpdates, getUpdateFee contract functions.
  • Updated and cleaned up tests accordingly.

Batch renames are made in separate commits for easier review.

PythUpgradable contract size reduced from 22.061 kB to 20.568 kB, according to forge build --sizes.

Gas report

No significant changes, according to forge test --gas-report --match-contract GasBenchmark.

Reports

Old:

contracts/pyth/PythUpgradable.sol:PythUpgradable contract
Deployment Cost Deployment Size
4848557 22459
Function Name min avg median max # calls
getEmaPrice 4025 4025 4025 4025 1
getPrice 3169 3169 3169 3169 1
getUpdateFee 2455 3370 3553 3553 426
initialize 245301 245301 245301 245301 35
parsePriceFeedUpdates 118792 151982 143161 207422 10
parsePriceFeedUpdatesUnique 121266 122119 122119 122973 2
updatePriceFeeds 103293 279601 328963 328963 47
updatePriceFeedsIfNecessary 7478 87091 87091 166705 2

New:

contracts/pyth/PythUpgradable.sol:PythUpgradable contract
Deployment Cost Deployment Size
4526025 20966
Function Name min avg median max # calls
getEmaPrice 4025 4025 4025 4025 1
getPrice 3169 3169 3169 3169 1
getUpdateFee 3553 3553 3553 3553 315
initialize 245301 245301 245301 245301 31
parsePriceFeedUpdates 121062 173233 188705 207350 10
parsePriceFeedUpdatesUnique 121242 122095 122095 122949 2
updatePriceFeeds 102690 300067 353387 353387 41
updatePriceFeedsIfNecessary 7478 99299 99299 191120 2

Copy link

vercel bot commented Mar 27, 2024

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 2:42pm
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 2:42pm

@Riateche Riateche force-pushed the remove-batch-update branch from 0616d9d to 047952f Compare March 27, 2024 17:25
Copy link
Collaborator

@ali-behjati ali-behjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very nice. I left some inline comments to see whether we can remove even more code! I'll approve after getting your opinions about them.

@Riateche Riateche force-pushed the remove-batch-update branch from b7ea030 to 88971cd Compare March 28, 2024 14:29
@Riateche Riateche force-pushed the remove-batch-update branch from 88971cd to 46493d6 Compare March 28, 2024 14:35
Copy link
Collaborator

@ali-behjati ali-behjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Feel free to merge it when you've removed some of the duplicate tests.

@Riateche Riateche merged commit cd543bc into main Mar 28, 2024
@Riateche Riateche deleted the remove-batch-update branch March 28, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants