Description:
Currently, every message settlement verifies whether msg.sender is the owner or a relayer by looping through the relays array. This increases gas costs, especially when there are many relayers.
To optimize this, introduce a mapping(address => bool) isRelayer and use it for checks instead. This will eliminate the need for iteration and reduce gas consumption.