Skip to content

Commit c96ab56

Browse files
RiatecheReisen
authored andcommitted
Aggregation v2 (pyth-network#296)
* feat: accumulator v2 (wip 1) * feat: accumulator v2 (wip 2) * chore: fix some warnings and fix validator build * feat: accumulator v2 (wip 3) * feat: skip message buffer aggregation if all price feeds use v2 aggregation * feat: combine v1 and v2 aggregation price feed messages in the merkle tree * refactor: clean up and avoid extra vector * fix: don't aggregate if already aggregated in the program * test: bring back old pyth tests (wip) * test: fix old pyth tests * test: add initial v2 tests to validator * refactor: unify env var handling * chore: fix build for stable Rust by ignoring lints * test: fix and expand accumulator-v2 tests * chore: clean up comments * chore: update dependency * chore: fix clippy and fmt * test: add extra check * chore: bump version to 1.14.175 * feat: add more traces for accumulator * fix: load program accounts by index * feat: add checks to make sure indexes are set * chore: bump oracle Co-authored-by: Reisen <reisen@morphism.org>
1 parent 13a525f commit c96ab56

File tree

14 files changed

+1722
-709
lines changed

14 files changed

+1722
-709
lines changed

Cargo.lock

Lines changed: 142 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,3 @@ exclude = [
9494

9595
# This prevents a Travis CI error when building for Windows.
9696
resolver = "2"
97-
98-
[patch.crates-io]
99-
serde_wormhole = { git = "https://github.com/wormhole-foundation/wormhole", tag = "v2.17.1" }

core/src/validator.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ use {
7474
accounts_db::{AccountShrinkThreshold, AccountsDbConfig},
7575
accounts_index::AccountSecondaryIndexes,
7676
accounts_update_notifier_interface::AccountsUpdateNotifier,
77-
bank::Bank,
77+
bank::{pyth_accumulator, Bank},
7878
bank_forks::BankForks,
7979
commitment::BlockCommitmentCache,
8080
cost_model::CostModel,
@@ -1521,15 +1521,12 @@ fn load_blockstore(
15211521
}
15221522
}
15231523

1524-
{
1525-
let bank = bank_forks.write().unwrap().working_bank();
1526-
for (key_name, pk_res) in bank.get_accumulator_keys() {
1527-
match pk_res {
1528-
Ok(pk) => info!("Accumulator {}: {}", key_name, pk),
1529-
Err(err) => {
1530-
error!("Failed to get Accumulator {}: {:?}", key_name, err);
1531-
std::process::abort();
1532-
}
1524+
for (key_name, pk_res) in pyth_accumulator::get_accumulator_keys() {
1525+
match pk_res {
1526+
Ok(pk) => info!("Accumulator {}: {}", key_name, pk),
1527+
Err(err) => {
1528+
error!("Failed to get Accumulator {}: {:?}", key_name, err);
1529+
std::process::abort();
15331530
}
15341531
}
15351532
}

0 commit comments

Comments
 (0)