Skip to content

Commit 5b7c2f0

Browse files
committed
Add small priority fees to core transactions
1 parent 6bba5a6 commit 5b7c2f0

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

pkg/code/transaction/transaction.go

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/code-payments/code-server/pkg/code/common"
1010
"github.com/code-payments/code-server/pkg/solana"
11+
compute_budget "github.com/code-payments/code-server/pkg/solana/computebudget"
1112
"github.com/code-payments/code-server/pkg/solana/cvm"
1213
)
1314

@@ -50,6 +51,8 @@ func MakeOpenAccountTransaction(
5051
}
5152

5253
instructions := []solana.Instruction{
54+
compute_budget.SetComputeUnitPrice(1_000),
55+
compute_budget.SetComputeUnitLimit(50_000),
5356
initializeInstruction,
5457
}
5558
return MakeNoncedTransaction(nonce, bh, instructions...)
@@ -84,7 +87,12 @@ func MakeCompressAccountTransaction(
8487
},
8588
)
8689

87-
return MakeNoncedTransaction(nonce, bh, compressInstruction)
90+
instructions := []solana.Instruction{
91+
compute_budget.SetComputeUnitPrice(1_000),
92+
compute_budget.SetComputeUnitLimit(200_000),
93+
compressInstruction,
94+
}
95+
return MakeNoncedTransaction(nonce, bh, instructions...)
8896
}
8997

9098
func MakeInternalWithdrawTransaction(
@@ -126,7 +134,12 @@ func MakeInternalWithdrawTransaction(
126134
},
127135
)
128136

129-
return MakeNoncedTransaction(nonce, bh, execInstruction)
137+
instructions := []solana.Instruction{
138+
compute_budget.SetComputeUnitPrice(1_000),
139+
compute_budget.SetComputeUnitLimit(200_000),
140+
execInstruction,
141+
}
142+
return MakeNoncedTransaction(nonce, bh, instructions...)
130143
}
131144

132145
func MakeExternalWithdrawTransaction(
@@ -175,7 +188,12 @@ func MakeExternalWithdrawTransaction(
175188
},
176189
)
177190

178-
return MakeNoncedTransaction(nonce, bh, execInstruction)
191+
instructions := []solana.Instruction{
192+
compute_budget.SetComputeUnitPrice(1_000),
193+
compute_budget.SetComputeUnitLimit(200_000),
194+
execInstruction,
195+
}
196+
return MakeNoncedTransaction(nonce, bh, instructions...)
179197
}
180198

181199
func MakeInternalTransferWithAuthorityTransaction(
@@ -220,7 +238,12 @@ func MakeInternalTransferWithAuthorityTransaction(
220238
},
221239
)
222240

223-
return MakeNoncedTransaction(nonce, bh, execInstruction)
241+
instructions := []solana.Instruction{
242+
compute_budget.SetComputeUnitPrice(1_000),
243+
compute_budget.SetComputeUnitLimit(200_000),
244+
execInstruction,
245+
}
246+
return MakeNoncedTransaction(nonce, bh, instructions...)
224247
}
225248

226249
func MakeExternalTransferWithAuthorityTransaction(
@@ -271,7 +294,12 @@ func MakeExternalTransferWithAuthorityTransaction(
271294
},
272295
)
273296

274-
return MakeNoncedTransaction(nonce, bh, execInstruction)
297+
instructions := []solana.Instruction{
298+
compute_budget.SetComputeUnitPrice(1_000),
299+
compute_budget.SetComputeUnitLimit(200_000),
300+
execInstruction,
301+
}
302+
return MakeNoncedTransaction(nonce, bh, instructions...)
275303
}
276304

277305
type MergedMemoryBankResult struct {

0 commit comments

Comments
 (0)