incorrect bridge estimations fix

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-02-10 20:35:12 +03:00
parent 87ebb9beff
commit 056177c34b
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
3 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.5.5",
"version": "0.5.7",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -252,10 +252,10 @@ const Bridge = ({ chainId, address, config, connect }) => {
if (commit.disabled || blockNumber < blocksInFourHours) {
continue;
}
certainty += (commit?.lastStoredBlock ?? 0n) - (blockNumber - blocksInFourHours);
certainty += (commit?.lastStoredBlock ?? 0n) + BigInt(finalityDelay) - (blockNumber - blocksInFourHours);
}
return Math.max(Number(certainty * 100n / (blocksInFourHours * BigInt(length))), 0);
}, [latestCommits, blockNumber]);
}, [latestCommits, blockNumber, finalityDelay]);
const timeToNextEpoch = useMemo(() => {
if (!currentSession || !genesisSlot || !currentSlot) {
@ -343,6 +343,7 @@ const Bridge = ({ chainId, address, config, connect }) => {
transactionEta={slowestEvmBlock ? Number(slowestEvmBlock) : undefined}
timeToNextEpoch={timeToNextEpoch ? Number(timeToNextEpoch) : undefined}
isSmallScreen={isSmallScreen}
maxDelay={14400 + finalityDelay * Number(networkAvgBlockSpeed(chainId))}
/>
</Paper>
</Grid>

View File

@ -12,6 +12,7 @@ export const BridgeHeader = ({
bridgeStability,
transactionEta,
timeToNextEpoch,
maxDelay,
isSmallScreen
}) => {
const theme = useTheme();
@ -92,7 +93,7 @@ export const BridgeHeader = ({
<Grid item xs={isSmallScreen ? 12 : 4}>
<Metric
isLoading={transactionEta === undefined}
metric={transactionEta > 14400 ? "∞" : formatTime(transactionEta)}
metric={transactionEta > maxDelay ? "∞" : formatTime(transactionEta)}
label="Max Bridge ETA"
tooltip="Maximum estimated time for finalizing bridge transactions based on the latest update."
/>