@@ -28,9 +28,9 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
28
28
/// This is bytes4(keccak256("WormholeTransceiverInit"))
29
29
bytes4 constant WH_TRANSCEIVER_INIT_PREFIX = 0xc83e3d2e ;
30
30
31
- /// @dev Prefix for all Wormhole sibling registration payloads
32
- /// This is bytes4(keccak256("WormholeSiblingRegistration "))
33
- bytes4 constant WH_SIBLING_REGISTRATION_PREFIX = 0xd0d292f1 ;
31
+ /// @dev Prefix for all Wormhole peer registration payloads
32
+ /// This is bytes4(keccak256("WormholePeerRegistration "))
33
+ bytes4 constant WH_PEER_REGISTRATION_PREFIX = 0xd0d292f1 ;
34
34
35
35
IWormhole public immutable wormhole;
36
36
IWormholeRelayer public immutable wormholeRelayer;
@@ -46,8 +46,8 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
46
46
bytes32 private constant WORMHOLE_CONSUMED_VAAS_SLOT =
47
47
bytes32 (uint256 (keccak256 ("whTransceiver.consumedVAAs " )) - 1 );
48
48
49
- bytes32 private constant WORMHOLE_SIBLINGS_SLOT =
50
- bytes32 (uint256 (keccak256 ("whTransceiver.siblings " )) - 1 );
49
+ bytes32 private constant WORMHOLE_PEERS_SLOT =
50
+ bytes32 (uint256 (keccak256 ("whTransceiver.peers " )) - 1 );
51
51
52
52
bytes32 private constant WORMHOLE_RELAYING_ENABLED_CHAINS_SLOT =
53
53
bytes32 (uint256 (keccak256 ("whTransceiver.relayingEnabledChains " )) - 1 );
@@ -71,12 +71,12 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
71
71
}
72
72
}
73
73
74
- function _getWormholeSiblingsStorage ()
74
+ function _getWormholePeersStorage ()
75
75
internal
76
76
pure
77
77
returns (mapping (uint16 => bytes32 ) storage $)
78
78
{
79
- uint256 slot = uint256 (WORMHOLE_SIBLINGS_SLOT );
79
+ uint256 slot = uint256 (WORMHOLE_PEERS_SLOT );
80
80
assembly ("memory-safe" ) {
81
81
$.slot := slot
82
82
}
@@ -211,7 +211,7 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
211
211
if (! weIns.shouldSkipRelayerSend && _shouldRelayViaStandardRelaying (recipientChain)) {
212
212
wormholeRelayer.sendPayloadToEvm {value: deliveryPayment}(
213
213
recipientChain,
214
- fromWormholeFormat (getWormholeSibling (recipientChain)),
214
+ fromWormholeFormat (getWormholePeer (recipientChain)),
215
215
encodedTransceiverPayload,
216
216
0 ,
217
217
GAS_LIMIT
@@ -236,8 +236,8 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
236
236
uint16 sourceChain ,
237
237
bytes32 deliveryHash
238
238
) external payable onlyRelayer {
239
- if (getWormholeSibling (sourceChain) != sourceAddress) {
240
- revert InvalidWormholeSibling (sourceChain, sourceAddress);
239
+ if (getWormholePeer (sourceChain) != sourceAddress) {
240
+ revert InvalidWormholePeer (sourceChain, sourceAddress);
241
241
}
242
242
243
243
// VAA replay protection
@@ -301,9 +301,9 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
301
301
revert InvalidVaa (reason);
302
302
}
303
303
304
- // ensure that the message came from a registered sibling contract
304
+ // ensure that the message came from a registered peer contract
305
305
if (! _verifyBridgeVM (vm)) {
306
- revert InvalidWormholeSibling (vm.emitterChainId, vm.emitterAddress);
306
+ revert InvalidWormholePeer (vm.emitterChainId, vm.emitterAddress);
307
307
}
308
308
309
309
// save the VAA hash in storage to protect against replay attacks.
@@ -320,7 +320,7 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
320
320
321
321
function _verifyBridgeVM (IWormhole.VM memory vm ) internal view returns (bool ) {
322
322
checkFork (wormholeTransceiver_evmChainId);
323
- return getWormholeSibling (vm.emitterChainId) == vm.emitterAddress;
323
+ return getWormholePeer (vm.emitterChainId) == vm.emitterAddress;
324
324
}
325
325
326
326
function isVAAConsumed (bytes32 hash ) public view returns (bool ) {
@@ -333,49 +333,46 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
333
333
334
334
/// @notice Get the corresponding Transceiver contract on other chains that have been registered via governance.
335
335
/// This design should be extendable to other chains, so each Transceiver would be potentially concerned with Transceivers on multiple other chains
336
- /// Note that siblings are registered under wormhole chainID values
337
- function getWormholeSibling (uint16 chainId ) public view returns (bytes32 ) {
338
- return _getWormholeSiblingsStorage ()[chainId];
336
+ /// Note that peers are registered under wormhole chainID values
337
+ function getWormholePeer (uint16 chainId ) public view returns (bytes32 ) {
338
+ return _getWormholePeersStorage ()[chainId];
339
339
}
340
340
341
- function setWormholeSibling (
342
- uint16 siblingChainId ,
343
- bytes32 siblingContract
344
- ) external onlyOwner {
345
- _setWormholeSibling (siblingChainId, siblingContract);
341
+ function setWormholePeer (uint16 peerChainId , bytes32 peerContract ) external onlyOwner {
342
+ _setWormholePeer (peerChainId, peerContract);
346
343
}
347
344
348
- function _setWormholeSibling (uint16 chainId , bytes32 siblingContract ) internal {
345
+ function _setWormholePeer (uint16 chainId , bytes32 peerContract ) internal {
349
346
if (chainId == 0 ) {
350
347
revert InvalidWormholeChainIdZero ();
351
348
}
352
- if (siblingContract == bytes32 (0 )) {
353
- revert InvalidWormholeSiblingZeroAddress ();
349
+ if (peerContract == bytes32 (0 )) {
350
+ revert InvalidWormholePeerZeroAddress ();
354
351
}
355
352
356
- bytes32 oldSiblingContract = _getWormholeSiblingsStorage ()[chainId];
353
+ bytes32 oldPeerContract = _getWormholePeersStorage ()[chainId];
357
354
358
- // We don't want to allow updating a sibling since this adds complexity in the accountant
359
- // If the owner makes a mistake with sibling registration they should deploy a new Wormhole
355
+ // We don't want to allow updating a peer since this adds complexity in the accountant
356
+ // If the owner makes a mistake with peer registration they should deploy a new Wormhole
360
357
// transceiver and register this new transceiver with the NttManager
361
- if (oldSiblingContract != bytes32 (0 )) {
362
- revert SiblingAlreadySet (chainId, oldSiblingContract );
358
+ if (oldPeerContract != bytes32 (0 )) {
359
+ revert PeerAlreadySet (chainId, oldPeerContract );
363
360
}
364
361
365
- _getWormholeSiblingsStorage ()[chainId] = siblingContract ;
362
+ _getWormholePeersStorage ()[chainId] = peerContract ;
366
363
367
364
// Publish a message for this transceiver registration
368
365
TransceiverStructs.TransceiverRegistration memory registration = TransceiverStructs
369
366
.TransceiverRegistration ({
370
- transceiverIdentifier: WH_SIBLING_REGISTRATION_PREFIX ,
367
+ transceiverIdentifier: WH_PEER_REGISTRATION_PREFIX ,
371
368
transceiverChainId: chainId,
372
- transceiverAddress: siblingContract
369
+ transceiverAddress: peerContract
373
370
});
374
371
wormhole.publishMessage (
375
372
0 , TransceiverStructs.encodeTransceiverRegistration (registration), consistencyLevel
376
373
);
377
374
378
- emit SetWormholeSibling (chainId, siblingContract );
375
+ emit SetWormholePeer (chainId, peerContract );
379
376
}
380
377
381
378
function isWormholeRelayingEnabled (uint16 chainId ) public view returns (bool ) {
0 commit comments