Skip to content

Commit 2d625fe

Browse files
authored
remove legacy relayer code (#897)
1 parent 1a7b853 commit 2d625fe

45 files changed

Lines changed: 26 additions & 7269 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cli/src/commands/manual.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -488,24 +488,12 @@ export function createManualCommand(
488488
vaa = deserialize("Ntt:WormholeTransfer", vaaBytes);
489489
} catch (e) {
490490
console.error(
491-
colors.yellow(
492-
"Failed to deserialize as Ntt:WormholeTransfer, trying Ntt:WormholeTransferStandardRelayer..."
491+
colors.red(
492+
"Failed to deserialize VAA as any known NTT transfer type."
493493
)
494494
);
495-
try {
496-
vaa = deserialize(
497-
"Ntt:WormholeTransferStandardRelayer",
498-
vaaBytes
499-
);
500-
} catch (e2) {
501-
console.error(
502-
colors.red(
503-
"Failed to deserialize VAA as any known NTT transfer type."
504-
)
505-
);
506-
if (e2 instanceof Error) console.error(e2.message);
507-
process.exit(1);
508-
}
495+
if (e instanceof Error) console.error(e.message);
496+
process.exit(1);
509497
}
510498

511499
console.log(colors.blue("📨 Manual Redeem Operation"));

evm/cfg/WormholeNttConfig.json.sample

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"decimals":,
66
"inboundLimit":,
77
"isEvmChain": true,
8-
"isWormholeRelayingEnabled": true,
9-
"isSpecialRelayingEnabled": false,
108
"nttManager": "0x00000000000000000000000000000000000000000000000000000000deadbeef",
119
"wormholeTransceiver": "0x00000000000000000000000000000000000000000000000000000000deadbeef"
1210
},
@@ -15,8 +13,6 @@
1513
"decimals":,
1614
"inboundLimit":,
1715
"isEvmChain": true,
18-
"isWormholeRelayingEnabled": true,
19-
"isSpecialRelayingEnabled": false,
2016
"nttManager": "0x00000000000000000000000000000000000000000000000000000000deadbeef",
2117
"wormholeTransceiver": "0x00000000000000000000000000000000000000000000000000000000deadbeef"
2218
}

evm/script/helpers/ParseNttConfig.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ contract ParseNttConfig is Script {
1717
uint8 decimals;
1818
uint256 inboundLimit;
1919
bool isEvmChain;
20-
bool isSpecialRelayingEnabled;
21-
bool isWormholeRelayingEnabled;
2220
bytes32 nttManager;
2321
bytes32 wormholeTransceiver;
2422
}

evm/ts/src/ntt.ts

Lines changed: 3 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -165,54 +165,6 @@ export class EvmNttWormholeTranceiver<N extends Network, C extends EvmChains>
165165
"WormholeTransceiver.receiveMessage"
166166
);
167167
}
168-
169-
async isWormholeRelayingEnabled(destChain: Chain): Promise<boolean> {
170-
if (!("isWormholeRelayingEnabled" in this.transceiver)) return false;
171-
return await this.transceiver.isWormholeRelayingEnabled(
172-
toChainId(destChain)
173-
);
174-
}
175-
176-
async *setIsWormholeRelayingEnabled(destChain: Chain, enabled: boolean) {
177-
if (!("setIsWormholeRelayingEnabled" in this.transceiver)) {
178-
throw new Error(
179-
"setIsWormholeRelayingEnabled is not supported by this ABI version"
180-
);
181-
}
182-
const tx =
183-
await this.transceiver.setIsWormholeRelayingEnabled.populateTransaction(
184-
toChainId(destChain),
185-
enabled
186-
);
187-
yield this.manager.createUnsignedTx(
188-
tx,
189-
"WormholeTransceiver.setWormholeRelayingEnabled"
190-
);
191-
}
192-
193-
async isSpecialRelayingEnabled(destChain: Chain): Promise<boolean> {
194-
if (!("isSpecialRelayingEnabled" in this.transceiver)) return false;
195-
return await this.transceiver.isSpecialRelayingEnabled(
196-
toChainId(destChain)
197-
);
198-
}
199-
200-
async *setIsSpecialRelayingEnabled(destChain: Chain, enabled: boolean) {
201-
if (!("setIsSpecialRelayingEnabled" in this.transceiver)) {
202-
throw new Error(
203-
"setIsSpecialRelayingEnabled is not supported by this ABI version"
204-
);
205-
}
206-
const tx =
207-
await this.transceiver.setIsSpecialRelayingEnabled.populateTransaction(
208-
toChainId(destChain),
209-
enabled
210-
);
211-
yield this.manager.createUnsignedTx(
212-
tx,
213-
"WormholeTransceiver.setSpecialRelayingEnabled"
214-
);
215-
}
216168
}
217169

