diff --git a/programs/svm-spoke/src/instructions/deposit.rs b/programs/svm-spoke/src/instructions/deposit.rs index d3a679516..e2e6380b7 100644 --- a/programs/svm-spoke/src/instructions/deposit.rs +++ b/programs/svm-spoke/src/instructions/deposit.rs @@ -1,4 +1,4 @@ -// Note: The `svm-spoke` does not support `speedUpV3Deposit` and `fillV3RelayWithUpdatedDeposit` due to cryptographic +// Note: The `svm-spoke` does not support `speedUpDeposit` and `fillRelayWithUpdatedDeposit` due to cryptographic // incompatibilities between Solana (Ed25519) and Ethereum (ECDSA secp256k1). Specifically, Solana wallets cannot // generate ECDSA signatures required for Ethereum verification. As a result, speed-up functionality on Solana is not // implemented. For more details, refer to the documentation: https://docs.across.to diff --git a/scripts/svm/fakeFillWithRandomDistribution.ts b/scripts/svm/fakeFillWithRandomDistribution.ts index a734283e2..1e08a46ea 100644 --- a/scripts/svm/fakeFillWithRandomDistribution.ts +++ b/scripts/svm/fakeFillWithRandomDistribution.ts @@ -51,7 +51,7 @@ const argv = yargs(hideBin(process.argv)) .option("distributionCount", { type: "number", demandOption: false, describe: "Distribution count" }) .option("bufferParams", { type: "boolean", demandOption: false, describe: "Use buffer account for params" }).argv; -async function fillV3RelayToRandom(): Promise { +async function fillRelayToRandom(): Promise { const resolvedArgv = await argv; const depositor = new PublicKey(resolvedArgv.depositor); const handler = new PublicKey(resolvedArgv.handler); @@ -130,7 +130,7 @@ async function fillV3RelayToRandom(): Promise { message: encodedMessage, }; - console.log("Filling V3 Relay with handler..."); + console.log("Filling Relay with handler..."); // Define the state account PDA const [statePda] = PublicKey.findProgramAddressSync( @@ -184,11 +184,11 @@ async function fillV3RelayToRandom(): Promise { ); // Prepare fill instruction as we will need to use Address Lookup Table (ALT). - const fillV3RelayValues: FillDataValues = [relayHash, relayData, repaymentChain, repaymentAddress]; + const fillRelayValues: FillDataValues = [relayHash, relayData, repaymentChain, repaymentAddress]; if (bufferParams) { - await loadFillRelayParams(program, signer, fillV3RelayValues[1], fillV3RelayValues[2], fillV3RelayValues[3]); + await loadFillRelayParams(program, signer, fillRelayValues[1], fillRelayValues[2], fillRelayValues[3]); } - const fillV3RelayParams: FillDataParams = bufferParams ? [fillV3RelayValues[0], null, null, null] : fillV3RelayValues; + const fillRelayParams: FillDataParams = bufferParams ? [fillRelayValues[0], null, null, null] : fillRelayValues; const [instructionParams] = bufferParams ? PublicKey.findProgramAddressSync( [Buffer.from("instruction_params"), signer.publicKey.toBuffer()], @@ -215,7 +215,7 @@ async function fillV3RelayToRandom(): Promise { ...multicallHandlerCoder.compiledKeyMetas, ]; const fillInstruction = await program.methods - .fillRelay(...fillV3RelayParams) + .fillRelay(...fillRelayParams) .accounts(fillAccounts) .remainingAccounts(remainingAccounts) .instruction(); @@ -230,5 +230,5 @@ async function fillV3RelayToRandom(): Promise { console.log("Transaction signature:", txSignature); } -// Run the fillV3RelayToRandom function -fillV3RelayToRandom(); +// Run the fillRelayToRandom function +fillRelayToRandom(); diff --git a/scripts/svm/nativeDeposit.ts b/scripts/svm/nativeDeposit.ts index 9ff23601f..13f5df866 100644 --- a/scripts/svm/nativeDeposit.ts +++ b/scripts/svm/nativeDeposit.ts @@ -78,7 +78,7 @@ async function nativeDeposit(): Promise { const userTokenAccountInfo = await provider.connection.getAccountInfo(userTokenAccount); const existingTokenAccount = userTokenAccountInfo !== null && userTokenAccountInfo.owner.equals(TOKEN_PROGRAM_ID); - console.log("Depositing V3..."); + console.log("Depositing..."); console.table([ { property: "seed", value: seed.toString() }, { property: "recipient", value: recipient.toString() }, diff --git a/scripts/svm/queryEventsV2.ts b/scripts/svm/queryEventsV2.ts index 90e253c5b..68db294cd 100644 --- a/scripts/svm/queryEventsV2.ts +++ b/scripts/svm/queryEventsV2.ts @@ -17,8 +17,8 @@ const argvPromise = yargs(hideBin(process.argv)) describe: "Name of the event to query", choices: [ "any", - "FilledV3Relay", - "V3FundsDeposited", + "FilledRelay", + "FundsDeposited", "EnabledDepositRoute", "RelayedRootBundle", "ExecutedRelayerRefundRoot", @@ -27,7 +27,7 @@ const argvPromise = yargs(hideBin(process.argv)) "PausedFills", "SetXDomainAdmin", "EmergencyDeletedRootBundle", - "RequestedV3SlowFill", + "RequestedSlowFill", "ClaimedRelayerRefund", "TokensBridged", ], diff --git a/scripts/svm/simpleDeposit.ts b/scripts/svm/simpleDeposit.ts index a6821cada..4c2fc72f6 100644 --- a/scripts/svm/simpleDeposit.ts +++ b/scripts/svm/simpleDeposit.ts @@ -66,7 +66,7 @@ async function deposit(): Promise { ASSOCIATED_TOKEN_PROGRAM_ID ); - console.log("Depositing V3..."); + console.log("Depositing..."); console.table([ { property: "seed", value: seed.toString() }, { property: "recipient", value: recipient.toString() }, @@ -144,5 +144,5 @@ async function deposit(): Promise { console.log("Transaction signature:", tx); } -// Run the depositV3 function +// Run the deposit function deposit(); diff --git a/scripts/svm/simpleFakeRelayerRepayment.ts b/scripts/svm/simpleFakeRelayerRepayment.ts index c5d88d5fa..caa8b3a0c 100644 --- a/scripts/svm/simpleFakeRelayerRepayment.ts +++ b/scripts/svm/simpleFakeRelayerRepayment.ts @@ -76,7 +76,7 @@ async function testBundleLogic(): Promise { const tokenDecimals = (await getMint(provider.connection, inputToken, undefined, TOKEN_PROGRAM_ID)).decimals; - // Use program.methods.depositV3 to send tokens to the spoke. note this is NOT a valid deposit, we just want to + // Use program.methods.deposit to send tokens to the spoke. note this is NOT a valid deposit, we just want to // seed tokens into the spoke to test repayment. // Delegate state PDA to pull depositor tokens. diff --git a/scripts/svm/simpleFill.ts b/scripts/svm/simpleFill.ts index fb78ef98b..ac58c6b97 100644 --- a/scripts/svm/simpleFill.ts +++ b/scripts/svm/simpleFill.ts @@ -77,7 +77,7 @@ async function fillRelay(): Promise { // Define the signer (replace with your actual signer) const signer = (provider.wallet as anchor.Wallet).payer; - console.log("Filling V3 Relay..."); + console.log("Filling Relay..."); // Define the state account PDA const [statePda, _] = PublicKey.findProgramAddressSync( @@ -190,5 +190,5 @@ async function fillRelay(): Promise { console.log("Transaction signature:", tx); } -// Run the fillV3Relay function +// Run the fillRelay function fillRelay(); diff --git a/test/svm/SvmSpoke.Deposit.ts b/test/svm/SvmSpoke.Deposit.ts index d17ab1e5e..8b32dcfee 100644 --- a/test/svm/SvmSpoke.Deposit.ts +++ b/test/svm/SvmSpoke.Deposit.ts @@ -347,11 +347,11 @@ describe("svm_spoke.deposit", () => { } }); - it("depositV3Now behaves as deposit but forces the quote timestamp as expected", async () => { + it("depositNow behaves as deposit but forces the quote timestamp as expected", async () => { // Set up initial deposit data. Note that this method has a slightly different interface to deposit, using // fillDeadlineOffset rather than fillDeadline. current chain time is added to fillDeadlineOffset to set the // fillDeadline for the deposit. exclusivityPeriod operates the same as in standard deposit. - // Equally, depositV3Now does not have `quoteTimestamp`. this is set to the current time from the program. + // Equally, depositNow does not have `quoteTimestamp`. this is set to the current time from the program. const fillDeadlineOffset = 60; // 60 seconds offset const depositNowData = { @@ -531,7 +531,7 @@ describe("svm_spoke.deposit", () => { tokenProgram ); - // Create the transaction for unsafeDepositV3 + // Create the transaction for unsafeDeposit const unsafeDepositIx = await program.methods .unsafeDeposit( depositData.depositor!, diff --git a/test/svm/SvmSpoke.Fill.AcrossPlus.ts b/test/svm/SvmSpoke.Fill.AcrossPlus.ts index 68ee7c2c0..fc8657780 100644 --- a/test/svm/SvmSpoke.Fill.AcrossPlus.ts +++ b/test/svm/SvmSpoke.Fill.AcrossPlus.ts @@ -100,19 +100,17 @@ describe("svm_spoke.fill.across_plus", () => { ]; // Prepare fill instruction. - const fillV3RelayValues: FillDataValues = [relayHash, relayData, new BN(1), relayer.publicKey]; + const fillRelayValues: FillDataValues = [relayHash, relayData, new BN(1), relayer.publicKey]; if (bufferParams) { - await loadFillRelayParams(program, relayer, fillV3RelayValues[1], fillV3RelayValues[2], fillV3RelayValues[3]); + await loadFillRelayParams(program, relayer, fillRelayValues[1], fillRelayValues[2], fillRelayValues[3]); [accounts.instructionParams] = PublicKey.findProgramAddressSync( [Buffer.from("instruction_params"), relayer.publicKey.toBuffer()], program.programId ); } - const fillV3RelayParams: FillDataParams = bufferParams - ? [fillV3RelayValues[0], null, null, null] - : fillV3RelayValues; + const fillRelayParams: FillDataParams = bufferParams ? [fillRelayValues[0], null, null, null] : fillRelayValues; const fillIx = await program.methods - .fillRelay(...fillV3RelayParams) + .fillRelay(...fillRelayParams) .accounts(accounts) .remainingAccounts(remainingAccounts) .instruction(); diff --git a/test/svm/SvmSpoke.Fill.ts b/test/svm/SvmSpoke.Fill.ts index d34ea6a83..d9337f135 100644 --- a/test/svm/SvmSpoke.Fill.ts +++ b/test/svm/SvmSpoke.Fill.ts @@ -170,7 +170,7 @@ describe("svm_spoke.fill", () => { updateRelayData(initialRelayData); }); - it("Fills a V3 relay and verifies balances", async () => { + it("Fills a relay and verifies balances", async () => { // Verify recipient's balance before the fill let recipientAccount = await getAccount(connection, recipientTA); assertSE(recipientAccount.amount, "0", "Recipient's balance should be 0 before the fill"); @@ -226,7 +226,7 @@ describe("svm_spoke.fill", () => { assertSE(event.relayer, otherRelayer.publicKey, "Repayment address should match"); }); - it("Fails to fill a V3 relay after the fill deadline", async () => { + it("Fails to fill a relay after the fill deadline", async () => { updateRelayData({ ...relayData, fillDeadline: Math.floor(Date.now() / 1000) - 69 }); // 69 seconds ago const relayHash = Array.from(calculateRelayHashUint8Array(relayData, chainId)); @@ -238,7 +238,7 @@ describe("svm_spoke.fill", () => { } }); - it("Fails to fill a V3 relay by non-exclusive relayer before exclusivity deadline", async () => { + it("Fails to fill a relay by non-exclusive relayer before exclusivity deadline", async () => { accounts.signer = otherRelayer.publicKey; accounts.relayerTokenAccount = otherRelayerTA; @@ -280,7 +280,7 @@ describe("svm_spoke.fill", () => { ); }); - it("Fails to fill a V3 relay with the same deposit data multiple times", async () => { + it("Fails to fill a relay with the same deposit data multiple times", async () => { const relayHash = Array.from(calculateRelayHashUint8Array(relayData, chainId)); // First fill attempt @@ -305,7 +305,7 @@ describe("svm_spoke.fill", () => { systemProgram: anchor.web3.SystemProgram.programId, }; - // Execute the fill_v3_relay call + // Execute the fill_relay call await approvedFillRelay([relayHash, relayData, new BN(1), relayer.publicKey]); // Verify the fill PDA exists before closing @@ -335,20 +335,20 @@ describe("svm_spoke.fill", () => { assert.isNull(fillStatusAccountAfter, "Fill PDA should be closed after closing"); }); - it("Fetches FillStatusAccount before and after fillV3Relay", async () => { + it("Fetches FillStatusAccount before and after fillRelay", async () => { const relayHash = calculateRelayHashUint8Array(relayData, chainId); const [fillStatusPDA] = PublicKey.findProgramAddressSync([Buffer.from("fills"), relayHash], program.programId); - // Fetch FillStatusAccount before fillV3Relay + // Fetch FillStatusAccount before fillRelay let fillStatusAccount = await program.account.fillStatusAccount.fetchNullable(fillStatusPDA); - assert.isNull(fillStatusAccount, "FillStatusAccount should be uninitialized before fillV3Relay"); + assert.isNull(fillStatusAccount, "FillStatusAccount should be uninitialized before fillRelay"); // Fill the relay await approvedFillRelay([Array.from(relayHash), relayData, new BN(1), relayer.publicKey]); - // Fetch FillStatusAccount after fillV3Relay + // Fetch FillStatusAccount after fillRelay fillStatusAccount = await program.account.fillStatusAccount.fetch(fillStatusPDA); - assert.isNotNull(fillStatusAccount, "FillStatusAccount should be initialized after fillV3Relay"); + assert.isNotNull(fillStatusAccount, "FillStatusAccount should be initialized after fillRelay"); assert.equal(JSON.stringify(fillStatusAccount.status), `{\"filled\":{}}`, "FillStatus should be Filled"); assert.equal(fillStatusAccount.relayer.toString(), relayer.publicKey.toString(), "Caller should be set as relayer"); }); @@ -413,7 +413,7 @@ describe("svm_spoke.fill", () => { } }); - it("Fills a V3 relay from custom relayer token account", async () => { + it("Fills a relay from custom relayer token account", async () => { // Create and mint to custom relayer token account const customKeypair = Keypair.generate(); const customRelayerTA = await createAccount(connection, payer, mint, relayer.publicKey, customKeypair); diff --git a/test/svm/SvmSpoke.SlowFill.AcrossPlus.ts b/test/svm/SvmSpoke.SlowFill.AcrossPlus.ts index d933f6b41..1f036e6f3 100644 --- a/test/svm/SvmSpoke.SlowFill.AcrossPlus.ts +++ b/test/svm/SvmSpoke.SlowFill.AcrossPlus.ts @@ -145,11 +145,11 @@ describe("svm_spoke.slow_fill.across_plus", () => { program.programId ); } - const requestV3SlowFillParams: RequestSlowFillDataParams = bufferParams + const requestSlowFillParams: RequestSlowFillDataParams = bufferParams ? [requestSlowFillValues[0], null] : requestSlowFillValues; const requestIx = await program.methods - .requestSlowFill(...requestV3SlowFillParams) + .requestSlowFill(...requestSlowFillParams) .accounts(requestAccounts) .instruction(); diff --git a/test/svm/SvmSpoke.SlowFill.ts b/test/svm/SvmSpoke.SlowFill.ts index ab78cb8a9..dd78a6800 100644 --- a/test/svm/SvmSpoke.SlowFill.ts +++ b/test/svm/SvmSpoke.SlowFill.ts @@ -196,7 +196,7 @@ describe("svm_spoke.slow_fill", () => { await updateRelayData(initialRelayData); }); - it("Requests a V3 slow fill, verify the event & state change", async () => { + it("Requests a slow fill, verify the event & state change", async () => { // Attempt to request a slow fill before the exclusivityDeadline const relayHash = Array.from(calculateRelayHashUint8Array(relayData, chainId)); @@ -231,7 +231,7 @@ describe("svm_spoke.slow_fill", () => { }); }); - it("Fails to request a V3 slow fill if the relay has already been filled", async () => { + it("Fails to request a slow fill if the relay has already been filled", async () => { const relayHashUint8Array = calculateRelayHashUint8Array(relayData, chainId); const relayHash = Array.from(relayHashUint8Array); @@ -300,7 +300,7 @@ describe("svm_spoke.slow_fill", () => { assert.equal(fillStatusAccount.relayer.toString(), relayer.publicKey.toString(), "Caller should be set as relayer"); }); - it("Fails to request a V3 slow fill multiple times for the same fill", async () => { + it("Fails to request a slow fill multiple times for the same fill", async () => { const relayHash = calculateRelayHashUint8Array(relayData, chainId); // Set the contract time to be after the exclusivityDeadline @@ -326,14 +326,14 @@ describe("svm_spoke.slow_fill", () => { } }); - it("Executes V3 slow relay leaf, verify the event & state change", async () => { + it("Executes slow relay leaf, verify the event & state change", async () => { // Relay root bundle with slow fill leaf. const { relayHash, leaf, rootBundleId, proofAsNumbers, rootBundle } = await relaySlowFillRootBundle(); const iVaultBal = (await connection.getTokenAccountBalance(vault)).value.amount; const iRecipientBal = (await connection.getTokenAccountBalance(recipientTA)).value.amount; - // Attempt to execute V3 slow relay leaf before requesting slow fill. This should fail before requested, + // Attempt to execute slow relay leaf before requesting slow fill. This should fail before requested, // even if there is a valid proof. const executeSlowRelayLeafAccounts = { state: state, @@ -358,14 +358,14 @@ describe("svm_spoke.slow_fill", () => { assert.include(err.toString(), "AccountNotInitialized", "Expected AccountNotInitialized error"); } - // Request V3 slow fill + // Request slow fill await program.methods .requestSlowFill(Array.from(relayHash), leaf.relayData) .accounts(requestAccounts) .signers([relayer]) .rpc(); - // Execute V3 slow relay leaf after requesting slow fill + // Execute slow relay leaf after requesting slow fill const ix = await program.methods .executeSlowRelayLeaf(Array.from(relayHash), leaf, rootBundleId, proofAsNumbers) .accounts(executeSlowRelayLeafAccounts) @@ -418,7 +418,7 @@ describe("svm_spoke.slow_fill", () => { assertSE(event.relayer, PublicKey.default, "Repayment address should be 0"); }); - it("Fails to request a V3 slow fill when fills are paused", async () => { + it("Fails to request a slow fill when fills are paused", async () => { // Pause fills const pauseFillsAccounts = { state: state, @@ -444,8 +444,8 @@ describe("svm_spoke.slow_fill", () => { } }); - it("Fails to execute V3 slow relay leaf to wrong recipient", async () => { - // Request V3 slow fill. + it("Fails to execute slow relay leaf to wrong recipient", async () => { + // Request slow fill. const { relayHash, leaf, rootBundleId, proofAsNumbers, rootBundle } = await relaySlowFillRootBundle(); await program.methods .requestSlowFill(Array.from(relayHash), leaf.relayData) @@ -453,7 +453,7 @@ describe("svm_spoke.slow_fill", () => { .signers([relayer]) .rpc(); - // Try to execute V3 slow relay leaf with wrong recipient token account should fail. + // Try to execute slow relay leaf with wrong recipient token account should fail. const wrongRecipient = Keypair.generate().publicKey; const wrongRecipientTA = (await getOrCreateAssociatedTokenAccount(connection, payer, mint, wrongRecipient)).address; try { @@ -481,8 +481,8 @@ describe("svm_spoke.slow_fill", () => { } }); - it("Cannot replay execute V3 slow relay leaf against wrong fill status account", async () => { - // Request V3 slow fill for the first recipient. + it("Cannot replay execute slow relay leaf against wrong fill status account", async () => { + // Request slow fill for the first recipient. const firstRecipient = Keypair.generate().publicKey; const { relayHash: firstRelayHash, @@ -499,7 +499,7 @@ describe("svm_spoke.slow_fill", () => { const firstRecipientTA = recipientTA; // Global recipientTA will get updated when passing the second relayData. const firstFillStatus = fillStatus; // Global fillStatus will get updated when passing the second relayData. - // Request V3 slow fill for the second recipient. + // Request slow fill for the second recipient. // Note: we could also had generated single slow relay root for both recipients, but having them relayed in separate // root bundles makes it easier to reuse existing test code. const secondRecipient = Keypair.generate().publicKey; @@ -512,7 +512,7 @@ describe("svm_spoke.slow_fill", () => { const secondFillStatus = fillStatus; // Global fillStatus got updated with the second relayData. const iFirstRecipientBal = (await connection.getTokenAccountBalance(firstRecipientTA)).value.amount; - // Execute V3 slow relay leaf for the first recipient. + // Execute slow relay leaf for the first recipient. const executeSlowRelayLeafAccounts = { state, rootBundle: firstRootBundle, @@ -537,7 +537,7 @@ describe("svm_spoke.slow_fill", () => { "First recipient balance should be increased by its relay amount" ); - // Try to replay execute V3 slow relay leaf for the first recipient using the fill status account that is derived + // Try to replay execute slow relay leaf for the first recipient using the fill status account that is derived // from the second relay hash. This should fail due to mismatching relay hash. try { const executeSlowRelayLeafAccounts = { @@ -564,8 +564,8 @@ describe("svm_spoke.slow_fill", () => { } }); - it("Fails to execute V3 slow relay leaf for mint inconsistent output_token", async () => { - // Request V3 slow fill. + it("Fails to execute slow relay leaf for mint inconsistent output_token", async () => { + // Request slow fill. const { relayHash, leaf, rootBundleId, proofAsNumbers, rootBundle } = await relaySlowFillRootBundle(); await program.methods .requestSlowFill(Array.from(relayHash), leaf.relayData) @@ -579,7 +579,7 @@ describe("svm_spoke.slow_fill", () => { const wrongVault = (await getOrCreateAssociatedTokenAccount(connection, payer, wrongMint, state, true)).address; await mintTo(connection, payer, wrongMint, wrongVault, provider.publicKey, initialMintAmount); - // Try to execute V3 slow relay leaf with inconsistent mint should fail. + // Try to execute slow relay leaf with inconsistent mint should fail. try { const executeSlowRelayLeafAccounts = { state, @@ -605,8 +605,8 @@ describe("svm_spoke.slow_fill", () => { } }); - it("Cannot execute V3 slow relay leaf targeted at another chain", async () => { - // Request V3 slow fill for another chain. + it("Cannot execute slow relay leaf targeted at another chain", async () => { + // Request slow fill for another chain. const anotherChainId = new BN(Math.floor(Math.random() * 1000000)); const { relayHash, leaf, rootBundleId, proofAsNumbers, rootBundle } = await relaySlowFillRootBundle( undefined, @@ -618,7 +618,7 @@ describe("svm_spoke.slow_fill", () => { .signers([relayer]) .rpc(); - // Trying to execute V3 slow relay leaf for another chain should fail as the program overrides chain_id that should + // Trying to execute slow relay leaf for another chain should fail as the program overrides chain_id that should // invalidate the proofs. try { const executeSlowRelayLeafAccounts = { @@ -653,14 +653,14 @@ describe("svm_spoke.slow_fill", () => { Buffer.alloc(0) ); - // Request V3 slow fill + // Request slow fill const tx1 = await program.methods .requestSlowFill(Array.from(relayHash), leaf.relayData) .accounts(requestAccounts) .signers([relayer]) .rpc(); - // Execute V3 slow relay leaf after requesting slow fill + // Execute slow relay leaf after requesting slow fill const executeSlowRelayLeafAccounts = { state, rootBundle,