Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump to 4.7.8 - fix: return a new tenderly simulation status in case of tenderly downtime #759

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/providers/simulation-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export enum SimulationStatus {
Succeeded = 2,
InsufficientBalance = 3,
NotApproved = 4,
SystemDown = 5,
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/providers/tenderly-simulation-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class FallbackTenderlySimulator extends Simulator {
MetricLoggerUnit.Count
);
}
return { ...swapRoute, simulationStatus: SimulationStatus.Failed };
return { ...swapRoute, simulationStatus: SimulationStatus.SystemDown };
}
}
}
Expand Down Expand Up @@ -440,6 +440,12 @@ export class TenderlySimulator extends Simulator {
1,
MetricLoggerUnit.Count
);
// technically, we can also early return SimulationStatus.SystemDown when http status is not 200.
// in reality, when tenderly is down for whatever reason, i see it always throw during axios http request
// so that it hits the catch block in https://github.com/Uniswap/smart-order-router/blob/8bfec299001d3204483f761f57a38be04512a948/src/providers/tenderly-simulation-provider.ts#L226
// which is where we want to actually return SimulationStatus.SystemDown
// in other words, I've never see a TenderlySimulationUniversalRouterResponseStatus metric with a non-200 status
// if there's downtime, it won't log metric at https://github.com/Uniswap/smart-order-router/blob/8bfec299001d3204483f761f57a38be04512a948/src/providers/tenderly-simulation-provider.ts#L434

// Validate tenderly response body
if (
Expand Down
Loading