This commit is contained in:
derpy-duck 2023-03-02 21:51:21 +00:00
parent f0cb171533
commit 54244cc95c
1 changed files with 14 additions and 12 deletions

View File

@ -292,9 +292,8 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
// - the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction // - the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction
valid = checkRedeliveryInstructionTarget(redeliveryInstruction, originalInstruction); valid = checkRedeliveryInstructionTarget(redeliveryInstruction, originalInstruction);
// Emit an 'Invalid Redelivery' event if one of the following five checks failed: // Emit an 'Invalid Redelivery' event if one of the following four checks failed:
// - msg.sender is the permissioned address allowed to execute this redelivery instruction // - the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction
// - the redelivery instruction's target chain = this chain
// - the original instruction's target chain = this chain // - the original instruction's target chain = this chain
// - the new redelivery instruction's 'receiver value' amount >= the original instruction's 'receiver value' amount // - the new redelivery instruction's 'receiver value' amount >= the original instruction's 'receiver value' amount
// - the new redelivery instruction's upper bound on gas >= the original instruction's upper bound on gas // - the new redelivery instruction's upper bound on gas >= the original instruction's upper bound on gas
@ -345,9 +344,16 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
) internal view returns (bool isValid) { ) internal view returns (bool isValid) {
address providerAddress = fromWormholeFormat(redeliveryInstruction.executionParameters.providerDeliveryAddress); address providerAddress = fromWormholeFormat(redeliveryInstruction.executionParameters.providerDeliveryAddress);
// Check that the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction // Check that msg.sender is the permissioned address allowed to execute this redelivery instruction
if ((providerAddress != fromWormholeFormat(originalInstruction.executionParameters.providerDeliveryAddress))) { if (providerAddress != msg.sender) {
revert IDelivery.MismatchingRelayProvidersInRedelivery(); revert IDelivery.UnexpectedRelayer();
}
uint16 whChainId = chainId();
// Check that the redelivery instruction's target chain = this chain
if (whChainId != redeliveryInstruction.targetChain) {
revert IDelivery.TargetChainIsNotThisChain(redeliveryInstruction.targetChain);
} }
uint256 wormholeMessageFee = wormhole().messageFee(); uint256 wormholeMessageFee = wormhole().messageFee();
@ -361,12 +367,8 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
revert IDelivery.InsufficientRelayerFunds(); revert IDelivery.InsufficientRelayerFunds();
} }
uint16 whChainId = chainId(); // Check that the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction
isValid = (providerAddress == fromWormholeFormat(originalInstruction.executionParameters.providerDeliveryAddress))
// Check that msg.sender is the permissioned address allowed to execute this redelivery instruction
isValid = msg.sender == providerAddress
// Check that the redelivery instruction's target chain = this chain
&& whChainId == redeliveryInstruction.targetChain
// Check that the original instruction's target chain = this chain // Check that the original instruction's target chain = this chain
&& whChainId == originalInstruction.targetChain && whChainId == originalInstruction.targetChain
// Check that the new redelivery instruction's 'receiver value' amount >= the original instruction's 'receiver value' amount // Check that the new redelivery instruction's 'receiver value' amount >= the original instruction's 'receiver value' amount