fix(sdk): deprecate NttAutomaticRoute in favor of NttExecutorRoute#854
fix(sdk): deprecate NttAutomaticRoute in favor of NttExecutorRoute#854evgeniko wants to merge 2 commits into
Conversation
The EVM on-chain special/standard relayer pricing is no longer maintained since the relay logic was removed from WormholeTransceiver (36570ce). Older deployed transceivers still have stale pricing enabled, causing quoteDeliveryPrice with automatic: true to return inflated fees (e.g. 0.6 ETH for ETH→Solana). The executor route uses an off-chain quoting service and is the correct path for automatic EVM transfers. - Mark nttAutomaticRoute/NttAutomaticRoute as @deprecated - Add console.warn in EvmNtt.quoteDeliveryPrice when automatic: true - Update example to use nttExecutorRoute
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded a conditional runtime warning for automatic NTT quotes advising use of the executor route, updated example usage to use Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
evm/ts/src/ntt.ts (1)
527-534: Consider warning once to avoid noisy logs in quote loops.This warning is helpful, but repeated quote calls (e.g., UI refresh/polling) may flood console output. A one-time guard keeps the signal while reducing noise.
💡 Suggested diff
export class EvmNtt<N extends Network, C extends EvmChains> implements Ntt<N, C> { + private _hasWarnedAutomaticQuote = false; tokenAddress: string; readonly chainId: bigint; @@ async quoteDeliveryPrice( dstChain: Chain, options: Ntt.TransferOptions ): Promise<bigint> { - if (options.automatic) { + if (options.automatic && !this._hasWarnedAutomaticQuote) { + this._hasWarnedAutomaticQuote = true; console.warn( "EvmNtt.quoteDeliveryPrice with automatic: true queries on-chain " + "special/standard relayer pricing which is no longer maintained " + "and may return inflated fees. " + "For automatic EVM transfers, use nttExecutorRoute and obtain quotes via route.quote() instead." ); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@evm/ts/src/ntt.ts` around lines 527 - 534, The console.warn in EvmNtt.quoteDeliveryPrice is noisy during repeated quote calls; add a one-time guard (e.g., a module-scoped or static boolean like warnedAutomaticQuote) and only emit the warning the first time options.automatic is true, setting the flag after the first warn; update the check in quoteDeliveryPrice to reference that flag so subsequent calls are silent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@evm/ts/src/ntt.ts`:
- Around line 527-534: The console.warn in EvmNtt.quoteDeliveryPrice is noisy
during repeated quote calls; add a one-time guard (e.g., a module-scoped or
static boolean like warnedAutomaticQuote) and only emit the warning the first
time options.automatic is true, setting the flag after the first warn; update
the check in quoteDeliveryPrice to reference that flag so subsequent calls are
silent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c03be426-41cc-4b85-8119-c3fd328d43e5
📒 Files selected for processing (3)
evm/ts/src/ntt.tssdk/examples/src/route.tssdk/route/src/automatic.ts
| console.warn( | ||
| "EvmNtt.quoteDeliveryPrice with automatic: true queries on-chain " + | ||
| "special/standard relayer pricing which is no longer maintained " + | ||
| "and may return inflated fees. " + |
There was a problem hiding this comment.
Suggest adding "Any messages sent via the Standard Relayer will not be automatically delivered to the destination chain."
| * @deprecated Use {@link nttExecutorRoute} instead. | ||
| * When the source chain is EVM, this route relies on on-chain special/standard relayer pricing | ||
| * which is no longer maintained. Older EVM transceiver deployments may return stale or inflated | ||
| * delivery quotes. |
There was a problem hiding this comment.
Instead of "Older EVM transceiver deployments may return stale or inflated delivery quotes", let's say: "Messages sent via the Standard Relayer will not be automatically delivered to the destination chain past April 1st, 2026."
There was a problem hiding this comment.
Good call on adding the delivery deadline, I'll add it, but I would still keep the stale quotes note too since that's the main issue integrators have been hitting. An explanation for why the quote is very high is important here imo.
| * @deprecated Use {@link NttExecutorRoute} instead. | ||
| * When the source chain is EVM, this route relies on on-chain special/standard relayer pricing | ||
| * which is no longer maintained. Older EVM transceiver deployments may return stale or inflated | ||
| * delivery quotes. |
There was a problem hiding this comment.
Same comment as the above
Summary
nttAutomaticRoute/NttAutomaticRouteas@deprecatedwith pointer tonttExecutorRoute/NttExecutorRouteconsole.warninEvmNtt.quoteDeliveryPricewhenautomatic: trueis passedsdk/examples/src/route.tsto usenttExecutorRouteContext
The EVM on-chain special/standard relayer pricing was removed from
WormholeTransceiverin 36570ce ("SR removal and CCL"), but older deployed transceivers (v1.0.0/v1.1.0) still haveisSpecialRelayingEnabledactive with stale pricing. This causesquoteDeliveryPricewithautomatic: trueto return inflated fees (e.g. 0.6 ETH for an ETH→Solana transfer) via the unmaintained special relayer contract.The executor route (
NttExecutorRoute) replaced this path and quotes via an off-chain service, returning correct fees. The Solana automatic relay path (via the on-chain NttQuoter program) is unaffected and still valid.Summary by CodeRabbit