incorrect bridge estimations fix
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
87ebb9beff
commit
056177c34b
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ghost-dao-interface",
|
||||
"private": true,
|
||||
"version": "0.5.5",
|
||||
"version": "0.5.7",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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."
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user