Skip to content

Commit eb5e04b

Browse files
authored
v2.0.0 nitpicks (#78)
* Add max_batch_size to pythnet sample config, clean up config.toml * oracle: clarify permissions update logging * Cargo.toml: bump to v2.0.1
1 parent aeaaaf5 commit eb5e04b

File tree

5 files changed

+89
-76
lines changed

5 files changed

+89
-76
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-agent"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
edition = "2021"
55

66
[[bin]]

config/config.sample.pythnet.toml

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ key_store.mapping_key = "AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J"
2323
# Pythnet accumulator key
2424
key_store.accumulator_key = "7Vbmv1jt4vyuqBZcpYPpnVhrqVe5e6ZPb6JxDcffRHUM"
2525

26+
# IMPORTANT: Exporter batch size must be decreased to 7 to support
27+
# larger accumulator transactions, when accumulator_key is set.
28+
exporter.max_batch_size = 7
29+
2630
# Duration of the interval at which to publish updates
2731
exporter.publish_interval_duration = "400ms"
2832

config/config.toml

+81-72
Original file line numberDiff line numberDiff line change
@@ -23,83 +23,23 @@ wss_url = "wss://api.pythtest.pyth.network"
2323
# non-existent file path, the system expects a keypair to be loaded
2424
# via the remote keypair loader. If the path is valid, the remote
2525
# keypair loading is disabled.
26-
key_store.publish_keypair = "/path/to/keypair.json"
26+
key_store.publish_keypair_path = "/path/to/keypair.json"
2727

2828
# Public key of the oracle program
2929
key_store.program_key = "RelevantOracleProgramAddress"
3030

3131
# Public key of the root mapping account
3232
key_store.mapping_key = "RelevantOracleMappingAddress"
3333

34-
# Optional public key of the accumulator program (if provided)
35-
key_store.accumulator_key = "RelevantOracleAccumulatorAddress"
34+
### Optional fields of primary/secondary network config ###
3635

37-
### Optional fields ###
38-
39-
# [metrics_server]
40-
#
41-
# Where to serve the quick-access dashboard and metrics. Metrics live under "/metrics"
42-
# NOTE: non-loopback addresses must be used carefully, making sure the
43-
# connection is not exposed for unauthorized access.
44-
# bind_address = "127.0.0.1:8888"
45-
46-
# [remote_keypair_loader}
47-
# Where to serve the remote keypair loading endpoint, under "/primary/load_keypair" and "/secondary/load_keypair"
48-
# NOTE: non-loopback addresses must be used carefully, making sure the
49-
# connection is not exposed for unauthorized access.
50-
# bind_address = "127.0.0.1:9001"
51-
52-
# How much whole SOL must a keypair hold to be considered valid for use on a given network. Disabled with 0
53-
# primary_min_keypair_balance_sol = 1
54-
# secondary_min_keypair_balance_sol = 1
55-
56-
57-
# Channel capacities. These refer to async messaging channels
58-
# internally used by the agent's subroutines
59-
60-
# Capacity of the channel used to broadcast shutdown events to all
61-
# components
62-
# channel_capacities.shutdown = 10000
63-
64-
# Capacity of the channel used to send updates from the primary Oracle
65-
# to the Global Store
66-
# channel_capacities.primary_oracle_updates = 10000
67-
68-
# Capacity of the channel used to send updates from the secondary
69-
# Oracle to the Global Store
70-
# channel_capacities.secondary_oracle_updates = 10000
71-
72-
# Capacity of the channel the Pythd API Adapter uses to send lookup
73-
# requests to the Global Store
74-
# channel_capacities.global_store_lookup = 10000
75-
76-
# Capacity of the channel the Pythd API Adapter uses to communicate
77-
# with the Local Store
78-
# channel_capacities.local_store_lookup = 10000
79-
80-
# Capacity of the channel on which the Local Store receives messages
81-
# channel_capacities.local_store = 10000
82-
83-
# Capacity of the channel on which the Pythd API Adapter receives
84-
# messages
85-
# channel_capacities.pythd_adapter = 10000
86-
87-
# Capacity of the slog logging channel. Adjust this value if you see
88-
# complaints about channel capacity from slog
89-
# channel_capacities.logger_buffer = 10000
90-
91-
92-
# Relative path to publisher identity keypair
93-
# w.r.t. `key_store.root_path`. When the specified file is not found
94-
# on startup, the relevant primary/secondary network will expect a
95-
# remote-loaded keypair. See remote_keypair_loader options for
96-
# details.
97-
# key_store.publish_keypair_path = "publish_key_pair.json" # I exist, remote loading disabled
98-
# key_store.publish_keypair_path = "none" # I do not exist, remote loading activated for the network
99-
100-
# Relative path to accumulator message buffer program ID. Setting this
36+
# Pubkey of accumulator message buffer program ID. Setting this
10137
# value enables accumulator support on publishing transactions.
102-
# key_store.accumulator_key_path = <not set by default>
38+
# key_store.accumulator_key = <not set by default>
39+
#
40+
# IMPORTANT: When publishing with accumulator_key defined,
41+
# max_batch_size must be decreased to 7
42+
# exporter.max_batch_size = 7
10343

10444
# The interval with which to poll account information.
10545
# oracle.poll_interval_duration = "2m"
@@ -148,13 +88,82 @@ key_store.accumulator_key = "RelevantOracleAccumulatorAddress"
14888
# a value at least as large as (number of products published / number of products in a batch).
14989
# exporter.transaction_monitor.max_transactions = "100"
15090

91+
### Optional config sections ###
15192

152-
# Configuration for the optional secondary network this agent will publish data to. In most cases this should be a Solana endpoint. The options correspond to the ones in primary_network
153-
# [secondary_network]
93+
## Metrics server section ##
15494

155-
# Configuration for the JRPC API
156-
[pythd_adapter]
95+
# [metrics_server]
96+
#
97+
# Where to serve the quick-access dashboard and metrics. Metrics live under "/metrics"
98+
# NOTE: non-loopback addresses must be used carefully, making sure the
99+
# connection is not exposed for unauthorized access.
100+
# bind_address = "127.0.0.1:8888"
101+
102+
## Remote keypair loader section. ##
103+
104+
# [remote_keypair_loader}
105+
# Where to serve the remote keypair loading endpoint, under
106+
# "/primary/load_keypair" and "/secondary/load_keypair".
107+
#
108+
# NOTE: non-loopback addresses must be used carefully, making sure the
109+
# connection is not exposed for unauthorized access.
110+
# bind_address = "127.0.0.1:9001"
111+
112+
# How much whole SOL must a keypair hold to be considered valid for
113+
# use on a given network. Disabled with 0.
114+
# primary_min_keypair_balance_sol = 1
115+
# secondary_min_keypair_balance_sol = 1
116+
117+
118+
## Channel capacities section. ##
119+
120+
# These refer to async messaging channels
121+
# internally used by the agent's subroutines
122+
123+
# [channel_capacities]
124+
# Capacity of the channel used to broadcast shutdown events to all
125+
# components
126+
# shutdown = 10000
127+
128+
# Capacity of the channel used to send updates from the primary Oracle
129+
# to the Global Store
130+
# primary_oracle_updates = 10000
131+
132+
# Capacity of the channel used to send updates from the secondary
133+
# Oracle to the Global Store
134+
# secondary_oracle_updates = 10000
135+
136+
# Capacity of the channel the Pythd API Adapter uses to send lookup
137+
# requests to the Global Store
138+
# global_store_lookup = 10000
139+
140+
# Capacity of the channel the Pythd API Adapter uses to communicate
141+
# with the Local Store
142+
# local_store_lookup = 10000
143+
144+
# Capacity of the channel on which the Local Store receives messages
145+
# local_store = 10000
146+
147+
# Capacity of the channel on which the Pythd API Adapter receives
148+
# messages
149+
# pythd_adapter = 10000
150+
151+
# Capacity of the slog logging channel. Adjust this value if you see
152+
# complaints about channel capacity from slog
153+
# logger_buffer = 10000
154+
155+
156+
## JRPC API config section. ##
157+
158+
# [pythd_adapter]
157159
# The duration of the interval at which `notify_price_sched` notifications will be sent.
158160
# Note that this doesn't affect the rate at which transactions are published:
159161
# this is soley a backwards-compatibility API feature.
160162
# notify_price_sched_interval_duration = "1s"
163+
164+
## Optional secondary network section ##
165+
166+
# Configuration for the optional secondary network this agent will
167+
# publish data to. In most cases this should be a Solana endpoint. The
168+
# options correspond to the ones in primary_network
169+
# [secondary_network]

src/agent/solana/oracle.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ impl Oracle {
258258
info!(
259259
self.logger,
260260
"updated publisher permissions";
261-
"new" => format!("{:?}", new_publishers.difference(&previous_publishers).collect::<HashSet<_>>()),
262-
"total" => new_publishers.len(),
261+
"new_publishers" => format!("{:?}", new_publishers.difference(&previous_publishers).collect::<HashSet<_>>()),
262+
"total_publishers" => new_publishers.len(),
263263
);
264264

265265
// Update the data with the new data structs

0 commit comments

Comments
 (0)