From a70817eb3a3ea708f0a3ab0fe01c88f469aee1a8 Mon Sep 17 00:00:00 2001 From: Matty Evans Date: Fri, 13 Feb 2026 08:40:10 +1000 Subject: [PATCH] feat(gas-profiler): show friendly syncing state when backend nodes are unavailable Replace generic error alerts with dedicated UI when the proxy returns 503 "currently syncing". Users now see an animated spinner and clear message instead of a raw error, reducing confusion during node sync. --- .../execution/gas-profiler/SimulatePage.tsx | 84 +++++++++++++++++-- 1 file changed, 75 insertions(+), 9 deletions(-) diff --git a/src/pages/ethereum/execution/gas-profiler/SimulatePage.tsx b/src/pages/ethereum/execution/gas-profiler/SimulatePage.tsx index ddf89a2a4..e0b008fbe 100644 --- a/src/pages/ethereum/execution/gas-profiler/SimulatePage.tsx +++ b/src/pages/ethereum/execution/gas-profiler/SimulatePage.tsx @@ -105,6 +105,19 @@ function getDeltaColor(percent: number): string { return 'text-muted'; } +/** Detect backend syncing errors (503 from the proxy). */ +function isSyncingError(error: unknown): boolean { + if (error instanceof Error) { + return error.message.includes('currently syncing'); + } + + if (typeof error === 'string') { + return error.includes('currently syncing'); + } + + return false; +} + function calculateAggregateStats(results: BlockSimulationResult[]): AggregateStats { const stats = results.reduce( (acc, result) => { @@ -824,14 +837,37 @@ export function SimulatePage(): JSX.Element { Loading gas parameters... )} - {defaultsError && ( - - )} + {defaultsError && + (isSyncingError(defaultsError) ? ( +
+
+
+ +
+
+

Backend nodes are syncing

+

+ The nodes serving this network are catching up with the chain. Check back shortly and try again. +

+
+
+
+
+ ) : ( + + ))} {gasWarning && modifiedCount === 0 && ( - + {isSyncingError(simState.error) ? ( + +
+
+
+
+ +
+
+
+

Backend Syncing

+

+ The simulation was interrupted because all backend nodes for this network are currently syncing with + the chain. + {simState.completedBlocks > 0 && + ` ${simState.completedBlocks} of ${simState.totalBlocks} blocks completed before the interruption.`}{' '} + Check back shortly and try again. +

+
+
+
+ + ) : ( + + )}
)}