Skip to content

Commit f5af412

Browse files
authored
fix(price-pusher): randomize price feed ids (#1761)
* fix: randomize price feed ids * Actual good sorting * add space
1 parent 27656f9 commit f5af412

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

apps/price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "7.0.1",
3+
"version": "7.0.2",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

apps/price_pusher/src/solana/solana.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,17 @@ export class SolanaPricePusher implements IPricePusher {
9393
return;
9494
}
9595

96+
const shuffledPriceIds = priceIds
97+
.map((x) => {
98+
return { element: x, key: Math.random() };
99+
})
100+
.sort((a, b) => a.key - b.key)
101+
.map((x) => x.element);
102+
96103
let priceFeedUpdateData;
97104
try {
98105
priceFeedUpdateData = await this.priceServiceConnection.getLatestVaas(
99-
priceIds
106+
shuffledPriceIds
100107
);
101108
} catch (err: any) {
102109
this.logger.error(err, "getPriceFeedsUpdateData failed:");

0 commit comments

Comments
 (0)