Skip to content

Commit c502b7c

Browse files
committed
Add comments about the sourceManagerAddress being the current peer and not necessarily the original sender.
1 parent d5031a7 commit c502b7c

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

evm/src/NttManager/NttManager.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ contract NttManager is INttManager, RateLimiter, ManagerBase {
274274
/// @dev Override this function to process an additional payload on the NativeTokenTransfer
275275
/// For integrator flexibility, this function is *not* marked pure or view
276276
/// @param - The Wormhole chain id of the sender
277-
/// @param - The address of the sender's NTT Manager contract.
277+
/// @param - The address verified to equal the peer currently registered for the source chain —
278+
/// not necessarily the manager that originally sent the message, since the peer may have
279+
/// been changed while the message was in flight. Integrators must not treat this as the
280+
/// authenticated original sender.
278281
/// @param - The message id from the NttManagerMessage.
279282
/// @param - The original message sender address from the NttManagerMessage.
280283
/// @param - The parsed NativeTokenTransfer, which includes the additionalPayload field

evm/src/interfaces/INttManager.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,13 @@ interface INttManager is IManagerBase {
217217
/// the command in the message. This function will decode the payload
218218
/// as an NttManagerMessage to extract the sequence, msgType, and other parameters.
219219
/// @dev This function is exposed as a fallback for when an `Transceiver` is deregistered
220-
/// when a message is in flight.
220+
/// when a message is in flight. It verifies that `sourceNttManagerAddress` matches the
221+
/// peer currently registered for `sourceChainId` and reverts with `InvalidPeer` otherwise;
222+
/// note this is the *current* peer, which may differ from the manager that originally
223+
/// emitted the message if the peer has since been changed.
221224
/// @param sourceChainId The Wormhole chain id of the sender.
222-
/// @param sourceNttManagerAddress The address of the sender's nttManager contract.
225+
/// @param sourceNttManagerAddress The address expected to equal the peer currently registered
226+
/// for `sourceChainId` — not necessarily the manager that originally sent the message.
223227
/// @param message The message to execute.
224228
function executeMsg(
225229
uint16 sourceChainId,

0 commit comments

Comments
 (0)