Add origin filter to relayer msg processor (#2301)

### Description

Ensures the relayer never attempts to process a message destined for
it's own origin domain.

### Related issues

- Fixes https://github.com/hyperlane-xyz/issues/issues/464

### Backward compatibility

Yes

### Testing

E2E tests
pull/2302/head agents-2023-05-26
Yorke Rhodes 2 years ago committed by GitHub
parent 90191d43d0
commit bb0d688311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      rust/agents/relayer/src/msg/processor.rs

@ -129,6 +129,13 @@ impl MessageProcessor {
return Ok(()); return Ok(());
} }
// Skip if the message is intended for this origin
if destination == self.domain().id() {
debug!(?msg, "Message destined for self, skipping");
self.message_nonce += 1;
return Ok(());
}
// Skip if the message is intended for a destination we do not service // Skip if the message is intended for a destination we do not service
if !self.send_channels.contains_key(&destination) { if !self.send_channels.contains_key(&destination) {
debug!(?msg, "Message destined for unknown domain, skipping"); debug!(?msg, "Message destined for unknown domain, skipping");

Loading…
Cancel
Save