From 55ece0d8a83ec666e42f0765b5689c2fa750f2e8 Mon Sep 17 00:00:00 2001 From: sashaodessa <140454972+sashaodessa@users.noreply.github.com> Date: Sat, 4 Oct 2025 17:14:26 +0200 Subject: [PATCH 1/3] Update SpokePool.Fixture.ts --- test/evm/hardhat/fixtures/SpokePool.Fixture.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/evm/hardhat/fixtures/SpokePool.Fixture.ts b/test/evm/hardhat/fixtures/SpokePool.Fixture.ts index ecddd83a0..2f89afba9 100644 --- a/test/evm/hardhat/fixtures/SpokePool.Fixture.ts +++ b/test/evm/hardhat/fixtures/SpokePool.Fixture.ts @@ -176,20 +176,6 @@ export function getV3RelayHash(relayData: V3RelayData, destinationChainId: numbe ); } -// @todo we likely don't need to keep this function around for too long but its useful for making sure that the new relay hash is identical to the -// legacy one. -export function getLegacyV3RelayHash(relayData: V3RelayData, destinationChainId: number): string { - return ethers.utils.keccak256( - defaultAbiCoder.encode( - [ - "tuple(address depositor, address recipient, address exclusiveRelayer, address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 originChainId, uint32 depositId, uint32 fillDeadline, uint32 exclusivityDeadline, bytes message)", - "uint256 destinationChainId", - ], - [relayData, destinationChainId] - ) - ); -} - export function getDepositParams(args: { recipient?: string; originToken: string; From 3afbb35ef3323c5517a67bc6645fbeb0c6160f7f Mon Sep 17 00:00:00 2001 From: sashaodessa <140454972+sashaodessa@users.noreply.github.com> Date: Sat, 4 Oct 2025 17:15:29 +0200 Subject: [PATCH 2/3] Update SpokePool.Relay.ts --- test/evm/hardhat/SpokePool.Relay.ts | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/test/evm/hardhat/SpokePool.Relay.ts b/test/evm/hardhat/SpokePool.Relay.ts index a414621cd..c3c0c487f 100644 --- a/test/evm/hardhat/SpokePool.Relay.ts +++ b/test/evm/hardhat/SpokePool.Relay.ts @@ -22,7 +22,6 @@ import { FillType, getUpdatedV3DepositSignature, getV3RelayHash, - getLegacyV3RelayHash, } from "./fixtures/SpokePool.Fixture"; import { repaymentChainId, @@ -91,32 +90,6 @@ describe("SpokePool Relayer Logic", async function () { const relayExecution = await getRelayExecutionParams(relayData, destinationChainId); expect(await spokePool.fillStatuses(relayExecution.relayHash)).to.equal(FillStatus.Unfilled); }); - // @todo we can remove this after the new spoke pool is upgraded - it("relay hash is same pre and post address -> bytes32 upgrade", async function () { - const newBytes32Keys = ["depositor", "recipient", "exclusiveRelayer", "inputToken", "outputToken"]; - const relayDataCopy = { ...relayData, message: randomBytes32() }; - const legacyRelayData = { - ...relayDataCopy, - depositor: bytes32ToAddress(relayData.depositor), - recipient: bytes32ToAddress(relayData.recipient), - exclusiveRelayer: bytes32ToAddress(relayData.exclusiveRelayer), - inputToken: bytes32ToAddress(relayData.inputToken), - outputToken: bytes32ToAddress(relayData.outputToken), - }; - expect( - newBytes32Keys.every( - (key) => ethers.utils.hexDataLength(legacyRelayData[key as keyof typeof legacyRelayData] as string) === 20 - ) - ).to.be.true; - expect( - newBytes32Keys.every( - (key) => ethers.utils.hexDataLength(relayDataCopy[key as keyof typeof relayDataCopy] as string) === 32 - ) - ).to.be.true; - const newRelayHash = getV3RelayHash(relayDataCopy, destinationChainId); - const oldRelayHash = getLegacyV3RelayHash(legacyRelayData, destinationChainId); - expect(newRelayHash).to.equal(oldRelayHash); - }); it("expired fill deadline reverts", async function () { const _relay = { ...relayData, From d3bb0dde1bde3ba313f1d855db4ee3440d599b97 Mon Sep 17 00:00:00 2001 From: sashaodessa <140454972+sashaodessa@users.noreply.github.com> Date: Sat, 4 Oct 2025 17:16:01 +0200 Subject: [PATCH 3/3] Update MerkleLib.Proofs.ts --- test/evm/hardhat/MerkleLib.Proofs.ts | 60 ---------------------------- 1 file changed, 60 deletions(-) diff --git a/test/evm/hardhat/MerkleLib.Proofs.ts b/test/evm/hardhat/MerkleLib.Proofs.ts index 4d3c4493d..35e6e9c26 100644 --- a/test/evm/hardhat/MerkleLib.Proofs.ts +++ b/test/evm/hardhat/MerkleLib.Proofs.ts @@ -12,7 +12,6 @@ import { BigNumber, ethers, randomBytes32, - bytes32ToAddress, addressToBytes, } from "../../../utils/utils"; import { V3RelayData, V3SlowFill } from "../../../test-utils"; @@ -152,63 +151,4 @@ describe("MerkleLib Proofs", async function () { expect(() => merkleTree.getHexProof(invalidLeaf)).to.throw(); expect(await merkleLibTest.verifyV3SlowRelayFulfillment(root, invalidLeaf, proof)).to.equal(false); }); - // @todo we can remove this after the new spoke pool is upgraded - it("Legacy V3SlowFill produces the same MerkleLeaf", async function () { - const chainId = randomBigNumber(2).toNumber(); - const relayData: V3RelayData = { - depositor: addressToBytes(randomAddress()), - recipient: addressToBytes(randomAddress()), - exclusiveRelayer: addressToBytes(randomAddress()), - inputToken: addressToBytes(randomAddress()), - outputToken: addressToBytes(randomAddress()), - inputAmount: randomBigNumber(), - outputAmount: randomBigNumber(), - originChainId: randomBigNumber(2).toNumber(), - depositId: randomBigNumber(2), - fillDeadline: randomBigNumber(2).toNumber(), - exclusivityDeadline: randomBigNumber(2).toNumber(), - message: ethers.utils.hexlify(ethers.utils.randomBytes(1024)), - }; - const slowLeaf: V3SlowFill = { - relayData, - chainId, - updatedOutputAmount: relayData.outputAmount, - }; - const legacyRelayData: V3RelayData = { - ...relayData, - depositor: bytes32ToAddress(relayData.depositor), - recipient: bytes32ToAddress(relayData.recipient), - exclusiveRelayer: bytes32ToAddress(relayData.exclusiveRelayer), - inputToken: bytes32ToAddress(relayData.inputToken), - outputToken: bytes32ToAddress(relayData.outputToken), - }; - const legacySlowLeaf: V3SlowFill = { - relayData: legacyRelayData, - chainId: slowLeaf.chainId, - updatedOutputAmount: slowLeaf.updatedOutputAmount, - }; - - const paramType = await getParamType("MerkleLibTest", "verifyV3SlowRelayFulfillment", "slowFill"); - const hashFn = (input: V3SlowFill) => keccak256(defaultAbiCoder.encode([paramType!], [input])); - const merkleTree = new MerkleTree([slowLeaf], hashFn); - const root = merkleTree.getHexRoot(); - - const legacyHashFn = (input: V3SlowFill) => - keccak256( - defaultAbiCoder.encode( - [ - "tuple(" + - "tuple(address depositor, address recipient, address exclusiveRelayer, address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 originChainId, uint32 depositId, uint32 fillDeadline, uint32 exclusivityDeadline, bytes message) relayData," + - "uint256 chainId," + - "uint256 updatedOutputAmount" + - ")", - ], - [input] - ) - ); - const merkleTreeLegacy = new MerkleTree([legacySlowLeaf], legacyHashFn); - const legacyRoot = merkleTreeLegacy.getHexRoot(); - - expect(legacyRoot).to.equal(root); - }); });