-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add feed index for batch publish #416
Conversation
6ff3f80
to
7e3636c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I'll approve once we have some tests for it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think MIN_SIZE_WITH_LAST_FEED_INDEX
, INITIAL_SIZE
and NEW_ACCOUNT_SPACE
are all the same, can't we use INITIAL_SIZE
everywhere?
Originally, I tried to alter I've removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
* batch publish wip * refactor: separate header checks and account data casts * feat: feed index (wip) * feat: assign price feed indexes to old accounts * feat: init feed index when creating prices and init permission account * refactor: remove transfer to save contract size * test: add test for price feed indexes * refactor: address feedback * chore: fix some outdated account list docs
Cherry picked this change from the main branch: ``` commit 256b575 Author: Pavel Strakhov <[email protected]> Date: Thu Aug 29 10:52:42 2024 +0100 Add feed index for batch publish (pyth-network#416) * batch publish wip * refactor: separate header checks and account data casts * feat: feed index (wip) * feat: assign price feed indexes to old accounts * feat: init feed index when creating prices and init permission account * refactor: remove transfer to save contract size * test: add test for price feed indexes * refactor: address feedback * chore: fix some outdated account list docs ```
reserve_new_price_feed_index
gets called frominit_price_feed_index
(to assign an index to an existing price) and fromadd_price
(to assign an index to a new price).The transition process would be to top up the permission account so that it's rent exempt with the new size, then to call
init_price_feed_index
for every existing price feed.