Skip to content

Commit 63e4977

Browse files
committed
Fix bug with compute instruction calculation
1 parent a4944c8 commit 63e4977

File tree

8 files changed

+24
-25
lines changed

8 files changed

+24
-25
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ spl-associated-token-account = "6.0.0"
5757
spl-token = "4.0.0"
5858
itertools = "0.13"
5959
tokio-graceful-shutdown = "0.15"
60-
solana-transaction-utils = { version = "0.4.0", path = "./solana-transaction-utils" }
60+
solana-transaction-utils = { version = "0.4.1", path = "./solana-transaction-utils" }
6161
tuktuk-sdk = { version = "0.3.5", path = "./tuktuk-sdk" }
6262
tuktuk-program = { version = "0.3.2", path = "./tuktuk-program" }
6363
solana-account-decoder = { version = "2.2.3" }

solana-transaction-utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "solana-transaction-utils"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
authors.workspace = true
55
edition.workspace = true
66
license.workspace = true

solana-transaction-utils/src/priority_fee.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ pub async fn auto_compute_price<C: AsRef<RpcClient>>(
175175
compute_price_instruction_for_accounts(client, &accounts).await?;
176176

177177
// Replace or insert compute price instruction
178-
if let Some(pos) = instructions
179-
.iter()
180-
.position(|ix| ix.program_id == solana_sdk::compute_budget::id())
181-
{
182-
updated_instructions[pos + 1] = compute_price_ix; // Replace existing
178+
if let Some(pos) = instructions.iter().position(|ix| {
179+
ix.program_id == solana_sdk::compute_budget::id()
180+
&& ix.data.first() == compute_price_ix.data.first()
181+
}) {
182+
updated_instructions[pos] = compute_price_ix; // Replace existing
183183
} else {
184184
updated_instructions.insert(1, compute_price_ix); // Insert after compute budget
185185
}
@@ -239,10 +239,10 @@ pub async fn auto_compute_limit_and_price<C: AsRef<RpcClient>>(
239239
.await?;
240240

241241
// Replace or insert compute budget instruction
242-
if let Some(pos) = updated_instructions
243-
.iter()
244-
.position(|ix| ix.program_id == solana_sdk::compute_budget::id())
245-
{
242+
if let Some(pos) = updated_instructions.iter().position(|ix| {
243+
ix.program_id == solana_sdk::compute_budget::id()
244+
&& ix.data.first() == compute_budget_ix.data.first()
245+
}) {
246246
updated_instructions[pos] = compute_budget_ix; // Replace existing
247247
} else {
248248
updated_instructions.insert(0, compute_budget_ix); // Insert at the beginning

solana-transaction-utils/src/queue.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ pub async fn create_transaction_queue<T: Send + Clone + 'static + Sync>(
121121
let mut updated_instructions = bundle.tx.instructions.clone();
122122
let compute_budget_ix = compute_budget_instruction(compute_units);
123123
// Replace or insert compute budget instruction
124-
if let Some(pos) = updated_instructions
125-
.iter()
126-
.position(|ix| ix.program_id == solana_sdk::compute_budget::id())
127-
{
124+
if let Some(pos) = updated_instructions.iter().position(|ix| {
125+
ix.program_id == solana_sdk::compute_budget::id()
126+
&& ix.data.first() == compute_budget_ix.data.first()
127+
}) {
128128
updated_instructions[pos] = compute_budget_ix; // Replace existing
129129
} else {
130130
updated_instructions.insert(0, compute_budget_ix); // Insert at the beginning

tuktuk-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tuktuk-cli"
3-
version = "0.2.11"
3+
version = "0.2.12"
44
description = "A cli for tuktuk"
55
homepage.workspace = true
66
repository.workspace = true

tuktuk-cli/src/cmd/task.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,10 @@ impl TaskCmd {
180180
return false;
181181
}
182182
}
183-
let is_task_active = task.trigger.is_active(now);
184-
if *active != is_task_active {
185-
return false;
186-
}
187-
return true;
183+
184+
// If active flag is set, only show tasks that are active
185+
// Otherwise, show all tasks
186+
return !*active || task.trigger.is_active(now);
188187
}
189188
false
190189
});

tuktuk-crank-turner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tuktuk-crank-turner"
3-
version = "0.2.22"
3+
version = "0.2.23"
44
authors.workspace = true
55
edition.workspace = true
66
license.workspace = true

0 commit comments

Comments
 (0)