Skip to content

Commit e8a34ee

Browse files
authored
chore: Bump @solana/kit 2.3 -> 5.4 (#1243)
Kit has moved from 2.2 to 5.4 in the past few months, so we're playing catch-up. I worked progressively through the major releases and found there weren't many changes required, so the jump from 2.3 -> 5.4 has been squashed into a single upgrade. Change mostly facilitated by Claude.
1 parent bf5cc54 commit e8a34ee

File tree

6 files changed

+451
-471
lines changed

6 files changed

+451
-471
lines changed

.github/actions/cache-svm-artifacts/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ runs:
2626
# The job that generates the artifacts is responsible for archiving them to the cache tarball. This avoids any
2727
# conflicts with other caching actions that might have cleaned some of cached contents.
2828
path: svm-${{ inputs.type }}.tar
29-
key: svm-${{ inputs.type }}-${{ runner.os }}-node-${{ steps.resolved-node.outputs.version }}-${{ hashFiles('Cargo.lock', 'programs/**/Cargo.toml', 'programs/**/Xargo.toml', 'programs/**/*.rs') }}
29+
key: svm-${{ inputs.type }}-${{ runner.os }}-node-${{ steps.resolved-node.outputs.version }}-${{ hashFiles('yarn.lock', 'Cargo.lock', 'programs/**/Cargo.toml', 'programs/**/Xargo.toml', 'programs/**/*.rs') }}
3030
- name: Unpack restored SVM artifacts
3131
if: steps.svm-artifacts-cache.outputs.cache-hit == 'true'
3232
shell: bash

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@across-protocol/contracts",
3-
"version": "4.1.22",
3+
"version": "4.1.23",
44
"author": "UMA Team",
55
"license": "AGPL-3.0-only",
66
"repository": {
@@ -65,10 +65,10 @@
6565
"@openzeppelin/foundry-upgrades": "^0.4.0",
6666
"@safe-global/protocol-kit": "^6.1.1",
6767
"@scroll-tech/contracts": "^0.1.0",
68-
"@solana-program/address-lookup-table": "^0.7.0",
69-
"@solana-program/token": "^0.5.1",
70-
"@solana/kit": "^2.3.0",
71-
"@solana/spl-token": "^0.4.6",
68+
"@solana-program/address-lookup-table": "0.10.0",
69+
"@solana-program/token": "0.9.0",
70+
"@solana/kit": "^5.4.0",
71+
"@solana/spl-token": "0.4.14",
7272
"@solana/web3.js": "1.98.2",
7373
"@types/yargs": "^17.0.33",
7474
"@uma/common": "^2.37.3",
@@ -78,8 +78,8 @@
7878
"zksync-web3": "^0.14.3"
7979
},
8080
"devDependencies": {
81-
"@codama/nodes-from-anchor": "^1.2.0",
82-
"@codama/renderers-js": "^1.2.14",
81+
"@codama/nodes-from-anchor": "1.2.2",
82+
"@codama/renderers-js": "1.3.0",
8383
"@defi-wonderland/smock": "^2.3.4",
8484
"@ethersproject/abstract-provider": "5.7.0",
8585
"@ethersproject/abstract-signer": "5.7.0",

src/svm/web3-v2/transactionUtils.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ import {
33
AddressesByLookupTableAddress,
44
appendTransactionMessageInstruction,
55
appendTransactionMessageInstructions,
6+
assertIsTransactionWithBlockhashLifetime,
7+
assertIsTransactionWithinSizeLimit,
8+
BaseTransactionMessage,
69
Commitment,
7-
CompilableTransactionMessage,
810
compressTransactionMessageUsingAddressLookupTables as compressTxWithAlt,
911
createTransactionMessage,
1012
getSignatureFromTransaction,
11-
IInstruction,
13+
Instruction,
1214
KeyPairSigner,
1315
pipe,
1416
sendAndConfirmTransactionFactory,
1517
setTransactionMessageFeePayerSigner,
1618
setTransactionMessageLifetimeUsingBlockhash,
1719
signTransactionMessageWithSigners,
1820
TransactionMessageWithBlockhashLifetime,
21+
TransactionMessageWithFeePayer,
1922
TransactionSigner,
2023
} from "@solana/kit";
2124

@@ -32,10 +35,12 @@ import { RpcClient } from "./types";
3235
*/
3336
export const signAndSendTransaction = async (
3437
rpcClient: RpcClient,
35-
transactionMessage: CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime,
38+
transactionMessage: BaseTransactionMessage & TransactionMessageWithFeePayer & TransactionMessageWithBlockhashLifetime,
3639
commitment: Commitment = "confirmed"
3740
) => {
3841
const signedTransaction = await signTransactionMessageWithSigners(transactionMessage);
42+
assertIsTransactionWithBlockhashLifetime(signedTransaction);
43+
assertIsTransactionWithinSizeLimit(signedTransaction);
3944
const signature = getSignatureFromTransaction(signedTransaction);
4045
await sendAndConfirmTransactionFactory(rpcClient)(signedTransaction, {
4146
commitment,
@@ -58,7 +63,7 @@ export const createDefaultTransaction = async (rpcClient: RpcClient, signer: Tra
5863
export async function sendTransactionWithLookupTable(
5964
client: RpcClient,
6065
payer: KeyPairSigner,
61-
instructions: IInstruction[],
66+
instructions: Instruction[],
6267
addressesByLookupTableAddress: AddressesByLookupTableAddress
6368
) {
6469
return pipe(
@@ -68,6 +73,8 @@ export async function sendTransactionWithLookupTable(
6873
(tx) => signTransactionMessageWithSigners(tx),
6974
async (tx) => {
7075
const signedTx = await tx;
76+
assertIsTransactionWithBlockhashLifetime(signedTx);
77+
assertIsTransactionWithinSizeLimit(signedTx);
7178
await sendAndConfirmTransactionFactory(client)(signedTx, {
7279
commitment: "confirmed",
7380
skipPreflight: false,

test/svm/SvmSpoke.Fill.AcrossPlus.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
createKeyPairFromBytes,
99
createSignerFromKeyPair,
1010
getProgramDerivedAddress,
11-
IAccountMeta,
1211
pipe,
1312
} from "@solana/kit";
1413
import {
@@ -511,11 +510,11 @@ describe("svm_spoke.fill.across_plus", () => {
511510
{ pubkey: handlerProgram.programId, isSigner: false, isWritable: false },
512511
...multicallHandlerCoder.compiledKeyMetas,
513512
];
514-
const remainingAccounts: IAccountMeta<string>[] = _remainingAccounts.map((account) => ({
513+
const remainingAccounts = _remainingAccounts.map((account) => ({
515514
address: address(account.pubkey.toString()),
516515
role: account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY,
517516
}));
518-
(fillRelayIx.accounts as IAccountMeta<string>[]).push(...remainingAccounts);
517+
fillRelayIx.accounts.push(...remainingAccounts);
519518

520519
await pipe(
521520
await createDefaultTransaction(rpcClient, signer),

test/svm/SvmSpoke.Fill.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
createKeyPairFromBytes,
1111
createSignerFromKeyPair,
1212
getProgramDerivedAddress,
13-
IAccountMeta,
1413
pipe,
1514
} from "@solana/kit";
1615
import {
@@ -782,11 +781,11 @@ describe("svm_spoke.fill", () => {
782781
account.address === program.programId.toString() ? { ...account, role: AccountRole.READONLY } : account
783782
),
784783
};
785-
const remainingAccounts: IAccountMeta<string>[] = fillRemainingAccounts.map((account) => ({
784+
const remainingAccounts = fillRemainingAccounts.map((account) => ({
786785
address: address(account.pubkey.toString()),
787786
role: AccountRole.WRITABLE,
788787
}));
789-
(fillRelayIx.accounts as IAccountMeta<string>[]).push(...remainingAccounts);
788+
fillRelayIx.accounts.push(...remainingAccounts);
790789

791790
const tx = await pipe(
792791
await createDefaultTransaction(rpcClient, signer),
@@ -887,11 +886,11 @@ describe("svm_spoke.fill", () => {
887886
account.address === program.programId.toString() ? { ...account, role: AccountRole.READONLY } : account
888887
),
889888
};
890-
const remainingAccounts: IAccountMeta<string>[] = fillRemainingAccounts.map((account) => ({
889+
const remainingAccounts = fillRemainingAccounts.map((account) => ({
891890
address: address(account.pubkey.toString()),
892891
role: AccountRole.WRITABLE,
893892
}));
894-
(fillRelayIx.accounts as IAccountMeta<string>[]).push(...remainingAccounts);
893+
fillRelayIx.accounts.push(...remainingAccounts);
895894

896895
const alt = await createLookupTable(rpcClient, signer);
897896

0 commit comments

Comments
 (0)