218170
export class EvmNtt<N extends Network, C extends EvmChains>
@@ -374,25 +326,8 @@ export class EvmNtt<N extends Network, C extends EvmChains>
374326
yield this.createUnsignedTx(tx, "Ntt.setThreshold");
375327
}
376328

377-
async isRelayingAvailable(destination: Chain): Promise<boolean> {
378-
const enabled = await Promise.all(
379-
this.xcvrs.map(async (x) => {
380-
const [wh, special] = await Promise.all([
381-
x.isWormholeRelayingEnabled(destination),
382-
x.isSpecialRelayingEnabled(destination),
383-
]);
384-
return wh || special;
385-
})
386-
);
387-
388-
return enabled.filter((x) => x).length > 0;
389-
}
390-
391329
async getIsExecuted(attestation: Ntt.Attestation): Promise<boolean> {
392-
const payload =
393-
attestation.payloadName === "WormholeTransfer"
394-
? attestation.payload
395-
: attestation.payload["payload"];
330+
const payload = attestation.payload;
396331
const isExecuted = await this.manager.isMessageExecuted(
397332
Ntt.messageDigest(attestation.emitterChain, payload["nttManagerPayload"])
398333
);
@@ -404,10 +339,7 @@ export class EvmNtt<N extends Network, C extends EvmChains>
404339
async getIsTransferInboundQueued(
405340
attestation: Ntt.Attestation
406341
): Promise<boolean> {
407-
const payload =
408-
attestation.payloadName === "WormholeTransfer"
409-
? attestation.payload
410-
: attestation.payload["payload"];
342+
const payload = attestation.payload;
411343
return (
412344
(await this.getInboundQueuedTransfer(
413345
attestation.emitterChain,
@@ -417,10 +349,7 @@ export class EvmNtt<N extends Network, C extends EvmChains>
417349
}
418350

419351
getIsApproved(attestation: Ntt.Attestation): Promise<boolean> {
420-
const payload =
421-
attestation.payloadName === "WormholeTransfer"
422-
? attestation.payload
423-
: attestation.payload["payload"];
352+
const payload = attestation.payload;
424353
return this.manager.isMessageApproved(
425354
Ntt.messageDigest(attestation.emitterChain, payload["nttManagerPayload"])
426355
);

sdk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ For an example of using the NTT Route, refer to the [route example](examples/src
3333
### Before (4.x)
3434

3535
```ts
36-
import { nttAutomaticRoute } from "@wormhole-foundation/sdk-route-ntt";
36+
import { nttManualRoute } from "@wormhole-foundation/sdk-route-ntt";
3737
// Protocols auto-registered by side-effect of importing the NTT platform packages
3838
```
3939

sdk/definitions/src/layouts/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
NamedPayloads,
33
RegisterPayloadTypes,
4-
deliveryInstructionLayout,
54
} from "@wormhole-foundation/sdk-definitions";
65
import { nttManagerMessageLayout } from "./manager.js";
76
import { transceiverInfo, transceiverRegistration } from "./transceiver.js";
@@ -19,14 +18,6 @@ export const nttNamedPayloads = [
1918
nttManagerMessageLayout(nativeTokenTransferLayout)
2019
),
2120
],
22-
[
23-
"WormholeTransferStandardRelayer",
24-
deliveryInstructionLayout(
25-
wormholeTransceiverMessageLayout(
26-
nttManagerMessageLayout(nativeTokenTransferLayout)
27-
)
28-
),
29-
],
3021
["TransceiverInfo", transceiverInfo],
3122
["TransceiverRegistration", transceiverRegistration],
3223
] as const satisfies NamedPayloads;

sdk/definitions/src/ntt.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export namespace Ntt {
4343
transceiver: {
4444
[type: string]: string;
4545
};
46-
quoter?: string;
4746
svmShims?: {
4847
postMessageShimOverride?: string;
4948
verifyVaaShimOverride?: string;
@@ -94,9 +93,7 @@ export namespace Ntt {
9493
// TODO: what are the set of attestation types for Ntt?
9594
// can we know this ahead of time or does it need to be
9695
// flexible enough for folks to add their own somehow?
97-
export type Attestation =
98-
| VAA<"Ntt:WormholeTransfer">
99-
| VAA<"Ntt:WormholeTransferStandardRelayer">;
96+
export type Attestation = VAA<"Ntt:WormholeTransfer">;
10097

10198
/**
10299
* InboundQueuedTransfer is a queued transfer from another chain
@@ -240,9 +237,6 @@ export interface Ntt<N extends Network, C extends Chain> {
240237
payer?: AccountAddress<C>
241238
): AsyncGenerator<UnsignedTransaction<N, C>>;
242239

243-
/** Check to see if relaying service is available for automatic transfers */
244-
isRelayingAvailable(destination: Chain): Promise<boolean>;
245-
246240
/**
247241
* quoteDeliveryPrice returns the price to deliver a message to a given chain
248242
* the price is quote in native gas
@@ -441,10 +435,7 @@ export interface NttTransceiver<
441435
}
442436

443437
export namespace WormholeNttTransceiver {
444-
const _payloads = [
445-
"WormholeTransfer",
446-
"WormholeTransferStandardRelayer",
447-
] as const;
438+
const _payloads = ["WormholeTransfer"] as const;
448439
export type PayloadNames = (typeof _payloads)[number];
449440
export type VAA<PayloadName extends PayloadNames = PayloadNames> =
450441
ProtocolVAA<Ntt.ProtocolName, PayloadName>;

sdk/examples/src/consts.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const JITO_NTT_CONTRACTS: NttContracts = {
1010
token: "E3W7KwMH8ptaitYyWtxmfBUpqcuf2XieaFtQSn1LVXsA",
1111
manager: "WZLm4bJU4BNVmzWEwEzGVMQ5XFUc4iBmMSLutFbr41f",
1212
transceiver: { wormhole: "WZLm4bJU4BNVmzWEwEzGVMQ5XFUc4iBmMSLutFbr41f" },
13-
quoter: "Nqd6XqA8LbsCuG8MLWWuP865NV6jR1MbXeKxD4HLKDJ",
1413
},
1514
ArbitrumSepolia: {
1615
token: "0x87579Dc40781e99b870DDce46e93bd58A0e58Ae5",
@@ -44,7 +43,6 @@ export const TEST_NTT_TOKENS: NttContracts = {
4443
token: "EetppHswYvV1jjRWoQKC1hejdeBDHR9NNzNtCyRQfrrQ",
4544
manager: "NTtAaoDJhkeHeaVUHnyhwbPNAN6WgBpHkHBTc6d7vLK",
4645
transceiver: { wormhole: "NTtAaoDJhkeHeaVUHnyhwbPNAN6WgBpHkHBTc6d7vLK" },
47-
quoter: "Nqd6XqA8LbsCuG8MLWWuP865NV6jR1MbXeKxD4HLKDJ",
4846
},
4947
};
5048

@@ -60,18 +58,17 @@ export const TEST_NTT_SPL22_TOKENS: NttContracts = {
6058
token: "BAn1Zcr48bmaK5SmzBDjoju6csFe8AT6bot4ACBJvVwU",
6159
manager: "NtTnpY76eiMYqYX9xkag2CSXk9cGi6hinMWbMLMDYUP",
6260
transceiver: { wormhole: "NtTnpY76eiMYqYX9xkag2CSXk9cGi6hinMWbMLMDYUP" },
63-
quoter: "Nqd6XqA8LbsCuG8MLWWuP865NV6jR1MbXeKxD4HLKDJ",
6461
},
6562
};
6663

6764
// Reformat NTT contracts to fit TokenConfig for Route
6865
function reformat(contracts: NttContracts) {
6966
return Object.entries(TEST_NTT_TOKENS).map(([chain, contracts]) => {
70-
const { token, manager, transceiver: xcvrs, quoter } = contracts!;
67+
const { token, manager, transceiver: xcvrs } = contracts!;
7168
const transceiver = Object.entries(xcvrs).map(([k, v]) => {
7269
return { type: k as NttRoute.TransceiverType, address: v };
7370
});
74-
return { chain: chain as Chain, token, manager, quoter, transceiver };
71+
return { chain: chain as Chain, token, manager, transceiver };
7572
});
7673
}
7774

sdk/examples/src/route.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ registerDefinitionsNtt();
1616
registerEvmNtt();
1717
registerSolanaNtt();
1818

19-
import {
20-
nttAutomaticRoute,
21-
nttManualRoute,
22-
} from "@wormhole-foundation/sdk-route-ntt";
19+
import { nttManualRoute } from "@wormhole-foundation/sdk-route-ntt";
2320
import { NttTokens } from "./consts.js";
2421
import { getSigner } from "./helpers.js";
2522

@@ -32,10 +29,7 @@ import { getSigner } from "./helpers.js";
3229
const srcSigner = await getSigner(src);
3330
const dstSigner = await getSigner(dst);
3431

35-
const resolver = wh.resolver([
36-
nttManualRoute({ tokens: NttTokens }),
37-
nttAutomaticRoute({ tokens: NttTokens }),
38-
]);
32+
const resolver = wh.resolver([nttManualRoute({ tokens: NttTokens })]);
3933

4034
const { chain, token } = NttTokens.Test[0]!;
4135
const sendToken = Wormhole.tokenId(chain, token);

sdk/route/__tests__/executorFee.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const nttConfig: NttExecutorRoute.Config["ntt"] = {
3535
address: "ExVbjD8inGXkt7Cx8jVr4GF175sQy1MeqgfaY53Ah8as",
3636
},
3737
],
38-
quoter: "Nqd6XqA8LbsCuG8MLWWuP865NV6jR1MbXeKxD4HLKDJ",
3938
},
4039
{
4140
chain: "Sepolia",

0 commit comments

Comments
 (0)