From a2bca1782cc17805dd65671e3275b7946dfa4eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Fri, 17 Feb 2023 13:57:32 -0300 Subject: [PATCH] Optimize `appendDeliveryInstruction`. This simplification allows the compiler to emit less code. --- ethereum/contracts/coreRelayer/CoreRelayer.sol | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ethereum/contracts/coreRelayer/CoreRelayer.sol b/ethereum/contracts/coreRelayer/CoreRelayer.sol index fbad3c9..9815b89 100644 --- a/ethereum/contracts/coreRelayer/CoreRelayer.sol +++ b/ethereum/contracts/coreRelayer/CoreRelayer.sol @@ -942,14 +942,13 @@ contract CoreRelayer is CoreRelayerGovernance { view returns (bytes memory newEncoded) { - newEncoded = abi.encodePacked(encoded, request.targetChain, request.targetAddress, request.refundAddress); newEncoded = abi.encodePacked( - newEncoded, + encoded, + request.targetChain, + request.targetAddress, + request.refundAddress, calculateTargetDeliveryMaximumRefund(request.targetChain, request.maxTransactionFee, provider), - convertApplicationBudgetAmount(request.receiverValue, request.targetChain, provider) - ); - newEncoded = abi.encodePacked( - newEncoded, + convertApplicationBudgetAmount(request.receiverValue, request.targetChain, provider), uint8(1), //version for ExecutionParameters calculateTargetGasDeliveryAmount(request.targetChain, request.maxTransactionFee, provider), provider.getDeliveryAddress(request.targetChain)