Skip to content

Commit cf0159c

Browse files
authored
fix: use solana-client pubsub lib instead of solana-shadow (#97)
Solana-shadow is not maintained anymore and doesn't work properly. It drops many updates and after a certain amount of latency drops all messages. We have been using Solana PubSub client in Hermes without any problem and there is no reason to stick with solana-shadow.
1 parent 5e0f357 commit cf0159c

File tree

5 files changed

+97
-289
lines changed

5 files changed

+97
-289
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-agent"
3-
version = "2.4.0"
3+
version = "2.4.1"
44
edition = "2021"
55

66
[[bin]]
@@ -23,22 +23,21 @@ futures-util = { version = "0.3", default-features = false, features = [
2323
] }
2424
jrpc = "0.4.1"
2525
serde_json = "1.0.79"
26-
tracing = "0.1.31"
2726
chrono = "0.4.31"
2827
chrono-tz = "0.8.4"
2928
parking_lot = "0.12.1"
3029
pyth-sdk = "0.7.0"
31-
pyth-sdk-solana = "0.7.1"
32-
solana-client = "1.13.6"
33-
solana-sdk = "1.13.6"
30+
pyth-sdk-solana = "0.7.2"
31+
solana-account-decoder = "1.14.16"
32+
solana-client = "1.14.16"
33+
solana-sdk = "1.14.16"
3434
bincode = "1.3.3"
3535
slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_trace"] }
3636
slog-term = "2.9.0"
3737
rand = "0.8.5"
3838
slog-async = "2.7.0"
3939
config = "0.13.3"
4040
thiserror = "1.0.32"
41-
solana-shadow = "0.2.4"
4241
clap = { version = "4.0.32", features = ["derive"] }
4342
humantime-serde = "1.1.1"
4443
slog-envlogger = "2.2.0"

config/config.sample.pythnet.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ key_store.program_key = "FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH"
4848
# Oracle mapping pubkey
4949
key_store.mapping_key = "AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J"
5050

51-
# Duration of the interval at which to publish updates. Default interval is 1 seconds.
52-
# exporter.publish_interval_duration = "1s"
53-
54-
# Price per compute unit offered for update_price transactions.
55-
# This is needed for solana to be able to land transactions on the network
56-
# during periods of high network congestion.
57-
exporter.compute_unit_price_micro_lamports = 40000
58-
5951
# Compute unit limit requested per instruction for transactions that update the price.
6052
# This should be an upper bound of the compute units a single upd_price instruction might consume.
6153
# For solana mainnet, this should be set to 20000 instead of the default 40000 since there is no accumulator.
@@ -65,10 +57,10 @@ exporter.compute_unit_limit = 20000
6557
# This is needed for solana to be able to land transactions on the network
6658
# during periods of high network congestion.
6759
exporter.dynamic_compute_unit_pricing_enabled = true
68-
exporter.maximum_slot_gap_for_dynamic_compute_unit_price = 50
69-
exporter.maximum_total_compute_fee_micro_lamports = 10000000000
7060

71-
# The interval with which to poll account information.
61+
# The interval with which to poll account information. We are adding it as an extra
62+
# layer of protection to ensure we get the latest account information if there are
63+
# any issues with the ws subscription.
7264
oracle.poll_interval_duration = "5s"
7365

7466
# Configuration for the JRPC API

0 commit comments

Comments
 (0)