Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/clients/ProfitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
Address,
SvmAddress,
toAddressType,
convertRelayDataParamsToBytes32,
PriceClient,
acrossApi,
coingecko,
Expand Down Expand Up @@ -257,7 +256,7 @@ export class ProfitClient {
message: "Failed to simulate fill for deposit.",
reason,
cause,
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
notificationPath: "across-warn",
});
return { nativeGasCost: uint256Max, tokenGasCost: uint256Max, gasPrice: uint256Max };
Expand Down Expand Up @@ -479,7 +478,7 @@ export class ProfitClient {
this.logger.debug({
at: "ProfitClient#getFillProfitability",
message: `${symbol} deposit to ${destinationChainId} #${depositId.toString()} with repayment on ${repaymentChainId} is ${profitable}`,
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
inputTokenPriceUsd: formatEther(fill.inputTokenPriceUsd),
inputTokenAmountUsd: formatEther(fill.inputAmountUsd),
outputTokenPriceUsd: formatEther(fill.inputTokenPriceUsd),
Expand Down Expand Up @@ -527,7 +526,7 @@ export class ProfitClient {
this.logger.debug({
at: "ProfitClient#isFillProfitable",
message: `Unable to determine fill profitability (${err}).`,
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
lpFeePct,
});
}
Expand All @@ -550,7 +549,7 @@ export class ProfitClient {
this.logger.debug({
at: "ProfitClient",
message: "Handling unprofitable fill",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
lpFeePct,
relayerFeePct,
gasCost,
Expand Down
3 changes: 1 addition & 2 deletions src/clients/TokenClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
SvmAddress,
SVMProvider,
EvmAddress,
convertRelayDataParamsToBytes32,
getSolanaTokenBalance,
} from "../utils";

Expand Down Expand Up @@ -104,7 +103,7 @@ export class TokenClient {
this.logger.debug({
at: "TokenBalanceClient",
message: "Handling token shortfall",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
unfilledAmount,
});
this.captureTokenShortfall(deposit.destinationChainId, deposit.outputToken, deposit.depositId, unfilledAmount);
Expand Down
38 changes: 15 additions & 23 deletions src/relayer/Relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
toAddressType,
EvmAddress,
CHAIN_IDs,
convertRelayDataParamsToBytes32,
chainIsSvm,
} from "../utils";
import { RelayerClients } from "./RelayerClientHelper";
Expand Down Expand Up @@ -237,7 +236,7 @@ export class Relayer {
message: "Skipping deposit that is not supported by this relayer version.",
latestVersionSupported: configStoreClient.configStoreVersion,
latestInConfigStore: configStoreClient.getConfigStoreVersionForTimestamp(),
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
});
return ignoreDeposit();
}
Expand All @@ -255,7 +254,7 @@ export class Relayer {
this.logger.debug({
at: "Relayer::filterDeposit",
message: "Skipping deposit from or to disabled chains.",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
enabledOriginChains: this.config.relayerOriginChains,
enabledDestinationChains: this.config.relayerDestinationChains,
});
Expand All @@ -272,7 +271,7 @@ export class Relayer {
this.logger.debug({
at: "Relayer::filterDeposit",
message: `Skipping ${srcChain} deposit due to invalid address.`,
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
});
return ignoreDeposit();
}
Expand All @@ -295,7 +294,7 @@ export class Relayer {
this.logger.debug({
at: "Relayer::filterDeposit",
message: "Skipping deposit for unwhitelisted token",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
l1Token: l1Token.toNative(),
});
return ignoreDeposit();
Expand Down Expand Up @@ -334,7 +333,7 @@ export class Relayer {
at: "Relayer::filterDeposit",
message: "Skipping fill for deposit with message",
depositUpdated: isDepositSpedUp(deposit),
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
});
return ignoreDeposit();
}
Expand All @@ -348,7 +347,7 @@ export class Relayer {
this.logger.error({
at: "Relayer::filterDeposit",
message: "👨‍👧‍👦 Skipping deposit with invalid fills from the same relayer",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
invalidFills,
destinationChainId,
});
Expand Down Expand Up @@ -1029,7 +1028,7 @@ export class Relayer {
this.logger.debug({
at: "Relayer::requestSlowFill",
message: "Prevent requesting slow fill request from chain that forces origin chain repayment or to lite chain.",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
});
return;
}
Expand All @@ -1040,7 +1039,7 @@ export class Relayer {
this.logger[this.config.sendingRelaysEnabled ? "warn" : "debug"]({
at: "Relayer::requestSlowFill",
message: "Suppressing slow fill request for deposit with message.",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
});
return;
}
Expand Down Expand Up @@ -1073,7 +1072,7 @@ export class Relayer {
chainId: destinationChainId,
contract: spokePoolClient.spokePool,
method: "requestSlowFill",
args: [convertRelayDataParamsToBytes32(deposit)],
args: [deposit],
message: "Requested slow fill for deposit.",
mrkdwn: formatSlowFillRequestMarkdown(),
});
Expand Down Expand Up @@ -1123,7 +1122,7 @@ export class Relayer {
this.logger.warn({
at: "Relayer::fillRelay",
message: "Suppressed fill for deposit that forces origin chain repayment but repaymentChainId != originChainId",
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
repaymentChainId,
});
return;
Expand All @@ -1132,30 +1131,23 @@ export class Relayer {
this.logger.debug({
at: "Relayer::fillRelay",
message: `Filling v3 deposit ${deposit.depositId.toString()} with repayment on ${repaymentChainId}.`,
deposit: convertRelayDataParamsToBytes32(deposit),
deposit,
repaymentChainId,
realizedLpFeePct,
});

const spokePoolClient = spokePoolClients[deposit.destinationChainId];
if (isEVMSpokePoolClient(spokePoolClient)) {
const repaymentAddress = this.getRelayerAddrOn(repaymentChainId).toBytes32();
const [method, messageModifier, args] = !isDepositSpedUp(deposit)
? [
"fillRelay",
"",
[
convertRelayDataParamsToBytes32(deposit),
repaymentChainId,
this.getRelayerAddrOn(repaymentChainId).toBytes32(),
],
]
? ["fillRelay", "", [deposit, repaymentChainId, repaymentAddress]]
: [
"fillRelayWithUpdatedDeposit",
" with updated parameters ",
[
convertRelayDataParamsToBytes32(deposit),
deposit,
repaymentChainId,
this.getRelayerAddrOn(repaymentChainId).toBytes32(),
repaymentAddress,
deposit.updatedOutputAmount,
deposit.updatedRecipient.toBytes32(),
deposit.updatedMessage,
Expand Down