Skip to content
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

Batch publish #313

Merged
merged 10 commits into from
Aug 30, 2024
Merged

Batch publish #313

merged 10 commits into from
Aug 30, 2024

Conversation

Riateche
Copy link
Contributor

@Riateche Riateche commented Jul 31, 2024

  • Read published prices from publishers' accounts and apply them to price feed accounts
  • Add minimal CI

@Riateche Riateche changed the base branch from pyth to pyth-v1.14.17 July 31, 2024 09:34
@Riateche Riateche force-pushed the batch-publish branch 9 times, most recently from a1fd3c8 to 6982f90 Compare July 31, 2024 11:32
Copy link
Collaborator

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

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

It looks very good to me. I like to see how the program will work.

.github/workflows/pyth.yml Show resolved Hide resolved
.github/workflows/pyth.yml Outdated Show resolved Hide resolved
runtime/src/bank/pyth_batch_publish.rs Outdated Show resolved Hide resolved
@Riateche Riateche changed the title WIP: Batch publish Batch publish Aug 28, 2024
runtime/src/bank/pyth/tests/mod.rs Show resolved Hide resolved
@@ -132,6 +146,7 @@ pub fn get_accumulator_keys() -> Vec<(
"STAKE_CAPS_PARAMETERS_ADDR",
Ok(*STAKE_CAPS_PARAMETERS_ADDR),
),
("BATCH_PUBLISH_PID", Ok(*BATCH_PUBLISH_PID)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

i recommend we rename this function and move it to mod.rs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -427,21 +442,34 @@ pub fn update_v2(bank: &Bank) -> std::result::Result<(), AccumulatorUpdateErrorV
v2_messages.push(publisher_stake_caps_message);
}

let mut measure = Measure::start("update_v2_aggregate_price");
let mut new_prices = batch_publish::extract_batch_publish_prices(bank).unwrap_or_else(|err| {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's have a measure for this too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

};

#[test]
fn test_batch_publish() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if feed index of 0 is permitted we can add tests with that and make sure that it doesn't work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Expanded the test to make sure prices with feed_index == 0 are not applied.

@Riateche Riateche merged commit 2a7cebd into pyth-v1.14.17 Aug 30, 2024
3 checks passed
@Riateche Riateche deleted the batch-publish branch August 30, 2024 09:15
ilya-bobyr pushed a commit to ilya-bobyr/pythnet that referenced this pull request Dec 19, 2024
---

Batch publish (pyth-network#313)

* feat: batch publish

* feat: batch publish 2 (wip)

* feat: verify that price feed index is set

* refactor: add pyth module

* feat: integrate pyth-price-publisher

* refactor: rename and move get_accumulator_keys

* test: make sure batch publish does not apply prices when price_index == 0

* chore: fix format

* fix: update deps

---

Update dependency, program id and test for pyth-price-store (pyth-network#314)

* test: modify batch publish tests

* chore: use real batch publish pid as default

* chore: update pyth-price-store dependency

---

Rename price store env var and bump version (pyth-network#315)

* chore: rename variable for pyth store pid

* chore: bump pythnet version to 1.14.179
ilya-bobyr pushed a commit to ilya-bobyr/pythnet that referenced this pull request Dec 20, 2024
---

Batch publish (pyth-network#313)

* feat: batch publish

* feat: batch publish 2 (wip)

* feat: verify that price feed index is set

* refactor: add pyth module

* feat: integrate pyth-price-publisher

* refactor: rename and move get_accumulator_keys

* test: make sure batch publish does not apply prices when price_index == 0

* chore: fix format

* fix: update deps

---

Update dependency, program id and test for pyth-price-store (pyth-network#314)

* test: modify batch publish tests

* chore: use real batch publish pid as default

* chore: update pyth-price-store dependency

---

Rename price store env var and bump version (pyth-network#315)

* chore: rename variable for pyth store pid

* chore: bump pythnet version to 1.14.179
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