From 6af8cf116a1618efd690334b4844d5b09a51993f Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Thu, 25 Apr 2024 12:57:57 +0200 Subject: [PATCH] chore: update max compute unit config and bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- config/config.toml | 2 +- src/agent/solana/exporter.rs | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index baede694..efcb172f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3270,7 +3270,7 @@ dependencies = [ [[package]] name = "pyth-agent" -version = "2.6.1" +version = "2.6.2" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 330ac5a5..9677e2ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-agent" -version = "2.6.1" +version = "2.6.2" edition = "2021" [[bin]] diff --git a/config/config.toml b/config/config.toml index bca09dd5..6767b91b 100644 --- a/config/config.toml +++ b/config/config.toml @@ -74,7 +74,7 @@ key_store.mapping_key = "RelevantOracleMappingAddress" # exporter.max_batch_size = 12 # Number of compute units requested per update_price instruction within the transaction. -# exporter.compute_unit_limit = 20000 +# exporter.compute_unit_limit = 60000 # Price per compute unit offered for update_price transactions # exporter.compute_unit_price_micro_lamports = diff --git a/src/agent/solana/exporter.rs b/src/agent/solana/exporter.rs index 2adca249..089e2889 100644 --- a/src/agent/solana/exporter.rs +++ b/src/agent/solana/exporter.rs @@ -153,8 +153,10 @@ impl Default for Config { max_batch_size: 12, inflight_transactions_channel_capacity: 10000, transaction_monitor: Default::default(), - // The largest transactions appear to be about ~12000 CUs. We leave ourselves some breathing room. - compute_unit_limit: 40000, + // The largest transactions without accumulator spend around 38k compute units + // and accumulator cpi costs around 10k compute units. We set the limit to 60k + // to have some buffer. + compute_unit_limit: 60000, compute_unit_price_micro_lamports: None, dynamic_compute_unit_pricing_enabled: false, // Maximum compute unit price (as a cap on the dynamic price)