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

feat: support batch publish #140

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ tracing-opentelemetry = "0.24.0"
opentelemetry = "0.23.0"
opentelemetry_sdk = { version = "0.23.0", features = ["rt-tokio"]}
opentelemetry-otlp = { version = "0.16.0" }
pyth-price-publisher = { git = "https://github.com/pyth-network/pyth-crosschain", branch = "add-publisher-program" }
Copy link
Collaborator

@ali-bahjati ali-bahjati Sep 3, 2024

Choose a reason for hiding this comment

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

let's publish this package too. also bump the agent version.

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.

bytemuck = "1.13.0"

[dev-dependencies]
tokio-util = { version = "0.7.10", features = ["full"] }
Expand Down
3 changes: 2 additions & 1 deletion src/agent/services/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ mod exporter {
&network_state_rx,
key_store.accumulator_key,
&publish_keypair,
key_store.program_key,
key_store.oracle_program_key,
key_store.publish_program_key,
config.exporter.max_batch_size,
config.exporter.staleness_threshold,
config.exporter.compute_unit_limit,
Expand Down
2 changes: 1 addition & 1 deletion src/agent/services/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ where
config.clone(),
network,
state.clone(),
key_store.program_key,
key_store.oracle_program_key,
)
.await
{
Expand Down
25 changes: 18 additions & 7 deletions src/agent/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,17 @@ pub mod key_store {
/// The public key of the Oracle program
#[serde(
serialize_with = "pubkey_string_ser",
deserialize_with = "pubkey_string_de"
deserialize_with = "pubkey_string_de",
alias = "program_key" // for compatibility
)]
pub oracle_program_key: Pubkey,
/// The public key of the Publish program
#[serde(
serialize_with = "opt_pubkey_string_ser",
deserialize_with = "opt_pubkey_string_de",
default
)]
pub program_key: Pubkey,
pub publish_program_key: Option<Pubkey>,
/// The public key of the root mapping account
#[serde(
serialize_with = "pubkey_string_ser",
Expand All @@ -114,13 +122,15 @@ pub mod key_store {
/// The keypair used to publish price updates. When None,
/// publishing will not start until a new keypair is supplied
/// via the remote loading endpoint
pub publish_keypair: Option<Keypair>,
pub publish_keypair: Option<Keypair>,
/// Public key of the Oracle program
pub program_key: Pubkey,
pub oracle_program_key: Pubkey,
/// Public key of the Publish program
pub publish_program_key: Option<Pubkey>,
/// Public key of the root mapping account
pub mapping_key: Pubkey,
pub mapping_key: Pubkey,
/// Public key of the accumulator program (if provided)
pub accumulator_key: Option<Pubkey>,
pub accumulator_key: Option<Pubkey>,
}

impl KeyStore {
Expand All @@ -139,7 +149,8 @@ pub mod key_store {

Ok(KeyStore {
publish_keypair,
program_key: config.program_key,
oracle_program_key: config.oracle_program_key,
publish_program_key: config.publish_program_key,
mapping_key: config.mapping_key,
accumulator_key: config.accumulator_key,
})
Expand Down
Loading
Loading