Skip to content

Commit a78241f

Browse files
authored
fix(svm): N-01 remove v3 from remaining functions and comments (#964)
Signed-off-by: Reinis Martinsons <[email protected]>
1 parent 58f2665 commit a78241f

File tree

12 files changed

+62
-64
lines changed

12 files changed

+62
-64
lines changed

programs/svm-spoke/src/instructions/deposit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Note: The `svm-spoke` does not support `speedUpV3Deposit` and `fillV3RelayWithUpdatedDeposit` due to cryptographic
1+
// Note: The `svm-spoke` does not support `speedUpDeposit` and `fillRelayWithUpdatedDeposit` due to cryptographic
22
// incompatibilities between Solana (Ed25519) and Ethereum (ECDSA secp256k1). Specifically, Solana wallets cannot
33
// generate ECDSA signatures required for Ethereum verification. As a result, speed-up functionality on Solana is not
44
// implemented. For more details, refer to the documentation: https://docs.across.to

scripts/svm/fakeFillWithRandomDistribution.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const argv = yargs(hideBin(process.argv))
5151
.option("distributionCount", { type: "number", demandOption: false, describe: "Distribution count" })
5252
.option("bufferParams", { type: "boolean", demandOption: false, describe: "Use buffer account for params" }).argv;
5353

54-
async function fillV3RelayToRandom(): Promise<void> {
54+
async function fillRelayToRandom(): Promise<void> {
5555
const resolvedArgv = await argv;
5656
const depositor = new PublicKey(resolvedArgv.depositor);
5757
const handler = new PublicKey(resolvedArgv.handler);
@@ -130,7 +130,7 @@ async function fillV3RelayToRandom(): Promise<void> {
130130
message: encodedMessage,
131131
};
132132

133-
console.log("Filling V3 Relay with handler...");
133+
console.log("Filling Relay with handler...");
134134

135135
// Define the state account PDA
136136
const [statePda] = PublicKey.findProgramAddressSync(
@@ -184,11 +184,11 @@ async function fillV3RelayToRandom(): Promise<void> {
184184
);
185185

186186
// Prepare fill instruction as we will need to use Address Lookup Table (ALT).
187-
const fillV3RelayValues: FillDataValues = [relayHash, relayData, repaymentChain, repaymentAddress];
187+
const fillRelayValues: FillDataValues = [relayHash, relayData, repaymentChain, repaymentAddress];
188188
if (bufferParams) {
189-
await loadFillRelayParams(program, signer, fillV3RelayValues[1], fillV3RelayValues[2], fillV3RelayValues[3]);
189+
await loadFillRelayParams(program, signer, fillRelayValues[1], fillRelayValues[2], fillRelayValues[3]);
190190
}
191-
const fillV3RelayParams: FillDataParams = bufferParams ? [fillV3RelayValues[0], null, null, null] : fillV3RelayValues;
191+
const fillRelayParams: FillDataParams = bufferParams ? [fillRelayValues[0], null, null, null] : fillRelayValues;
192192
const [instructionParams] = bufferParams
193193
? PublicKey.findProgramAddressSync(
194194
[Buffer.from("instruction_params"), signer.publicKey.toBuffer()],
@@ -215,7 +215,7 @@ async function fillV3RelayToRandom(): Promise<void> {
215215
...multicallHandlerCoder.compiledKeyMetas,
216216
];
217217
const fillInstruction = await program.methods
218-
.fillRelay(...fillV3RelayParams)
218+
.fillRelay(...fillRelayParams)
219219
.accounts(fillAccounts)
220220
.remainingAccounts(remainingAccounts)
221221
.instruction();
@@ -230,5 +230,5 @@ async function fillV3RelayToRandom(): Promise<void> {
230230
console.log("Transaction signature:", txSignature);
231231
}
232232

233-
// Run the fillV3RelayToRandom function
234-
fillV3RelayToRandom();
233+
// Run the fillRelayToRandom function
234+
fillRelayToRandom();

scripts/svm/nativeDeposit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async function nativeDeposit(): Promise<void> {
7878
const userTokenAccountInfo = await provider.connection.getAccountInfo(userTokenAccount);
7979
const existingTokenAccount = userTokenAccountInfo !== null && userTokenAccountInfo.owner.equals(TOKEN_PROGRAM_ID);
8080

81-
console.log("Depositing V3...");
81+
console.log("Depositing...");
8282
console.table([
8383
{ property: "seed", value: seed.toString() },
8484
{ property: "recipient", value: recipient.toString() },

scripts/svm/queryEventsV2.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const argvPromise = yargs(hideBin(process.argv))
1717
describe: "Name of the event to query",
1818
choices: [
1919
"any",
20-
"FilledV3Relay",
21-
"V3FundsDeposited",
20+
"FilledRelay",
21+
"FundsDeposited",
2222
"EnabledDepositRoute",
2323
"RelayedRootBundle",
2424
"ExecutedRelayerRefundRoot",
@@ -27,7 +27,7 @@ const argvPromise = yargs(hideBin(process.argv))
2727
"PausedFills",
2828
"SetXDomainAdmin",
2929
"EmergencyDeletedRootBundle",
30-
"RequestedV3SlowFill",
30+
"RequestedSlowFill",
3131
"ClaimedRelayerRefund",
3232
"TokensBridged",
3333
],

scripts/svm/simpleDeposit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function deposit(): Promise<void> {
6666
ASSOCIATED_TOKEN_PROGRAM_ID
6767
);
6868

69-
console.log("Depositing V3...");
69+
console.log("Depositing...");
7070
console.table([
7171
{ property: "seed", value: seed.toString() },
7272
{ property: "recipient", value: recipient.toString() },
@@ -144,5 +144,5 @@ async function deposit(): Promise<void> {
144144
console.log("Transaction signature:", tx);
145145
}
146146

147-
// Run the depositV3 function
147+
// Run the deposit function
148148
deposit();

scripts/svm/simpleFakeRelayerRepayment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function testBundleLogic(): Promise<void> {
7676

7777
const tokenDecimals = (await getMint(provider.connection, inputToken, undefined, TOKEN_PROGRAM_ID)).decimals;
7878

79-
// Use program.methods.depositV3 to send tokens to the spoke. note this is NOT a valid deposit, we just want to
79+
// Use program.methods.deposit to send tokens to the spoke. note this is NOT a valid deposit, we just want to
8080
// seed tokens into the spoke to test repayment.
8181

8282
// Delegate state PDA to pull depositor tokens.

scripts/svm/simpleFill.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async function fillRelay(): Promise<void> {
7777
// Define the signer (replace with your actual signer)
7878
const signer = (provider.wallet as anchor.Wallet).payer;
7979

80-
console.log("Filling V3 Relay...");
80+
console.log("Filling Relay...");
8181

8282
// Define the state account PDA
8383
const [statePda, _] = PublicKey.findProgramAddressSync(
@@ -190,5 +190,5 @@ async function fillRelay(): Promise<void> {
190190
console.log("Transaction signature:", tx);
191191
}
192192

193-
// Run the fillV3Relay function
193+
// Run the fillRelay function
194194
fillRelay();

test/svm/SvmSpoke.Deposit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ describe("svm_spoke.deposit", () => {
347347
}
348348
});
349349

350-
it("depositV3Now behaves as deposit but forces the quote timestamp as expected", async () => {
350+
it("depositNow behaves as deposit but forces the quote timestamp as expected", async () => {
351351
// Set up initial deposit data. Note that this method has a slightly different interface to deposit, using
352352
// fillDeadlineOffset rather than fillDeadline. current chain time is added to fillDeadlineOffset to set the
353353
// fillDeadline for the deposit. exclusivityPeriod operates the same as in standard deposit.
354-
// Equally, depositV3Now does not have `quoteTimestamp`. this is set to the current time from the program.
354+
// Equally, depositNow does not have `quoteTimestamp`. this is set to the current time from the program.
355355
const fillDeadlineOffset = 60; // 60 seconds offset
356356

357357
const depositNowData = {
@@ -531,7 +531,7 @@ describe("svm_spoke.deposit", () => {
531531
tokenProgram
532532
);
533533

534-
// Create the transaction for unsafeDepositV3
534+
// Create the transaction for unsafeDeposit
535535
const unsafeDepositIx = await program.methods
536536
.unsafeDeposit(
537537
depositData.depositor!,

test/svm/SvmSpoke.Fill.AcrossPlus.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,17 @@ describe("svm_spoke.fill.across_plus", () => {
100100
];
101101

102102
// Prepare fill instruction.
103-
const fillV3RelayValues: FillDataValues = [relayHash, relayData, new BN(1), relayer.publicKey];
103+
const fillRelayValues: FillDataValues = [relayHash, relayData, new BN(1), relayer.publicKey];
104104
if (bufferParams) {
105-
await loadFillRelayParams(program, relayer, fillV3RelayValues[1], fillV3RelayValues[2], fillV3RelayValues[3]);
105+
await loadFillRelayParams(program, relayer, fillRelayValues[1], fillRelayValues[2], fillRelayValues[3]);
106106
[accounts.instructionParams] = PublicKey.findProgramAddressSync(
107107
[Buffer.from("instruction_params"), relayer.publicKey.toBuffer()],
108108
program.programId
109109
);
110110
}
111-
const fillV3RelayParams: FillDataParams = bufferParams
112-
? [fillV3RelayValues[0], null, null, null]
113-
: fillV3RelayValues;
111+
const fillRelayParams: FillDataParams = bufferParams ? [fillRelayValues[0], null, null, null] : fillRelayValues;
114112
const fillIx = await program.methods
115-
.fillRelay(...fillV3RelayParams)
113+
.fillRelay(...fillRelayParams)
116114
.accounts(accounts)
117115
.remainingAccounts(remainingAccounts)
118116
.instruction();

test/svm/SvmSpoke.Fill.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe("svm_spoke.fill", () => {
170170
updateRelayData(initialRelayData);
171171
});
172172

173-
it("Fills a V3 relay and verifies balances", async () => {
173+
it("Fills a relay and verifies balances", async () => {
174174
// Verify recipient's balance before the fill
175175
let recipientAccount = await getAccount(connection, recipientTA);
176176
assertSE(recipientAccount.amount, "0", "Recipient's balance should be 0 before the fill");
@@ -226,7 +226,7 @@ describe("svm_spoke.fill", () => {
226226
assertSE(event.relayer, otherRelayer.publicKey, "Repayment address should match");
227227
});
228228

229-
it("Fails to fill a V3 relay after the fill deadline", async () => {
229+
it("Fails to fill a relay after the fill deadline", async () => {
230230
updateRelayData({ ...relayData, fillDeadline: Math.floor(Date.now() / 1000) - 69 }); // 69 seconds ago
231231

232232
const relayHash = Array.from(calculateRelayHashUint8Array(relayData, chainId));
@@ -238,7 +238,7 @@ describe("svm_spoke.fill", () => {
238238
}
239239
});
240240

241-
it("Fails to fill a V3 relay by non-exclusive relayer before exclusivity deadline", async () => {
241+
it("Fails to fill a relay by non-exclusive relayer before exclusivity deadline", async () => {
242242
accounts.signer = otherRelayer.publicKey;
243243
accounts.relayerTokenAccount = otherRelayerTA;
244244

@@ -280,7 +280,7 @@ describe("svm_spoke.fill", () => {
280280
);
281281
});
282282

283-
it("Fails to fill a V3 relay with the same deposit data multiple times", async () => {
283+
it("Fails to fill a relay with the same deposit data multiple times", async () => {
284284
const relayHash = Array.from(calculateRelayHashUint8Array(relayData, chainId));
285285

286286
// First fill attempt
@@ -305,7 +305,7 @@ describe("svm_spoke.fill", () => {
305305
systemProgram: anchor.web3.SystemProgram.programId,
306306
};
307307

308-
// Execute the fill_v3_relay call
308+
// Execute the fill_relay call
309309
await approvedFillRelay([relayHash, relayData, new BN(1), relayer.publicKey]);
310310

311311
// Verify the fill PDA exists before closing
@@ -335,20 +335,20 @@ describe("svm_spoke.fill", () => {
335335
assert.isNull(fillStatusAccountAfter, "Fill PDA should be closed after closing");
336336
});
337337

338-
it("Fetches FillStatusAccount before and after fillV3Relay", async () => {
338+
it("Fetches FillStatusAccount before and after fillRelay", async () => {
339339
const relayHash = calculateRelayHashUint8Array(relayData, chainId);
340340
const [fillStatusPDA] = PublicKey.findProgramAddressSync([Buffer.from("fills"), relayHash], program.programId);
341341

342-
// Fetch FillStatusAccount before fillV3Relay
342+
// Fetch FillStatusAccount before fillRelay
343343
let fillStatusAccount = await program.account.fillStatusAccount.fetchNullable(fillStatusPDA);
344-
assert.isNull(fillStatusAccount, "FillStatusAccount should be uninitialized before fillV3Relay");
344+
assert.isNull(fillStatusAccount, "FillStatusAccount should be uninitialized before fillRelay");
345345

346346
// Fill the relay
347347
await approvedFillRelay([Array.from(relayHash), relayData, new BN(1), relayer.publicKey]);
348348

349-
// Fetch FillStatusAccount after fillV3Relay
349+
// Fetch FillStatusAccount after fillRelay
350350
fillStatusAccount = await program.account.fillStatusAccount.fetch(fillStatusPDA);
351-
assert.isNotNull(fillStatusAccount, "FillStatusAccount should be initialized after fillV3Relay");
351+
assert.isNotNull(fillStatusAccount, "FillStatusAccount should be initialized after fillRelay");
352352
assert.equal(JSON.stringify(fillStatusAccount.status), `{\"filled\":{}}`, "FillStatus should be Filled");
353353
assert.equal(fillStatusAccount.relayer.toString(), relayer.publicKey.toString(), "Caller should be set as relayer");
354354
});
@@ -413,7 +413,7 @@ describe("svm_spoke.fill", () => {
413413
}
414414
});
415415

416-
it("Fills a V3 relay from custom relayer token account", async () => {
416+
it("Fills a relay from custom relayer token account", async () => {
417417
// Create and mint to custom relayer token account
418418
const customKeypair = Keypair.generate();
419419
const customRelayerTA = await createAccount(connection, payer, mint, relayer.publicKey, customKeypair);

0 commit comments

Comments
 (0)