reorg block fix (#2936)

This commit is contained in:
Igor Stuev
2025-08-12 14:54:58 +02:00
committed by GitHub
parent 7da857e291
commit 0a2c221686
5 changed files with 43 additions and 33 deletions
+4 -4
View File
@@ -23,15 +23,15 @@ export interface Block {
transactions_count: number;
internal_transactions_count: number;
miner: AddressParam;
size: number;
size?: number;
hash: string;
parent_hash: string;
difficulty: string;
total_difficulty: string | null;
difficulty?: string;
total_difficulty?: string | null;
gas_used: string | null;
gas_limit: string;
nonce: string;
base_fee_per_gas: string | null;
base_fee_per_gas?: string | null;
burnt_fees: string | null;
priority_fee: string | null;
extra_data: string | null;
+27 -19
View File
@@ -224,17 +224,21 @@ const BlockDetails = ({ query }: Props) => {
</>
) }
<DetailedInfo.ItemLabel
hint="Size of the block in bytes"
isLoading={ isPlaceholderData }
>
Size
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue>
<Skeleton loading={ isPlaceholderData }>
{ data.size.toLocaleString() }
</Skeleton>
</DetailedInfo.ItemValue>
{ data.size && (
<>
<DetailedInfo.ItemLabel
hint="Size of the block in bytes"
isLoading={ isPlaceholderData }
>
Size
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue>
<Skeleton loading={ isPlaceholderData }>
{ data.size.toLocaleString() }
</Skeleton>
</DetailedInfo.ItemValue>
</>
) }
<DetailedInfo.ItemLabel
hint="Date & time at which block was produced."
@@ -623,14 +627,18 @@ const BlockDetails = ({ query }: Props) => {
</>
) }
<DetailedInfo.ItemLabel
hint={ `Block difficulty for ${ validatorTitle }, used to calibrate block generation time` }
>
Difficulty
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue overflow="hidden">
<HashStringShortenDynamic hash={ BigNumber(data.difficulty).toFormat() }/>
</DetailedInfo.ItemValue>
{ data.difficulty && (
<>
<DetailedInfo.ItemLabel
hint={ `Block difficulty for ${ validatorTitle }, used to calibrate block generation time` }
>
Difficulty
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue overflow="hidden">
<HashStringShortenDynamic hash={ BigNumber(data.difficulty).toFormat() }/>
</DetailedInfo.ItemValue>
</>
) }
{ data.total_difficulty && (
<>
+1 -1
View File
@@ -71,7 +71,7 @@ export default function useBlockQuery({ heightOrHash }: Params): BlockQuery {
size: Number(block.size),
hash: block.hash,
parent_hash: block.parentHash,
difficulty: block.difficulty.toString(),
difficulty: block.difficulty?.toString() ?? null,
total_difficulty: block.totalDifficulty?.toString() ?? null,
gas_used: block.gasUsed.toString(),
gas_limit: block.gasLimit.toString(),
+9 -7
View File
@@ -38,7 +38,7 @@ const BlocksListItem = ({ data, isLoading, enableTimeIncrement, animation }: Pro
const totalReward = getBlockTotalReward(data);
const burntFees = BigNumber(data.burnt_fees || 0);
const txFees = BigNumber(data.transaction_fees || 0);
const baseFeeValue = getBaseFeeValue(data.base_fee_per_gas);
const baseFeeValue = getBaseFeeValue(data.base_fee_per_gas || null);
return (
<ListItemMobile rowGap={ 3 } key={ String(data.height) } animation={ animation }>
@@ -66,12 +66,14 @@ const BlocksListItem = ({ data, isLoading, enableTimeIncrement, animation }: Pro
display="inline-block"
/>
</Flex>
<Flex columnGap={ 2 }>
<Text fontWeight={ 500 }>Size</Text>
<Skeleton loading={ isLoading } display="inline-block" color="text.secondary">
<span>{ data.size.toLocaleString() } bytes</span>
</Skeleton>
</Flex>
{ data.size && (
<Flex columnGap={ 2 }>
<Text fontWeight={ 500 }>Size</Text>
<Skeleton loading={ isLoading } display="inline-block" color="text.secondary">
<span>{ data.size?.toLocaleString() } bytes</span>
</Skeleton>
</Flex>
) }
{ !config.UI.views.block.hiddenFields?.miner && (
<Flex columnGap={ 2 } w="100%">
<Text fontWeight={ 500 }>{ capitalize(getNetworkValidatorTitle()) }</Text>
+2 -2
View File
@@ -35,7 +35,7 @@ const BlocksTableItem = ({ data, isLoading, enableTimeIncrement, animation }: Pr
const totalReward = getBlockTotalReward(data);
const burntFees = BigNumber(data.burnt_fees || 0);
const txFees = BigNumber(data.transaction_fees || 0);
const baseFeeValue = getBaseFeeValue(data.base_fee_per_gas);
const baseFeeValue = getBaseFeeValue(data.base_fee_per_gas || null);
return (
<TableRow animation={ animation }>
@@ -69,7 +69,7 @@ const BlocksTableItem = ({ data, isLoading, enableTimeIncrement, animation }: Pr
</TableCell>
<TableCell >
<Skeleton loading={ isLoading } display="inline-block">
{ data.size.toLocaleString() }
{ data.size?.toLocaleString() || 'N/A' }
</Skeleton>
</TableCell>
{ !config.UI.views.block.hiddenFields?.miner && (